1 # mach-virt - VirtIO guest (serial console)
2 # =========================================================
6 # $ qemu-system-aarch64 \
8 # -readconfig mach-virt-serial.cfg \
9 # -display none -serial mon:stdio \
12 # You will probably need to tweak the lines marked as
13 # CHANGE ME before being able to use this configuration!
15 # The guest will have a selection of VirtIO devices
16 # tailored towards optimal performance with modern guests,
17 # and will be accessed through the serial console.
19 # ---------------------------------------------------------
21 # Using -nodefaults is required to have full control over
22 # the virtual hardware: when it's specified, QEMU will
23 # populate the board with only the builtin peripherals,
24 # such as the PL011 UART, plus a PCI Express Root Bus; the
25 # user will then have to explicitly add further devices.
27 # The PCI Express Root Bus shows up in the guest as:
31 # This configuration file adds a number of other useful
32 # devices, more specifically:
34 # 00.1c.* PCI bridge (PCI Express Root Ports)
35 # 01:00.0 SCSI storage controller
36 # 02:00.0 Ethernet controller
38 # More information about these devices is available below.
40 # We use '-display none' to prevent QEMU from creating a
41 # graphical display window, which would serve no use in
42 # this specific configuration, and '-serial mon:stdio' to
43 # multiplex the guest's serial console and the QEMU monitor
44 # to the host's stdio; use 'Ctrl+A h' to learn how to
45 # switch between the two and more.
49 # =========================================================
51 # We use the virt machine type and enable KVM acceleration
52 # for better performance.
54 # Using less than 1 GiB of memory is probably not going to
55 # yield good performance in the guest, and might even lead
56 # to obscure boot issues in some cases.
58 # Unfortunately, there is no way to configure the CPU model
59 # in this file, so it will have to be provided on the
60 # command line, but we can configure the guest to use the
61 # same GIC version as the host.
72 # Firmware configuration
73 # =========================================================
75 # There are two parts to the firmware: a read-only image
76 # containing the executable code, which is shared between
77 # guests, and a read/write variable store that is owned
78 # by one specific guest, exclusively, and is used to
79 # record information such as the UEFI boot order.
81 # For any new guest, its permanent, private variable store
82 # should initially be copied from the template file
83 # provided along with the firmware binary.
85 # Depending on the OS distribution you're using on the
86 # host, the name of the package containing the firmware
87 # binary and variable store template, as well as the paths
88 # to the files themselves, will be different. For example:
92 # /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw (bin)
93 # /usr/share/edk2/aarch64/vars-template-pflash.raw (var)
97 # /usr/share/AAVMF/AAVMF_CODE.fd (bin)
98 # /usr/share/AAVMF/AAVMF_VARS.fd (var)
102 # /usr/share/AAVMF/AAVMF_CODE.fd (bin)
103 # /usr/share/AAVMF/AAVMF_VARS.fd (var)
105 [drive "uefi-binary"]
106 file = "/usr/share/AAVMF/AAVMF_CODE.fd" # CHANGE ME
112 [drive "uefi-varstore"]
113 file = "guest_VARS.fd" # CHANGE ME
119 # PCI bridge (PCI Express Root Ports)
120 # =========================================================
122 # We create eight PCI Express Root Ports, and we plug them
123 # all into separate functions of the same slot. Some of
124 # them will be used by devices, the rest will remain
125 # available for hotplug.
128 driver = "pcie-root-port"
136 driver = "pcie-root-port"
143 driver = "pcie-root-port"
150 driver = "pcie-root-port"
157 driver = "pcie-root-port"
164 driver = "pcie-root-port"
171 driver = "pcie-root-port"
178 driver = "pcie-root-port"
185 # SCSI storage controller (and storage)
186 # =========================================================
188 # We use virtio-scsi here so that we can (hot)plug a large
189 # number of disks without running into issues; a SCSI disk,
190 # backed by a qcow2 disk image on the host's filesystem, is
193 # We also create an optical disk, mostly for installation
194 # purposes: once the guest OS has been succesfully
195 # installed, the guest will no longer boot from optical
196 # media. If you don't want, or no longer want, to have an
197 # optical disk in the guest you can safely comment out
198 # all relevant sections below.
201 driver = "virtio-scsi-pci"
212 file = "guest.qcow2" # CHANGE ME
216 [device "scsi-optical-disk"]
219 drive = "optical-disk"
222 [drive "optical-disk"]
223 file = "install.iso" # CHANGE ME
228 # Ethernet controller
229 # =========================================================
231 # We use virtio-net for improved performance over emulated
232 # hardware; on the host side, we take advantage of user
233 # networking so that the QEMU process doesn't require any
234 # additional privileges.
240 driver = "virtio-net-pci"