Hi there! I cannot launch virtual machine images on LXD. Other virtual machine images also don’t work. Any ideas what could go wrong?
$ lxc launch local:ubuntu-vm/21.04 --profile default vm1
Creating vm1
Starting vm1
Error: lstat /usr/share/OVMF: no such file or directory
Try `lxc info --show-log local:vm1` for more info
$ lxc info --show-log local:vm1
Name: vm1
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/08/26 12:08 UTC
Status: Stopped
Type: virtual-machine
Profiles: default
Error: open /var/log/lxd/vm1/qemu.log: no such file or directory
I set export LXD_OVMF_PATH="/usr/share/edk2-ovmf" in OpenRC service settings and restarted lxd daemon, and then I got following error message when I tried to launch virtual machine image:
$ lxc launch local:debian-vm/11 test
Creating test
Starting test
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited -- /usr/bin/qemu-system-x8
6_64 -S -name test -uuid 6c9d06a7-e24d-4ee1-b35d-fee3b2280a31 -daemonize -cpu host -nographic
-serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivile
ges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/test/qemu.conf -spice unix
=on,disable-ticketing=on,addr=/var/log/lxd/test/qemu.spice -pidfile /var/log/lxd/test/qemu.pi
d -D /var/log/lxd/test/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas
nobody: char device redirected to /dev/pts/5 (label console)
: Process exited with non-zero value 1
Try `lxc info --show-log local:test` for more info
$ lxc info --show-log local:test
Name: test
Location: none
Remote: unix://
Architecture: x86_64
Created: 2021/08/26 13:45 UTC
Status: Stopped
Type: virtual-machine
Profiles: default
Log:
qemu-system-x86_64:/var/log/lxd/test/qemu.conf:43: memdev=mem0 is ambiguous
I have enabled apparmor system-wide and LXD compiled with apparmor support.
When I type in terminal lxc console vm1 -t vga I see only tianocore splash screen, not normal tty console. lxc exec vm1 -- /bin/bash works as excepted.
That’s a guest thing, so you’d most likely need to change the kernel command line in grub or whatever bootloader is used by the guest image you’re using.