Cannot create instance type virtual machine

Hi there,

I’m pretty new to LXD. I try to learn something new aside Virtual Box and others, so I came across this awesome project. However, I installed a fresh new Manjaro Linux and installed LXD. Everything is working really smoothly (awesome!), but one thing does not work, which I can’t explain myself.

For instance, when I try to create a virtual machine, I get this output:

> lxc launch images:debian/10 felix --vm
Error: Failed instance creation: Failed creating instance record: Instance type "virtual-machine" is not supported on this server

I already searched the web, however, I did not find any explanation or a starting point where to look for. Can anyone provide me a hint what could be the matter of this message?

Many thanks in advance, regards, Thomas

Hi,

This is a fairly recent addition to LXD, we now check whether the “machine” you’re trying to launch a VM on supports virtualisation. We check that the path /dev/kvm exists and that the vhost_vsock kernel module can be loaded. If either of these two fail then we prevent creation of VMs.

In your case as you are running inside a VirtualBox VM you need to ensure that your Vbox VM has nested virtualisation enabled in order for the /dev/kvm path to appear.

1 Like

Hi there,

thanks for the quick reply. There’s a misunderstanding, I do not try LXD within a VirtualBox machine, I try to get it running on a direct Linux installation onto my Laptop. So, the type is not nested. :slight_smile:

/dev/kvm is present:

> sudo lsmod | sort | grep kvm
kvm                   921600  1 kvm_intel
kvm_intel             323584  0

However, I tried to find vhost_vsock.ko but the module seems not to be present on Manjaro 5.10.49-1.

I’ll try to figure out why it is not there and if I can get the module installed and loaded.

Thanks for pointing me. Any additional hint is welcome. Regards, Thomas

OK I see, the mention of Virtualbox threw me off. I think I read “aside” as “inside” :slight_smile:

Yes you’ll need the vhost_vsock module as otherwise we cannot communicate with the VM.

Thanks

Hi there,

I was able to manage to load the module vhost_vsock:

vhost_vsock            24576  0
vmw_vsock_virtio_transport_common    40960  1 vhost_vsock
vhost                  57344  1 vhost_vsock
vhost_iotlb            16384  1 vhost
vsock                  49152  2 vmw_vsock_virtio_transport_common,vhost_vsock

And /dev/kvm is present as well:
crw-rw-rw- 1 root kvm 10, 232 Jul 20 11:21 /dev/kvm

But the result remains as is, I can’t create a VM. One thing I recognized is in the output of lxc-checkconfig:

Cgroup v1 systemd controller: missing
Cgroup v1 freezer controller: missing
Cgroup namespace: required

So, it could be, that there’s another problem I have to solve.

Regards, Thomas

Can you look in your syslog for entries that contain Instance type not operational and see what the issue is.

Interesting!
I just had the same issue with 4.0.7 compiled from source.
I have both /dev/kvm present and vhost_vsock available and enabled.

The solution I’ve found is that on a Debian server the packages qemu-system-x86 and qemu-utils are needed to create virtual machines. I think it might fit here to mention this dependency. I assume the snap packages got the update automatically as the requirements were added?
Edit: QEMU is included here in the requirements but not what packages are needed exactly: Requirements | LXD

I still have to figure out why the vm isn’t getting an IP but the issue might be outside of lxd’s scope.

1 Like

Hi,

sorry for the late reply. I was finally able to get a virtual machine running with lxd. First of all I had to install qemu, then recognized that version 6 causes some troubles, so I downgraded it to version 5.2.0. I also had to install edk2-ovmf because I wasn’t able to fix the error Required EFI firmware settings file missing even though providing the option security.secureboot=false at creation time.
But then things started to work. So, many thanks to anyone providing help.

Regards, Thomas

1 Like

Yes the snap package provides the right version of qemu. Were are waiting for issues in qemu to be resolved before switching to qemu 6.

Did you look in the logs as I suggested, as I think it would log what was missing. Thanks.

Yes we should mention the qemu packages in the build section, as although not strictly required for build, clearly they are critical for VM operation :grinning: