Running trs + xen on AVA
EFI / Bootloader
To avoid having to setup the boot options, I enter the EFI Boot menu by pressing Escape during the AVA booting process, then select “Boot Maintenance Manager” → “Boot from file” and select “xen.efi” from the disk where the TRS image is flashed.
Creating the Xen guest
How to change the QEMU invocation command flags for a guest
Using the device_model_override option inside a guest .cfg file we can change the QEMU binary that runs for a guest. The following Python3 script can be used as a device_model_override binary and launch the QEMU build of your choice with the command flags you want.
Custom command flags for QEMU go to the hard-coded global variable
guest_device_argslist in the script’s source code.QEMU Binary path is hard-coded in the
QEMU_BINARY_PATHglobal variable.Environment flags can be set by adding
os.environ["ENV_VAR"] = "VALUE"lines.stdout/stderrare redirected to the path in the hard-codedLOG_FILEglobal variable.
Save the following source code as qemu_device_model.py, set executable permissions with chmod +x qemu_device_model.py and override the xen device model parameter in the guest .cfg file:
device_model_version="qemu-xen"
device_model_override="/home/root/qemu_device_model.py"This will call the script with the same arguments it’d otherwise pass to the QEMU binary.
The source code:
Create guest
xl create /path/to/guest.cfgInspect guest domain state:
xl listSometimes, QEMU doesn’t exit cleanly and the guest shows up as (null) . Issue pkill qemu and it should go away.
Attach to guest console
xl console -t pv -n 0 GUEST_NAMEwhere GUEST_NAME is the value of "name" in the guest configuration.