qemu_vsock: ConfigFeature
qemu_swtpm: ConfigFeature
qemu_cdrom: bool
+ qemu_bios: bool
qemu_args: Sequence[str]
preset: Optional[str]
parse=config_parse_boolean,
help="Attach the image as a CD-ROM to the virtual machine",
),
+ MkosiConfigSetting(
+ dest="qemu_bios",
+ metavar="BOOLEAN",
+ nargs="?",
+ section="Host",
+ parse=config_parse_boolean,
+ help="Boot QEMU with SeaBIOS instead of EDK2",
+ ),
MkosiConfigSetting(
dest="qemu_args",
metavar="ARGS",
QEMU Use VSock: {config.qemu_vsock}
QEMU Use Swtpm: {config.qemu_swtpm}
QEMU Use CD-ROM: {yes_no(config.qemu_cdrom)}
+ QEMU BIOS: {yes_no(config.qemu_bios)}
QEMU Extra Arguments: {line_join_list(config.qemu_args)}
"""
accel = "kvm"
firmware, fw_supports_sb = find_qemu_firmware(config)
- smm = "on" if fw_supports_sb else "off"
+ smm = "on" if fw_supports_sb and not config.qemu_bios else "off"
if config.architecture == Architecture.arm64:
machine = f"type=virt,accel={accel}"
cmdline += ["-smbios", f"type=11,value=io.systemd.credential.binary:{k}={base64.b64encode(v.encode()).decode()}"]
cmdline += ["-smbios", f"type=11,value=io.systemd.stub.kernel-cmdline-extra={' '.join(config.kernel_command_line_extra)}"]
- cmdline += ["-drive", f"if=pflash,format=raw,readonly=on,file={firmware}"]
+ # QEMU has built-in logic to look for the BIOS firmware so we don't need to do anything special for that.
+ if not config.qemu_bios:
+ cmdline += ["-drive", f"if=pflash,format=raw,readonly=on,file={firmware}"]
notifications: dict[str, str] = {}
with contextlib.ExitStack() as stack:
- if fw_supports_sb:
+ if fw_supports_sb and not config.qemu_bios:
ovmf_vars = stack.enter_context(tempfile.NamedTemporaryFile(prefix=".mkosi-"))
shutil.copy2(find_ovmf_vars(config), Path(ovmf_vars.name))
cmdline += [
"-device", "virtio-scsi-pci,id=scsi",
"-device", f"scsi-{'cd' if config.qemu_cdrom else 'hd'},drive=mkosi,bootindex=1"]
- if config.qemu_swtpm != ConfigFeature.disabled and shutil.which("swtpm") is not None:
+ if config.qemu_swtpm != ConfigFeature.disabled and shutil.which("swtpm") is not None and not config.qemu_bios:
sock = stack.enter_context(start_swtpm())
cmdline += ["-chardev", f"socket,id=chrtpm,path={sock}",
"-tpmdev", "emulator,id=tpm0,chardev=chrtpm"]
attach the image to the virtual machine as a CD-ROM device. Takes a
boolean. Defaults to `no`.
+`QemuBios=`, `--qemu-bios=`
+
+: When used with the `qemu` verb, this option specifies whether to use
+ the BIOS firmware instead of the UEFI firmware. Takes a boolean.
+ Defaults to `no`.
+
`QemuArgs=`
: Space-delimited list of additional arguments to pass when invoking