about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2024-02-10 22:12:06 -0500
committerGitHub <noreply@github.com>2024-02-10 22:12:06 -0500
commitd4ee957afa5a0123eb23f3d797bee85fec3d5890 (patch)
treeceb1d0e57d36a89fc6a8cf5fb2c3a990a2a0873b /nixos
parent22ef539110d806f787dbca520ab49ed9b2756e99 (diff)
parent11c26d4cc5f8997d678860eb37bca41ed37b8a4b (diff)
downloadnixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar.gz
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar.bz2
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar.lz
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar.xz
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.tar.zst
nixlib-d4ee957afa5a0123eb23f3d797bee85fec3d5890.zip
Merge pull request #287445 from fricklerhandwerk/qemu-env-vars
doc: expand on parameters passed to QEMU VMs
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix17
1 files changed, 12 insertions, 5 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 57e2c38301a0..55a214325118 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -738,7 +738,7 @@ in
             See the [QEMU Wiki on Networking](https://wiki.qemu.org/Documentation/Networking) for details.
 
             If you override this option, be advised to keep
-            ''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} (as seen in the example)
+            `''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}` (as seen in the example)
             to keep the default runtime behaviour.
           '';
         };
@@ -813,14 +813,19 @@ in
           defaultText = "!cfg.useBootLoader";
           description =
             lib.mdDoc ''
-              If enabled, the virtual machine will boot directly into the kernel instead of through a bootloader. Other relevant parameters such as the initrd are also passed to QEMU.
+              If enabled, the virtual machine will boot directly into the kernel instead of through a bootloader.
+              Read more about this feature in the [QEMU documentation on Direct Linux Boot](https://qemu-project.gitlab.io/qemu/system/linuxboot.html)
 
+              This is enabled by default.
               If you want to test netboot, consider disabling this option.
+              Enable a bootloader with {option}`virtualisation.useBootLoader` if you need.
 
-              This will not boot / reboot correctly into a system that has switched to a different configuration on disk.
+              Relevant parameters such as those set in `boot.initrd` and `boot.kernelParams` are also passed to QEMU.
+              Additional parameters can be supplied on invocation through the environment variable `$QEMU_KERNEL_PARAMS`.
+              They are added to the `-append` option, see [QEMU User Documentation](https://www.qemu.org/docs/master/system/qemu-manpage) for details
+              For example, to let QEMU use the parent terminal as the serial console, set `QEMU_KERNEL_PARAMS="console=ttyS0"`.
 
-              This is enabled by default if you don't enable bootloaders, but you can still enable a bootloader if you need.
-              Read more about this feature: <https://qemu-project.gitlab.io/qemu/system/linuxboot.html>.
+              This will not (re-)boot correctly into a system that has switched to a different configuration on disk.
             '';
         };
       initrd =
@@ -850,6 +855,8 @@ in
 
             If disabled, the kernel and initrd are directly booted,
             forgoing any bootloader.
+
+            Check the documentation on {option}`virtualisation.directBoot.enable` for details.
           '';
       };