1
# mach-virt - VirtIO guest (graphical console)
2
# =========================================================
6
# $ qemu-system-aarch64 \
8
# -readconfig mach-virt-graphical.cfg \
11
# You will probably need to tweak the lines marked as
12
# CHANGE ME before being able to use this configuration!
14
# The guest will have a selection of VirtIO devices
15
# tailored towards optimal performance with modern guests,
16
# and will be accessed through a graphical console.
18
# ---------------------------------------------------------
20
# Using -nodefaults is required to have full control over
21
# the virtual hardware: when it's specified, QEMU will
22
# populate the board with only the builtin peripherals,
23
# such as the PL011 UART, plus a PCI Express Root Bus; the
24
# user will then have to explicitly add further devices.
26
# The PCI Express Root Bus shows up in the guest as:
30
# This configuration file adds a number of other useful
31
# devices, more specifically:
33
# 00:01.0 Display controller
34
# 00.1c.* PCI bridge (PCI Express Root Ports)
35
# 01:00.0 SCSI storage controller
36
# 02:00.0 Ethernet controller
37
# 03:00.0 USB controller
39
# More information about these devices is available below.
43
# =========================================================
45
# We use the virt machine type and enable KVM acceleration
46
# for better performance.
48
# Using less than 1 GiB of memory is probably not going to
49
# yield good performance in the guest, and might even lead
50
# to obscure boot issues in some cases.
52
# Unfortunately, there is no way to configure the CPU model
53
# in this file, so it will have to be provided on the
54
# command line, but we can configure the guest to use the
55
# same GIC version as the host.
68
# Firmware configuration
69
# =========================================================
71
# There are two parts to the firmware: a read-only image
72
# containing the executable code, which is shared between
73
# guests, and a read/write variable store that is owned
74
# by one specific guest, exclusively, and is used to
75
# record information such as the UEFI boot order.
77
# For any new guest, its permanent, private variable store
78
# should initially be copied from the template file
79
# provided along with the firmware binary.
81
# Depending on the OS distribution you're using on the
82
# host, the name of the package containing the firmware
83
# binary and variable store template, as well as the paths
84
# to the files themselves, will be different. For example:
88
# /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw (bin)
89
# /usr/share/edk2/aarch64/vars-template-pflash.raw (var)
93
# /usr/share/AAVMF/AAVMF_CODE.fd (bin)
94
# /usr/share/AAVMF/AAVMF_VARS.fd (var)
98
# /usr/share/AAVMF/AAVMF_CODE.fd (bin)
99
# /usr/share/AAVMF/AAVMF_VARS.fd (var)
102
file = "/usr/share/AAVMF/AAVMF_CODE.fd" # CHANGE ME
108
[drive "uefi-varstore"]
109
file = "guest_VARS.fd" # CHANGE ME
115
# PCI bridge (PCI Express Root Ports)
116
# =========================================================
118
# We create eight PCI Express Root Ports, and we plug them
119
# all into separate functions of the same slot. Some of
120
# them will be used by devices, the rest will remain
121
# available for hotplug.
124
driver = "pcie-root-port"
132
driver = "pcie-root-port"
139
driver = "pcie-root-port"
146
driver = "pcie-root-port"
153
driver = "pcie-root-port"
160
driver = "pcie-root-port"
167
driver = "pcie-root-port"
174
driver = "pcie-root-port"
181
# SCSI storage controller (and storage)
182
# =========================================================
184
# We use virtio-scsi here so that we can (hot)plug a large
185
# number of disks without running into issues; a SCSI disk,
186
# backed by a qcow2 disk image on the host's filesystem, is
189
# We also create an optical disk, mostly for installation
190
# purposes: once the guest OS has been successfully
191
# installed, the guest will no longer boot from optical
192
# media. If you don't want, or no longer want, to have an
193
# optical disk in the guest you can safely comment out
194
# all relevant sections below.
197
driver = "virtio-scsi-pci"
208
file = "guest.qcow2" # CHANGE ME
212
[device "scsi-optical-disk"]
215
drive = "optical-disk"
218
[drive "optical-disk"]
219
file = "install.iso" # CHANGE ME
225
# =========================================================
227
# We use virtio-net for improved performance over emulated
228
# hardware; on the host side, we take advantage of user
229
# networking so that the QEMU process doesn't require any
230
# additional privileges.
236
driver = "virtio-net-pci"
242
# USB controller (and input devices)
243
# =========================================================
245
# We add a virtualization-friendly USB 3.0 controller and
246
# a USB keyboard / USB tablet combo so that graphical
247
# guests can be controlled appropriately.
250
driver = "nec-usb-xhci"
259
driver = "usb-tablet"
264
# =========================================================
266
# We use virtio-gpu because the legacy VGA framebuffer is
267
# very troublesome on aarch64, and virtio-gpu is the only
268
# video device that doesn't implement it.
270
# If you're running the guest on a remote, potentially
271
# headless host, you will probably want to append something
274
# -display vnc=127.0.0.1:0
276
# to the command line in order to prevent QEMU from
277
# creating a graphical display window on the host and
278
# enable remote access instead.
281
driver = "virtio-gpu"