xref: /qemu/docs/system/linuxboot.rst (revision ec7e5a90fea996f04ea24e81b680a87bc975354a)
1.. _direct_005flinux_005fboot:
2
3Direct Linux Boot
4-----------------
5
6This section explains how to launch a Linux kernel inside QEMU without
7having to make a full bootable image. It is very useful for fast Linux
8kernel testing.
9
10The syntax is:
11
12.. parsed-literal::
13
14   |qemu_system| -kernel bzImage -drive file=rootdisk.img,format=raw -append "root=/dev/sda"
15
16Use ``-kernel`` to provide the Linux kernel image and ``-append`` to
17give the kernel command line arguments. The ``-initrd`` option can be
18used to provide an INITRD image.
19
20If you do not need graphical output, you can disable it and redirect the
21virtual serial port and the QEMU monitor to the console with the
22``-nographic`` option. The typical command line is:
23
24.. parsed-literal::
25
26   |qemu_system| -kernel bzImage -drive file=rootdisk.img,format=raw \
27                    -append "root=/dev/sda console=ttyS0" -nographic
28
29Use Ctrl-a c to switch between the serial console and the monitor (see
30:ref:`GUI_keys`).
31