Thanks @tomp.
I think you are right, but I seem unable to modify default root device; is it at all possible?
My current VM is:
mcon@lxd:~$ lxc profile show firewall
config: {}
description: Profile to be used for Firewall VMs
devices:
eth0:
nictype: macvlan
parent: enp1s0
type: nic
eth1:
nictype: macvlan
parent: enxa0cec887415e
type: nic
eth2:
network: ORANGE
type: nic
root:
path: /
pool: default
type: disk
name: firewall
used_by:
- /1.0/instances/opnsense
- /1.0/instances/ipfire
- /1.0/instances/efw
mcon@lxd:~$ lxc config show efw --expanded
architecture: x86_64
config:
security.secureboot: "false"
volatile.apply_template: create
volatile.cloud-init.instance-id: c71bf58e-bf00-42b3-8b50-aac53e79d92e
volatile.eth0.hwaddr: 00:16:3e:ba:6a:1e
volatile.eth1.hwaddr: 00:16:3e:9e:c9:50
volatile.eth2.hwaddr: 00:16:3e:71:c6:c7
volatile.uuid: ae77e787-1554-46e2-a373-c949073e9e81
devices:
bootdisk:
boot.priority: "10"
source: /home/mcon/efw.iso
type: disk
eth0:
nictype: macvlan
parent: enp1s0
type: nic
eth1:
nictype: macvlan
parent: enxa0cec887415e
type: nic
eth2:
network: ORANGE
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- firewall
stateful: false
description: ""
mcon@lxd:~$
I seem to understand problem is rootdevice which is handled through virtio, so I tried something along the lines:
mcon@lxd:~$ lxc config device override efw root pool="" source=/var/lib/lxd/storage-pools/default/virtual-machines/efw/root.img
Error: Invalid devices: Device validation failed for "root": Root disk entry may not have a "source" property set
mcon@lxd:~$
I am guessing I should try to override directly qemu parameters, but I was unable to find what to overridden in my case.
I tried something like:
mcon@lxd:~$ lxc config set efw raw.qemu=" -hda /var/lib/lxd/storage-pools/default/virtual-machines/efw/root.img"
but it didn’t work (no error, but same behavior as before).
Update:
Trying to use a different (autogenerated) image using -hda /home/mcon/efw.img bombs with a different message:
qemu-system-x86_64: -drive file=/home/mcon/efw.img,format=raw,index=0,media=disk: Failed to lock byte 100
I don’t need a “second disk” mounted somewhere.
I need to mount the image as root disk (i.e.: on /).
I either lost something in your suggestion or that’s a different issue.
My attempts are partially successful, meaning boot starts, apparently without error, but it stops after a while (before reaching command prompt).
Full log of my current attempt follows:
BSD needs a few extras hurdles… https://www.youtube.com/watch?v=OeU2SUKV5sQ
So according to the former project lead, migration.stateful disables some flags which interfere with BSD, but a comment that raw.qemu -cpu host might be more flexible.
I’ve got a Citrix BSD based appliance and had to load an old BIOS (pc-q35-2.6) to get it to work and has been stable for quite a while, as per @tomp’s link. That’s more for something that’s a customised appliance without UEFI support and the recent security.csm config doesn’t work this appliance. You’d probably get going with the one of the two in the first paragraph.