Merge tag 'v9.1.0'
[qemu/ar7.git] / docs / config / mach-virt-graphical.cfg
blobeba76eb198831652f07d2d30970509a9e83db44a
1 # mach-virt - VirtIO guest (graphical console)
2 # =========================================================
4 # Usage:
6 #   $ qemu-system-aarch64 \
7 #     -nodefaults \
8 #     -readconfig mach-virt-graphical.cfg \
9 #     -cpu host
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:
28 #   00:00.0 Host bridge
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.
42 # Machine options
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.
57 [machine]
58   type = "virt"
59   gic-version = "host"
61 [accel]
62   accel = "kvm"
64 [memory]
65   size = "1024"
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:
86 # Fedora
87 #   edk2-aarch64                                      (pkg)
88 #   /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw       (bin)
89 #   /usr/share/edk2/aarch64/vars-template-pflash.raw  (var)
91 # RHEL
92 #   AAVMF                                             (pkg)
93 #   /usr/share/AAVMF/AAVMF_CODE.fd                    (bin)
94 #   /usr/share/AAVMF/AAVMF_VARS.fd                    (var)
96 # Debian/Ubuntu
97 #   qemu-efi                                          (pkg)
98 #   /usr/share/AAVMF/AAVMF_CODE.fd                    (bin)
99 #   /usr/share/AAVMF/AAVMF_VARS.fd                    (var)
101 [drive "uefi-binary"]
102   file = "/usr/share/AAVMF/AAVMF_CODE.fd"       # CHANGE ME
103   format = "raw"
104   if = "pflash"
105   unit = "0"
106   readonly = "on"
108 [drive "uefi-varstore"]
109   file = "guest_VARS.fd"                        # CHANGE ME
110   format = "raw"
111   if = "pflash"
112   unit = "1"
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.
123 [device "pcie.1"]
124   driver = "pcie-root-port"
125   bus = "pcie.0"
126   addr = "1c.0"
127   port = "1"
128   chassis = "1"
129   multifunction = "on"
131 [device "pcie.2"]
132   driver = "pcie-root-port"
133   bus = "pcie.0"
134   addr = "1c.1"
135   port = "2"
136   chassis = "2"
138 [device "pcie.3"]
139   driver = "pcie-root-port"
140   bus = "pcie.0"
141   addr = "1c.2"
142   port = "3"
143   chassis = "3"
145 [device "pcie.4"]
146   driver = "pcie-root-port"
147   bus = "pcie.0"
148   addr = "1c.3"
149   port = "4"
150   chassis = "4"
152 [device "pcie.5"]
153   driver = "pcie-root-port"
154   bus = "pcie.0"
155   addr = "1c.4"
156   port = "5"
157   chassis = "5"
159 [device "pcie.6"]
160   driver = "pcie-root-port"
161   bus = "pcie.0"
162   addr = "1c.5"
163   port = "6"
164   chassis = "6"
166 [device "pcie.7"]
167   driver = "pcie-root-port"
168   bus = "pcie.0"
169   addr = "1c.6"
170   port = "7"
171   chassis = "7"
173 [device "pcie.8"]
174   driver = "pcie-root-port"
175   bus = "pcie.0"
176   addr = "1c.7"
177   port = "8"
178   chassis = "8"
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
187 # attached to it.
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.
196 [device "scsi"]
197   driver = "virtio-scsi-pci"
198   bus = "pcie.1"
199   addr = "00.0"
201 [device "scsi-disk"]
202   driver = "scsi-hd"
203   bus = "scsi.0"
204   drive = "disk"
205   bootindex = "1"
207 [drive "disk"]
208   file = "guest.qcow2"                          # CHANGE ME
209   format = "qcow2"
210   if = "none"
212 [device "scsi-optical-disk"]
213   driver = "scsi-cd"
214   bus = "scsi.0"
215   drive = "optical-disk"
216   bootindex = "2"
218 [drive "optical-disk"]
219   file = "install.iso"                          # CHANGE ME
220   format = "raw"
221   if = "none"
224 # Ethernet controller
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.
232 [netdev "hostnet"]
233   type = "user"
235 [device "net"]
236   driver = "virtio-net-pci"
237   netdev = "hostnet"
238   bus = "pcie.2"
239   addr = "00.0"
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.
249 [device "usb"]
250   driver = "nec-usb-xhci"
251   bus = "pcie.3"
252   addr = "00.0"
254 [device "keyboard"]
255   driver = "usb-kbd"
256   bus = "usb.0"
258 [device "tablet"]
259   driver = "usb-tablet"
260   bus = "usb.0"
263 # Display controller
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
272 # like
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.
280 [device "video"]
281   driver = "virtio-gpu"
282   bus = "pcie.0"
283   addr = "01.0"