Error Creating VM

Hi - Is it even possible to create a VM Lxc container using Virtual Ubuntu 20.04 as a virtual host (oracle box) with a lxd install via the snap package? I have no problem creating non VM containers. It look like it may be a privilege issue. Thanks

I am getting the below error?

Error: Failed to run: forklimits limit=memlock:unlimited:unlimited – /snap/lxd/20222/bin/qemu-system-x86_64 -S -name vm1 -uuid 3cd37ad3-bb90-420e-a573-27436xxxxxxx -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-reboot -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/vm1/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/vm1/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/vm1/qemu.pid -D /var/snap/lxd/common/lxd/logs/vm1/qemu.log -chroot /var/snap/lxd/common/lxd/virtual-machines/vm1 -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd: char device redirected to /dev/pts/8 (label console)
: Process exited with a non-zero value

What does lxc info --show-log vm1 get you?

Here is the log… Is this related to the virtual host or a dependency that needs to be installed?.

Maybe Enable Nested VT-X/AMD-V or Enable PAE/NX in the virtual host?

Thanks

ame: vm1
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/05/03 12:19 UTC
Status: Stopped
Type: virtual-machine
Profiles: default, vm

Log:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize kvm: No such file or directory

Ok, so that indicates your system is lacking the required /dev/kvm device.

It may be that virtualbox doesn’t allow for nesting to work properly or there is maybe a config option for it.

Nesting in general works fine, I frequently run LXD VMs inside of LXD VMs, so in your case, it’s most likely VirtualBox blocking something.

I will try to enable Nested Vt-x/amd -v

There are definitely a couple of gotchas with running lxc from a virtual host.

Thanks for giving me some direction.