I ran into this error in the test lab today and figured I would document the cause. When you create a QEMU/KVM virtual machine using the command line virt-install or the graphical virtual machine manager you get an error similar to the following
Error starting domain: internal error: process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy failed to initialize KVM: Device or resource busy
This is caused by the virtualization technology for your CPU (Intel VT-x or AMD-V) being locked by another hypervisor, in our case it was VirtualBox. If we had VirtualBox open we could build and start our QEMU/KVM machines just fine however as soon as we started one of our VirtualBox machines and tried to build or start a QEMU/KVM machine we would get the error.
Interestingly if you had your QEMU/KVM machines running first and then tried to start a VirtualBox machine, the error message from VirtualBox tells you straight away what the error is, something along the lines of “Intel VT-x is in use by another hypervisor”.
Probably not something many people will encounter but it might help somebody.
Thanks! Just stuttered on this problem and was wondering what might be at cause.
Thank you! It was my case.
Thanks. I use Vagrant at work and it was running in the background.
Thanks. That was the explanation I was looking for
This was causing headaches with minikube switching between VirtualBox and kvm2. Thanks!
The second I read this I realised what the problem was. I’d seen this problem before and resolved it but forgot that if VirtualBox is running even without any of its VMs actually running you still get the error. You need to make sure VB is not running at all because it locks the VT-x and QEMU can’t access the number of cores it needs. I literally spent hours on this so thanks for the reminder.
Happened to me with VirtualBox and Android Studio emulator.
how is this helpful? “Probably not something many people will encounter but it might help somebody.”
I still need to run both vagrant and VirtualBox simultaneously
really thanks for your help, i was using vagrant + virtual box
Thanks, I had some vagrant boxes with VB provider, they were locking of course.
Thank you so much, you saved my day !!
I was scratching my head why it is not running.
I closed the VB and kvm started
:))
Thank you so much for this post..!
It helped me lot and saced my time…!
Well that explains a lot. Thank you
This was very helpful! I spent hours on this issue only to find out I simply had to shut down virtual box. Thanks you!
thank you very much, i spent almost two hours on this problem.
encountered it after manually creating a template on gns3 by importing the .vdi file of the vbox guest machine and when I turned it on, the error appeared. Thanks for the explanation though.
Thanks very helpful