cyberus-technology / virtualbox-kvm

KVM Backend for VirtualBox. With our current development model, we cannot easily accept pull requests here. If you'd like to contribute, feel free to reach out to us, we are happy to find a solution.
GNU General Public License v3.0
950 stars 119 forks source link

What are the steps to create a VM? (Getting `NS_ERROR_FAILURE` when booting a new Linux VM) #6

Closed antermin closed 9 months ago

antermin commented 9 months ago

Bug Description

I replaced distro-provided VirtualBox with VirtualBox KVM.

However, I am unable to boot a newly-created VM under VirtualBox KVM. Booting it under the original VirtualBox is fine though.

Are there any extra steps / configuration to make a VM compatible with VirtualBox KVM?

How to Reproduce

  1. Build and install VirtualBox KVM (I used the AUR package)
  2. Create a new Linux VM in VirtualBox KVM
  3. Try to boot the VM (but it always results in error, e.g. NS_ERROR_FAILURE)

Note: I have tried rebuilding with --disable-hardening --disable-java added, but it still fails to boot the VM.

VM configuration

Guest OS configuration details:

Host OS details:

Logs

blitz commented 9 months ago

Have you checked that KVM is available? You should see /dev/kvm on your system with permissions that allow you to access it.

Can you post the kernel log from your system together with lsmod output?

Typically there should be logs in ~/VirtualBox VMs/<your VM>. You could also build VBox with --build-debug to get additional logging (this has some issues though unrelated to the KVM backend and you should not use it besides debugging this issue).

antermin commented 9 months ago
  1. I can see /dev/kvm and I can also run VMs with qemu-system-x86_64 -enable-kvm:

    crw-rw-rw-   1 root kvm        10, 232 Feb  9 19:36 kvm
    crw-rw----   1 root kvm        10, 125 Feb  9 19:36 udmabuf
    crw-rw-rw-   1 root kvm        10, 238 Feb  9 19:36 vhost-net
    crw-rw-rw-   1 root kvm        10, 241 Feb  9 19:36 vhost-vsock
  2. Please refer to this gist

  3. I only have linux.vbox and linux.vbox-prev in the directory.

Edit: I tried rebuilding with --build-debug but it failed with undefined reference to 'soap_open_logfile' even though gsoap-2.8.132-1 is installed.

tpressure commented 9 months ago

Can you please try to start your VM via command line and check whether you get a useful error then?

VirtualBoxVM --startvm <vm_name>.

antermin commented 9 months ago

Can you please try to start your VM via command line and check whether you get a useful error then?

VirtualBoxVM --startvm <vm_name>.

Somehow it failed like this:

Qt FATAL: FATAL: The application binary appears to be running setuid, this is a security hole.
Aborted (core dumped)
blitz commented 9 months ago

Are you trying to run VirtualBox as root?

tpressure commented 9 months ago

Seems like the VirtualBoxVM binary has the s bit set.

As a workaround, you can try chmod -s /path/to/your/VirtualBoxVM.

antermin commented 9 months ago

Seems like the VirtualBoxVM binary has the s bit set.

Thank you so much!

After chmod -s /path/to/your/VirtualBoxVM, the issue is gone and the VM can be booted.