Ok, it is a VM according to lxc list
~$ lxc list
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| lubuntu-1 | STOPPED | | | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| mycontainer | RUNNING | 10.61.65.28 (eth0) | fd42:240c:548b:325c:216:3eff:feb0:6d1d (eth0) | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| steam | STOPPED | | | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| ubuntu | STOPPED | | | VIRTUAL-MACHINE | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| ubuntu-gui | STOPPED | | | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
| x2go-test | RUNNING | 10.61.65.155 (eth0) | fd42:240c:548b:325c:216:3eff:fec9:2b26 (eth0) | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------------+-----------+
Are you saying that my desired commands are more likely to work if I use a YAML or that either one is likely to run into problems?
In any case, following your advice (also I now notice I had forgotten the -
) I got past the previous error,
~$ echo "-machine type=pc,accel=kvm -cpu host -smp 4,sockets=1,cores=4,threads=1 -m 8G -vga qxl -spice port=5930,disable-ticketing=on -rtc clock=host,base=localtime -serial none -parallel none -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,file=/tmp/my_vars.fd -drive id=disk0,if=virtio,cache=none,format=raw,file=/home/boss/VMs/lubuntu.img -drive file=/home/boss/ISOs/ubuntu-20.04.3-desktop-amd64.iso,index=1,media=cdrom -net tap -net nic" | lxc config set ubuntu raw.qemu -
~$ lxc start ubuntu
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited -- /snap/lxd/21902/bin/qemu-system-x86_64 -S -name ubuntu -uuid 2890
aa72-6929-41db-853d-0599580c2f18 -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsole
te=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/snap/lxd/common/lxd/logs/ubuntu/qemu.conf -spice unix=
on,disable-ticketing=on,addr=/var/snap/lxd/common/lxd/logs/ubuntu/qemu.spice -pidfile /var/snap/lxd/common/lxd/logs/ubuntu/qemu.pid -D
/var/snap/lxd/common/lxd/logs/ubuntu/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas lxd -machine type=pc,accel=
kvm -cpu host -smp 4,sockets=1,cores=4,threads=1 -m 8G -vga qxl -spice port=5930,disable-ticketing=on -rtc clock=host,base=localtime -s
erial none -parallel none -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,file=/t
mp/my_vars.fd -drive id=disk0,if=virtio,cache=none,format=raw,file=/home/boss/VMs/lubuntu.img -drive file=/home/boss/ISOs/ubuntu-20.04.
3-desktop-amd64.iso,index=1,media=cdrom -net tap -net nic: char device redirected to /dev/pts/0 (label console)
: Process exited with non-zero value 1
Try `lxc info --show-log ubuntu` for more info
The log complains about a file not existing that in fact does exist:
~$ lxc info --show-log ubuntu
Name: ubuntu
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2021/11/27 16:25 EST
Last Used: 2021/11/27 16:26 EST
Log:
qemu-system-x86_64: -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd: Could not open '/usr/share/OVMF/OVMF_CODE.fd': No such file or directory
Edit: I still get this error if I create the VM with
lxc launch images:ubuntu/focal ubuntu1 --vm -c security.secureboot=false
Edit2: since this seems like a separate issue now, I created a new thread: Permissions issues with creating a VM through LXD, but not `qemu-system`