minikube: Failed to start kvm when virtualbox is running
I saw this error on integeration tests for the https://github.com/kubernetes/minikube/pull/4857 PR, @josedonizetti found out through these related issues that you can not run KVM and virtualbox at the same time.
Related:
- https://www.agix.com.au/kvm-error-ioctlkvm_create_vm-failed-16-device-or-resource-busy/
- https://github.com/CanonicalLtd/multipass/issues/6
- https://tech.blog.sue.ss.it/2014/09/linux-kvm-error-ioctlkvm_create_vm-failed-16-device-or-resource-busy/
Unable to start VM: create: Error creating machine: Error in driver during machine creation: error creating VM: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
08:52:59 | ! failed to initialize KVM: Device or resource busy')
08:52:59 | ! *
08:52:59 | ! X Unable to start VM: create: Error creating machine: Error in driver during machine creation: error creating VM: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
08:52:59 | ! failed to initialize KVM: Device or resource busy')
08:52:59 | ! *
08:52:59 | ! * Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
08:52:59 | ! - https://github.com/kubernetes/minikube/issues/new/choose
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (13 by maintainers)
Stop all libvirt/KVM virtual machines before starting VirtualBox. Stop all VBox virtual machines before starting KVM.
Note: You don’t have to delete them, just make sure that they are not running. Having them paused and suspended is OK.
@nanikjava I think it would be reasonable to check if either kvm/virtualbox is already running & log a warning to the user if that’s the case.
@josedonizetti @medyagh Is this something that need to be fixed ? What kind of check would be appropriate for this scenario ?
@josedonizetti When KVM runs first and then Virtualbox it gets stuck trying to connect to 127.0.0.1 port 34207
This is how the VM in Virtualbox UI looks like
Able replicate the problem.
Running kvm2 after virtualbox running shows the following
I knew this ☺️ Just didn’t know it was an issue. One at a time (without any reboot) is fine, though.