LXD needs vhost_vsock

Hi everyone,

I’m new to Manjaro. I was searching for a distro to learn for my test laptop and so I stumbled over Majaro through distrowatch. It’s really great, I love it!

Due to new challenges in my daily work I try to learn new things, specially virtualization. At the moment I try to get lxd running on my laptop, which succeeds only partially. I can create a container with whatever distro I want, however, I can’t get a virtual machine.

This is what happens:

> 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 posted a question at the discussion forum at Linuxcontainers and a maintainer answered that lxd needs kvm and vhost_vsock to work properly.
Now, kvm won’t be a problem, /dev/kvm is present and the kernel module is loaded:

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

But what’s still missing is vhost_vsock. I tried to find it under /lib/modules, even installed linux510-headers, but no success so far. So, is there anyone out there who made lxd working with virtual machines? If yes, please provide me some hints whatever you tried to get this done.

Many thanks in advance, regards, Thomas

You don’t need to worry about this module. ( See modinfo vhost_vsock )

Yes but, LXD is not as simple on Arch or Manjaro as on Ubuntu. Setting up libvirt or similar is a lot easier.

However, you need to start to read the Arch Wiki. Pay special attention to the setup section.
https://wiki.archlinux.org/title/LXD

Did you go thru the setup steps and did you installed all the optional dependencies required for the VM part of LXD?


Also I just noticed, LXD is not completely compatible with QEMU 6. So it might not work.

Hi there,

sorry for the late reply, I had too much to do the last days. I’ve gone through the wiki page and specially paid attention to the setup section, but I can’t see any reason why it should not work.

However, when talking about QEMU, I did not find it installed on my system. The question is, is QEMU part of lxd or do I have to install QEMU separately? If so I wonder why there’s no dependency set during the installation of lxd.

Another thing I’ve recognized is in the output of lxc-checkconfig:

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

I already tried to solve this myself, but no success so far. Any help is appreciated.

Regards, Thomas

LXD needs it for the vm and not for the container part. It is not required if you want to run containers, for many the main task for LXD ( since it is a fronted for LXC (not lxc))

However the qemu package and others are an optional dependency for the lxd package. If you use pacman it will print out missing optional dependencies. ( Pamac (the GUI ) might hide it.)

See the dependencies section at
https://archlinux.org/packages/community/x86_64/lxd/

All optional dependencies that are needed for “VM support” needs to be installed.

This is not done for “optional dependencies”. Manjaro/Arch are not Debian or Ubuntu. Things are different. However pacman will print out missing optional dependencies and it is in the pacman.log.

Many modern Linux systems use cgroups V2. cgroups are required for containers not VMs. LXC is compatible with cgroups v2, but lxc-checkconfig might give false warnings.

Stupid me. I installed qemu and now everything starts working. Still have to figure out a couple things, but anyway, better than before.

Many thanks to you for your patience!

Regards, Thomas