1
# q35 - VirtIO guest (graphical console)
2
# =========================================================
6
# $ qemu-system-x86_64 \
8
# -readconfig q35-virtio-graphical.cfg
10
# You will probably need to tweak the lines marked as
11
# CHANGE ME before being able to use this configuration!
13
# The guest will have a selection of VirtIO devices
14
# tailored towards optimal performance with modern guests,
15
# and will be accessed through a graphical console.
17
# ---------------------------------------------------------
19
# Using -nodefaults is required to have full control over
20
# the virtual hardware: when it's specified, QEMU will
21
# populate the board with only the builtin peripherals
22
# plus a small selection of core PCI devices and
23
# controllers; the user will then have to explicitly add
26
# The core PCI devices show up in the guest as:
29
# 00:1f.0 ISA bridge / LPC
30
# 00:1f.2 SATA (AHCI) controller
31
# 00:1f.3 SMBus controller
33
# This configuration file adds a number of other useful
34
# devices, more specifically:
36
# 00:01.0 VGA compatible controller
37
# 00:1b.0 Audio device
38
# 00.1c.* PCI bridge (PCI Express Root Ports)
39
# 01:00.0 SCSI storage controller
40
# 02:00.0 Ethernet controller
41
# 03:00.0 USB controller
43
# More information about these devices is available below.
47
# =========================================================
49
# We use the q35 machine type and enable KVM acceleration
50
# for better performance.
52
# Using less than 1 GiB of memory is probably not going to
53
# yield good performance in the guest, and might even lead
54
# to obscure boot issues in some cases.
64
# PCI bridge (PCI Express Root Ports)
65
# =========================================================
67
# We create eight PCI Express Root Ports, and we plug them
68
# all into separate functions of the same slot. Some of
69
# them will be used by devices, the rest will remain
70
# available for hotplug.
73
driver = "pcie-root-port"
81
driver = "pcie-root-port"
88
driver = "pcie-root-port"
95
driver = "pcie-root-port"
102
driver = "pcie-root-port"
109
driver = "pcie-root-port"
116
driver = "pcie-root-port"
123
driver = "pcie-root-port"
130
# SCSI storage controller (and storage)
131
# =========================================================
133
# We use virtio-scsi here so that we can (hot)plug a large
134
# number of disks without running into issues; a SCSI disk,
135
# backed by a qcow2 disk image on the host's filesystem, is
138
# We also create an optical disk, mostly for installation
139
# purposes: once the guest OS has been succesfully
140
# installed, the guest will no longer boot from optical
141
# media. If you don't want, or no longer want, to have an
142
# optical disk in the guest you can safely comment out
143
# all relevant sections below.
146
driver = "virtio-scsi-pci"
157
file = "guest.qcow2" # CHANGE ME
161
[device "scsi-optical-disk"]
164
drive = "optical-disk"
167
[drive "optical-disk"]
168
file = "install.iso" # CHANGE ME
173
# Ethernet controller
174
# =========================================================
176
# We use virtio-net for improved performance over emulated
177
# hardware; on the host side, we take advantage of user
178
# networking so that the QEMU process doesn't require any
179
# additional privileges.
185
driver = "virtio-net-pci"
191
# USB controller (and input devices)
192
# =========================================================
194
# We add a virtualization-friendly USB 3.0 controller and
195
# a USB tablet so that graphical guests can be controlled
196
# appropriately. A USB keyboard is not needed, as q35
197
# guests get a PS/2 one added automatically.
200
driver = "nec-usb-xhci"
205
driver = "usb-tablet"
209
# VGA compatible controller
210
# =========================================================
212
# We plug the QXL video card directly into the PCI Express
213
# Root Bus as it is a legacy PCI device; this way, we can
214
# reduce the number of PCI Express controllers in the
217
# If you're running the guest on a remote, potentially
218
# headless host, you will probably want to append something
221
# -display vnc=127.0.0.1:0
223
# to the command line in order to prevent QEMU from
224
# creating a graphical display window on the host and
225
# enable remote access instead.
234
# =========================================================
236
# Like the video card, the sound card is a legacy PCI
237
# device and as such can be plugged directly into the PCI
241
driver = "ich9-intel-hda"
246
driver = "hda-duplex"