Running OPNsense Serial image Installer on Xen
I'm not used to using hard drive images as VM installation media as opposed to ISO images. The boot="dc" directive in a Xen configuration flatfile specifies boot order by device type and not address - putting 'd' before 'c' does not mean the second image file specified will be booted, it means any CD-ROM image will be booted before any hard drive image.
From the official Xen wiki, Setting boot order for domUs:
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
boot="cda"
Pecking order is then resolved by the sequence of definition. The same is even true of XenCenter which provides a dropdown selector of bootable media categories and no way to specify a single image. Even the CLI toolstack does not provide this facility and that makes me leery of installations where the second disk image that we are installing to will be misidentified by device node upon completing the installation when we've detatched the installer's image and the installed image's device node is bumped up in sequence.
Fortunately (so far!), at least OPNsense seems to boot without issue from what was adb1 during installation but forevermore occupies adb0. However, from experience I know this will not hold true for many installations. The fix is to mount the guest image while it is shut down and try to search-and-replace every reference to the root device's node. I start by grepping the whole /etc tree and then focus on the guest's bootloader - which may require an offline, chrooted redeployment post-reconfiguration.
I used the following config and simply twiddled the disk line:
name = "opnsense-serial"
type = "hvm"
vcpus = 2
memory = 2048
vif = [ 'bridge=nullbr0', 'type=ioemu, bridge=nullbr0' ]
disk = ['file:/xen/opnsense/OPNsense-23.7-serial-amd64.img,hda,w', 'file:/xen/opnsense/opnsense.hdd,hdb,w']
#disk = ['file:/xen/opnsense/opnsense.hdd,hda,w']
serial = 'pty'
Then reverted to my original production config.
I would note that vgaconsole is entirely disabled on the serial installer, so configuring graphics and vnc/other GUI access is rendered moot.
Always remember to launch your serially-managed VMs with xenconsole by affixing the -c flag to your create command line - at least if you are managing or troubleshooting the VM - as this is the only way to view every line of output from bootstrap onward, unless you enable console logging to the dom0 - taking into consideration the potential security implications of storing every detail from every management session thereby conducted.
To enable logging of this interface, check out Enable xenconsoled Serial Logging.
Comments
There are no comments for this item.