YoeDistro/yoe-distro

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.

mr-nice opened this issue · 4 comments

Hi all,

I'm building yoe-distro on a virtual server. This worked quite well but after changes to the envsetup.sh I get this error, if I want to build with docker.

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.

After removing

--device /dev/kvm

from the docker run command I can build fine on that server.

What do you think about a config option to override that behavior? I totally understand that most people build the distribution on real hardware but this comes quite handy if building on virtual servers.

If there is interest in a patch I can submit one.

Greets,
mr-nice

kraj commented

thanks for the report and using Yoe, this device is handy when doing ptests which we have enabled recently. However, you are right it may not exist on virtual machines, so maybe check for its existence before enabling passthrough is good fix. Please go ahead and submit one.

As you can already override docker usage and if you want to use docker or podman, should I just introduce a environment variable for kvm usage aka USE_KVM or should we introduce a config in config/project/container.config where everything is configured? Which just gets consumed by envsetup.sh? This might also be handy later on to override all docker/container based configurations? It also might be handy to configure the docker uid mapping there? And if you want to run it rootless?

If I understood you right, your preferred patch would be to check if the file exists and is usable? I can do that as well.

kraj commented

I think if we can make it transparent to user that would be preferred

kraj commented

this should be fixed now.