hw/ppc/openpic: Do not open-code ROUND_UP() macro
[qemu/ar7.git] / docs / config / q35-virtio-graphical.cfg
blob148b5d2c5e4ea90ef04908b992b20a0ab2a83215
1 # q35 - VirtIO guest (graphical console)
2 # =========================================================
4 # Usage:
6 #   $ qemu-system-x86_64 \
7 #     -nodefaults \
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
24 # further devices.
26 # The core PCI devices show up in the guest as:
28 #   00:00.0 Host bridge
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.
46 # Machine options
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.
56 [machine]
57   type = "q35"
59 [accel]
60   accel = "kvm"
62 [memory]
63   size = "1024"
66 # PCI bridge (PCI Express Root Ports)
67 # =========================================================
69 # We create eight PCI Express Root Ports, and we plug them
70 # all into separate functions of the same slot. Some of
71 # them will be used by devices, the rest will remain
72 # available for hotplug.
74 [device "pcie.1"]
75   driver = "pcie-root-port"
76   bus = "pcie.0"
77   addr = "1c.0"
78   port = "1"
79   chassis = "1"
80   multifunction = "on"
82 [device "pcie.2"]
83   driver = "pcie-root-port"
84   bus = "pcie.0"
85   addr = "1c.1"
86   port = "2"
87   chassis = "2"
89 [device "pcie.3"]
90   driver = "pcie-root-port"
91   bus = "pcie.0"
92   addr = "1c.2"
93   port = "3"
94   chassis = "3"
96 [device "pcie.4"]
97   driver = "pcie-root-port"
98   bus = "pcie.0"
99   addr = "1c.3"
100   port = "4"
101   chassis = "4"
103 [device "pcie.5"]
104   driver = "pcie-root-port"
105   bus = "pcie.0"
106   addr = "1c.4"
107   port = "5"
108   chassis = "5"
110 [device "pcie.6"]
111   driver = "pcie-root-port"
112   bus = "pcie.0"
113   addr = "1c.5"
114   port = "6"
115   chassis = "6"
117 [device "pcie.7"]
118   driver = "pcie-root-port"
119   bus = "pcie.0"
120   addr = "1c.6"
121   port = "7"
122   chassis = "7"
124 [device "pcie.8"]
125   driver = "pcie-root-port"
126   bus = "pcie.0"
127   addr = "1c.7"
128   port = "8"
129   chassis = "8"
132 # SCSI storage controller (and storage)
133 # =========================================================
135 # We use virtio-scsi here so that we can (hot)plug a large
136 # number of disks without running into issues; a SCSI disk,
137 # backed by a qcow2 disk image on the host's filesystem, is
138 # attached to it.
140 # We also create an optical disk, mostly for installation
141 # purposes: once the guest OS has been successfully
142 # installed, the guest will no longer boot from optical
143 # media. If you don't want, or no longer want, to have an
144 # optical disk in the guest you can safely comment out
145 # all relevant sections below.
147 [device "scsi"]
148   driver = "virtio-scsi-pci"
149   bus = "pcie.1"
150   addr = "00.0"
152 [device "scsi-disk"]
153   driver = "scsi-hd"
154   bus = "scsi.0"
155   drive = "disk"
156   bootindex = "1"
158 [drive "disk"]
159   file = "guest.qcow2"                          # CHANGE ME
160   format = "qcow2"
161   if = "none"
163 [device "scsi-optical-disk"]
164   driver = "scsi-cd"
165   bus = "scsi.0"
166   drive = "optical-disk"
167   bootindex = "2"
169 [drive "optical-disk"]
170   file = "install.iso"                          # CHANGE ME
171   format = "raw"
172   if = "none"
175 # Ethernet controller
176 # =========================================================
178 # We use virtio-net for improved performance over emulated
179 # hardware; on the host side, we take advantage of user
180 # networking so that the QEMU process doesn't require any
181 # additional privileges.
183 [netdev "hostnet"]
184   type = "user"
186 [device "net"]
187   driver = "virtio-net-pci"
188   netdev = "hostnet"
189   bus = "pcie.2"
190   addr = "00.0"
193 # USB controller (and input devices)
194 # =========================================================
196 # We add a virtualization-friendly USB 3.0 controller and
197 # a USB tablet so that graphical guests can be controlled
198 # appropriately. A USB keyboard is not needed, as q35
199 # guests get a PS/2 one added automatically.
201 [device "usb"]
202   driver = "nec-usb-xhci"
203   bus = "pcie.3"
204   addr = "00.0"
206 [device "tablet"]
207   driver = "usb-tablet"
208   bus = "usb.0"
211 # VGA compatible controller
212 # =========================================================
214 # We plug the QXL video card directly into the PCI Express
215 # Root Bus as it is a legacy PCI device; this way, we can
216 # reduce the number of PCI Express controllers in the
217 # guest.
219 # If you're running the guest on a remote, potentially
220 # headless host, you will probably want to append something
221 # like
223 #   -display vnc=127.0.0.1:0
225 # to the command line in order to prevent QEMU from
226 # creating a graphical display window on the host and
227 # enable remote access instead.
229 [device "video"]
230   driver = "qxl-vga"
231   bus = "pcie.0"
232   addr = "01.0"
235 # Audio device
236 # =========================================================
238 # Like the video card, the sound card is a legacy PCI
239 # device and as such can be plugged directly into the PCI
240 # Express Root Bus.
242 [device "sound"]
243   driver = "ich9-intel-hda"
244   bus = "pcie.0"
245   addr = "1b.0"
247 [device "duplex"]
248   driver = "hda-duplex"
249   bus = "sound.0"
250   cad = "0"