Kernel args for qemu/kvm with UEFI
by chris.willing from LinuxQuestions.org on (#5KVJA)
Since it looks like LXC won't be updated for 15.0, I changed my package building system from LXC to qemu/kvm. A particular advantage (over a change to VBox) is the ability to specify an "external" kernel & initrd i.e. a kernel and initrd not part of the VM image itself, rather just files in the host filesystem. This brings with it the ability to pass kernel arguments (such as a list of packages to build) when the VM image is launched via an -append entry e.g.
Code:qemu-system-x86_64 -enable-kvm -drive file=/mnt/VM/kvm/slack64-15.0.img ... ... ... -kernel /some/where/vmlinuz -initrd /some/where/initrd -append "root=/dev/sda2 ro vga=0x386 PACKAGE_LIST=Blender"When the VM runs, it extracts the package list from /proc/cmdline, builds whatever is needed and dumps the result in a known location in the host file system.
That has all worked quite well for a few months now but recent discussion about secure boot led me to revisit booting these VM's with UEFI. Not that there's a particular need; I'm just interested. So I've installed the system/ovmf SBo package (actually a 2021 version, not the 2019 version specified in the repo) and following the required day of googling & fiddling around, I'm now able to boot the VM's under UEFI provided they use the internal kernel & initrd i.e. those in the VM image itself, not the external ones. Therefore my ability to pass kernel arguments no longer exists.
So, hoping someone has passed this way before, the question is how to pass extra information to a VM when it boots under UEFI?
Thanks for any suggestions,
chris
Code:qemu-system-x86_64 -enable-kvm -drive file=/mnt/VM/kvm/slack64-15.0.img ... ... ... -kernel /some/where/vmlinuz -initrd /some/where/initrd -append "root=/dev/sda2 ro vga=0x386 PACKAGE_LIST=Blender"When the VM runs, it extracts the package list from /proc/cmdline, builds whatever is needed and dumps the result in a known location in the host file system.
That has all worked quite well for a few months now but recent discussion about secure boot led me to revisit booting these VM's with UEFI. Not that there's a particular need; I'm just interested. So I've installed the system/ovmf SBo package (actually a 2021 version, not the 2019 version specified in the repo) and following the required day of googling & fiddling around, I'm now able to boot the VM's under UEFI provided they use the internal kernel & initrd i.e. those in the VM image itself, not the external ones. Therefore my ability to pass kernel arguments no longer exists.
So, hoping someone has passed this way before, the question is how to pass extra information to a VM when it boots under UEFI?
Thanks for any suggestions,
chris