2020-02-28 15:36:05 +00:00
|
|
|
.. _direct_005flinux_005fboot:
|
|
|
|
|
|
|
|
|
|
Direct Linux Boot
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
This section explains how to launch a Linux kernel inside QEMU without
|
|
|
|
|
having to make a full bootable image. It is very useful for fast Linux
|
|
|
|
|
kernel testing.
|
|
|
|
|
|
|
|
|
|
The syntax is:
|
|
|
|
|
|
|
|
|
|
.. parsed-literal::
|
|
|
|
|
|
2025-04-06 16:45:18 +08:00
|
|
|
|qemu_system| -kernel bzImage -drive file=rootdisk.img,format=raw -append "root=/dev/sda"
|
2020-02-28 15:36:05 +00:00
|
|
|
|
|
|
|
|
Use ``-kernel`` to provide the Linux kernel image and ``-append`` to
|
|
|
|
|
give the kernel command line arguments. The ``-initrd`` option can be
|
|
|
|
|
used to provide an INITRD image.
|
|
|
|
|
|
|
|
|
|
If you do not need graphical output, you can disable it and redirect the
|
|
|
|
|
virtual serial port and the QEMU monitor to the console with the
|
|
|
|
|
``-nographic`` option. The typical command line is:
|
|
|
|
|
|
|
|
|
|
.. parsed-literal::
|
|
|
|
|
|
2025-04-06 16:45:18 +08:00
|
|
|
|qemu_system| -kernel bzImage -drive file=rootdisk.img,format=raw \
|
|
|
|
|
-append "root=/dev/sda console=ttyS0" -nographic
|
2020-02-28 15:36:05 +00:00
|
|
|
|
2025-07-10 11:45:29 +01:00
|
|
|
Use :kbd:`Ctrl+a c` to switch between the serial console and the monitor (see
|
2023-05-12 15:43:38 +01:00
|
|
|
:ref:`GUI_keys`).
|