LXC 4.0+ can create containers as virtual machines using the --vm flag. I’m on NixOS 22.05 with lxc 5.1 and am trying to do this using the following command, but get the error shown:
$> sudo lxc launch images:alpine/edge ae-vm --vm
Creating ae-vm
Error: Failed instance creation: Failed creating instance record: Instance type "virtual-machine" is not supported on this server: vhost_vsock kernel module not loaded
Is there a config setting for this or something else that I’m missing? The virtualization section of my configuration.nix is:
virtualisation = {
containers.enable = true;
containerd.enable = true;
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = {
ovmf.enable = true;
runAsRoot = false;
};
};
lxd = {
enable = true;
zfsSupport = true;
recommendedSysctlSettings = true;
};
lxc = {
enable = true;
lxcfs.enable = true;
systemConfig = ''
lxc.lxcpath = /var/lib/lxd/containers
lxc.bdev.zfs.root = rpool/safe/lxd
'';
};
};