vhost-user-gpu: support dmabuf modifiers
[qemu/kevin.git] / qemu-options.hx
blob6be621c23249f397c470fb1ab33fb2b3f6cbf032
1 HXCOMM Use DEFHEADING() to define headings in both help text and rST.
2 HXCOMM Text between SRST and ERST is copied to the rST version and
3 HXCOMM discarded from C version.
4 HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
5 HXCOMM construct option structures, enums and help message for specified
6 HXCOMM architectures.
7 HXCOMM HXCOMM can be used for comments, discarded from both rST and C.
9 DEFHEADING(Standard options:)
11 DEF("help", 0, QEMU_OPTION_h,
12 "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
13 SRST
14 ``-h``
15 Display help and exit
16 ERST
18 DEF("version", 0, QEMU_OPTION_version,
19 "-version display version information and exit\n", QEMU_ARCH_ALL)
20 SRST
21 ``-version``
22 Display version information and exit
23 ERST
25 DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
26 "-machine [type=]name[,prop[=value][,...]]\n"
27 " selects emulated machine ('-machine help' for list)\n"
28 " property accel=accel1[:accel2[:...]] selects accelerator\n"
29 " supported accelerators are kvm, xen, hvf, nvmm, whpx or tcg (default: tcg)\n"
30 " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
31 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
32 " mem-merge=on|off controls memory merge support (default: on)\n"
33 " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
34 " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
35 " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
36 " nvdimm=on|off controls NVDIMM support (default=off)\n"
37 " memory-encryption=@var{} memory encryption object to use (default=none)\n"
38 " hmat=on|off controls ACPI HMAT support (default=off)\n"
39 " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n"
40 " cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n",
41 QEMU_ARCH_ALL)
42 SRST
43 ``-machine [type=]name[,prop=value[,...]]``
44 Select the emulated machine by name. Use ``-machine help`` to list
45 available machines.
47 For architectures which aim to support live migration compatibility
48 across releases, each release will introduce a new versioned machine
49 type. For example, the 2.8.0 release introduced machine types
50 "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures.
52 To allow live migration of guests from QEMU version 2.8.0, to QEMU
53 version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8"
54 and "pc-q35-2.8" machines too. To allow users live migrating VMs to
55 skip multiple intermediate releases when upgrading, new releases of
56 QEMU will support machine types from many previous versions.
58 Supported machine properties are:
60 ``accel=accels1[:accels2[:...]]``
61 This is used to enable an accelerator. Depending on the target
62 architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available.
63 By default, tcg is used. If there is more than one accelerator
64 specified, the next one is used if the previous one fails to
65 initialize.
67 ``vmport=on|off|auto``
68 Enables emulation of VMWare IO port, for vmmouse etc. auto says
69 to select the value based on accel. For accel=xen the default is
70 off otherwise the default is on.
72 ``dump-guest-core=on|off``
73 Include guest memory in a core dump. The default is on.
75 ``mem-merge=on|off``
76 Enables or disables memory merge support. This feature, when
77 supported by the host, de-duplicates identical memory pages
78 among VMs instances (enabled by default).
80 ``aes-key-wrap=on|off``
81 Enables or disables AES key wrapping support on s390-ccw hosts.
82 This feature controls whether AES wrapping keys will be created
83 to allow execution of AES cryptographic functions. The default
84 is on.
86 ``dea-key-wrap=on|off``
87 Enables or disables DEA key wrapping support on s390-ccw hosts.
88 This feature controls whether DEA wrapping keys will be created
89 to allow execution of DEA cryptographic functions. The default
90 is on.
92 ``nvdimm=on|off``
93 Enables or disables NVDIMM support. The default is off.
95 ``memory-encryption=``
96 Memory encryption object to use. The default is none.
98 ``hmat=on|off``
99 Enables or disables ACPI Heterogeneous Memory Attribute Table
100 (HMAT) support. The default is off.
102 ``memory-backend='id'``
103 An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options.
104 Allows to use a memory backend as main RAM.
106 For example:
109 -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on
110 -machine memory-backend=pc.ram
111 -m 512M
113 Migration compatibility note:
115 * as backend id one shall use value of 'default-ram-id', advertised by
116 machine type (available via ``query-machines`` QMP command), if migration
117 to/from old QEMU (<5.0) is expected.
118 * for machine types 4.0 and older, user shall
119 use ``x-use-canonical-path-for-ramblock-id=off`` backend option
120 if migration to/from old QEMU (<5.0) is expected.
122 For example:
125 -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off
126 -machine memory-backend=pc.ram
127 -m 512M
129 ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]``
130 Define a CXL Fixed Memory Window (CFMW).
132 Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
134 They are regions of Host Physical Addresses (HPA) on a system which
135 may be interleaved across one or more CXL host bridges. The system
136 software will assign particular devices into these windows and
137 configure the downstream Host-managed Device Memory (HDM) decoders
138 in root ports, switch ports and devices appropriately to meet the
139 interleave requirements before enabling the memory devices.
141 ``targets.X=target`` provides the mapping to CXL host bridges
142 which may be identified by the id provided in the -device entry.
143 Multiple entries are needed to specify all the targets when
144 the fixed memory window represents interleaved memory. X is the
145 target index from 0.
147 ``size=size`` sets the size of the CFMW. This must be a multiple of
148 256MiB. The region will be aligned to 256MiB but the location is
149 platform and configuration dependent.
151 ``interleave-granularity=granularity`` sets the granularity of
152 interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB
153 4096KiB, 8192KiB and 16384KiB granularities supported.
155 Example:
159 -machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k
160 ERST
162 DEF("M", HAS_ARG, QEMU_OPTION_M,
163 " sgx-epc.0.memdev=memid,sgx-epc.0.node=numaid\n",
164 QEMU_ARCH_ALL)
166 SRST
167 ``sgx-epc.0.memdev=@var{memid},sgx-epc.0.node=@var{numaid}``
168 Define an SGX EPC section.
169 ERST
171 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
172 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
173 SRST
174 ``-cpu model``
175 Select CPU model (``-cpu help`` for list and additional feature
176 selection)
177 ERST
179 DEF("accel", HAS_ARG, QEMU_OPTION_accel,
180 "-accel [accel=]accelerator[,prop[=value][,...]]\n"
181 " select accelerator (kvm, xen, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
182 " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
183 " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
184 " kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
185 " one-insn-per-tb=on|off (one guest instruction per TCG translation block)\n"
186 " split-wx=on|off (enable TCG split w^x mapping)\n"
187 " tb-size=n (TCG translation block cache size)\n"
188 " dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n"
189 " eager-split-size=n (KVM Eager Page Split chunk size, default 0, disabled. ARM only)\n"
190 " notify-vmexit=run|internal-error|disable,notify-window=n (enable notify VM exit and set notify window, x86 only)\n"
191 " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
192 SRST
193 ``-accel name[,prop=value[,...]]``
194 This is used to enable an accelerator. Depending on the target
195 architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By
196 default, tcg is used. If there is more than one accelerator
197 specified, the next one is used if the previous one fails to
198 initialize.
200 ``igd-passthru=on|off``
201 When Xen is in use, this option controls whether Intel
202 integrated graphics devices can be passed through to the guest
203 (default=off)
205 ``kernel-irqchip=on|off|split``
206 Controls KVM in-kernel irqchip support. The default is full
207 acceleration of the interrupt controllers. On x86, split irqchip
208 reduces the kernel attack surface, at a performance cost for
209 non-MSI interrupts. Disabling the in-kernel irqchip completely
210 is not recommended except for debugging purposes.
212 ``kvm-shadow-mem=size``
213 Defines the size of the KVM shadow MMU.
215 ``one-insn-per-tb=on|off``
216 Makes the TCG accelerator put only one guest instruction into
217 each translation block. This slows down emulation a lot, but
218 can be useful in some situations, such as when trying to analyse
219 the logs produced by the ``-d`` option.
221 ``split-wx=on|off``
222 Controls the use of split w^x mapping for the TCG code generation
223 buffer. Some operating systems require this to be enabled, and in
224 such a case this will default on. On other operating systems, this
225 will default off, but one may enable this for testing or debugging.
227 ``tb-size=n``
228 Controls the size (in MiB) of the TCG translation block cache.
230 ``thread=single|multi``
231 Controls number of TCG threads. When the TCG is multi-threaded
232 there will be one thread per vCPU therefore taking advantage of
233 additional host cores. The default is to enable multi-threading
234 where both the back-end and front-ends support it and no
235 incompatible TCG features have been enabled (e.g.
236 icount/replay).
238 ``dirty-ring-size=n``
239 When the KVM accelerator is used, it controls the size of the per-vCPU
240 dirty page ring buffer (number of entries for each vCPU). It should
241 be a value that is power of two, and it should be 1024 or bigger (but
242 still less than the maximum value that the kernel supports). 4096
243 could be a good initial value if you have no idea which is the best.
244 Set this value to 0 to disable the feature. By default, this feature
245 is disabled (dirty-ring-size=0). When enabled, KVM will instead
246 record dirty pages in a bitmap.
248 ``eager-split-size=n``
249 KVM implements dirty page logging at the PAGE_SIZE granularity and
250 enabling dirty-logging on a huge-page requires breaking it into
251 PAGE_SIZE pages in the first place. KVM on ARM does this splitting
252 lazily by default. There are performance benefits in doing huge-page
253 split eagerly, especially in situations where TLBI costs associated
254 with break-before-make sequences are considerable and also if guest
255 workloads are read intensive. The size here specifies how many pages
256 to break at a time and needs to be a valid block size which is
257 1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE
258 respectively. Be wary of specifying a higher size as it will have an
259 impact on the memory. By default, this feature is disabled
260 (eager-split-size=0).
262 ``notify-vmexit=run|internal-error|disable,notify-window=n``
263 Enables or disables notify VM exit support on x86 host and specify
264 the corresponding notify window to trigger the VM exit if enabled.
265 ``run`` option enables the feature. It does nothing and continue
266 if the exit happens. ``internal-error`` option enables the feature.
267 It raises a internal error. ``disable`` option doesn't enable the feature.
268 This feature can mitigate the CPU stuck issue due to event windows don't
269 open up for a specified of time (i.e. notify-window).
270 Default: notify-vmexit=run,notify-window=0.
272 ERST
274 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
275 "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]\n"
276 " set the number of initial CPUs to 'n' [default=1]\n"
277 " maxcpus= maximum number of total CPUs, including\n"
278 " offline CPUs for hotplug, etc\n"
279 " sockets= number of sockets on the machine board\n"
280 " dies= number of dies in one socket\n"
281 " clusters= number of clusters in one die\n"
282 " cores= number of cores in one cluster\n"
283 " threads= number of threads in one core\n"
284 "Note: Different machines may have different subsets of the CPU topology\n"
285 " parameters supported, so the actual meaning of the supported parameters\n"
286 " will vary accordingly. For example, for a machine type that supports a\n"
287 " three-level CPU hierarchy of sockets/cores/threads, the parameters will\n"
288 " sequentially mean as below:\n"
289 " sockets means the number of sockets on the machine board\n"
290 " cores means the number of cores in one socket\n"
291 " threads means the number of threads in one core\n"
292 " For a particular machine type board, an expected CPU topology hierarchy\n"
293 " can be defined through the supported sub-option. Unsupported parameters\n"
294 " can also be provided in addition to the sub-option, but their values\n"
295 " must be set as 1 in the purpose of correct parsing.\n",
296 QEMU_ARCH_ALL)
297 SRST
298 ``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]``
299 Simulate a SMP system with '\ ``n``\ ' CPUs initially present on
300 the machine type board. On boards supporting CPU hotplug, the optional
301 '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be
302 added at runtime. When both parameters are omitted, the maximum number
303 of CPUs will be calculated from the provided topology members and the
304 initial CPU count will match the maximum number. When only one of them
305 is given then the omitted one will be set to its counterpart's value.
306 Both parameters may be specified, but the maximum number of CPUs must
307 be equal to or greater than the initial CPU count. Product of the
308 CPU topology hierarchy must be equal to the maximum number of CPUs.
309 Both parameters are subject to an upper limit that is determined by
310 the specific machine type chosen.
312 To control reporting of CPU topology information, values of the topology
313 parameters can be specified. Machines may only support a subset of the
314 parameters and different machines may have different subsets supported
315 which vary depending on capacity of the corresponding CPU targets. So
316 for a particular machine type board, an expected topology hierarchy can
317 be defined through the supported sub-option. Unsupported parameters can
318 also be provided in addition to the sub-option, but their values must be
319 set as 1 in the purpose of correct parsing.
321 Either the initial CPU count, or at least one of the topology parameters
322 must be specified. The specified parameters must be greater than zero,
323 explicit configuration like "cpus=0" is not allowed. Values for any
324 omitted parameters will be computed from those which are given.
326 For example, the following sub-option defines a CPU topology hierarchy
327 (2 sockets totally on the machine, 2 cores per socket, 2 threads per
328 core) for a machine that only supports sockets/cores/threads.
329 Some members of the option can be omitted but their values will be
330 automatically computed:
334 -smp 8,sockets=2,cores=2,threads=2,maxcpus=8
336 The following sub-option defines a CPU topology hierarchy (2 sockets
337 totally on the machine, 2 dies per socket, 2 cores per die, 2 threads
338 per core) for PC machines which support sockets/dies/cores/threads.
339 Some members of the option can be omitted but their values will be
340 automatically computed:
344 -smp 16,sockets=2,dies=2,cores=2,threads=2,maxcpus=16
346 The following sub-option defines a CPU topology hierarchy (2 sockets
347 totally on the machine, 2 clusters per socket, 2 cores per cluster,
348 2 threads per core) for ARM virt machines which support sockets/clusters
349 /cores/threads. Some members of the option can be omitted but their values
350 will be automatically computed:
354 -smp 16,sockets=2,clusters=2,cores=2,threads=2,maxcpus=16
356 Historically preference was given to the coarsest topology parameters
357 when computing missing values (ie sockets preferred over cores, which
358 were preferred over threads), however, this behaviour is considered
359 liable to change. Prior to 6.2 the preference was sockets over cores
360 over threads. Since 6.2 the preference is cores over sockets over threads.
362 For example, the following option defines a machine board with 2 sockets
363 of 1 core before 6.2 and 1 socket of 2 cores after 6.2:
367 -smp 2
369 Note: The cluster topology will only be generated in ACPI and exposed
370 to guest if it's explicitly specified in -smp.
371 ERST
373 DEF("numa", HAS_ARG, QEMU_OPTION_numa,
374 "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
375 "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
376 "-numa dist,src=source,dst=destination,val=distance\n"
377 "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n"
378 "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n"
379 "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n",
380 QEMU_ARCH_ALL)
381 SRST
382 ``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
384 ``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
386 ``-numa dist,src=source,dst=destination,val=distance``
388 ``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
390 ``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=type[,latency=lat][,bandwidth=bw]``
392 ``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
393 Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
394 distance from a source node to a destination node. Set the ACPI
395 Heterogeneous Memory Attributes for the given nodes.
397 Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and
398 lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a
399 contiguous range of CPU indexes (or a single VCPU if lastcpu is
400 omitted). A non-contiguous set of VCPUs can be represented by
401 providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is
402 omitted on all nodes, VCPUs are automatically split between them.
404 For example, the following option assigns VCPUs 0, 1, 2 and 5 to a
405 NUMA node:
409 -numa node,cpus=0-2,cpus=5
411 '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option
412 which uses '\ ``socket-id|core-id|thread-id``\ ' properties to
413 assign CPU objects to a node using topology layout properties of
414 CPU. The set of properties is machine specific, and depends on used
415 machine type/'\ ``smp``\ ' options. It could be queried with
416 '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ '
417 property specifies node to which CPU object will be assigned, it's
418 required for node to be declared with '\ ``node``\ ' option before
419 it's used with '\ ``cpu``\ ' option.
421 For example:
425 -M pc \
426 -smp 1,sockets=2,maxcpus=2 \
427 -numa node,nodeid=0 -numa node,nodeid=1 \
428 -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
430 '\ ``memdev``\ ' option assigns RAM from a given memory backend
431 device to a node. It is recommended to use '\ ``memdev``\ ' option
432 over legacy '\ ``mem``\ ' option. This is because '\ ``memdev``\ '
433 option provides better performance and more control over the
434 backend's RAM (e.g. '\ ``prealloc``\ ' parameter of
435 '\ ``-memory-backend-ram``\ ' allows memory preallocation).
437 For compatibility reasons, legacy '\ ``mem``\ ' option is
438 supported in 5.0 and older machine types. Note that '\ ``mem``\ '
439 and '\ ``memdev``\ ' are mutually exclusive. If one node uses
440 '\ ``memdev``\ ', the rest nodes have to use '\ ``memdev``\ '
441 option, and vice versa.
443 Users must specify memory for all NUMA nodes by '\ ``memdev``\ '
444 (or legacy '\ ``mem``\ ' if available). In QEMU 5.2, the support
445 for '\ ``-numa node``\ ' without memory specified was removed.
447 '\ ``initiator``\ ' is an additional option that points to an
448 initiator NUMA node that has best performance (the lowest latency or
449 largest bandwidth) to this NUMA node. Note that this option can be
450 set only when the machine property 'hmat' is set to 'on'.
452 Following example creates a machine with 2 NUMA nodes, node 0 has
453 CPU. node 1 has only memory, and its initiator is node 0. Note that
454 because node 0 has CPU, by default the initiator of node 0 is itself
455 and must be itself.
459 -machine hmat=on \
460 -m 2G,slots=2,maxmem=4G \
461 -object memory-backend-ram,size=1G,id=m0 \
462 -object memory-backend-ram,size=1G,id=m1 \
463 -numa node,nodeid=0,memdev=m0 \
464 -numa node,nodeid=1,memdev=m1,initiator=0 \
465 -smp 2,sockets=2,maxcpus=2 \
466 -numa cpu,node-id=0,socket-id=0 \
467 -numa cpu,node-id=0,socket-id=1
469 source and destination are NUMA node IDs. distance is the NUMA
470 distance from source to destination. The distance from a node to
471 itself is always 10. If any pair of nodes is given a distance, then
472 all pairs must be given distances. Although, when distances are only
473 given in one direction for each pair of nodes, then the distances in
474 the opposite directions are assumed to be the same. If, however, an
475 asymmetrical pair of distances is given for even one node pair, then
476 all node pairs must be provided distance values for both directions,
477 even when they are symmetrical. When a node is unreachable from
478 another node, set the pair's distance to 255.
480 Note that the -``numa`` option doesn't allocate any of the specified
481 resources, it just assigns existing resources to NUMA nodes. This
482 means that one still has to use the ``-m``, ``-smp`` options to
483 allocate RAM and VCPUs respectively.
485 Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth
486 Information between initiator and target NUMA nodes in ACPI
487 Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can
488 create memory requests, usually it has one or more processors.
489 Target NUMA node contains addressable memory.
491 In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is
492 the memory hierarchy of the target NUMA node: if hierarchy is
493 'memory', the structure represents the memory performance; if
494 hierarchy is 'first-level\|second-level\|third-level', this
495 structure represents aggregated performance of memory side caches
496 for each domain. type of 'data-type' is type of data represented by
497 this structure instance: if 'hierarchy' is 'memory', 'data-type' is
498 'access\|read\|write' latency or 'access\|read\|write' bandwidth of
499 the target memory; if 'hierarchy' is
500 'first-level\|second-level\|third-level', 'data-type' is
501 'access\|read\|write' hit latency or 'access\|read\|write' hit
502 bandwidth of the target memory side cache.
504 lat is latency value in nanoseconds. bw is bandwidth value, the
505 possible value and units are NUM[M\|G\|T], mean that the bandwidth
506 value are NUM byte per second (or MB/s, GB/s or TB/s depending on
507 used suffix). Note that if latency or bandwidth value is 0, means
508 the corresponding latency or bandwidth information is not provided.
510 In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory
511 belongs. size is the size of memory side cache in bytes. level is
512 the cache level described in this structure, note that the cache
513 level 0 should not be used with '\ ``hmat-cache``\ ' option.
514 associativity is the cache associativity, the possible value is
515 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy
516 is the write policy. line is the cache Line size in bytes.
518 For example, the following options describe 2 NUMA nodes. Node 0 has
519 2 cpus and a ram, node 1 has only a ram. The processors in node 0
520 access memory in node 0 with access-latency 5 nanoseconds,
521 access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
522 memory in NUMA node 1 with access-latency 10 nanoseconds,
523 access-bandwidth is 100 MB/s. And for memory side cache information,
524 NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
525 policy is write-back, the cache Line size is 8 bytes:
529 -machine hmat=on \
530 -m 2G \
531 -object memory-backend-ram,size=1G,id=m0 \
532 -object memory-backend-ram,size=1G,id=m1 \
533 -smp 2,sockets=2,maxcpus=2 \
534 -numa node,nodeid=0,memdev=m0 \
535 -numa node,nodeid=1,memdev=m1,initiator=0 \
536 -numa cpu,node-id=0,socket-id=0 \
537 -numa cpu,node-id=0,socket-id=1 \
538 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
539 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
540 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
541 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
542 -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
543 -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
544 ERST
546 DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
547 "-add-fd fd=fd,set=set[,opaque=opaque]\n"
548 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
549 SRST
550 ``-add-fd fd=fd,set=set[,opaque=opaque]``
551 Add a file descriptor to an fd set. Valid options are:
553 ``fd=fd``
554 This option defines the file descriptor of which a duplicate is
555 added to fd set. The file descriptor cannot be stdin, stdout, or
556 stderr.
558 ``set=set``
559 This option defines the ID of the fd set to add the file
560 descriptor to.
562 ``opaque=opaque``
563 This option defines a free-form string that can be used to
564 describe fd.
566 You can open an image using pre-opened file descriptors from an fd
567 set:
569 .. parsed-literal::
571 |qemu_system| \\
572 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\
573 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\
574 -drive file=/dev/fdset/2,index=0,media=disk
575 ERST
577 DEF("set", HAS_ARG, QEMU_OPTION_set,
578 "-set group.id.arg=value\n"
579 " set <arg> parameter for item <id> of type <group>\n"
580 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
581 SRST
582 ``-set group.id.arg=value``
583 Set parameter arg for item id of type group
584 ERST
586 DEF("global", HAS_ARG, QEMU_OPTION_global,
587 "-global driver.property=value\n"
588 "-global driver=driver,property=property,value=value\n"
589 " set a global default for a driver property\n",
590 QEMU_ARCH_ALL)
591 SRST
592 ``-global driver.prop=value``
594 ``-global driver=driver,property=property,value=value``
595 Set default value of driver's property prop to value, e.g.:
597 .. parsed-literal::
599 |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img
601 In particular, you can use this to set driver properties for devices
602 which are created automatically by the machine model. To create a
603 device which is not created automatically and set properties on it,
604 use -``device``.
606 -global driver.prop=value is shorthand for -global
607 driver=driver,property=prop,value=value. The longhand syntax works
608 even when driver contains a dot.
609 ERST
611 DEF("boot", HAS_ARG, QEMU_OPTION_boot,
612 "-boot [order=drives][,once=drives][,menu=on|off]\n"
613 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
614 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
615 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
616 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
617 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
618 QEMU_ARCH_ALL)
619 SRST
620 ``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]``
621 Specify boot order drives as a string of drive letters. Valid drive
622 letters depend on the target architecture. The x86 PC uses: a, b
623 (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p
624 (Etherboot from network adapter 1-4), hard disk boot is the default.
625 To apply a particular boot order only on the first startup, specify
626 it via ``once``. Note that the ``order`` or ``once`` parameter
627 should not be used together with the ``bootindex`` property of
628 devices, since the firmware implementations normally do not support
629 both at the same time.
631 Interactive boot menus/prompts can be enabled via ``menu=on`` as far
632 as firmware/BIOS supports them. The default is non-interactive boot.
634 A splash picture could be passed to bios, enabling user to show it
635 as logo, when option splash=sp\_name is given and menu=on, If
636 firmware/BIOS supports them. Currently Seabios for X86 system
637 support it. limitation: The splash file could be a jpeg file or a
638 BMP file in 24 BPP format(true color). The resolution should be
639 supported by the SVGA mode, so the recommended is 320x240, 640x480,
640 800x640.
642 A timeout could be passed to bios, guest will pause for rb\_timeout
643 ms when boot failed, then reboot. If rb\_timeout is '-1', guest will
644 not reboot, qemu passes '-1' to bios by default. Currently Seabios
645 for X86 system support it.
647 Do strict boot via ``strict=on`` as far as firmware/BIOS supports
648 it. This only effects when boot priority is changed by bootindex
649 options. The default is non-strict boot.
651 .. parsed-literal::
653 # try to boot from network first, then from hard disk
654 |qemu_system_x86| -boot order=nc
655 # boot from CD-ROM first, switch back to default order after reboot
656 |qemu_system_x86| -boot once=d
657 # boot with a splash picture for 5 seconds.
658 |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000
660 Note: The legacy format '-boot drives' is still supported but its
661 use is discouraged as it may be removed from future versions.
662 ERST
664 DEF("m", HAS_ARG, QEMU_OPTION_m,
665 "-m [size=]megs[,slots=n,maxmem=size]\n"
666 " configure guest RAM\n"
667 " size: initial amount of guest memory\n"
668 " slots: number of hotplug slots (default: none)\n"
669 " maxmem: maximum amount of guest memory (default: none)\n"
670 " Note: Some architectures might enforce a specific granularity\n",
671 QEMU_ARCH_ALL)
672 SRST
673 ``-m [size=]megs[,slots=n,maxmem=size]``
674 Sets guest startup RAM size to megs megabytes. Default is 128 MiB.
675 Optionally, a suffix of "M" or "G" can be used to signify a value in
676 megabytes or gigabytes respectively. Optional pair slots, maxmem
677 could be used to set amount of hotpluggable memory slots and maximum
678 amount of memory. Note that maxmem must be aligned to the page size.
680 For example, the following command-line sets the guest startup RAM
681 size to 1GB, creates 3 slots to hotplug additional memory and sets
682 the maximum memory the guest can reach to 4GB:
684 .. parsed-literal::
686 |qemu_system| -m 1G,slots=3,maxmem=4G
688 If slots and maxmem are not specified, memory hotplug won't be
689 enabled and the guest startup RAM will never increase.
690 ERST
692 DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
693 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
694 SRST
695 ``-mem-path path``
696 Allocate guest RAM from a temporarily created file in path.
697 ERST
699 DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
700 "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
701 QEMU_ARCH_ALL)
702 SRST
703 ``-mem-prealloc``
704 Preallocate memory when using -mem-path.
705 ERST
707 DEF("k", HAS_ARG, QEMU_OPTION_k,
708 "-k language use keyboard layout (for example 'fr' for French)\n",
709 QEMU_ARCH_ALL)
710 SRST
711 ``-k language``
712 Use keyboard layout language (for example ``fr`` for French). This
713 option is only needed where it is not easy to get raw PC keycodes
714 (e.g. on Macs, with some X11 servers or with a VNC or curses
715 display). You don't normally need to use it on PC/Linux or
716 PC/Windows hosts.
718 The available layouts are:
722 ar de-ch es fo fr-ca hu ja mk no pt-br sv
723 da en-gb et fr fr-ch is lt nl pl ru th
724 de en-us fi fr-be hr it lv nl-be pt sl tr
726 The default is ``en-us``.
727 ERST
730 HXCOMM Deprecated by -audiodev
731 DEF("audio-help", 0, QEMU_OPTION_audio_help,
732 "-audio-help show -audiodev equivalent of the currently specified audio settings\n",
733 QEMU_ARCH_ALL)
734 SRST
735 ``-audio-help``
736 Will show the -audiodev equivalent of the currently specified
737 (deprecated) environment variables.
738 ERST
740 DEF("audio", HAS_ARG, QEMU_OPTION_audio,
741 "-audio [driver=]driver,model=value[,prop[=value][,...]]\n"
742 " specifies the audio backend and device to use;\n"
743 " apart from 'model', options are the same as for -audiodev.\n"
744 " use '-audio model=help' to show possible devices.\n",
745 QEMU_ARCH_ALL)
746 SRST
747 ``-audio [driver=]driver,model=value[,prop[=value][,...]]``
748 This option is a shortcut for configuring both the guest audio
749 hardware and the host audio backend in one go.
750 The driver option is the same as with the corresponding ``-audiodev`` option below.
751 The guest hardware model can be set with ``model=modelname``.
753 Use ``driver=help`` to list the available drivers,
754 and ``model=help`` to list the available device types.
756 The following two example do exactly the same, to show how ``-audio``
757 can be used to shorten the command line length:
759 .. parsed-literal::
761 |qemu_system| -audiodev pa,id=pa -device sb16,audiodev=pa
762 |qemu_system| -audio pa,model=sb16
763 ERST
765 DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
766 "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
767 " specifies the audio backend to use\n"
768 " Use ``-audiodev help`` to list the available drivers\n"
769 " id= identifier of the backend\n"
770 " timer-period= timer period in microseconds\n"
771 " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
772 " in|out.fixed-settings= use fixed settings for host audio\n"
773 " in|out.frequency= frequency to use with fixed settings\n"
774 " in|out.channels= number of channels to use with fixed settings\n"
775 " in|out.format= sample format to use with fixed settings\n"
776 " valid values: s8, s16, s32, u8, u16, u32, f32\n"
777 " in|out.voices= number of voices to use\n"
778 " in|out.buffer-length= length of buffer in microseconds\n"
779 "-audiodev none,id=id,[,prop[=value][,...]]\n"
780 " dummy driver that discards all output\n"
781 #ifdef CONFIG_AUDIO_ALSA
782 "-audiodev alsa,id=id[,prop[=value][,...]]\n"
783 " in|out.dev= name of the audio device to use\n"
784 " in|out.period-length= length of period in microseconds\n"
785 " in|out.try-poll= attempt to use poll mode\n"
786 " threshold= threshold (in microseconds) when playback starts\n"
787 #endif
788 #ifdef CONFIG_AUDIO_COREAUDIO
789 "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
790 " in|out.buffer-count= number of buffers\n"
791 #endif
792 #ifdef CONFIG_AUDIO_DSOUND
793 "-audiodev dsound,id=id[,prop[=value][,...]]\n"
794 " latency= add extra latency to playback in microseconds\n"
795 #endif
796 #ifdef CONFIG_AUDIO_OSS
797 "-audiodev oss,id=id[,prop[=value][,...]]\n"
798 " in|out.dev= path of the audio device to use\n"
799 " in|out.buffer-count= number of buffers\n"
800 " in|out.try-poll= attempt to use poll mode\n"
801 " try-mmap= try using memory mapped access\n"
802 " exclusive= open device in exclusive mode\n"
803 " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
804 #endif
805 #ifdef CONFIG_AUDIO_PA
806 "-audiodev pa,id=id[,prop[=value][,...]]\n"
807 " server= PulseAudio server address\n"
808 " in|out.name= source/sink device name\n"
809 " in|out.latency= desired latency in microseconds\n"
810 #endif
811 #ifdef CONFIG_AUDIO_PIPEWIRE
812 "-audiodev pipewire,id=id[,prop[=value][,...]]\n"
813 " in|out.name= source/sink device name\n"
814 " in|out.stream-name= name of pipewire stream\n"
815 " in|out.latency= desired latency in microseconds\n"
816 #endif
817 #ifdef CONFIG_AUDIO_SDL
818 "-audiodev sdl,id=id[,prop[=value][,...]]\n"
819 " in|out.buffer-count= number of buffers\n"
820 #endif
821 #ifdef CONFIG_AUDIO_SNDIO
822 "-audiodev sndio,id=id[,prop[=value][,...]]\n"
823 #endif
824 #ifdef CONFIG_SPICE
825 "-audiodev spice,id=id[,prop[=value][,...]]\n"
826 #endif
827 #ifdef CONFIG_DBUS_DISPLAY
828 "-audiodev dbus,id=id[,prop[=value][,...]]\n"
829 #endif
830 "-audiodev wav,id=id[,prop[=value][,...]]\n"
831 " path= path of wav file to record\n",
832 QEMU_ARCH_ALL)
833 SRST
834 ``-audiodev [driver=]driver,id=id[,prop[=value][,...]]``
835 Adds a new audio backend driver identified by id. There are global
836 and driver specific properties. Some values can be set differently
837 for input and output, they're marked with ``in|out.``. You can set
838 the input's property with ``in.prop`` and the output's property with
839 ``out.prop``. For example:
843 -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
844 -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
846 NOTE: parameter validation is known to be incomplete, in many cases
847 specifying an invalid option causes QEMU to print an error message
848 and continue emulation without sound.
850 Valid global options are:
852 ``id=identifier``
853 Identifies the audio backend.
855 ``timer-period=period``
856 Sets the timer period used by the audio subsystem in
857 microseconds. Default is 10000 (10 ms).
859 ``in|out.mixing-engine=on|off``
860 Use QEMU's mixing engine to mix all streams inside QEMU and
861 convert audio formats when not supported by the backend. When
862 off, fixed-settings must be off too. Note that disabling this
863 option means that the selected backend must support multiple
864 streams and the audio formats used by the virtual cards,
865 otherwise you'll get no sound. It's not recommended to disable
866 this option unless you want to use 5.1 or 7.1 audio, as mixing
867 engine only supports mono and stereo audio. Default is on.
869 ``in|out.fixed-settings=on|off``
870 Use fixed settings for host audio. When off, it will change
871 based on how the guest opens the sound card. In this case you
872 must not specify frequency, channels or format. Default is on.
874 ``in|out.frequency=frequency``
875 Specify the frequency to use when using fixed-settings. Default
876 is 44100Hz.
878 ``in|out.channels=channels``
879 Specify the number of channels to use when using fixed-settings.
880 Default is 2 (stereo).
882 ``in|out.format=format``
883 Specify the sample format to use when using fixed-settings.
884 Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``,
885 ``u32``, ``f32``. Default is ``s16``.
887 ``in|out.voices=voices``
888 Specify the number of voices to use. Default is 1.
890 ``in|out.buffer-length=usecs``
891 Sets the size of the buffer in microseconds.
893 ``-audiodev none,id=id[,prop[=value][,...]]``
894 Creates a dummy backend that discards all outputs. This backend has
895 no backend specific properties.
897 ``-audiodev alsa,id=id[,prop[=value][,...]]``
898 Creates backend using the ALSA. This backend is only available on
899 Linux.
901 ALSA specific options are:
903 ``in|out.dev=device``
904 Specify the ALSA device to use for input and/or output. Default
905 is ``default``.
907 ``in|out.period-length=usecs``
908 Sets the period length in microseconds.
910 ``in|out.try-poll=on|off``
911 Attempt to use poll mode with the device. Default is on.
913 ``threshold=threshold``
914 Threshold (in microseconds) when playback starts. Default is 0.
916 ``-audiodev coreaudio,id=id[,prop[=value][,...]]``
917 Creates a backend using Apple's Core Audio. This backend is only
918 available on Mac OS and only supports playback.
920 Core Audio specific options are:
922 ``in|out.buffer-count=count``
923 Sets the count of the buffers.
925 ``-audiodev dsound,id=id[,prop[=value][,...]]``
926 Creates a backend using Microsoft's DirectSound. This backend is
927 only available on Windows and only supports playback.
929 DirectSound specific options are:
931 ``latency=usecs``
932 Add extra usecs microseconds latency to playback. Default is
933 10000 (10 ms).
935 ``-audiodev oss,id=id[,prop[=value][,...]]``
936 Creates a backend using OSS. This backend is available on most
937 Unix-like systems.
939 OSS specific options are:
941 ``in|out.dev=device``
942 Specify the file name of the OSS device to use. Default is
943 ``/dev/dsp``.
945 ``in|out.buffer-count=count``
946 Sets the count of the buffers.
948 ``in|out.try-poll=on|of``
949 Attempt to use poll mode with the device. Default is on.
951 ``try-mmap=on|off``
952 Try using memory mapped device access. Default is off.
954 ``exclusive=on|off``
955 Open the device in exclusive mode (vmix won't work in this
956 case). Default is off.
958 ``dsp-policy=policy``
959 Sets the timing policy (between 0 and 10, where smaller number
960 means smaller latency but higher CPU usage). Use -1 to use
961 buffer sizes specified by ``buffer`` and ``buffer-count``. This
962 option is ignored if you do not have OSS 4. Default is 5.
964 ``-audiodev pa,id=id[,prop[=value][,...]]``
965 Creates a backend using PulseAudio. This backend is available on
966 most systems.
968 PulseAudio specific options are:
970 ``server=server``
971 Sets the PulseAudio server to connect to.
973 ``in|out.name=sink``
974 Use the specified source/sink for recording/playback.
976 ``in|out.latency=usecs``
977 Desired latency in microseconds. The PulseAudio server will try
978 to honor this value but actual latencies may be lower or higher.
980 ``-audiodev pipewire,id=id[,prop[=value][,...]]``
981 Creates a backend using PipeWire. This backend is available on
982 most systems.
984 PipeWire specific options are:
986 ``in|out.latency=usecs``
987 Desired latency in microseconds.
989 ``in|out.name=sink``
990 Use the specified source/sink for recording/playback.
992 ``in|out.stream-name``
993 Specify the name of pipewire stream.
995 ``-audiodev sdl,id=id[,prop[=value][,...]]``
996 Creates a backend using SDL. This backend is available on most
997 systems, but you should use your platform's native backend if
998 possible.
1000 SDL specific options are:
1002 ``in|out.buffer-count=count``
1003 Sets the count of the buffers.
1005 ``-audiodev sndio,id=id[,prop[=value][,...]]``
1006 Creates a backend using SNDIO. This backend is available on
1007 OpenBSD and most other Unix-like systems.
1009 Sndio specific options are:
1011 ``in|out.dev=device``
1012 Specify the sndio device to use for input and/or output. Default
1013 is ``default``.
1015 ``in|out.latency=usecs``
1016 Sets the desired period length in microseconds.
1018 ``-audiodev spice,id=id[,prop[=value][,...]]``
1019 Creates a backend that sends audio through SPICE. This backend
1020 requires ``-spice`` and automatically selected in that case, so
1021 usually you can ignore this option. This backend has no backend
1022 specific properties.
1024 ``-audiodev wav,id=id[,prop[=value][,...]]``
1025 Creates a backend that writes audio to a WAV file.
1027 Backend specific options are:
1029 ``path=path``
1030 Write recorded audio into the specified file. Default is
1031 ``qemu.wav``.
1032 ERST
1034 DEF("device", HAS_ARG, QEMU_OPTION_device,
1035 "-device driver[,prop[=value][,...]]\n"
1036 " add device (based on driver)\n"
1037 " prop=value,... sets driver properties\n"
1038 " use '-device help' to print all possible drivers\n"
1039 " use '-device driver,help' to print all possible properties\n",
1040 QEMU_ARCH_ALL)
1041 SRST
1042 ``-device driver[,prop[=value][,...]]``
1043 Add device driver. prop=value sets driver properties. Valid
1044 properties depend on the driver. To get help on possible drivers and
1045 properties, use ``-device help`` and ``-device driver,help``.
1047 Some drivers are:
1049 ``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]``
1050 Add an IPMI BMC. This is a simulation of a hardware management
1051 interface processor that normally sits on a system. It provides a
1052 watchdog and the ability to reset and power control the system. You
1053 need to connect this to an IPMI interface to make it useful
1055 The IPMI slave address to use for the BMC. The default is 0x20. This
1056 address is the BMC's address on the I2C network of management
1057 controllers. If you don't know what this means, it is safe to ignore
1060 ``id=id``
1061 The BMC id for interfaces to use this device.
1063 ``slave_addr=val``
1064 Define slave address to use for the BMC. The default is 0x20.
1066 ``sdrfile=file``
1067 file containing raw Sensor Data Records (SDR) data. The default
1068 is none.
1070 ``fruareasize=val``
1071 size of a Field Replaceable Unit (FRU) area. The default is
1072 1024.
1074 ``frudatafile=file``
1075 file containing raw Field Replaceable Unit (FRU) inventory data.
1076 The default is none.
1078 ``guid=uuid``
1079 value for the GUID for the BMC, in standard UUID format. If this
1080 is set, get "Get GUID" command to the BMC will return it.
1081 Otherwise "Get GUID" will return an error.
1083 ``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]``
1084 Add a connection to an external IPMI BMC simulator. Instead of
1085 locally emulating the BMC like the above item, instead connect to an
1086 external entity that provides the IPMI services.
1088 A connection is made to an external BMC simulator. If you do this,
1089 it is strongly recommended that you use the "reconnect=" chardev
1090 option to reconnect to the simulator if the connection is lost. Note
1091 that if this is not used carefully, it can be a security issue, as
1092 the interface has the ability to send resets, NMIs, and power off
1093 the VM. It's best if QEMU makes a connection to an external
1094 simulator running on a secure port on localhost, so neither the
1095 simulator nor QEMU is exposed to any outside network.
1097 See the "lanserv/README.vm" file in the OpenIPMI library for more
1098 details on the external interface.
1100 ``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
1101 Add a KCS IPMI interface on the ISA bus. This also adds a
1102 corresponding ACPI and SMBIOS entries, if appropriate.
1104 ``bmc=id``
1105 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern
1106 above.
1108 ``ioport=val``
1109 Define the I/O address of the interface. The default is 0xca0
1110 for KCS.
1112 ``irq=val``
1113 Define the interrupt to use. The default is 5. To disable
1114 interrupts, set this to 0.
1116 ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
1117 Like the KCS interface, but defines a BT interface. The default port
1118 is 0xe4 and the default interrupt is 5.
1120 ``-device pci-ipmi-kcs,bmc=id``
1121 Add a KCS IPMI interface on the PCI bus.
1123 ``bmc=id``
1124 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
1126 ``-device pci-ipmi-bt,bmc=id``
1127 Like the KCS interface, but defines a BT interface on the PCI bus.
1129 ``-device intel-iommu[,option=...]``
1130 This is only supported by ``-machine q35``, which will enable Intel VT-d
1131 emulation within the guest. It supports below options:
1133 ``intremap=on|off`` (default: auto)
1134 This enables interrupt remapping feature. It's required to enable
1135 complete x2apic. Currently it only supports kvm kernel-irqchip modes
1136 ``off`` or ``split``, while full kernel-irqchip is not yet supported.
1137 The default value is "auto", which will be decided by the mode of
1138 kernel-irqchip.
1140 ``caching-mode=on|off`` (default: off)
1141 This enables caching mode for the VT-d emulated device. When
1142 caching-mode is enabled, each guest DMA buffer mapping will generate an
1143 IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in
1144 a synchronous way. It is required for ``-device vfio-pci`` to work
1145 with the VT-d device, because host assigned devices requires to setup
1146 the DMA mapping on the host before guest DMA starts.
1148 ``device-iotlb=on|off`` (default: off)
1149 This enables device-iotlb capability for the emulated VT-d device. So
1150 far virtio/vhost should be the only real user for this parameter,
1151 paired with ats=on configured for the device.
1153 ``aw-bits=39|48`` (default: 39)
1154 This decides the address width of IOVA address space. The address
1155 space has 39 bits width for 3-level IOMMU page tables, and 48 bits for
1156 4-level IOMMU page tables.
1158 Please also refer to the wiki page for general scenarios of VT-d
1159 emulation in QEMU: https://wiki.qemu.org/Features/VT-d.
1161 ERST
1163 DEF("name", HAS_ARG, QEMU_OPTION_name,
1164 "-name string1[,process=string2][,debug-threads=on|off]\n"
1165 " set the name of the guest\n"
1166 " string1 sets the window title and string2 the process name\n"
1167 " When debug-threads is enabled, individual threads are given a separate name\n"
1168 " NOTE: The thread names are for debugging and not a stable API.\n",
1169 QEMU_ARCH_ALL)
1170 SRST
1171 ``-name name``
1172 Sets the name of the guest. This name will be displayed in the SDL
1173 window caption. The name will also be used for the VNC server. Also
1174 optionally set the top visible process name in Linux. Naming of
1175 individual threads can also be enabled on Linux to aid debugging.
1176 ERST
1178 DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
1179 "-uuid %08x-%04x-%04x-%04x-%012x\n"
1180 " specify machine UUID\n", QEMU_ARCH_ALL)
1181 SRST
1182 ``-uuid uuid``
1183 Set system UUID.
1184 ERST
1186 DEFHEADING()
1188 DEFHEADING(Block device options:)
1190 SRST
1191 The QEMU block device handling options have a long history and
1192 have gone through several iterations as the feature set and complexity
1193 of the block layer have grown. Many online guides to QEMU often
1194 reference older and deprecated options, which can lead to confusion.
1196 The most explicit way to describe disks is to use a combination of
1197 ``-device`` to specify the hardware device and ``-blockdev`` to
1198 describe the backend. The device defines what the guest sees and the
1199 backend describes how QEMU handles the data. It is the only guaranteed
1200 stable interface for describing block devices and as such is
1201 recommended for management tools and scripting.
1203 The ``-drive`` option combines the device and backend into a single
1204 command line option which is a more human friendly. There is however no
1205 interface stability guarantee although some older board models still
1206 need updating to work with the modern blockdev forms.
1208 Older options like ``-hda`` are essentially macros which expand into
1209 ``-drive`` options for various drive interfaces. The original forms
1210 bake in a lot of assumptions from the days when QEMU was emulating a
1211 legacy PC, they are not recommended for modern configurations.
1213 ERST
1215 DEF("fda", HAS_ARG, QEMU_OPTION_fda,
1216 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
1217 DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
1218 SRST
1219 ``-fda file``
1221 ``-fdb file``
1222 Use file as floppy disk 0/1 image (see the :ref:`disk images` chapter in
1223 the System Emulation Users Guide).
1224 ERST
1226 DEF("hda", HAS_ARG, QEMU_OPTION_hda,
1227 "-hda/-hdb file use 'file' as hard disk 0/1 image\n", QEMU_ARCH_ALL)
1228 DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
1229 DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
1230 "-hdc/-hdd file use 'file' as hard disk 2/3 image\n", QEMU_ARCH_ALL)
1231 DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
1232 SRST
1233 ``-hda file``
1235 ``-hdb file``
1237 ``-hdc file``
1239 ``-hdd file``
1240 Use file as hard disk 0, 1, 2 or 3 image on the default bus of the
1241 emulated machine (this is for example the IDE bus on most x86 machines,
1242 but it can also be SCSI, virtio or something else on other target
1243 architectures). See also the :ref:`disk images` chapter in the System
1244 Emulation Users Guide.
1245 ERST
1247 DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
1248 "-cdrom file use 'file' as CD-ROM image\n",
1249 QEMU_ARCH_ALL)
1250 SRST
1251 ``-cdrom file``
1252 Use file as CD-ROM image on the default bus of the emulated machine
1253 (which is IDE1 master on x86, so you cannot use ``-hdc`` and ``-cdrom``
1254 at the same time there). On systems that support it, you can use the
1255 host CD-ROM by using ``/dev/cdrom`` as filename.
1256 ERST
1258 DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
1259 "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
1260 " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
1261 " [,read-only=on|off][,auto-read-only=on|off]\n"
1262 " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
1263 " [,driver specific parameters...]\n"
1264 " configure a block backend\n", QEMU_ARCH_ALL)
1265 SRST
1266 ``-blockdev option[,option[,option[,...]]]``
1267 Define a new block driver node. Some of the options apply to all
1268 block drivers, other options are only accepted for a specific block
1269 driver. See below for a list of generic options and options for the
1270 most common block drivers.
1272 Options that expect a reference to another node (e.g. ``file``) can
1273 be given in two ways. Either you specify the node name of an already
1274 existing node (file=node-name), or you define a new node inline,
1275 adding options for the referenced node after a dot
1276 (file.filename=path,file.aio=native).
1278 A block driver node created with ``-blockdev`` can be used for a
1279 guest device by specifying its node name for the ``drive`` property
1280 in a ``-device`` argument that defines a block device.
1282 ``Valid options for any block driver node:``
1283 ``driver``
1284 Specifies the block driver to use for the given node.
1286 ``node-name``
1287 This defines the name of the block driver node by which it
1288 will be referenced later. The name must be unique, i.e. it
1289 must not match the name of a different block driver node, or
1290 (if you use ``-drive`` as well) the ID of a drive.
1292 If no node name is specified, it is automatically generated.
1293 The generated node name is not intended to be predictable
1294 and changes between QEMU invocations. For the top level, an
1295 explicit node name must be specified.
1297 ``read-only``
1298 Open the node read-only. Guest write attempts will fail.
1300 Note that some block drivers support only read-only access,
1301 either generally or in certain configurations. In this case,
1302 the default value ``read-only=off`` does not work and the
1303 option must be specified explicitly.
1305 ``auto-read-only``
1306 If ``auto-read-only=on`` is set, QEMU may fall back to
1307 read-only usage even when ``read-only=off`` is requested, or
1308 even switch between modes as needed, e.g. depending on
1309 whether the image file is writable or whether a writing user
1310 is attached to the node.
1312 ``force-share``
1313 Override the image locking system of QEMU by forcing the
1314 node to utilize weaker shared access for permissions where
1315 it would normally request exclusive access. When there is
1316 the potential for multiple instances to have the same file
1317 open (whether this invocation of QEMU is the first or the
1318 second instance), both instances must permit shared access
1319 for the second instance to succeed at opening the file.
1321 Enabling ``force-share=on`` requires ``read-only=on``.
1323 ``cache.direct``
1324 The host page cache can be avoided with ``cache.direct=on``.
1325 This will attempt to do disk IO directly to the guest's
1326 memory. QEMU may still perform an internal copy of the data.
1328 ``cache.no-flush``
1329 In case you don't care about data integrity over host
1330 failures, you can use ``cache.no-flush=on``. This option
1331 tells QEMU that it never needs to write any data to the disk
1332 but can instead keep things in cache. If anything goes
1333 wrong, like your host losing power, the disk storage getting
1334 disconnected accidentally, etc. your image will most
1335 probably be rendered unusable.
1337 ``discard=discard``
1338 discard is one of "ignore" (or "off") or "unmap" (or "on")
1339 and controls whether ``discard`` (also known as ``trim`` or
1340 ``unmap``) requests are ignored or passed to the filesystem.
1341 Some machine types may not support discard requests.
1343 ``detect-zeroes=detect-zeroes``
1344 detect-zeroes is "off", "on" or "unmap" and enables the
1345 automatic conversion of plain zero writes by the OS to
1346 driver specific optimized zero write commands. You may even
1347 choose "unmap" if discard is set to "unmap" to allow a zero
1348 write to be converted to an ``unmap`` operation.
1350 ``Driver-specific options for file``
1351 This is the protocol-level block driver for accessing regular
1352 files.
1354 ``filename``
1355 The path to the image file in the local filesystem
1357 ``aio``
1358 Specifies the AIO backend (threads/native/io_uring,
1359 default: threads)
1361 ``locking``
1362 Specifies whether the image file is protected with Linux OFD
1363 / POSIX locks. The default is to use the Linux Open File
1364 Descriptor API if available, otherwise no lock is applied.
1365 (auto/on/off, default: auto)
1367 Example:
1371 -blockdev driver=file,node-name=disk,filename=disk.img
1373 ``Driver-specific options for raw``
1374 This is the image format block driver for raw images. It is
1375 usually stacked on top of a protocol level block driver such as
1376 ``file``.
1378 ``file``
1379 Reference to or definition of the data source block driver
1380 node (e.g. a ``file`` driver node)
1382 Example 1:
1386 -blockdev driver=file,node-name=disk_file,filename=disk.img
1387 -blockdev driver=raw,node-name=disk,file=disk_file
1389 Example 2:
1393 -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
1395 ``Driver-specific options for qcow2``
1396 This is the image format block driver for qcow2 images. It is
1397 usually stacked on top of a protocol level block driver such as
1398 ``file``.
1400 ``file``
1401 Reference to or definition of the data source block driver
1402 node (e.g. a ``file`` driver node)
1404 ``backing``
1405 Reference to or definition of the backing file block device
1406 (default is taken from the image file). It is allowed to
1407 pass ``null`` here in order to disable the default backing
1408 file.
1410 ``lazy-refcounts``
1411 Whether to enable the lazy refcounts feature (on/off;
1412 default is taken from the image file)
1414 ``cache-size``
1415 The maximum total size of the L2 table and refcount block
1416 caches in bytes (default: the sum of l2-cache-size and
1417 refcount-cache-size)
1419 ``l2-cache-size``
1420 The maximum size of the L2 table cache in bytes (default: if
1421 cache-size is not specified - 32M on Linux platforms, and 8M
1422 on non-Linux platforms; otherwise, as large as possible
1423 within the cache-size, while permitting the requested or the
1424 minimal refcount cache size)
1426 ``refcount-cache-size``
1427 The maximum size of the refcount block cache in bytes
1428 (default: 4 times the cluster size; or if cache-size is
1429 specified, the part of it which is not used for the L2
1430 cache)
1432 ``cache-clean-interval``
1433 Clean unused entries in the L2 and refcount caches. The
1434 interval is in seconds. The default value is 600 on
1435 supporting platforms, and 0 on other platforms. Setting it
1436 to 0 disables this feature.
1438 ``pass-discard-request``
1439 Whether discard requests to the qcow2 device should be
1440 forwarded to the data source (on/off; default: on if
1441 discard=unmap is specified, off otherwise)
1443 ``pass-discard-snapshot``
1444 Whether discard requests for the data source should be
1445 issued when a snapshot operation (e.g. deleting a snapshot)
1446 frees clusters in the qcow2 file (on/off; default: on)
1448 ``pass-discard-other``
1449 Whether discard requests for the data source should be
1450 issued on other occasions where a cluster gets freed
1451 (on/off; default: off)
1453 ``discard-no-unref``
1454 When enabled, discards from the guest will not cause cluster
1455 allocations to be relinquished. This prevents qcow2 fragmentation
1456 that would be caused by such discards. Besides potential
1457 performance degradation, such fragmentation can lead to increased
1458 allocation of clusters past the end of the image file,
1459 resulting in image files whose file length can grow much larger
1460 than their guest disk size would suggest.
1461 If image file length is of concern (e.g. when storing qcow2
1462 images directly on block devices), you should consider enabling
1463 this option.
1465 ``overlap-check``
1466 Which overlap checks to perform for writes to the image
1467 (none/constant/cached/all; default: cached). For details or
1468 finer granularity control refer to the QAPI documentation of
1469 ``blockdev-add``.
1471 Example 1:
1475 -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
1476 -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
1478 Example 2:
1482 -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
1484 ``Driver-specific options for other drivers``
1485 Please refer to the QAPI documentation of the ``blockdev-add``
1486 QMP command.
1487 ERST
1489 DEF("drive", HAS_ARG, QEMU_OPTION_drive,
1490 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
1491 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
1492 " [,snapshot=on|off][,rerror=ignore|stop|report]\n"
1493 " [,werror=ignore|stop|report|enospc][,id=name]\n"
1494 " [,aio=threads|native|io_uring]\n"
1495 " [,readonly=on|off][,copy-on-read=on|off]\n"
1496 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
1497 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
1498 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
1499 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
1500 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
1501 " [[,iops_size=is]]\n"
1502 " [[,group=g]]\n"
1503 " use 'file' as a drive image\n", QEMU_ARCH_ALL)
1504 SRST
1505 ``-drive option[,option[,option[,...]]]``
1506 Define a new drive. This includes creating a block driver node (the
1507 backend) as well as a guest device, and is mostly a shortcut for
1508 defining the corresponding ``-blockdev`` and ``-device`` options.
1510 ``-drive`` accepts all options that are accepted by ``-blockdev``.
1511 In addition, it knows the following options:
1513 ``file=file``
1514 This option defines which disk image (see the :ref:`disk images`
1515 chapter in the System Emulation Users Guide) to use with this drive.
1516 If the filename contains comma, you must double it (for instance,
1517 "file=my,,file" to use file "my,file").
1519 Special files such as iSCSI devices can be specified using
1520 protocol specific URLs. See the section for "Device URL Syntax"
1521 for more information.
1523 ``if=interface``
1524 This option defines on which type on interface the drive is
1525 connected. Available types are: ide, scsi, sd, mtd, floppy,
1526 pflash, virtio, none.
1528 ``bus=bus,unit=unit``
1529 These options define where is connected the drive by defining
1530 the bus number and the unit id.
1532 ``index=index``
1533 This option defines where the drive is connected by using an
1534 index in the list of available connectors of a given interface
1535 type.
1537 ``media=media``
1538 This option defines the type of the media: disk or cdrom.
1540 ``snapshot=snapshot``
1541 snapshot is "on" or "off" and controls snapshot mode for the
1542 given drive (see ``-snapshot``).
1544 ``cache=cache``
1545 cache is "none", "writeback", "unsafe", "directsync" or
1546 "writethrough" and controls how the host cache is used to access
1547 block data. This is a shortcut that sets the ``cache.direct``
1548 and ``cache.no-flush`` options (as in ``-blockdev``), and
1549 additionally ``cache.writeback``, which provides a default for
1550 the ``write-cache`` option of block guest devices (as in
1551 ``-device``). The modes correspond to the following settings:
1553 ============= =============== ============ ==============
1554 \ cache.writeback cache.direct cache.no-flush
1555 ============= =============== ============ ==============
1556 writeback on off off
1557 none on on off
1558 writethrough off off off
1559 directsync off on off
1560 unsafe on off on
1561 ============= =============== ============ ==============
1563 The default mode is ``cache=writeback``.
1565 ``aio=aio``
1566 aio is "threads", "native", or "io_uring" and selects between pthread
1567 based disk I/O, native Linux AIO, or Linux io_uring API.
1569 ``format=format``
1570 Specify which disk format will be used rather than detecting the
1571 format. Can be used to specify format=raw to avoid interpreting
1572 an untrusted format header.
1574 ``werror=action,rerror=action``
1575 Specify which action to take on write and read errors. Valid
1576 actions are: "ignore" (ignore the error and try to continue),
1577 "stop" (pause QEMU), "report" (report the error to the guest),
1578 "enospc" (pause QEMU only if the host disk is full; report the
1579 error to the guest otherwise). The default setting is
1580 ``werror=enospc`` and ``rerror=report``.
1582 ``copy-on-read=copy-on-read``
1583 copy-on-read is "on" or "off" and enables whether to copy read
1584 backing file sectors into the image file.
1586 ``bps=b,bps_rd=r,bps_wr=w``
1587 Specify bandwidth throttling limits in bytes per second, either
1588 for all request types or for reads or writes only. Small values
1589 can lead to timeouts or hangs inside the guest. A safe minimum
1590 for disks is 2 MB/s.
1592 ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
1593 Specify bursts in bytes per second, either for all request types
1594 or for reads or writes only. Bursts allow the guest I/O to spike
1595 above the limit temporarily.
1597 ``iops=i,iops_rd=r,iops_wr=w``
1598 Specify request rate limits in requests per second, either for
1599 all request types or for reads or writes only.
1601 ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm``
1602 Specify bursts in requests per second, either for all request
1603 types or for reads or writes only. Bursts allow the guest I/O to
1604 spike above the limit temporarily.
1606 ``iops_size=is``
1607 Let every is bytes of a request count as a new request for iops
1608 throttling purposes. Use this option to prevent guests from
1609 circumventing iops limits by sending fewer but larger requests.
1611 ``group=g``
1612 Join a throttling quota group with given name g. All drives that
1613 are members of the same group are accounted for together. Use
1614 this option to prevent guests from circumventing throttling
1615 limits by using many small disks instead of a single larger
1616 disk.
1618 By default, the ``cache.writeback=on`` mode is used. It will report
1619 data writes as completed as soon as the data is present in the host
1620 page cache. This is safe as long as your guest OS makes sure to
1621 correctly flush disk caches where needed. If your guest OS does not
1622 handle volatile disk write caches correctly and your host crashes or
1623 loses power, then the guest may experience data corruption.
1625 For such guests, you should consider using ``cache.writeback=off``.
1626 This means that the host page cache will be used to read and write
1627 data, but write notification will be sent to the guest only after
1628 QEMU has made sure to flush each write to the disk. Be aware that
1629 this has a major impact on performance.
1631 When using the ``-snapshot`` option, unsafe caching is always used.
1633 Copy-on-read avoids accessing the same backing file sectors
1634 repeatedly and is useful when the backing file is over a slow
1635 network. By default copy-on-read is off.
1637 Instead of ``-cdrom`` you can use:
1639 .. parsed-literal::
1641 |qemu_system| -drive file=file,index=2,media=cdrom
1643 Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use:
1645 .. parsed-literal::
1647 |qemu_system| -drive file=file,index=0,media=disk
1648 |qemu_system| -drive file=file,index=1,media=disk
1649 |qemu_system| -drive file=file,index=2,media=disk
1650 |qemu_system| -drive file=file,index=3,media=disk
1652 You can open an image using pre-opened file descriptors from an fd
1653 set:
1655 .. parsed-literal::
1657 |qemu_system| \\
1658 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\
1659 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\
1660 -drive file=/dev/fdset/2,index=0,media=disk
1662 You can connect a CDROM to the slave of ide0:
1664 .. parsed-literal::
1666 |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom
1668 If you don't specify the "file=" argument, you define an empty
1669 drive:
1671 .. parsed-literal::
1673 |qemu_system_x86| -drive if=ide,index=1,media=cdrom
1675 Instead of ``-fda``, ``-fdb``, you can use:
1677 .. parsed-literal::
1679 |qemu_system_x86| -drive file=file,index=0,if=floppy
1680 |qemu_system_x86| -drive file=file,index=1,if=floppy
1682 By default, interface is "ide" and index is automatically
1683 incremented:
1685 .. parsed-literal::
1687 |qemu_system_x86| -drive file=a -drive file=b
1689 is interpreted like:
1691 .. parsed-literal::
1693 |qemu_system_x86| -hda a -hdb b
1694 ERST
1696 DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
1697 "-mtdblock file use 'file' as on-board Flash memory image\n",
1698 QEMU_ARCH_ALL)
1699 SRST
1700 ``-mtdblock file``
1701 Use file as on-board Flash memory image.
1702 ERST
1704 DEF("sd", HAS_ARG, QEMU_OPTION_sd,
1705 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
1706 SRST
1707 ``-sd file``
1708 Use file as SecureDigital card image.
1709 ERST
1711 DEF("snapshot", 0, QEMU_OPTION_snapshot,
1712 "-snapshot write to temporary files instead of disk image files\n",
1713 QEMU_ARCH_ALL)
1714 SRST
1715 ``-snapshot``
1716 Write to temporary files instead of disk image files. In this case,
1717 the raw disk image you use is not written back. You can however
1718 force the write back by pressing C-a s (see the :ref:`disk images`
1719 chapter in the System Emulation Users Guide).
1721 .. warning::
1722 snapshot is incompatible with ``-blockdev`` (instead use qemu-img
1723 to manually create snapshot images to attach to your blockdev).
1724 If you have mixed ``-blockdev`` and ``-drive`` declarations you
1725 can use the 'snapshot' property on your drive declarations
1726 instead of this global option.
1728 ERST
1730 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
1731 "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
1732 " [,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode]\n"
1733 " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
1734 " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
1735 " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
1736 " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
1737 " [[,throttling.iops-size=is]]\n"
1738 "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly=on]\n"
1739 "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly=on]\n"
1740 "-fsdev synth,id=id\n",
1741 QEMU_ARCH_ALL)
1743 SRST
1744 ``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly=on][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]``
1746 ``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly=on]``
1748 ``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly=on]``
1750 ``-fsdev synth,id=id[,readonly=on]``
1751 Define a new file system device. Valid options are:
1753 ``local``
1754 Accesses to the filesystem are done by QEMU.
1756 ``proxy``
1757 Accesses to the filesystem are done by virtfs-proxy-helper(1). This
1758 option is deprecated (since QEMU 8.1) and will be removed in a future
1759 version of QEMU. Use ``local`` instead.
1761 ``synth``
1762 Synthetic filesystem, only used by QTests.
1764 ``id=id``
1765 Specifies identifier for this device.
1767 ``path=path``
1768 Specifies the export path for the file system device. Files
1769 under this path will be available to the 9p client on the guest.
1771 ``security_model=security_model``
1772 Specifies the security model to be used for this export path.
1773 Supported security models are "passthrough", "mapped-xattr",
1774 "mapped-file" and "none". In "passthrough" security model, files
1775 are stored using the same credentials as they are created on the
1776 guest. This requires QEMU to run as root. In "mapped-xattr"
1777 security model, some of the file attributes like uid, gid, mode
1778 bits and link target are stored as file attributes. For
1779 "mapped-file" these attributes are stored in the hidden
1780 .virtfs\_metadata directory. Directories exported by this
1781 security model cannot interact with other unix tools. "none"
1782 security model is same as passthrough except the sever won't
1783 report failures if it fails to set file attributes like
1784 ownership. Security model is mandatory only for local fsdriver.
1785 Other fsdrivers (like proxy) don't take security model as a
1786 parameter.
1788 ``writeout=writeout``
1789 This is an optional argument. The only supported value is
1790 "immediate". This means that host page cache will be used to
1791 read and write data but write notification will be sent to the
1792 guest only when the data has been reported as written by the
1793 storage subsystem.
1795 ``readonly=on``
1796 Enables exporting 9p share as a readonly mount for guests. By
1797 default read-write access is given.
1799 ``socket=socket``
1800 Enables proxy filesystem driver to use passed socket file for
1801 communicating with virtfs-proxy-helper(1).
1803 ``sock_fd=sock_fd``
1804 Enables proxy filesystem driver to use passed socket descriptor
1805 for communicating with virtfs-proxy-helper(1). Usually a helper
1806 like libvirt will create socketpair and pass one of the fds as
1807 sock\_fd.
1809 ``fmode=fmode``
1810 Specifies the default mode for newly created files on the host.
1811 Works only with security models "mapped-xattr" and
1812 "mapped-file".
1814 ``dmode=dmode``
1815 Specifies the default mode for newly created directories on the
1816 host. Works only with security models "mapped-xattr" and
1817 "mapped-file".
1819 ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
1820 Specify bandwidth throttling limits in bytes per second, either
1821 for all request types or for reads or writes only.
1823 ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm``
1824 Specify bursts in bytes per second, either for all request types
1825 or for reads or writes only. Bursts allow the guest I/O to spike
1826 above the limit temporarily.
1828 ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w``
1829 Specify request rate limits in requests per second, either for
1830 all request types or for reads or writes only.
1832 ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm``
1833 Specify bursts in requests per second, either for all request
1834 types or for reads or writes only. Bursts allow the guest I/O to
1835 spike above the limit temporarily.
1837 ``throttling.iops-size=is``
1838 Let every is bytes of a request count as a new request for iops
1839 throttling purposes.
1841 -fsdev option is used along with -device driver "virtio-9p-...".
1843 ``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag``
1844 Options for virtio-9p-... driver are:
1846 ``type``
1847 Specifies the variant to be used. Supported values are "pci",
1848 "ccw" or "device", depending on the machine type.
1850 ``fsdev=id``
1851 Specifies the id value specified along with -fsdev option.
1853 ``mount_tag=mount_tag``
1854 Specifies the tag name to be used by the guest to mount this
1855 export point.
1856 ERST
1858 DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
1859 "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
1860 " [,id=id][,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
1861 "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly=on]\n"
1862 "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly=on]\n"
1863 "-virtfs synth,mount_tag=tag[,id=id][,readonly=on]\n",
1864 QEMU_ARCH_ALL)
1866 SRST
1867 ``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly=on] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]``
1869 ``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly=on]``
1871 ``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly=on]``
1873 ``-virtfs synth,mount_tag=mount_tag``
1874 Define a new virtual filesystem device and expose it to the guest using
1875 a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain
1876 directory on host is made directly accessible by guest as a pass-through
1877 file system by using the 9P network protocol for communication between
1878 host and guests, if desired even accessible, shared by several guests
1879 simultaneously.
1881 Note that ``-virtfs`` is actually just a convenience shortcut for its
1882 generalized form ``-fsdev -device virtio-9p-pci``.
1884 The general form of pass-through file system options are:
1886 ``local``
1887 Accesses to the filesystem are done by QEMU.
1889 ``proxy``
1890 Accesses to the filesystem are done by virtfs-proxy-helper(1).
1891 This option is deprecated (since QEMU 8.1) and will be removed in a
1892 future version of QEMU. Use ``local`` instead.
1894 ``synth``
1895 Synthetic filesystem, only used by QTests.
1897 ``id=id``
1898 Specifies identifier for the filesystem device
1900 ``path=path``
1901 Specifies the export path for the file system device. Files
1902 under this path will be available to the 9p client on the guest.
1904 ``security_model=security_model``
1905 Specifies the security model to be used for this export path.
1906 Supported security models are "passthrough", "mapped-xattr",
1907 "mapped-file" and "none". In "passthrough" security model, files
1908 are stored using the same credentials as they are created on the
1909 guest. This requires QEMU to run as root. In "mapped-xattr"
1910 security model, some of the file attributes like uid, gid, mode
1911 bits and link target are stored as file attributes. For
1912 "mapped-file" these attributes are stored in the hidden
1913 .virtfs\_metadata directory. Directories exported by this
1914 security model cannot interact with other unix tools. "none"
1915 security model is same as passthrough except the sever won't
1916 report failures if it fails to set file attributes like
1917 ownership. Security model is mandatory only for local fsdriver.
1918 Other fsdrivers (like proxy) don't take security model as a
1919 parameter.
1921 ``writeout=writeout``
1922 This is an optional argument. The only supported value is
1923 "immediate". This means that host page cache will be used to
1924 read and write data but write notification will be sent to the
1925 guest only when the data has been reported as written by the
1926 storage subsystem.
1928 ``readonly=on``
1929 Enables exporting 9p share as a readonly mount for guests. By
1930 default read-write access is given.
1932 ``socket=socket``
1933 Enables proxy filesystem driver to use passed socket file for
1934 communicating with virtfs-proxy-helper(1). Usually a helper like
1935 libvirt will create socketpair and pass one of the fds as
1936 sock\_fd.
1938 ``sock_fd``
1939 Enables proxy filesystem driver to use passed 'sock\_fd' as the
1940 socket descriptor for interfacing with virtfs-proxy-helper(1).
1942 ``fmode=fmode``
1943 Specifies the default mode for newly created files on the host.
1944 Works only with security models "mapped-xattr" and
1945 "mapped-file".
1947 ``dmode=dmode``
1948 Specifies the default mode for newly created directories on the
1949 host. Works only with security models "mapped-xattr" and
1950 "mapped-file".
1952 ``mount_tag=mount_tag``
1953 Specifies the tag name to be used by the guest to mount this
1954 export point.
1956 ``multidevs=multidevs``
1957 Specifies how to deal with multiple devices being shared with a
1958 9p export. Supported behaviours are either "remap", "forbid" or
1959 "warn". The latter is the default behaviour on which virtfs 9p
1960 expects only one device to be shared with the same export, and
1961 if more than one device is shared and accessed via the same 9p
1962 export then only a warning message is logged (once) by qemu on
1963 host side. In order to avoid file ID collisions on guest you
1964 should either create a separate virtfs export for each device to
1965 be shared with guests (recommended way) or you might use "remap"
1966 instead which allows you to share multiple devices with only one
1967 export instead, which is achieved by remapping the original
1968 inode numbers from host to guest in a way that would prevent
1969 such collisions. Remapping inodes in such use cases is required
1970 because the original device IDs from host are never passed and
1971 exposed on guest. Instead all files of an export shared with
1972 virtfs always share the same device id on guest. So two files
1973 with identical inode numbers but from actually different devices
1974 on host would otherwise cause a file ID collision and hence
1975 potential misbehaviours on guest. "forbid" on the other hand
1976 assumes like "warn" that only one device is shared by the same
1977 export, however it will not only log a warning message but also
1978 deny access to additional devices on guest. Note though that
1979 "forbid" does currently not block all possible file access
1980 operations (e.g. readdir() would still return entries from other
1981 devices).
1982 ERST
1984 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
1985 "-iscsi [user=user][,password=password][,password-secret=secret-id]\n"
1986 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE]\n"
1987 " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
1988 " [,timeout=timeout]\n"
1989 " iSCSI session parameters\n", QEMU_ARCH_ALL)
1991 SRST
1992 ``-iscsi``
1993 Configure iSCSI session parameters.
1994 ERST
1996 DEFHEADING()
1998 DEFHEADING(USB convenience options:)
2000 DEF("usb", 0, QEMU_OPTION_usb,
2001 "-usb enable on-board USB host controller (if not enabled by default)\n",
2002 QEMU_ARCH_ALL)
2003 SRST
2004 ``-usb``
2005 Enable USB emulation on machine types with an on-board USB host
2006 controller (if not enabled by default). Note that on-board USB host
2007 controllers may not support USB 3.0. In this case
2008 ``-device qemu-xhci`` can be used instead on machines with PCI.
2009 ERST
2011 DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
2012 "-usbdevice name add the host or guest USB device 'name'\n",
2013 QEMU_ARCH_ALL)
2014 SRST
2015 ``-usbdevice devname``
2016 Add the USB device devname, and enable an on-board USB controller
2017 if possible and necessary (just like it can be done via
2018 ``-machine usb=on``). Note that this option is mainly intended for
2019 the user's convenience only. More fine-grained control can be
2020 achieved by selecting a USB host controller (if necessary) and the
2021 desired USB device via the ``-device`` option instead. For example,
2022 instead of using ``-usbdevice mouse`` it is possible to use
2023 ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse
2024 to a USB 3.0 controller instead (at least on machines that support
2025 PCI and do not have an USB controller enabled by default yet).
2026 For more details, see the chapter about
2027 :ref:`Connecting USB devices` in the System Emulation Users Guide.
2028 Possible devices for devname are:
2030 ``braille``
2031 Braille device. This will use BrlAPI to display the braille
2032 output on a real or fake device (i.e. it also creates a
2033 corresponding ``braille`` chardev automatically beside the
2034 ``usb-braille`` USB device).
2036 ``keyboard``
2037 Standard USB keyboard. Will override the PS/2 keyboard (if present).
2039 ``mouse``
2040 Virtual Mouse. This will override the PS/2 mouse emulation when
2041 activated.
2043 ``tablet``
2044 Pointer device that uses absolute coordinates (like a
2045 touchscreen). This means QEMU is able to report the mouse
2046 position without having to grab the mouse. Also overrides the
2047 PS/2 mouse emulation when activated.
2049 ``wacom-tablet``
2050 Wacom PenPartner USB tablet.
2053 ERST
2055 DEFHEADING()
2057 DEFHEADING(Display options:)
2059 DEF("display", HAS_ARG, QEMU_OPTION_display,
2060 #if defined(CONFIG_SPICE)
2061 "-display spice-app[,gl=on|off]\n"
2062 #endif
2063 #if defined(CONFIG_SDL)
2064 "-display sdl[,gl=on|core|es|off][,grab-mod=<mod>][,show-cursor=on|off]\n"
2065 " [,window-close=on|off]\n"
2066 #endif
2067 #if defined(CONFIG_GTK)
2068 "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
2069 " [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
2070 " [,show-menubar=on|off]\n"
2071 #endif
2072 #if defined(CONFIG_VNC)
2073 "-display vnc=<display>[,<optargs>]\n"
2074 #endif
2075 #if defined(CONFIG_CURSES)
2076 "-display curses[,charset=<encoding>]\n"
2077 #endif
2078 #if defined(CONFIG_COCOA)
2079 "-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]\n"
2080 #endif
2081 #if defined(CONFIG_OPENGL)
2082 "-display egl-headless[,rendernode=<file>]\n"
2083 #endif
2084 #if defined(CONFIG_DBUS_DISPLAY)
2085 "-display dbus[,addr=<dbusaddr>]\n"
2086 " [,gl=on|core|es|off][,rendernode=<file>]\n"
2087 #endif
2088 #if defined(CONFIG_COCOA)
2089 "-display cocoa[,show-cursor=on|off][,left-command-key=on|off]\n"
2090 #endif
2091 "-display none\n"
2092 " select display backend type\n"
2093 " The default display is equivalent to\n "
2094 #if defined(CONFIG_GTK)
2095 "\"-display gtk\"\n"
2096 #elif defined(CONFIG_SDL)
2097 "\"-display sdl\"\n"
2098 #elif defined(CONFIG_COCOA)
2099 "\"-display cocoa\"\n"
2100 #elif defined(CONFIG_VNC)
2101 "\"-vnc localhost:0,to=99,id=default\"\n"
2102 #else
2103 "\"-display none\"\n"
2104 #endif
2105 , QEMU_ARCH_ALL)
2106 SRST
2107 ``-display type``
2108 Select type of display to use. Use ``-display help`` to list the available
2109 display types. Valid values for type are
2111 ``spice-app[,gl=on|off]``
2112 Start QEMU as a Spice server and launch the default Spice client
2113 application. The Spice server will redirect the serial consoles
2114 and QEMU monitors. (Since 4.0)
2116 ``dbus``
2117 Export the display over D-Bus interfaces. (Since 7.0)
2119 The connection is registered with the "org.qemu" name (and queued when
2120 already owned).
2122 ``addr=<dbusaddr>`` : D-Bus bus address to connect to.
2124 ``p2p=yes|no`` : Use peer-to-peer connection, accepted via QMP ``add_client``.
2126 ``gl=on|off|core|es`` : Use OpenGL for rendering (the D-Bus interface
2127 will share framebuffers with DMABUF file descriptors).
2129 ``sdl``
2130 Display video output via SDL (usually in a separate graphics
2131 window; see the SDL documentation for other possibilities).
2132 Valid parameters are:
2134 ``grab-mod=<mods>`` : Used to select the modifier keys for toggling
2135 the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be
2136 either ``lshift-lctrl-lalt`` or ``rctrl``.
2138 ``gl=on|off|core|es`` : Use OpenGL for displaying
2140 ``show-cursor=on|off`` : Force showing the mouse cursor
2142 ``window-close=on|off`` : Allow to quit qemu with window close button
2144 ``gtk``
2145 Display video output in a GTK window. This interface provides
2146 drop-down menus and other UI elements to configure and control
2147 the VM during runtime. Valid parameters are:
2149 ``full-screen=on|off`` : Start in fullscreen mode
2151 ``gl=on|off`` : Use OpenGL for displaying
2153 ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
2155 ``show-tabs=on|off`` : Display the tab bar for switching between the
2156 various graphical interfaces (e.g. VGA and
2157 virtual console character devices) by default.
2159 ``show-cursor=on|off`` : Force showing the mouse cursor
2161 ``window-close=on|off`` : Allow to quit qemu with window close button
2163 ``show-menubar=on|off`` : Display the main window menubar, defaults to "on"
2165 ``zoom-to-fit=on|off`` : Expand video output to the window size,
2166 defaults to "off"
2168 ``curses[,charset=<encoding>]``
2169 Display video output via curses. For graphics device models
2170 which support a text mode, QEMU can display this output using a
2171 curses/ncurses interface. Nothing is displayed when the graphics
2172 device is in graphical mode or if the graphics device does not
2173 support a text mode. Generally only the VGA device models
2174 support text mode. The font charset used by the guest can be
2175 specified with the ``charset`` option, for example
2176 ``charset=CP850`` for IBM CP850 encoding. The default is
2177 ``CP437``.
2179 ``cocoa``
2180 Display video output in a Cocoa window. Mac only. This interface
2181 provides drop-down menus and other UI elements to configure and
2182 control the VM during runtime. Valid parameters are:
2184 ``show-cursor=on|off`` : Force showing the mouse cursor
2186 ``left-command-key=on|off`` : Disable forwarding left command key to host
2188 ``egl-headless[,rendernode=<file>]``
2189 Offload all OpenGL operations to a local DRI device. For any
2190 graphical display, this display needs to be paired with either
2191 VNC or SPICE displays.
2193 ``vnc=<display>``
2194 Start a VNC server on display <display>
2196 ``none``
2197 Do not display video output. The guest will still see an
2198 emulated graphics card, but its output will not be displayed to
2199 the QEMU user. This option differs from the -nographic option in
2200 that it only affects what is done with video output; -nographic
2201 also changes the destination of the serial and parallel port
2202 data.
2203 ERST
2205 DEF("nographic", 0, QEMU_OPTION_nographic,
2206 "-nographic disable graphical output and redirect serial I/Os to console\n",
2207 QEMU_ARCH_ALL)
2208 SRST
2209 ``-nographic``
2210 Normally, if QEMU is compiled with graphical window support, it
2211 displays output such as guest graphics, guest console, and the QEMU
2212 monitor in a window. With this option, you can totally disable
2213 graphical output so that QEMU is a simple command line application.
2214 The emulated serial port is redirected on the console and muxed with
2215 the monitor (unless redirected elsewhere explicitly). Therefore, you
2216 can still use QEMU to debug a Linux kernel with a serial console.
2217 Use C-a h for help on switching between the console and monitor.
2218 ERST
2220 #ifdef CONFIG_SPICE
2221 DEF("spice", HAS_ARG, QEMU_OPTION_spice,
2222 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
2223 " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
2224 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
2225 " [,x509-dh-key-file=<file>][,addr=addr]\n"
2226 " [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n"
2227 " [,tls-ciphers=<list>]\n"
2228 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
2229 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
2230 " [,sasl=on|off][,disable-ticketing=on|off]\n"
2231 " [,password-secret=<secret-id>]\n"
2232 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
2233 " [,jpeg-wan-compression=[auto|never|always]]\n"
2234 " [,zlib-glz-wan-compression=[auto|never|always]]\n"
2235 " [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n"
2236 " [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n"
2237 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
2238 " [,gl=[on|off]][,rendernode=<file>]\n"
2239 " enable spice\n"
2240 " at least one of {port, tls-port} is mandatory\n",
2241 QEMU_ARCH_ALL)
2242 #endif
2243 SRST
2244 ``-spice option[,option[,...]]``
2245 Enable the spice remote desktop protocol. Valid options are
2247 ``port=<nr>``
2248 Set the TCP port spice is listening on for plaintext channels.
2250 ``addr=<addr>``
2251 Set the IP address spice is listening on. Default is any
2252 address.
2254 ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off``
2255 Force using the specified IP version.
2257 ``password-secret=<secret-id>``
2258 Set the ID of the ``secret`` object containing the password
2259 you need to authenticate.
2261 ``sasl=on|off``
2262 Require that the client use SASL to authenticate with the spice.
2263 The exact choice of authentication method used is controlled
2264 from the system / user's SASL configuration file for the 'qemu'
2265 service. This is typically found in /etc/sasl2/qemu.conf. If
2266 running QEMU as an unprivileged user, an environment variable
2267 SASL\_CONF\_PATH can be used to make it search alternate
2268 locations for the service config. While some SASL auth methods
2269 can also provide data encryption (eg GSSAPI), it is recommended
2270 that SASL always be combined with the 'tls' and 'x509' settings
2271 to enable use of SSL and server certificates. This ensures a
2272 data encryption preventing compromise of authentication
2273 credentials.
2275 ``disable-ticketing=on|off``
2276 Allow client connects without authentication.
2278 ``disable-copy-paste=on|off``
2279 Disable copy paste between the client and the guest.
2281 ``disable-agent-file-xfer=on|off``
2282 Disable spice-vdagent based file-xfer between the client and the
2283 guest.
2285 ``tls-port=<nr>``
2286 Set the TCP port spice is listening on for encrypted channels.
2288 ``x509-dir=<dir>``
2289 Set the x509 file directory. Expects same filenames as -vnc
2290 $display,x509=$dir
2292 ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>``
2293 The x509 file names can also be configured individually.
2295 ``tls-ciphers=<list>``
2296 Specify which ciphers to use.
2298 ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]``
2299 Force specific channel to be used with or without TLS
2300 encryption. The options can be specified multiple times to
2301 configure multiple channels. The special name "default" can be
2302 used to set the default mode. For channels which are not
2303 explicitly forced into one mode the spice client is allowed to
2304 pick tls/plaintext as he pleases.
2306 ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]``
2307 Configure image compression (lossless). Default is auto\_glz.
2309 ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]``
2310 Configure wan image compression (lossy for slow links). Default
2311 is auto.
2313 ``streaming-video=[off|all|filter]``
2314 Configure video stream detection. Default is off.
2316 ``agent-mouse=[on|off]``
2317 Enable/disable passing mouse events via vdagent. Default is on.
2319 ``playback-compression=[on|off]``
2320 Enable/disable audio stream compression (using celt 0.5.1).
2321 Default is on.
2323 ``seamless-migration=[on|off]``
2324 Enable/disable spice seamless migration. Default is off.
2326 ``gl=[on|off]``
2327 Enable/disable OpenGL context. Default is off.
2329 ``rendernode=<file>``
2330 DRM render node for OpenGL rendering. If not specified, it will
2331 pick the first available. (Since 2.9)
2332 ERST
2334 DEF("portrait", 0, QEMU_OPTION_portrait,
2335 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
2336 QEMU_ARCH_ALL)
2337 SRST
2338 ``-portrait``
2339 Rotate graphical output 90 deg left (only PXA LCD).
2340 ERST
2342 DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
2343 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
2344 QEMU_ARCH_ALL)
2345 SRST
2346 ``-rotate deg``
2347 Rotate graphical output some deg left (only PXA LCD).
2348 ERST
2350 DEF("vga", HAS_ARG, QEMU_OPTION_vga,
2351 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
2352 " select video card type\n", QEMU_ARCH_ALL)
2353 SRST
2354 ``-vga type``
2355 Select type of VGA card to emulate. Valid values for type are
2357 ``cirrus``
2358 Cirrus Logic GD5446 Video card. All Windows versions starting
2359 from Windows 95 should recognize and use this graphic card. For
2360 optimal performances, use 16 bit color depth in the guest and
2361 the host OS. (This card was the default before QEMU 2.2)
2363 ``std``
2364 Standard VGA card with Bochs VBE extensions. If your guest OS
2365 supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if
2366 you want to use high resolution modes (>= 1280x1024x16) then you
2367 should use this option. (This card is the default since QEMU
2368 2.2)
2370 ``vmware``
2371 VMWare SVGA-II compatible adapter. Use it if you have
2372 sufficiently recent XFree86/XOrg server or Windows guest with a
2373 driver for this card.
2375 ``qxl``
2376 QXL paravirtual graphic card. It is VGA compatible (including
2377 VESA 2.0 VBE support). Works best with qxl guest drivers
2378 installed though. Recommended choice when using the spice
2379 protocol.
2381 ``tcx``
2382 (sun4m only) Sun TCX framebuffer. This is the default
2383 framebuffer for sun4m machines and offers both 8-bit and 24-bit
2384 colour depths at a fixed resolution of 1024x768.
2386 ``cg3``
2387 (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit
2388 framebuffer for sun4m machines available in both 1024x768
2389 (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people
2390 wishing to run older Solaris versions.
2392 ``virtio``
2393 Virtio VGA card.
2395 ``none``
2396 Disable VGA card.
2397 ERST
2399 DEF("full-screen", 0, QEMU_OPTION_full_screen,
2400 "-full-screen start in full screen\n", QEMU_ARCH_ALL)
2401 SRST
2402 ``-full-screen``
2403 Start in full screen.
2404 ERST
2406 DEF("g", HAS_ARG, QEMU_OPTION_g ,
2407 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
2408 QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
2409 SRST
2410 ``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]``
2411 Set the initial graphical resolution and depth (PPC, SPARC only).
2413 For PPC the default is 800x600x32.
2415 For SPARC with the TCX graphics device, the default is 1024x768x8
2416 with the option of 1024x768x24. For cgthree, the default is
2417 1024x768x8 with the option of 1152x900x8 for people who wish to use
2418 OBP.
2419 ERST
2421 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
2422 "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
2423 SRST
2424 ``-vnc display[,option[,option[,...]]]``
2425 Normally, if QEMU is compiled with graphical window support, it
2426 displays output such as guest graphics, guest console, and the QEMU
2427 monitor in a window. With this option, you can have QEMU listen on
2428 VNC display display and redirect the VGA display over the VNC
2429 session. It is very useful to enable the usb tablet device when
2430 using this option (option ``-device usb-tablet``). When using the
2431 VNC display, you must use the ``-k`` parameter to set the keyboard
2432 layout if you are not using en-us. Valid syntax for the display is
2434 ``to=L``
2435 With this option, QEMU will try next available VNC displays,
2436 until the number L, if the origianlly defined "-vnc display" is
2437 not available, e.g. port 5900+display is already used by another
2438 application. By default, to=0.
2440 ``host:d``
2441 TCP connections will only be allowed from host on display d. By
2442 convention the TCP port is 5900+d. Optionally, host can be
2443 omitted in which case the server will accept connections from
2444 any host.
2446 ``unix:path``
2447 Connections will be allowed over UNIX domain sockets where path
2448 is the location of a unix socket to listen for connections on.
2450 ``none``
2451 VNC is initialized but not started. The monitor ``change``
2452 command can be used to later start the VNC server.
2454 Following the display value there may be one or more option flags
2455 separated by commas. Valid options are
2457 ``reverse=on|off``
2458 Connect to a listening VNC client via a "reverse" connection.
2459 The client is specified by the display. For reverse network
2460 connections (host:d,``reverse``), the d argument is a TCP port
2461 number, not a display number.
2463 ``websocket=on|off``
2464 Opens an additional TCP listening port dedicated to VNC
2465 Websocket connections. If a bare websocket option is given, the
2466 Websocket port is 5700+display. An alternative port can be
2467 specified with the syntax ``websocket``\ =port.
2469 If host is specified connections will only be allowed from this
2470 host. It is possible to control the websocket listen address
2471 independently, using the syntax ``websocket``\ =host:port.
2473 If no TLS credentials are provided, the websocket connection
2474 runs in unencrypted mode. If TLS credentials are provided, the
2475 websocket connection requires encrypted client connections.
2477 ``password=on|off``
2478 Require that password based authentication is used for client
2479 connections.
2481 The password must be set separately using the ``set_password``
2482 command in the :ref:`QEMU monitor`. The
2483 syntax to change your password is:
2484 ``set_password <protocol> <password>`` where <protocol> could be
2485 either "vnc" or "spice".
2487 If you would like to change <protocol> password expiration, you
2488 should use ``expire_password <protocol> <expiration-time>``
2489 where expiration time could be one of the following options:
2490 now, never, +seconds or UNIX time of expiration, e.g. +60 to
2491 make password expire in 60 seconds, or 1335196800 to make
2492 password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for
2493 this date and time).
2495 You can also use keywords "now" or "never" for the expiration
2496 time to allow <protocol> password to expire immediately or never
2497 expire.
2499 ``password-secret=<secret-id>``
2500 Require that password based authentication is used for client
2501 connections, using the password provided by the ``secret``
2502 object identified by ``secret-id``.
2504 ``tls-creds=ID``
2505 Provides the ID of a set of TLS credentials to use to secure the
2506 VNC server. They will apply to both the normal VNC server socket
2507 and the websocket socket (if enabled). Setting TLS credentials
2508 will cause the VNC server socket to enable the VeNCrypt auth
2509 mechanism. The credentials should have been previously created
2510 using the ``-object tls-creds`` argument.
2512 ``tls-authz=ID``
2513 Provides the ID of the QAuthZ authorization object against which
2514 the client's x509 distinguished name will validated. This object
2515 is only resolved at time of use, so can be deleted and recreated
2516 on the fly while the VNC server is active. If missing, it will
2517 default to denying access.
2519 ``sasl=on|off``
2520 Require that the client use SASL to authenticate with the VNC
2521 server. The exact choice of authentication method used is
2522 controlled from the system / user's SASL configuration file for
2523 the 'qemu' service. This is typically found in
2524 /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user,
2525 an environment variable SASL\_CONF\_PATH can be used to make it
2526 search alternate locations for the service config. While some
2527 SASL auth methods can also provide data encryption (eg GSSAPI),
2528 it is recommended that SASL always be combined with the 'tls'
2529 and 'x509' settings to enable use of SSL and server
2530 certificates. This ensures a data encryption preventing
2531 compromise of authentication credentials. See the
2532 :ref:`VNC security` section in the System Emulation Users Guide
2533 for details on using SASL authentication.
2535 ``sasl-authz=ID``
2536 Provides the ID of the QAuthZ authorization object against which
2537 the client's SASL username will validated. This object is only
2538 resolved at time of use, so can be deleted and recreated on the
2539 fly while the VNC server is active. If missing, it will default
2540 to denying access.
2542 ``acl=on|off``
2543 Legacy method for enabling authorization of clients against the
2544 x509 distinguished name and SASL username. It results in the
2545 creation of two ``authz-list`` objects with IDs of
2546 ``vnc.username`` and ``vnc.x509dname``. The rules for these
2547 objects must be configured with the HMP ACL commands.
2549 This option is deprecated and should no longer be used. The new
2550 ``sasl-authz`` and ``tls-authz`` options are a replacement.
2552 ``lossy=on|off``
2553 Enable lossy compression methods (gradient, JPEG, ...). If this
2554 option is set, VNC client may receive lossy framebuffer updates
2555 depending on its encoding settings. Enabling this option can
2556 save a lot of bandwidth at the expense of quality.
2558 ``non-adaptive=on|off``
2559 Disable adaptive encodings. Adaptive encodings are enabled by
2560 default. An adaptive encoding will try to detect frequently
2561 updated screen regions, and send updates in these regions using
2562 a lossy encoding (like JPEG). This can be really helpful to save
2563 bandwidth when playing videos. Disabling adaptive encodings
2564 restores the original static behavior of encodings like Tight.
2566 ``share=[allow-exclusive|force-shared|ignore]``
2567 Set display sharing policy. 'allow-exclusive' allows clients to
2568 ask for exclusive access. As suggested by the rfb spec this is
2569 implemented by dropping other connections. Connecting multiple
2570 clients in parallel requires all clients asking for a shared
2571 session (vncviewer: -shared switch). This is the default.
2572 'force-shared' disables exclusive client access. Useful for
2573 shared desktop sessions, where you don't want someone forgetting
2574 specify -shared disconnect everybody else. 'ignore' completely
2575 ignores the shared flag and allows everybody connect
2576 unconditionally. Doesn't conform to the rfb spec but is
2577 traditional QEMU behavior.
2579 ``key-delay-ms``
2580 Set keyboard delay, for key down and key up events, in
2581 milliseconds. Default is 10. Keyboards are low-bandwidth
2582 devices, so this slowdown can help the device and guest to keep
2583 up and not lose events in case events are arriving in bulk.
2584 Possible causes for the latter are flaky network connections, or
2585 scripts for automated testing.
2587 ``audiodev=audiodev``
2588 Use the specified audiodev when the VNC client requests audio
2589 transmission. When not using an -audiodev argument, this option
2590 must be omitted, otherwise is must be present and specify a
2591 valid audiodev.
2593 ``power-control=on|off``
2594 Permit the remote client to issue shutdown, reboot or reset power
2595 control requests.
2596 ERST
2598 ARCHHEADING(, QEMU_ARCH_I386)
2600 ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
2602 DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
2603 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
2604 QEMU_ARCH_I386)
2605 SRST
2606 ``-win2k-hack``
2607 Use it when installing Windows 2000 to avoid a disk full bug. After
2608 Windows 2000 is installed, you no longer need this option (this
2609 option slows down the IDE transfers).
2610 ERST
2612 DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
2613 "-no-fd-bootchk disable boot signature checking for floppy disks\n",
2614 QEMU_ARCH_I386)
2615 SRST
2616 ``-no-fd-bootchk``
2617 Disable boot signature checking for floppy disks in BIOS. May be
2618 needed to boot from old floppy disks.
2619 ERST
2621 DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
2622 "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
2623 SRST
2624 ``-no-acpi``
2625 Disable ACPI (Advanced Configuration and Power Interface) support.
2626 Use it if your guest OS complains about ACPI problems (PC target
2627 machine only).
2628 ERST
2630 DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
2631 "-no-hpet disable HPET\n", QEMU_ARCH_I386)
2632 SRST
2633 ``-no-hpet``
2634 Disable HPET support. Deprecated, use '-machine hpet=off' instead.
2635 ERST
2637 DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
2638 "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
2639 " ACPI table description\n", QEMU_ARCH_I386)
2640 SRST
2641 ``-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]``
2642 Add ACPI table with specified header fields and context from
2643 specified files. For file=, take whole ACPI table from the specified
2644 files, including all ACPI headers (possible overridden by other
2645 options). For data=, only data portion of the table is used, all
2646 header information is specified in the command line. If a SLIC table
2647 is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id
2648 fields will override the same in the RSDT and the FADT (a.k.a.
2649 FACP), in order to ensure the field matches required by the
2650 Microsoft SLIC spec and the ACPI spec.
2651 ERST
2653 DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
2654 "-smbios file=binary\n"
2655 " load SMBIOS entry from binary file\n"
2656 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
2657 " [,uefi=on|off]\n"
2658 " specify SMBIOS type 0 fields\n"
2659 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2660 " [,uuid=uuid][,sku=str][,family=str]\n"
2661 " specify SMBIOS type 1 fields\n"
2662 "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2663 " [,asset=str][,location=str]\n"
2664 " specify SMBIOS type 2 fields\n"
2665 "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
2666 " [,sku=str]\n"
2667 " specify SMBIOS type 3 fields\n"
2668 "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
2669 " [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n"
2670 " [,processor-id=%d]\n"
2671 " specify SMBIOS type 4 fields\n"
2672 "-smbios type=8[,external_reference=str][,internal_reference=str][,connector_type=%d][,port_type=%d]\n"
2673 " specify SMBIOS type 8 fields\n"
2674 "-smbios type=11[,value=str][,path=filename]\n"
2675 " specify SMBIOS type 11 fields\n"
2676 "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
2677 " [,asset=str][,part=str][,speed=%d]\n"
2678 " specify SMBIOS type 17 fields\n"
2679 "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
2680 " specify SMBIOS type 41 fields\n",
2681 QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH)
2682 SRST
2683 ``-smbios file=binary``
2684 Load SMBIOS entry from binary file.
2686 ``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]``
2687 Specify SMBIOS type 0 fields
2689 ``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]``
2690 Specify SMBIOS type 1 fields
2692 ``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]``
2693 Specify SMBIOS type 2 fields
2695 ``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
2696 Specify SMBIOS type 3 fields
2698 ``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str][,processor-id=%d]``
2699 Specify SMBIOS type 4 fields
2701 ``-smbios type=11[,value=str][,path=filename]``
2702 Specify SMBIOS type 11 fields
2704 This argument can be repeated multiple times, and values are added in the order they are parsed.
2705 Applications intending to use OEM strings data are encouraged to use their application name as
2706 a prefix for the value string. This facilitates passing information for multiple applications
2707 concurrently.
2709 The ``value=str`` syntax provides the string data inline, while the ``path=filename`` syntax
2710 loads data from a file on disk. Note that the file is not permitted to contain any NUL bytes.
2712 Both the ``value`` and ``path`` options can be repeated multiple times and will be added to
2713 the SMBIOS table in the order in which they appear.
2715 Note that on the x86 architecture, the total size of all SMBIOS tables is limited to 65535
2716 bytes. Thus the OEM strings data is not suitable for passing large amounts of data into the
2717 guest. Instead it should be used as a indicator to inform the guest where to locate the real
2718 data set, for example, by specifying the serial ID of a block device.
2720 An example passing three strings is
2722 .. parsed-literal::
2724 -smbios type=11,value=cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/,\\
2725 value=anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os,\\
2726 path=/some/file/with/oemstringsdata.txt
2728 In the guest OS this is visible with the ``dmidecode`` command
2730 .. parsed-literal::
2732 $ dmidecode -t 11
2733 Handle 0x0E00, DMI type 11, 5 bytes
2734 OEM Strings
2735 String 1: cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/
2736 String 2: anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os
2737 String 3: myapp:some extra data
2740 ``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]``
2741 Specify SMBIOS type 17 fields
2743 ``-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]``
2744 Specify SMBIOS type 41 fields
2746 This argument can be repeated multiple times. Its main use is to allow network interfaces be created
2747 as ``enoX`` on Linux, with X being the instance number, instead of the name depending on the interface
2748 position on the PCI bus.
2750 Here is an example of use:
2752 .. parsed-literal::
2754 -netdev user,id=internet \\
2755 -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \\
2756 -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev
2758 In the guest OS, the device should then appear as ``eno1``:
2760 ..parsed-literal::
2762 $ ip -brief l
2763 lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
2764 eno1 UP 50:54:00:00:00:42 <BROADCAST,MULTICAST,UP,LOWER_UP>
2766 Currently, the PCI device has to be attached to the root bus.
2768 ERST
2770 DEFHEADING()
2772 DEFHEADING(Network options:)
2774 DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
2775 #ifdef CONFIG_SLIRP
2776 "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n"
2777 " [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
2778 " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
2779 " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
2780 " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
2781 #ifndef _WIN32
2782 "[,smb=dir[,smbserver=addr]]\n"
2783 #endif
2784 " configure a user mode network backend with ID 'str',\n"
2785 " its DHCP server and optional services\n"
2786 #endif
2787 #ifdef _WIN32
2788 "-netdev tap,id=str,ifname=name\n"
2789 " configure a host TAP network backend with ID 'str'\n"
2790 #else
2791 "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
2792 " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
2793 " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
2794 " [,poll-us=n]\n"
2795 " configure a host TAP network backend with ID 'str'\n"
2796 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
2797 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
2798 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
2799 " to deconfigure it\n"
2800 " use '[down]script=no' to disable script execution\n"
2801 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
2802 " configure it\n"
2803 " use 'fd=h' to connect to an already opened TAP interface\n"
2804 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
2805 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
2806 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
2807 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
2808 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
2809 " use vhost=on to enable experimental in kernel accelerator\n"
2810 " (only has effect for virtio guests which use MSIX)\n"
2811 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
2812 " use 'vhostfd=h' to connect to an already opened vhost net device\n"
2813 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
2814 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
2815 " use 'poll-us=n' to specify the maximum number of microseconds that could be\n"
2816 " spent on busy polling for vhost net\n"
2817 "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
2818 " configure a host TAP network backend with ID 'str' that is\n"
2819 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
2820 " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
2821 #endif
2822 #ifdef __linux__
2823 "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
2824 " [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n"
2825 " [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n"
2826 " [,rxcookie=rxcookie][,offset=offset]\n"
2827 " configure a network backend with ID 'str' connected to\n"
2828 " an Ethernet over L2TPv3 pseudowire.\n"
2829 " Linux kernel 3.3+ as well as most routers can talk\n"
2830 " L2TPv3. This transport allows connecting a VM to a VM,\n"
2831 " VM to a router and even VM to Host. It is a nearly-universal\n"
2832 " standard (RFC3931). Note - this implementation uses static\n"
2833 " pre-configured tunnels (same as the Linux kernel).\n"
2834 " use 'src=' to specify source address\n"
2835 " use 'dst=' to specify destination address\n"
2836 " use 'udp=on' to specify udp encapsulation\n"
2837 " use 'srcport=' to specify source udp port\n"
2838 " use 'dstport=' to specify destination udp port\n"
2839 " use 'ipv6=on' to force v6\n"
2840 " L2TPv3 uses cookies to prevent misconfiguration as\n"
2841 " well as a weak security measure\n"
2842 " use 'rxcookie=0x012345678' to specify a rxcookie\n"
2843 " use 'txcookie=0x012345678' to specify a txcookie\n"
2844 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
2845 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
2846 " use 'pincounter=on' to work around broken counter handling in peer\n"
2847 " use 'offset=X' to add an extra offset between header and data\n"
2848 #endif
2849 "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
2850 " configure a network backend to connect to another network\n"
2851 " using a socket connection\n"
2852 "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
2853 " configure a network backend to connect to a multicast maddr and port\n"
2854 " use 'localaddr=addr' to specify the host address to send packets from\n"
2855 "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
2856 " configure a network backend to connect to another network\n"
2857 " using an UDP tunnel\n"
2858 "-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off][,reconnect=seconds]\n"
2859 "-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect=seconds]\n"
2860 "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect=seconds]\n"
2861 " configure a network backend to connect to another network\n"
2862 " using a socket connection in stream mode.\n"
2863 "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]\n"
2864 "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]\n"
2865 " configure a network backend to connect to a multicast maddr and port\n"
2866 " use ``local.host=addr`` to specify the host address to send packets from\n"
2867 "-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]\n"
2868 "-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]\n"
2869 "-netdev dgram,id=str,local.type=fd,local.str=file-descriptor\n"
2870 " configure a network backend to connect to another network\n"
2871 " using an UDP tunnel\n"
2872 #ifdef CONFIG_VDE
2873 "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
2874 " configure a network backend to connect to port 'n' of a vde switch\n"
2875 " running on host and listening for incoming connections on 'socketpath'.\n"
2876 " Use group 'groupname' and mode 'octalmode' to change default\n"
2877 " ownership and permissions for communication port.\n"
2878 #endif
2879 #ifdef CONFIG_NETMAP
2880 "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
2881 " attach to the existing netmap-enabled network interface 'name', or to a\n"
2882 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
2883 " netmap device, defaults to '/dev/netmap')\n"
2884 #endif
2885 #ifdef CONFIG_POSIX
2886 "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
2887 " configure a vhost-user network, backed by a chardev 'dev'\n"
2888 #endif
2889 #ifdef __linux__
2890 "-netdev vhost-vdpa,id=str[,vhostdev=/path/to/dev][,vhostfd=h]\n"
2891 " configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n"
2892 " use 'vhostdev=/path/to/dev' to open a vhost vdpa device\n"
2893 " use 'vhostfd=h' to connect to an already opened vhost vdpa device\n"
2894 #endif
2895 #ifdef CONFIG_VMNET
2896 "-netdev vmnet-host,id=str[,isolated=on|off][,net-uuid=uuid]\n"
2897 " [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
2898 " configure a vmnet network backend in host mode with ID 'str',\n"
2899 " isolate this interface from others with 'isolated',\n"
2900 " configure the address range and choose a subnet mask,\n"
2901 " specify network UUID 'uuid' to disable DHCP and interact with\n"
2902 " vmnet-host interfaces within this isolated network\n"
2903 "-netdev vmnet-shared,id=str[,isolated=on|off][,nat66-prefix=addr]\n"
2904 " [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
2905 " configure a vmnet network backend in shared mode with ID 'str',\n"
2906 " configure the address range and choose a subnet mask,\n"
2907 " set IPv6 ULA prefix (of length 64) to use for internal network,\n"
2908 " isolate this interface from others with 'isolated'\n"
2909 "-netdev vmnet-bridged,id=str,ifname=name[,isolated=on|off]\n"
2910 " configure a vmnet network backend in bridged mode with ID 'str',\n"
2911 " use 'ifname=name' to select a physical network interface to be bridged,\n"
2912 " isolate this interface from others with 'isolated'\n"
2913 #endif
2914 "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
2915 " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
2916 DEF("nic", HAS_ARG, QEMU_OPTION_nic,
2917 "-nic [tap|bridge|"
2918 #ifdef CONFIG_SLIRP
2919 "user|"
2920 #endif
2921 #ifdef __linux__
2922 "l2tpv3|"
2923 #endif
2924 #ifdef CONFIG_VDE
2925 "vde|"
2926 #endif
2927 #ifdef CONFIG_NETMAP
2928 "netmap|"
2929 #endif
2930 #ifdef CONFIG_POSIX
2931 "vhost-user|"
2932 #endif
2933 #ifdef CONFIG_VMNET
2934 "vmnet-host|vmnet-shared|vmnet-bridged|"
2935 #endif
2936 "socket][,option][,...][mac=macaddr]\n"
2937 " initialize an on-board / default host NIC (using MAC address\n"
2938 " macaddr) and connect it to the given host network backend\n"
2939 "-nic none use it alone to have zero network devices (the default is to\n"
2940 " provided a 'user' network connection)\n",
2941 QEMU_ARCH_ALL)
2942 DEF("net", HAS_ARG, QEMU_OPTION_net,
2943 "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
2944 " configure or create an on-board (or machine default) NIC and\n"
2945 " connect it to hub 0 (please use -nic unless you need a hub)\n"
2946 "-net ["
2947 #ifdef CONFIG_SLIRP
2948 "user|"
2949 #endif
2950 "tap|"
2951 "bridge|"
2952 #ifdef CONFIG_VDE
2953 "vde|"
2954 #endif
2955 #ifdef CONFIG_NETMAP
2956 "netmap|"
2957 #endif
2958 #ifdef CONFIG_VMNET
2959 "vmnet-host|vmnet-shared|vmnet-bridged|"
2960 #endif
2961 "socket][,option][,option][,...]\n"
2962 " old way to initialize a host network interface\n"
2963 " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
2964 SRST
2965 ``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
2966 This option is a shortcut for configuring both the on-board
2967 (default) guest NIC hardware and the host network backend in one go.
2968 The host backend options are the same as with the corresponding
2969 ``-netdev`` options below. The guest NIC model can be set with
2970 ``model=modelname``. Use ``model=help`` to list the available device
2971 types. The hardware MAC address can be set with ``mac=macaddr``.
2973 The following two example do exactly the same, to show how ``-nic``
2974 can be used to shorten the command line length:
2976 .. parsed-literal::
2978 |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
2979 |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
2981 ``-nic none``
2982 Indicate that no network devices should be configured. It is used to
2983 override the default configuration (default NIC with "user" host
2984 network backend) which is activated if no other networking options
2985 are provided.
2987 ``-netdev user,id=id[,option][,option][,...]``
2988 Configure user mode host network backend which requires no
2989 administrator privilege to run. Valid options are:
2991 ``id=id``
2992 Assign symbolic name for use in monitor commands.
2994 ``ipv4=on|off and ipv6=on|off``
2995 Specify that either IPv4 or IPv6 must be enabled. If neither is
2996 specified both protocols are enabled.
2998 ``net=addr[/mask]``
2999 Set IP network address the guest will see. Optionally specify
3000 the netmask, either in the form a.b.c.d or as number of valid
3001 top-most bits. Default is 10.0.2.0/24.
3003 ``host=addr``
3004 Specify the guest-visible address of the host. Default is the
3005 2nd IP in the guest network, i.e. x.x.x.2.
3007 ``ipv6-net=addr[/int]``
3008 Set IPv6 network address the guest will see (default is
3009 fec0::/64). The network prefix is given in the usual hexadecimal
3010 IPv6 address notation. The prefix size is optional, and is given
3011 as the number of valid top-most bits (default is 64).
3013 ``ipv6-host=addr``
3014 Specify the guest-visible IPv6 address of the host. Default is
3015 the 2nd IPv6 in the guest network, i.e. xxxx::2.
3017 ``restrict=on|off``
3018 If this option is enabled, the guest will be isolated, i.e. it
3019 will not be able to contact the host and no guest IP packets
3020 will be routed over the host to the outside. This option does
3021 not affect any explicitly set forwarding rules.
3023 ``hostname=name``
3024 Specifies the client hostname reported by the built-in DHCP
3025 server.
3027 ``dhcpstart=addr``
3028 Specify the first of the 16 IPs the built-in DHCP server can
3029 assign. Default is the 15th to 31st IP in the guest network,
3030 i.e. x.x.x.15 to x.x.x.31.
3032 ``dns=addr``
3033 Specify the guest-visible address of the virtual nameserver. The
3034 address must be different from the host address. Default is the
3035 3rd IP in the guest network, i.e. x.x.x.3.
3037 ``ipv6-dns=addr``
3038 Specify the guest-visible address of the IPv6 virtual
3039 nameserver. The address must be different from the host address.
3040 Default is the 3rd IP in the guest network, i.e. xxxx::3.
3042 ``dnssearch=domain``
3043 Provides an entry for the domain-search list sent by the
3044 built-in DHCP server. More than one domain suffix can be
3045 transmitted by specifying this option multiple times. If
3046 supported, this will cause the guest to automatically try to
3047 append the given domain suffix(es) in case a domain name can not
3048 be resolved.
3050 Example:
3052 .. parsed-literal::
3054 |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
3056 ``domainname=domain``
3057 Specifies the client domain name reported by the built-in DHCP
3058 server.
3060 ``tftp=dir``
3061 When using the user mode network stack, activate a built-in TFTP
3062 server. The files in dir will be exposed as the root of a TFTP
3063 server. The TFTP client on the guest must be configured in
3064 binary mode (use the command ``bin`` of the Unix TFTP client).
3066 ``tftp-server-name=name``
3067 In BOOTP reply, broadcast name as the "TFTP server name"
3068 (RFC2132 option 66). This can be used to advise the guest to
3069 load boot files or configurations from a different server than
3070 the host address.
3072 ``bootfile=file``
3073 When using the user mode network stack, broadcast file as the
3074 BOOTP filename. In conjunction with ``tftp``, this can be used
3075 to network boot a guest from a local directory.
3077 Example (using pxelinux):
3079 .. parsed-literal::
3081 |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \\
3082 -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
3084 ``smb=dir[,smbserver=addr]``
3085 When using the user mode network stack, activate a built-in SMB
3086 server so that Windows OSes can access to the host files in
3087 ``dir`` transparently. The IP address of the SMB server can be
3088 set to addr. By default the 4th IP in the guest network is used,
3089 i.e. x.x.x.4.
3091 In the guest Windows OS, the line:
3095 10.0.2.4 smbserver
3097 must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
3098 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
3099 NT/2000).
3101 Then ``dir`` can be accessed in ``\\smbserver\qemu``.
3103 Note that a SAMBA server must be installed on the host OS.
3105 ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport``
3106 Redirect incoming TCP or UDP connections to the host port
3107 hostport to the guest IP address guestaddr on guest port
3108 guestport. If guestaddr is not specified, its value is x.x.x.15
3109 (default first address given by the built-in DHCP server). By
3110 specifying hostaddr, the rule can be bound to a specific host
3111 interface. If no connection type is set, TCP is used. This
3112 option can be given multiple times.
3114 For example, to redirect host X11 connection from screen 1 to
3115 guest screen 0, use the following:
3117 .. parsed-literal::
3119 # on the host
3120 |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
3121 # this host xterm should open in the guest X11 server
3122 xterm -display :1
3124 To redirect telnet connections from host port 5555 to telnet
3125 port on the guest, use the following:
3127 .. parsed-literal::
3129 # on the host
3130 |qemu_system| -nic user,hostfwd=tcp::5555-:23
3131 telnet localhost 5555
3133 Then when you use on the host ``telnet localhost 5555``, you
3134 connect to the guest telnet server.
3136 ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command``
3137 Forward guest TCP connections to the IP address server on port
3138 port to the character device dev or to a program executed by
3139 cmd:command which gets spawned for each connection. This option
3140 can be given multiple times.
3142 You can either use a chardev directly and have that one used
3143 throughout QEMU's lifetime, like in the following example:
3145 .. parsed-literal::
3147 # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
3148 # the guest accesses it
3149 |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
3151 Or you can execute a command on every TCP connection established
3152 by the guest, so that QEMU behaves similar to an inetd process
3153 for that virtual server:
3155 .. parsed-literal::
3157 # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
3158 # and connect the TCP stream to its stdin/stdout
3159 |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
3161 ``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]``
3162 Configure a host TAP network backend with ID id.
3164 Use the network script file to configure it and the network script
3165 dfile to deconfigure it. If name is not provided, the OS
3166 automatically provides one. The default network configure script is
3167 ``/etc/qemu-ifup`` and the default network deconfigure script is
3168 ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to
3169 disable script execution.
3171 If running QEMU as an unprivileged user, use the network helper
3172 to configure the TAP interface and attach it to the bridge.
3173 The default network helper executable is
3174 ``/path/to/qemu-bridge-helper`` and the default bridge device is
3175 ``br0``.
3177 ``fd``\ =h can be used to specify the handle of an already opened
3178 host TAP interface.
3180 Examples:
3182 .. parsed-literal::
3184 #launch a QEMU instance with the default network script
3185 |qemu_system| linux.img -nic tap
3187 .. parsed-literal::
3189 #launch a QEMU instance with two NICs, each one connected
3190 #to a TAP device
3191 |qemu_system| linux.img \\
3192 -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \\
3193 -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
3195 .. parsed-literal::
3197 #launch a QEMU instance with the default network helper to
3198 #connect a TAP device to bridge br0
3199 |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
3200 -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
3202 ``-netdev bridge,id=id[,br=bridge][,helper=helper]``
3203 Connect a host TAP network interface to a host bridge device.
3205 Use the network helper helper to configure the TAP interface and
3206 attach it to the bridge. The default network helper executable is
3207 ``/path/to/qemu-bridge-helper`` and the default bridge device is
3208 ``br0``.
3210 Examples:
3212 .. parsed-literal::
3214 #launch a QEMU instance with the default network helper to
3215 #connect a TAP device to bridge br0
3216 |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
3218 .. parsed-literal::
3220 #launch a QEMU instance with the default network helper to
3221 #connect a TAP device to bridge qemubr0
3222 |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
3224 ``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]``
3225 This host network backend can be used to connect the guest's network
3226 to another QEMU virtual machine using a TCP socket connection. If
3227 ``listen`` is specified, QEMU waits for incoming connections on port
3228 (host is optional). ``connect`` is used to connect to another QEMU
3229 instance using the ``listen`` option. ``fd``\ =h specifies an
3230 already opened TCP socket.
3232 Example:
3234 .. parsed-literal::
3236 # launch a first QEMU instance
3237 |qemu_system| linux.img \\
3238 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3239 -netdev socket,id=n1,listen=:1234
3240 # connect the network of this instance to the network of the first instance
3241 |qemu_system| linux.img \\
3242 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\
3243 -netdev socket,id=n2,connect=127.0.0.1:1234
3245 ``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]``
3246 Configure a socket host network backend to share the guest's network
3247 traffic with another QEMU virtual machines using a UDP multicast
3248 socket, effectively making a bus for every QEMU with same multicast
3249 address maddr and port. NOTES:
3251 1. Several QEMU can be running on different hosts and share same bus
3252 (assuming correct multicast setup for these hosts).
3254 2. mcast support is compatible with User Mode Linux (argument
3255 ``ethN=mcast``), see http://user-mode-linux.sf.net.
3257 3. Use ``fd=h`` to specify an already opened UDP multicast socket.
3259 Example:
3261 .. parsed-literal::
3263 # launch one QEMU instance
3264 |qemu_system| linux.img \\
3265 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3266 -netdev socket,id=n1,mcast=230.0.0.1:1234
3267 # launch another QEMU instance on same "bus"
3268 |qemu_system| linux.img \\
3269 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\
3270 -netdev socket,id=n2,mcast=230.0.0.1:1234
3271 # launch yet another QEMU instance on same "bus"
3272 |qemu_system| linux.img \\
3273 -device e1000,netdev=n3,mac=52:54:00:12:34:58 \\
3274 -netdev socket,id=n3,mcast=230.0.0.1:1234
3276 Example (User Mode Linux compat.):
3278 .. parsed-literal::
3280 # launch QEMU instance (note mcast address selected is UML's default)
3281 |qemu_system| linux.img \\
3282 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3283 -netdev socket,id=n1,mcast=239.192.168.1:1102
3284 # launch UML
3285 /path/to/linux ubd0=/path/to/root_fs eth0=mcast
3287 Example (send packets from host's 1.2.3.4):
3289 .. parsed-literal::
3291 |qemu_system| linux.img \\
3292 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3293 -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
3295 ``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
3296 Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
3297 is a popular protocol to transport Ethernet (and other Layer 2) data
3298 frames between two systems. It is present in routers, firewalls and
3299 the Linux kernel (from version 3.3 onwards).
3301 This transport allows a VM to communicate to another VM, router or
3302 firewall directly.
3304 ``src=srcaddr``
3305 source address (mandatory)
3307 ``dst=dstaddr``
3308 destination address (mandatory)
3310 ``udp``
3311 select udp encapsulation (default is ip).
3313 ``srcport=srcport``
3314 source udp port.
3316 ``dstport=dstport``
3317 destination udp port.
3319 ``ipv6``
3320 force v6, otherwise defaults to v4.
3322 ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
3323 Cookies are a weak form of security in the l2tpv3 specification.
3324 Their function is mostly to prevent misconfiguration. By default
3325 they are 32 bit.
3327 ``cookie64``
3328 Set cookie size to 64 bit instead of the default 32
3330 ``counter=off``
3331 Force a 'cut-down' L2TPv3 with no counter as in
3332 draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
3334 ``pincounter=on``
3335 Work around broken counter handling in peer. This may also help
3336 on networks which have packet reorder.
3338 ``offset=offset``
3339 Add an extra offset between header and data
3341 For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to
3342 the bridge br-lan on the remote Linux host 1.2.3.4:
3344 .. parsed-literal::
3346 # Setup tunnel on linux host using raw ip as encapsulation
3347 # on 1.2.3.4
3348 ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \\
3349 encap udp udp_sport 16384 udp_dport 16384
3350 ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \\
3351 0xFFFFFFFF peer_session_id 0xFFFFFFFF
3352 ifconfig vmtunnel0 mtu 1500
3353 ifconfig vmtunnel0 up
3354 brctl addif br-lan vmtunnel0
3357 # on 4.3.2.1
3358 # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
3360 |qemu_system| linux.img -device e1000,netdev=n1 \\
3361 -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
3363 ``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
3364 Configure VDE backend to connect to PORT n of a vde switch running
3365 on host and listening for incoming connections on socketpath. Use
3366 GROUP groupname and MODE octalmode to change default ownership and
3367 permissions for communication port. This option is only available if
3368 QEMU has been compiled with vde support enabled.
3370 Example:
3372 .. parsed-literal::
3374 # launch vde switch
3375 vde_switch -F -sock /tmp/myswitch
3376 # launch QEMU instance
3377 |qemu_system| linux.img -nic vde,sock=/tmp/myswitch
3379 ``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
3380 Establish a vhost-user netdev, backed by a chardev id. The chardev
3381 should be a unix domain socket backed one. The vhost-user uses a
3382 specifically defined protocol to pass vhost ioctl replacement
3383 messages to an application on the other end of the socket. On
3384 non-MSIX guests, the feature can be forced with vhostforce. Use
3385 'queues=n' to specify the number of queues to be created for
3386 multiqueue vhost-user.
3388 Example:
3392 qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
3393 -numa node,memdev=mem \
3394 -chardev socket,id=chr0,path=/path/to/socket \
3395 -netdev type=vhost-user,id=net0,chardev=chr0 \
3396 -device virtio-net-pci,netdev=net0
3398 ``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]``
3399 Establish a vhost-vdpa netdev.
3401 vDPA device is a device that uses a datapath which complies with
3402 the virtio specifications with a vendor specific control path.
3403 vDPA devices can be both physically located on the hardware or
3404 emulated by software.
3406 ``-netdev hubport,id=id,hubid=hubid[,netdev=nd]``
3407 Create a hub port on the emulated hub with ID hubid.
3409 The hubport netdev lets you connect a NIC to a QEMU emulated hub
3410 instead of a single netdev. Alternatively, you can also connect the
3411 hubport to another netdev with ID nd by using the ``netdev=nd``
3412 option.
3414 ``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]``
3415 Legacy option to configure or create an on-board (or machine
3416 default) Network Interface Card(NIC) and connect it either to the
3417 emulated hub with ID 0 (i.e. the default hub), or to the netdev nd.
3418 If model is omitted, then the default NIC model associated with the
3419 machine type is used. Note that the default NIC model may change in
3420 future QEMU releases, so it is highly recommended to always specify
3421 a model. Optionally, the MAC address can be changed to mac, the
3422 device address set to addr (PCI cards only), and a name can be
3423 assigned for use in monitor commands. Optionally, for PCI cards, you
3424 can specify the number v of MSI-X vectors that the card should have;
3425 this option currently only affects virtio cards; set v = 0 to
3426 disable MSI-X. If no ``-net`` option is specified, a single NIC is
3427 created. QEMU can emulate several different models of network card.
3428 Use ``-net nic,model=help`` for a list of available devices for your
3429 target.
3431 ``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]``
3432 Configure a host network backend (with the options corresponding to
3433 the same ``-netdev`` option) and connect it to the emulated hub 0
3434 (the default hub). Use name to specify the name of the hub port.
3435 ERST
3437 DEFHEADING()
3439 DEFHEADING(Character device options:)
3441 DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
3442 "-chardev help\n"
3443 "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3444 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n"
3445 " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n"
3446 " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
3447 "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n"
3448 " [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n"
3449 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
3450 " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n"
3451 " [,logfile=PATH][,logappend=on|off]\n"
3452 "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3453 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
3454 " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3455 "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
3456 "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3457 "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3458 #ifdef _WIN32
3459 "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3460 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3461 #else
3462 "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3463 "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
3464 #endif
3465 #ifdef CONFIG_BRLAPI
3466 "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3467 #endif
3468 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
3469 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
3470 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3471 #endif
3472 #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
3473 "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3474 #endif
3475 #if defined(CONFIG_SPICE)
3476 "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
3477 "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
3478 #endif
3479 , QEMU_ARCH_ALL
3482 SRST
3483 The general form of a character device option is:
3485 ``-chardev backend,id=id[,mux=on|off][,options]``
3486 Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
3487 ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
3488 ``pty``, ``stdio``, ``braille``, ``parallel``,
3489 ``spicevmc``, ``spiceport``. The specific backend will determine the
3490 applicable options.
3492 Use ``-chardev help`` to print all available chardev backend types.
3494 All devices must have an id, which can be any string up to 127
3495 characters long. It is used to uniquely identify this device in
3496 other command line directives.
3498 A character device may be used in multiplexing mode by multiple
3499 front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is
3500 a "1:N" device, and here the "1" end is your specified chardev
3501 backend, and the "N" end is the various parts of QEMU that can talk
3502 to a chardev. If you create a chardev with ``id=myid`` and
3503 ``mux=on``, QEMU will create a multiplexer with your specified ID,
3504 and you can then configure multiple front ends to use that chardev
3505 ID for their input/output. Up to four different front ends can be
3506 connected to a single multiplexed chardev. (Without multiplexing
3507 enabled, a chardev can only be used by a single front end.) For
3508 instance you could use this to allow a single stdio chardev to be
3509 used by two serial ports and the QEMU monitor:
3513 -chardev stdio,mux=on,id=char0 \
3514 -mon chardev=char0,mode=readline \
3515 -serial chardev:char0 \
3516 -serial chardev:char0
3518 You can have more than one multiplexer in a system configuration;
3519 for instance you could have a TCP port multiplexed between UART 0
3520 and UART 1, and stdio multiplexed between the QEMU monitor and a
3521 parallel port:
3525 -chardev stdio,mux=on,id=char0 \
3526 -mon chardev=char0,mode=readline \
3527 -parallel chardev:char0 \
3528 -chardev tcp,...,mux=on,id=char1 \
3529 -serial chardev:char1 \
3530 -serial chardev:char1
3532 When you're using a multiplexed character device, some escape
3533 sequences are interpreted in the input. See the chapter about
3534 :ref:`keys in the character backend multiplexer` in the
3535 System Emulation Users Guide for more details.
3537 Note that some other command line options may implicitly create
3538 multiplexed character backends; for instance ``-serial mon:stdio``
3539 creates a multiplexed stdio backend connected to the serial port and
3540 the QEMU monitor, and ``-nographic`` also multiplexes the console
3541 and the monitor to stdio.
3543 There is currently no support for multiplexing in the other
3544 direction (where a single QEMU front end takes input and output from
3545 multiple chardevs).
3547 Every backend supports the ``logfile`` option, which supplies the
3548 path to a file to record all data transmitted via the backend. The
3549 ``logappend`` option controls whether the log file will be truncated
3550 or appended to when opened.
3552 The available backends are:
3554 ``-chardev null,id=id``
3555 A void device. This device will not emit any data, and will drop any
3556 data it receives. The null backend does not take any options.
3558 ``-chardev socket,id=id[,TCP options or unix options][,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
3559 Create a two-way stream socket, which can be either a TCP or a unix
3560 socket. A unix socket will be created if ``path`` is specified.
3561 Behaviour is undefined if TCP options are specified for a unix
3562 socket.
3564 ``server=on|off`` specifies that the socket shall be a listening socket.
3566 ``wait=on|off`` specifies that QEMU should not block waiting for a client
3567 to connect to a listening socket.
3569 ``telnet=on|off`` specifies that traffic on the socket should interpret
3570 telnet escape sequences.
3572 ``websocket=on|off`` specifies that the socket uses WebSocket protocol for
3573 communication.
3575 ``reconnect`` sets the timeout for reconnecting on non-server
3576 sockets when the remote end goes away. qemu will delay this many
3577 seconds and then attempt to reconnect. Zero disables reconnecting,
3578 and is the default.
3580 ``tls-creds`` requests enablement of the TLS protocol for
3581 encryption, and specifies the id of the TLS credentials to use for
3582 the handshake. The credentials must be previously created with the
3583 ``-object tls-creds`` argument.
3585 ``tls-auth`` provides the ID of the QAuthZ authorization object
3586 against which the client's x509 distinguished name will be
3587 validated. This object is only resolved at time of use, so can be
3588 deleted and recreated on the fly while the chardev server is active.
3589 If missing, it will default to denying access.
3591 TCP and unix socket options are given below:
3593 ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]``
3594 ``host`` for a listening socket specifies the local address to
3595 be bound. For a connecting socket species the remote host to
3596 connect to. ``host`` is optional for listening sockets. If not
3597 specified it defaults to ``0.0.0.0``.
3599 ``port`` for a listening socket specifies the local port to be
3600 bound. For a connecting socket specifies the port on the remote
3601 host to connect to. ``port`` can be given as either a port
3602 number or a service name. ``port`` is required.
3604 ``to`` is only relevant to listening sockets. If it is
3605 specified, and ``port`` cannot be bound, QEMU will attempt to
3606 bind to subsequent ports up to and including ``to`` until it
3607 succeeds. ``to`` must be specified as a port number.
3609 ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4
3610 or IPv6 must be used. If neither is specified the socket may
3611 use either protocol.
3613 ``nodelay=on|off`` disables the Nagle algorithm.
3615 ``unix options: path=path[,abstract=on|off][,tight=on|off]``
3616 ``path`` specifies the local path of the unix socket. ``path``
3617 is required.
3618 ``abstract=on|off`` specifies the use of the abstract socket namespace,
3619 rather than the filesystem. Optional, defaults to false.
3620 ``tight=on|off`` sets the socket length of abstract sockets to their minimum,
3621 rather than the full sun_path length. Optional, defaults to true.
3623 ``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]``
3624 Sends all traffic from the guest to a remote host over UDP.
3626 ``host`` specifies the remote host to connect to. If not specified
3627 it defaults to ``localhost``.
3629 ``port`` specifies the port on the remote host to connect to.
3630 ``port`` is required.
3632 ``localaddr`` specifies the local address to bind to. If not
3633 specified it defaults to ``0.0.0.0``.
3635 ``localport`` specifies the local port to bind to. If not specified
3636 any available local port will be used.
3638 ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used.
3639 If neither is specified the device may use either protocol.
3641 ``-chardev msmouse,id=id``
3642 Forward QEMU's emulated msmouse events to the guest. ``msmouse``
3643 does not take any options.
3645 ``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
3646 Connect to a QEMU text console. ``vc`` may optionally be given a
3647 specific size.
3649 ``width`` and ``height`` specify the width and height respectively
3650 of the console, in pixels.
3652 ``cols`` and ``rows`` specify that the console be sized to fit a
3653 text console with the given dimensions.
3655 ``-chardev ringbuf,id=id[,size=size]``
3656 Create a ring buffer with fixed size ``size``. size must be a power
3657 of two and defaults to ``64K``.
3659 ``-chardev file,id=id,path=path[,input-path=input-path]``
3660 Log all traffic received from the guest to a file.
3662 ``path`` specifies the path of the file to be opened. This file will
3663 be created if it does not already exist, and overwritten if it does.
3664 ``path`` is required.
3666 If ``input-path`` is specified, this is the path of a second file
3667 which will be used for input. If ``input-path`` is not specified,
3668 no input will be available from the chardev.
3670 Note that ``input-path`` is not supported on Windows hosts.
3672 ``-chardev pipe,id=id,path=path``
3673 Create a two-way connection to the guest. The behaviour differs
3674 slightly between Windows hosts and other hosts:
3676 On Windows, a single duplex pipe will be created at
3677 ``\\.pipe\path``.
3679 On other hosts, 2 pipes will be created called ``path.in`` and
3680 ``path.out``. Data written to ``path.in`` will be received by the
3681 guest. Data written by the guest can be read from ``path.out``. QEMU
3682 will not create these fifos, and requires them to be present.
3684 ``path`` forms part of the pipe path as described above. ``path`` is
3685 required.
3687 ``-chardev console,id=id``
3688 Send traffic from the guest to QEMU's standard output. ``console``
3689 does not take any options.
3691 ``console`` is only available on Windows hosts.
3693 ``-chardev serial,id=id,path=path``
3694 Send traffic from the guest to a serial device on the host.
3696 On Unix hosts serial will actually accept any tty device, not only
3697 serial lines.
3699 ``path`` specifies the name of the serial device to open.
3701 ``-chardev pty,id=id``
3702 Create a new pseudo-terminal on the host and connect to it. ``pty``
3703 does not take any options.
3705 ``pty`` is not available on Windows hosts.
3707 ``-chardev stdio,id=id[,signal=on|off]``
3708 Connect to standard input and standard output of the QEMU process.
3710 ``signal`` controls if signals are enabled on the terminal, that
3711 includes exiting QEMU with the key sequence Control-c. This option
3712 is enabled by default, use ``signal=off`` to disable it.
3714 ``-chardev braille,id=id``
3715 Connect to a local BrlAPI server. ``braille`` does not take any
3716 options.
3718 ``-chardev parallel,id=id,path=path``
3720 ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
3721 hosts.
3723 Connect to a local parallel port.
3725 ``path`` specifies the path to the parallel port device. ``path`` is
3726 required.
3728 ``-chardev spicevmc,id=id,debug=debug,name=name``
3729 ``spicevmc`` is only available when spice support is built in.
3731 ``debug`` debug level for spicevmc
3733 ``name`` name of spice channel to connect to
3735 Connect to a spice virtual machine channel, such as vdiport.
3737 ``-chardev spiceport,id=id,debug=debug,name=name``
3738 ``spiceport`` is only available when spice support is built in.
3740 ``debug`` debug level for spicevmc
3742 ``name`` name of spice port to connect to
3744 Connect to a spice port, allowing a Spice client to handle the
3745 traffic identified by a name (preferably a fqdn).
3746 ERST
3748 DEFHEADING()
3750 #ifdef CONFIG_TPM
3751 DEFHEADING(TPM device options:)
3753 DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
3754 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
3755 " use path to provide path to a character device; default is /dev/tpm0\n"
3756 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
3757 " not provided it will be searched for in /sys/class/misc/tpm?/device\n"
3758 "-tpmdev emulator,id=id,chardev=dev\n"
3759 " configure the TPM device using chardev backend\n",
3760 QEMU_ARCH_ALL)
3761 SRST
3762 The general form of a TPM device option is:
3764 ``-tpmdev backend,id=id[,options]``
3765 The specific backend type will determine the applicable options. The
3766 ``-tpmdev`` option creates the TPM backend and requires a
3767 ``-device`` option that specifies the TPM frontend interface model.
3769 Use ``-tpmdev help`` to print all available TPM backend types.
3771 The available backends are:
3773 ``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path``
3774 (Linux-host only) Enable access to the host's TPM using the
3775 passthrough driver.
3777 ``path`` specifies the path to the host's TPM device, i.e., on a
3778 Linux host this would be ``/dev/tpm0``. ``path`` is optional and by
3779 default ``/dev/tpm0`` is used.
3781 ``cancel-path`` specifies the path to the host TPM device's sysfs
3782 entry allowing for cancellation of an ongoing TPM command.
3783 ``cancel-path`` is optional and by default QEMU will search for the
3784 sysfs entry to use.
3786 Some notes about using the host's TPM with the passthrough driver:
3788 The TPM device accessed by the passthrough driver must not be used
3789 by any other application on the host.
3791 Since the host's firmware (BIOS/UEFI) has already initialized the
3792 TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize
3793 the TPM again and may therefore not show a TPM-specific menu that
3794 would otherwise allow the user to configure the TPM, e.g., allow the
3795 user to enable/disable or activate/deactivate the TPM. Further, if
3796 TPM ownership is released from within a VM then the host's TPM will
3797 get disabled and deactivated. To enable and activate the TPM again
3798 afterwards, the host has to be rebooted and the user is required to
3799 enter the firmware's menu to enable and activate the TPM. If the TPM
3800 is left disabled and/or deactivated most TPM commands will fail.
3802 To create a passthrough TPM use the following two options:
3806 -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
3808 Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by
3809 ``tpmdev=tpm0`` in the device option.
3811 ``-tpmdev emulator,id=id,chardev=dev``
3812 (Linux-host only) Enable access to a TPM emulator using Unix domain
3813 socket based chardev backend.
3815 ``chardev`` specifies the unique ID of a character device backend
3816 that provides connection to the software TPM server.
3818 To create a TPM emulator backend device with chardev socket backend:
3822 -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
3823 ERST
3825 DEFHEADING()
3827 #endif
3829 DEFHEADING(Boot Image or Kernel specific:)
3830 SRST
3831 There are broadly 4 ways you can boot a system with QEMU.
3833 - specify a firmware and let it control finding a kernel
3834 - specify a firmware and pass a hint to the kernel to boot
3835 - direct kernel image boot
3836 - manually load files into the guest's address space
3838 The third method is useful for quickly testing kernels but as there is
3839 no firmware to pass configuration information to the kernel the
3840 hardware must either be probeable, the kernel built for the exact
3841 configuration or passed some configuration data (e.g. a DTB blob)
3842 which tells the kernel what drivers it needs. This exact details are
3843 often hardware specific.
3845 The final method is the most generic way of loading images into the
3846 guest address space and used mostly for ``bare metal`` type
3847 development where the reset vectors of the processor are taken into
3848 account.
3850 ERST
3852 SRST
3854 For x86 machines and some other architectures ``-bios`` will generally
3855 do the right thing with whatever it is given. For other machines the
3856 more strict ``-pflash`` option needs an image that is sized for the
3857 flash device for the given machine type.
3859 Please see the :ref:`system-targets-ref` section of the manual for
3860 more detailed documentation.
3862 ERST
3864 DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
3865 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
3866 SRST
3867 ``-bios file``
3868 Set the filename for the BIOS.
3869 ERST
3871 DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
3872 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
3873 SRST
3874 ``-pflash file``
3875 Use file as a parallel flash image.
3876 ERST
3878 SRST
3880 The kernel options were designed to work with Linux kernels although
3881 other things (like hypervisors) can be packaged up as a kernel
3882 executable image. The exact format of a executable image is usually
3883 architecture specific.
3885 The way in which the kernel is started (what address it is loaded at,
3886 what if any information is passed to it via CPU registers, the state
3887 of the hardware when it is started, and so on) is also architecture
3888 specific. Typically it follows the specification laid down by the
3889 Linux kernel for how kernels for that architecture must be started.
3891 ERST
3893 DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
3894 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
3895 SRST
3896 ``-kernel bzImage``
3897 Use bzImage as kernel image. The kernel can be either a Linux kernel
3898 or in multiboot format.
3899 ERST
3901 DEF("append", HAS_ARG, QEMU_OPTION_append, \
3902 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
3903 SRST
3904 ``-append cmdline``
3905 Use cmdline as kernel command line
3906 ERST
3908 DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
3909 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
3910 SRST
3911 ``-initrd file``
3912 Use file as initial ram disk.
3914 ``-initrd "file1 arg=foo,file2"``
3915 This syntax is only available with multiboot.
3917 Use file1 and file2 as modules and pass arg=foo as parameter to the
3918 first module.
3919 ERST
3921 DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
3922 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
3923 SRST
3924 ``-dtb file``
3925 Use file as a device tree binary (dtb) image and pass it to the
3926 kernel on boot.
3927 ERST
3929 SRST
3931 Finally you can also manually load images directly into the address
3932 space of the guest. This is most useful for developers who already
3933 know the layout of their guest and take care to ensure something sane
3934 will happen when the reset vector executes.
3936 The generic loader can be invoked by using the loader device:
3938 ``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
3940 there is also the guest loader which operates in a similar way but
3941 tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
3942 the guest image is:
3944 ``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
3946 ERST
3948 DEFHEADING()
3950 DEFHEADING(Debug/Expert options:)
3952 DEF("compat", HAS_ARG, QEMU_OPTION_compat,
3953 "-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n"
3954 " Policy for handling deprecated management interfaces\n"
3955 "-compat [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n"
3956 " Policy for handling unstable management interfaces\n",
3957 QEMU_ARCH_ALL)
3958 SRST
3959 ``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]``
3960 Set policy for handling deprecated management interfaces (experimental):
3962 ``deprecated-input=accept`` (default)
3963 Accept deprecated commands and arguments
3964 ``deprecated-input=reject``
3965 Reject deprecated commands and arguments
3966 ``deprecated-input=crash``
3967 Crash on deprecated commands and arguments
3968 ``deprecated-output=accept`` (default)
3969 Emit deprecated command results and events
3970 ``deprecated-output=hide``
3971 Suppress deprecated command results and events
3973 Limitation: covers only syntactic aspects of QMP.
3975 ``-compat [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]``
3976 Set policy for handling unstable management interfaces (experimental):
3978 ``unstable-input=accept`` (default)
3979 Accept unstable commands and arguments
3980 ``unstable-input=reject``
3981 Reject unstable commands and arguments
3982 ``unstable-input=crash``
3983 Crash on unstable commands and arguments
3984 ``unstable-output=accept`` (default)
3985 Emit unstable command results and events
3986 ``unstable-output=hide``
3987 Suppress unstable command results and events
3989 Limitation: covers only syntactic aspects of QMP.
3990 ERST
3992 DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
3993 "-fw_cfg [name=]<name>,file=<file>\n"
3994 " add named fw_cfg entry with contents from file\n"
3995 "-fw_cfg [name=]<name>,string=<str>\n"
3996 " add named fw_cfg entry with contents from string\n",
3997 QEMU_ARCH_ALL)
3998 SRST
3999 ``-fw_cfg [name=]name,file=file``
4000 Add named fw\_cfg entry with contents from file file.
4002 ``-fw_cfg [name=]name,string=str``
4003 Add named fw\_cfg entry with contents from string str.
4005 The terminating NUL character of the contents of str will not be
4006 included as part of the fw\_cfg item data. To insert contents with
4007 embedded NUL characters, you have to use the file parameter.
4009 The fw\_cfg entries are passed by QEMU through to the guest.
4011 Example:
4015 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
4017 creates an fw\_cfg entry named opt/com.mycompany/blob with contents
4018 from ./my\_blob.bin.
4019 ERST
4021 DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
4022 "-serial dev redirect the serial port to char device 'dev'\n",
4023 QEMU_ARCH_ALL)
4024 SRST
4025 ``-serial dev``
4026 Redirect the virtual serial port to host character device dev. The
4027 default device is ``vc`` in graphical mode and ``stdio`` in non
4028 graphical mode.
4030 This option can be used several times to simulate up to 4 serial
4031 ports.
4033 Use ``-serial none`` to disable all serial ports.
4035 Available character devices are:
4037 ``vc[:WxH]``
4038 Virtual console. Optionally, a width and height can be given in
4039 pixel with
4043 vc:800x600
4045 It is also possible to specify width or height in characters:
4049 vc:80Cx24C
4051 ``pty``
4052 [Linux only] Pseudo TTY (a new PTY is automatically allocated)
4054 ``none``
4055 No device is allocated.
4057 ``null``
4058 void device
4060 ``chardev:id``
4061 Use a named character device defined with the ``-chardev``
4062 option.
4064 ``/dev/XXX``
4065 [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial
4066 port parameters are set according to the emulated ones.
4068 ``/dev/parportN``
4069 [Linux only, parallel port only] Use host parallel port N.
4070 Currently SPP and EPP parallel port features can be used.
4072 ``file:filename``
4073 Write output to filename. No character can be read.
4075 ``stdio``
4076 [Unix only] standard input/output
4078 ``pipe:filename``
4079 name pipe filename
4081 ``COMn``
4082 [Windows only] Use host serial port n
4084 ``udp:[remote_host]:remote_port[@[src_ip]:src_port]``
4085 This implements UDP Net Console. When remote\_host or src\_ip
4086 are not specified they default to ``0.0.0.0``. When not using a
4087 specified src\_port a random port is automatically chosen.
4089 If you just want a simple readonly console you can use
4090 ``netcat`` or ``nc``, by starting QEMU with:
4091 ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time
4092 QEMU writes something to that port it will appear in the
4093 netconsole session.
4095 If you plan to send characters back via netconsole or you want
4096 to stop and start QEMU a lot of times, you should have QEMU use
4097 the same source port each time by using something like ``-serial
4098 udp::4555@:4556`` to QEMU. Another approach is to use a patched
4099 version of netcat which can listen to a TCP port and send and
4100 receive characters via udp. If you have a patched version of
4101 netcat which activates telnet remote echo and single char
4102 transfer, then you can use the following options to set up a
4103 netcat redirector to allow telnet on port 5555 to access the
4104 QEMU port.
4106 ``QEMU Options:``
4107 -serial udp::4555@:4556
4109 ``netcat options:``
4110 -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
4112 ``telnet options:``
4113 localhost 5555
4115 ``tcp:[host]:port[,server=on|off][,wait=on|off][,nodelay=on|off][,reconnect=seconds]``
4116 The TCP Net Console has two modes of operation. It can send the
4117 serial I/O to a location or wait for a connection from a
4118 location. By default the TCP Net Console is sent to host at the
4119 port. If you use the ``server=on`` option QEMU will wait for a client
4120 socket application to connect to the port before continuing,
4121 unless the ``wait=on|off`` option was specified. The ``nodelay=on|off``
4122 option disables the Nagle buffering algorithm. The ``reconnect=on``
4123 option only applies if ``server=no`` is set, if the connection goes
4124 down it will attempt to reconnect at the given interval. If host
4125 is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
4126 time is accepted. You can use ``telnet=on`` to connect to the
4127 corresponding character device.
4129 ``Example to send tcp console to 192.168.0.2 port 4444``
4130 -serial tcp:192.168.0.2:4444
4132 ``Example to listen and wait on port 4444 for connection``
4133 -serial tcp::4444,server=on
4135 ``Example to not wait and listen on ip 192.168.0.100 port 4444``
4136 -serial tcp:192.168.0.100:4444,server=on,wait=off
4138 ``telnet:host:port[,server=on|off][,wait=on|off][,nodelay=on|off]``
4139 The telnet protocol is used instead of raw tcp sockets. The
4140 options work the same as if you had specified ``-serial tcp``.
4141 The difference is that the port acts like a telnet server or
4142 client using telnet option negotiation. This will also allow you
4143 to send the MAGIC\_SYSRQ sequence if you use a telnet that
4144 supports sending the break sequence. Typically in unix telnet
4145 you do it with Control-] and then type "send break" followed by
4146 pressing the enter key.
4148 ``websocket:host:port,server=on[,wait=on|off][,nodelay=on|off]``
4149 The WebSocket protocol is used instead of raw tcp socket. The
4150 port acts as a WebSocket server. Client mode is not supported.
4152 ``unix:path[,server=on|off][,wait=on|off][,reconnect=seconds]``
4153 A unix domain socket is used instead of a tcp socket. The option
4154 works the same as if you had specified ``-serial tcp`` except
4155 the unix domain socket path is used for connections.
4157 ``mon:dev_string``
4158 This is a special option to allow the monitor to be multiplexed
4159 onto another serial port. The monitor is accessed with key
4160 sequence of Control-a and then pressing c. dev\_string should be
4161 any one of the serial devices specified above. An example to
4162 multiplex the monitor onto a telnet server listening on port
4163 4444 would be:
4165 ``-serial mon:telnet::4444,server=on,wait=off``
4167 When the monitor is multiplexed to stdio in this way, Ctrl+C
4168 will not terminate QEMU any more but will be passed to the guest
4169 instead.
4171 ``braille``
4172 Braille device. This will use BrlAPI to display the braille
4173 output on a real or fake device.
4175 ``msmouse``
4176 Three button serial mouse. Configure the guest to use Microsoft
4177 protocol.
4178 ERST
4180 DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
4181 "-parallel dev redirect the parallel port to char device 'dev'\n",
4182 QEMU_ARCH_ALL)
4183 SRST
4184 ``-parallel dev``
4185 Redirect the virtual parallel port to host device dev (same devices
4186 as the serial port). On Linux hosts, ``/dev/parportN`` can be used
4187 to use hardware devices connected on the corresponding host parallel
4188 port.
4190 This option can be used several times to simulate up to 3 parallel
4191 ports.
4193 Use ``-parallel none`` to disable all parallel ports.
4194 ERST
4196 DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
4197 "-monitor dev redirect the monitor to char device 'dev'\n",
4198 QEMU_ARCH_ALL)
4199 SRST
4200 ``-monitor dev``
4201 Redirect the monitor to host device dev (same devices as the serial
4202 port). The default device is ``vc`` in graphical mode and ``stdio``
4203 in non graphical mode. Use ``-monitor none`` to disable the default
4204 monitor.
4205 ERST
4206 DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
4207 "-qmp dev like -monitor but opens in 'control' mode\n",
4208 QEMU_ARCH_ALL)
4209 SRST
4210 ``-qmp dev``
4211 Like ``-monitor`` but opens in 'control' mode. For example, to make
4212 QMP available on localhost port 4444::
4214 -qmp tcp:localhost:4444,server=on,wait=off
4216 Not all options are configurable via this syntax; for maximum
4217 flexibility use the ``-mon`` option and an accompanying ``-chardev``.
4219 ERST
4220 DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
4221 "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
4222 QEMU_ARCH_ALL)
4223 SRST
4224 ``-qmp-pretty dev``
4225 Like ``-qmp`` but uses pretty JSON formatting.
4226 ERST
4228 DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
4229 "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
4230 SRST
4231 ``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
4232 Set up a monitor connected to the chardev ``name``.
4233 QEMU supports two monitors: the Human Monitor Protocol
4234 (HMP; for human interaction), and the QEMU Monitor Protocol
4235 (QMP; a JSON RPC-style protocol).
4236 The default is HMP; ``mode=control`` selects QMP instead.
4237 ``pretty`` is only valid when ``mode=control``,
4238 turning on JSON pretty printing to ease
4239 human reading and debugging.
4241 For example::
4243 -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
4244 -mon chardev=mon1,mode=control,pretty=on
4246 enables the QMP monitor on localhost port 4444 with pretty-printing.
4247 ERST
4249 DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
4250 "-debugcon dev redirect the debug console to char device 'dev'\n",
4251 QEMU_ARCH_ALL)
4252 SRST
4253 ``-debugcon dev``
4254 Redirect the debug console to host device dev (same devices as the
4255 serial port). The debug console is an I/O port which is typically
4256 port 0xe9; writing to that I/O port sends output to this device. The
4257 default device is ``vc`` in graphical mode and ``stdio`` in non
4258 graphical mode.
4259 ERST
4261 DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
4262 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
4263 SRST
4264 ``-pidfile file``
4265 Store the QEMU process PID in file. It is useful if you launch QEMU
4266 from a script.
4267 ERST
4269 DEF("singlestep", 0, QEMU_OPTION_singlestep, \
4270 "-singlestep deprecated synonym for -accel tcg,one-insn-per-tb=on\n", QEMU_ARCH_ALL)
4271 SRST
4272 ``-singlestep``
4273 This is a deprecated synonym for the TCG accelerator property
4274 ``one-insn-per-tb``.
4275 ERST
4277 DEF("preconfig", 0, QEMU_OPTION_preconfig, \
4278 "--preconfig pause QEMU before machine is initialized (experimental)\n",
4279 QEMU_ARCH_ALL)
4280 SRST
4281 ``--preconfig``
4282 Pause QEMU for interactive configuration before the machine is
4283 created, which allows querying and configuring properties that will
4284 affect machine initialization. Use QMP command 'x-exit-preconfig' to
4285 exit the preconfig state and move to the next state (i.e. run guest
4286 if -S isn't used or pause the second time if -S is used). This
4287 option is experimental.
4288 ERST
4290 DEF("S", 0, QEMU_OPTION_S, \
4291 "-S freeze CPU at startup (use 'c' to start execution)\n",
4292 QEMU_ARCH_ALL)
4293 SRST
4294 ``-S``
4295 Do not start CPU at startup (you must type 'c' in the monitor).
4296 ERST
4298 DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
4299 "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
4300 " run qemu with overcommit hints\n"
4301 " mem-lock=on|off controls memory lock support (default: off)\n"
4302 " cpu-pm=on|off controls cpu power management (default: off)\n",
4303 QEMU_ARCH_ALL)
4304 SRST
4305 ``-overcommit mem-lock=on|off``
4307 ``-overcommit cpu-pm=on|off``
4308 Run qemu with hints about host resource overcommit. The default is
4309 to assume that host overcommits all resources.
4311 Locking qemu and guest memory can be enabled via ``mem-lock=on``
4312 (disabled by default). This works when host memory is not
4313 overcommitted and reduces the worst-case latency for guest.
4315 Guest ability to manage power state of host cpus (increasing latency
4316 for other processes on the same host cpu, but decreasing latency for
4317 guest) can be enabled via ``cpu-pm=on`` (disabled by default). This
4318 works best when host CPU is not overcommitted. When used, host
4319 estimates of CPU cycle and power utilization will be incorrect, not
4320 taking into account guest idle time.
4321 ERST
4323 DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
4324 "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n"
4325 " the guest without waiting for gdb to connect; use -S too\n"
4326 " if you want it to not start execution.)\n",
4327 QEMU_ARCH_ALL)
4328 SRST
4329 ``-gdb dev``
4330 Accept a gdb connection on device dev (see the :ref:`GDB usage` chapter
4331 in the System Emulation Users Guide). Note that this option does not pause QEMU
4332 execution -- if you want QEMU to not start the guest until you
4333 connect with gdb and issue a ``continue`` command, you will need to
4334 also pass the ``-S`` option to QEMU.
4336 The most usual configuration is to listen on a local TCP socket::
4338 -gdb tcp::3117
4340 but you can specify other backends; UDP, pseudo TTY, or even stdio
4341 are all reasonable use cases. For example, a stdio connection
4342 allows you to start QEMU from within gdb and establish the
4343 connection via a pipe:
4345 .. parsed-literal::
4347 (gdb) target remote | exec |qemu_system| -gdb stdio ...
4348 ERST
4350 DEF("s", 0, QEMU_OPTION_s, \
4351 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
4352 QEMU_ARCH_ALL)
4353 SRST
4354 ``-s``
4355 Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
4356 (see the :ref:`GDB usage` chapter in the System Emulation Users Guide).
4357 ERST
4359 DEF("d", HAS_ARG, QEMU_OPTION_d, \
4360 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
4361 QEMU_ARCH_ALL)
4362 SRST
4363 ``-d item1[,...]``
4364 Enable logging of specified items. Use '-d help' for a list of log
4365 items.
4366 ERST
4368 DEF("D", HAS_ARG, QEMU_OPTION_D, \
4369 "-D logfile output log to logfile (default stderr)\n",
4370 QEMU_ARCH_ALL)
4371 SRST
4372 ``-D logfile``
4373 Output log in logfile instead of to stderr
4374 ERST
4376 DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
4377 "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
4378 QEMU_ARCH_ALL)
4379 SRST
4380 ``-dfilter range1[,...]``
4381 Filter debug output to that relevant to a range of target addresses.
4382 The filter spec can be either start+size, start-size or start..end
4383 where start end and size are the addresses and sizes required. For
4384 example:
4388 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
4390 Will dump output for any code in the 0x1000 sized block starting at
4391 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and
4392 another 0x1000 sized block starting at 0xffffffc00005f000.
4393 ERST
4395 DEF("seed", HAS_ARG, QEMU_OPTION_seed, \
4396 "-seed number seed the pseudo-random number generator\n",
4397 QEMU_ARCH_ALL)
4398 SRST
4399 ``-seed number``
4400 Force the guest to use a deterministic pseudo-random number
4401 generator, seeded with number. This does not affect crypto routines
4402 within the host.
4403 ERST
4405 DEF("L", HAS_ARG, QEMU_OPTION_L, \
4406 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
4407 QEMU_ARCH_ALL)
4408 SRST
4409 ``-L path``
4410 Set the directory for the BIOS, VGA BIOS and keymaps.
4412 To list all the data directories, use ``-L help``.
4413 ERST
4415 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
4416 "-enable-kvm enable KVM full virtualization support\n",
4417 QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
4418 QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
4419 SRST
4420 ``-enable-kvm``
4421 Enable KVM full virtualization support. This option is only
4422 available if KVM support is enabled when compiling.
4423 ERST
4425 DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
4426 "-xen-domid id specify xen guest domain id\n",
4427 QEMU_ARCH_ARM | QEMU_ARCH_I386)
4428 DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
4429 "-xen-attach attach to existing xen domain\n"
4430 " libxl will use this when starting QEMU\n",
4431 QEMU_ARCH_ARM | QEMU_ARCH_I386)
4432 DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
4433 "-xen-domid-restrict restrict set of available xen operations\n"
4434 " to specified domain id. (Does not affect\n"
4435 " xenpv machine type).\n",
4436 QEMU_ARCH_ARM | QEMU_ARCH_I386)
4437 SRST
4438 ``-xen-domid id``
4439 Specify xen guest domain id (XEN only).
4441 ``-xen-attach``
4442 Attach to existing xen domain. libxl will use this when starting
4443 QEMU (XEN only). Restrict set of available xen operations to
4444 specified domain id (XEN only).
4445 ERST
4447 DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
4448 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
4449 SRST
4450 ``-no-reboot``
4451 Exit instead of rebooting.
4452 ERST
4454 DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
4455 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
4456 SRST
4457 ``-no-shutdown``
4458 Don't exit QEMU on guest shutdown, but instead only stop the
4459 emulation. This allows for instance switching to monitor to commit
4460 changes to the disk image.
4461 ERST
4463 DEF("action", HAS_ARG, QEMU_OPTION_action,
4464 "-action reboot=reset|shutdown\n"
4465 " action when guest reboots [default=reset]\n"
4466 "-action shutdown=poweroff|pause\n"
4467 " action when guest shuts down [default=poweroff]\n"
4468 "-action panic=pause|shutdown|exit-failure|none\n"
4469 " action when guest panics [default=shutdown]\n"
4470 "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n"
4471 " action when watchdog fires [default=reset]\n",
4472 QEMU_ARCH_ALL)
4473 SRST
4474 ``-action event=action``
4475 The action parameter serves to modify QEMU's default behavior when
4476 certain guest events occur. It provides a generic method for specifying the
4477 same behaviors that are modified by the ``-no-reboot`` and ``-no-shutdown``
4478 parameters.
4480 Examples:
4482 ``-action panic=none``
4483 ``-action reboot=shutdown,shutdown=pause``
4484 ``-device i6300esb -action watchdog=pause``
4486 ERST
4488 DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
4489 "-loadvm [tag|id]\n" \
4490 " start right away with a saved state (loadvm in monitor)\n",
4491 QEMU_ARCH_ALL)
4492 SRST
4493 ``-loadvm file``
4494 Start right away with a saved state (``loadvm`` in monitor)
4495 ERST
4497 #ifndef _WIN32
4498 DEF("daemonize", 0, QEMU_OPTION_daemonize, \
4499 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
4500 #endif
4501 SRST
4502 ``-daemonize``
4503 Daemonize the QEMU process after initialization. QEMU will not
4504 detach from standard IO until it is ready to receive connections on
4505 any of its devices. This option is a useful way for external
4506 programs to launch QEMU without having to cope with initialization
4507 race conditions.
4508 ERST
4510 DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
4511 "-option-rom rom load a file, rom, into the option ROM space\n",
4512 QEMU_ARCH_ALL)
4513 SRST
4514 ``-option-rom file``
4515 Load the contents of file as an option ROM. This option is useful to
4516 load things like EtherBoot.
4517 ERST
4519 DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
4520 "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
4521 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
4522 QEMU_ARCH_ALL)
4524 SRST
4525 ``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]``
4526 Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at
4527 the current UTC or local time, respectively. ``localtime`` is
4528 required for correct date in MS-DOS or Windows. To start at a
4529 specific point in time, provide datetime in the format
4530 ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC.
4532 By default the RTC is driven by the host system time. This allows
4533 using of the RTC as accurate reference clock inside the guest,
4534 specifically if the host time is smoothly following an accurate
4535 external reference clock, e.g. via NTP. If you want to isolate the
4536 guest time from the host, you can set ``clock`` to ``rt`` instead,
4537 which provides a host monotonic clock if host support it. To even
4538 prevent the RTC from progressing during suspension, you can set
4539 ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is
4540 recommended especially in icount mode in order to preserve
4541 determinism; however, note that in icount mode the speed of the
4542 virtual clock is variable and can in general differ from the host
4543 clock.
4545 Enable ``driftfix`` (i386 targets only) if you experience time drift
4546 problems, specifically with Windows' ACPI HAL. This option will try
4547 to figure out how many timer interrupts were not processed by the
4548 Windows guest and will re-inject them.
4549 ERST
4551 DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
4552 "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=<filename>[,rrsnapshot=<snapshot>]]\n" \
4553 " enable virtual instruction counter with 2^N clock ticks per\n" \
4554 " instruction, enable aligning the host and virtual clocks\n" \
4555 " or disable real time cpu sleeping, and optionally enable\n" \
4556 " record-and-replay mode\n", QEMU_ARCH_ALL)
4557 SRST
4558 ``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]``
4559 Enable virtual instruction counter. The virtual cpu will execute one
4560 instruction every 2^N ns of virtual time. If ``auto`` is specified
4561 then the virtual cpu speed will be automatically adjusted to keep
4562 virtual time within a few seconds of real time.
4564 Note that while this option can give deterministic behavior, it does
4565 not provide cycle accurate emulation. Modern CPUs contain
4566 superscalar out of order cores with complex cache hierarchies. The
4567 number of instructions executed often has little or no correlation
4568 with actual performance.
4570 When the virtual cpu is sleeping, the virtual time will advance at
4571 default speed unless ``sleep=on`` is specified. With
4572 ``sleep=on``, the virtual time will jump to the next timer
4573 deadline instantly whenever the virtual cpu goes to sleep mode and
4574 will not advance if no timer is enabled. This behavior gives
4575 deterministic execution times from the guest point of view.
4576 The default if icount is enabled is ``sleep=off``.
4577 ``sleep=on`` cannot be used together with either ``shift=auto``
4578 or ``align=on``.
4580 ``align=on`` will activate the delay algorithm which will try to
4581 synchronise the host clock and the virtual clock. The goal is to
4582 have a guest running at the real frequency imposed by the shift
4583 option. Whenever the guest clock is behind the host clock and if
4584 ``align=on`` is specified then we print a message to the user to
4585 inform about the delay. Currently this option does not work when
4586 ``shift`` is ``auto``. Note: The sync algorithm will work for those
4587 shift values for which the guest clock runs ahead of the host clock.
4588 Typically this happens when the shift value is high (how high
4589 depends on the host machine). The default if icount is enabled
4590 is ``align=off``.
4592 When the ``rr`` option is specified deterministic record/replay is
4593 enabled. The ``rrfile=`` option must also be provided to
4594 specify the path to the replay log. In record mode data is written
4595 to this file, and in replay mode it is read back.
4596 If the ``rrsnapshot`` option is given then it specifies a VM snapshot
4597 name. In record mode, a new VM snapshot with the given name is created
4598 at the start of execution recording. In replay mode this option
4599 specifies the snapshot name used to load the initial VM state.
4600 ERST
4602 DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
4603 "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
4604 " action when watchdog fires [default=reset]\n",
4605 QEMU_ARCH_ALL)
4606 SRST
4607 ``-watchdog-action action``
4608 The action controls what QEMU will do when the watchdog timer
4609 expires. The default is ``reset`` (forcefully reset the guest).
4610 Other possible actions are: ``shutdown`` (attempt to gracefully
4611 shutdown the guest), ``poweroff`` (forcefully poweroff the guest),
4612 ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the
4613 guest), ``debug`` (print a debug message and continue), or ``none``
4614 (do nothing).
4616 Note that the ``shutdown`` action requires that the guest responds
4617 to ACPI signals, which it may not be able to do in the sort of
4618 situations where the watchdog would have expired, and thus
4619 ``-watchdog-action shutdown`` is not recommended for production use.
4621 Examples:
4623 ``-device i6300esb -watchdog-action pause``
4625 ERST
4627 DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
4628 "-echr chr set terminal escape character instead of ctrl-a\n",
4629 QEMU_ARCH_ALL)
4630 SRST
4631 ``-echr numeric_ascii_value``
4632 Change the escape character used for switching to the monitor when
4633 using monitor and serial sharing. The default is ``0x01`` when using
4634 the ``-nographic`` option. ``0x01`` is equal to pressing
4635 ``Control-a``. You can select a different character from the ascii
4636 control keys where 1 through 26 map to Control-a through Control-z.
4637 For instance you could use the either of the following to change the
4638 escape character to Control-t.
4640 ``-echr 0x14``; \ ``-echr 20``
4642 ERST
4644 DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
4645 "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \
4646 "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \
4647 "-incoming unix:socketpath\n" \
4648 " prepare for incoming migration, listen on\n" \
4649 " specified protocol and socket address\n" \
4650 "-incoming fd:fd\n" \
4651 "-incoming exec:cmdline\n" \
4652 " accept incoming migration on given file descriptor\n" \
4653 " or from given external command\n" \
4654 "-incoming defer\n" \
4655 " wait for the URI to be specified via migrate_incoming\n",
4656 QEMU_ARCH_ALL)
4657 SRST
4658 ``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]``
4660 ``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]``
4661 Prepare for incoming migration, listen on a given tcp port.
4663 ``-incoming unix:socketpath``
4664 Prepare for incoming migration, listen on a given unix socket.
4666 ``-incoming fd:fd``
4667 Accept incoming migration from a given filedescriptor.
4669 ``-incoming exec:cmdline``
4670 Accept incoming migration as an output from specified external
4671 command.
4673 ``-incoming defer``
4674 Wait for the URI to be specified via migrate\_incoming. The monitor
4675 can be used to change settings (such as migration parameters) prior
4676 to issuing the migrate\_incoming to allow the migration to begin.
4677 ERST
4679 DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
4680 "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
4681 SRST
4682 ``-only-migratable``
4683 Only allow migratable devices. Devices will not be allowed to enter
4684 an unmigratable state.
4685 ERST
4687 DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
4688 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
4689 SRST
4690 ``-nodefaults``
4691 Don't create default devices. Normally, QEMU sets the default
4692 devices like serial port, parallel port, virtual console, monitor
4693 device, VGA adapter, floppy and CD-ROM drive and others. The
4694 ``-nodefaults`` option will disable all those default devices.
4695 ERST
4697 #ifndef _WIN32
4698 DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
4699 "-chroot dir chroot to dir just before starting the VM (deprecated)\n",
4700 QEMU_ARCH_ALL)
4701 #endif
4702 SRST
4703 ``-chroot dir``
4704 Deprecated, use '-run-with chroot=...' instead.
4705 Immediately before starting guest execution, chroot to the specified
4706 directory. Especially useful in combination with -runas.
4707 ERST
4709 #ifndef _WIN32
4710 DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
4711 "-runas user change to user id user just before starting the VM\n" \
4712 " user can be numeric uid:gid instead\n",
4713 QEMU_ARCH_ALL)
4714 #endif
4715 SRST
4716 ``-runas user``
4717 Immediately before starting guest execution, drop root privileges,
4718 switching to the specified user.
4719 ERST
4721 DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
4722 "-prom-env variable=value\n"
4723 " set OpenBIOS nvram variables\n",
4724 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
4725 SRST
4726 ``-prom-env variable=value``
4727 Set OpenBIOS nvram variable to given value (PPC, SPARC only).
4731 qemu-system-sparc -prom-env 'auto-boot?=false' \
4732 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
4736 qemu-system-ppc -prom-env 'auto-boot?=false' \
4737 -prom-env 'boot-device=hd:2,\yaboot' \
4738 -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
4739 ERST
4740 DEF("semihosting", 0, QEMU_OPTION_semihosting,
4741 "-semihosting semihosting mode\n",
4742 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA |
4743 QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV)
4744 SRST
4745 ``-semihosting``
4746 Enable :ref:`Semihosting` mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only).
4748 .. warning::
4749 Note that this allows guest direct access to the host filesystem, so
4750 should only be used with a trusted guest OS.
4752 See the -semihosting-config option documentation for further
4753 information about the facilities this enables.
4754 ERST
4755 DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
4756 "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]\n" \
4757 " semihosting configuration\n",
4758 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA |
4759 QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV)
4760 SRST
4761 ``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]``
4762 Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V
4763 only).
4765 .. warning::
4766 Note that this allows guest direct access to the host filesystem, so
4767 should only be used with a trusted guest OS.
4769 ``target=native|gdb|auto``
4770 Defines where the semihosting calls will be addressed, to QEMU
4771 (``native``) or to GDB (``gdb``). The default is ``auto``, which
4772 means ``gdb`` during debug sessions and ``native`` otherwise.
4774 ``chardev=str1``
4775 Send the output to a chardev backend output for native or auto
4776 output when not in gdb
4778 ``userspace=on|off``
4779 Allows code running in guest userspace to access the semihosting
4780 interface. The default is that only privileged guest code can
4781 make semihosting calls. Note that setting ``userspace=on`` should
4782 only be used if all guest code is trusted (for example, in
4783 bare-metal test case code).
4785 ``arg=str1,arg=str2,...``
4786 Allows the user to pass input arguments, and can be used
4787 multiple times to build up a list. The old-style
4788 ``-kernel``/``-append`` method of passing a command line is
4789 still supported for backward compatibility. If both the
4790 ``--semihosting-config arg`` and the ``-kernel``/``-append`` are
4791 specified, the former is passed to semihosting as it always
4792 takes precedence.
4793 ERST
4794 DEF("old-param", 0, QEMU_OPTION_old_param,
4795 "-old-param old param mode\n", QEMU_ARCH_ARM)
4796 SRST
4797 ``-old-param``
4798 Old param mode (ARM only).
4799 ERST
4801 DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
4802 "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
4803 " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
4804 " Enable seccomp mode 2 system call filter (default 'off').\n" \
4805 " use 'obsolete' to allow obsolete system calls that are provided\n" \
4806 " by the kernel, but typically no longer used by modern\n" \
4807 " C library implementations.\n" \
4808 " use 'elevateprivileges' to allow or deny the QEMU process ability\n" \
4809 " to elevate privileges using set*uid|gid system calls.\n" \
4810 " The value 'children' will deny set*uid|gid system calls for\n" \
4811 " main QEMU process but will allow forks and execves to run unprivileged\n" \
4812 " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
4813 " blocking *fork and execve\n" \
4814 " use 'resourcecontrol' to disable process affinity and schedular priority\n",
4815 QEMU_ARCH_ALL)
4816 SRST
4817 ``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
4818 Enable Seccomp mode 2 system call filter. 'on' will enable syscall
4819 filtering and 'off' will disable it. The default is 'off'.
4821 ``obsolete=string``
4822 Enable Obsolete system calls
4824 ``elevateprivileges=string``
4825 Disable set\*uid\|gid system calls
4827 ``spawn=string``
4828 Disable \*fork and execve
4830 ``resourcecontrol=string``
4831 Disable process affinity and schedular priority
4832 ERST
4834 DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
4835 "-readconfig <file>\n"
4836 " read config file\n", QEMU_ARCH_ALL)
4837 SRST
4838 ``-readconfig file``
4839 Read device configuration from file. This approach is useful when
4840 you want to spawn QEMU process with many command line options but
4841 you don't want to exceed the command line character limit.
4842 ERST
4844 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
4845 "-no-user-config\n"
4846 " do not load default user-provided config files at startup\n",
4847 QEMU_ARCH_ALL)
4848 SRST
4849 ``-no-user-config``
4850 The ``-no-user-config`` option makes QEMU not load any of the
4851 user-provided config files on sysconfdir.
4852 ERST
4854 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
4855 "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
4856 " specify tracing options\n",
4857 QEMU_ARCH_ALL)
4858 SRST
4859 ``-trace [[enable=]pattern][,events=file][,file=file]``
4860 .. include:: ../qemu-option-trace.rst.inc
4862 ERST
4863 DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
4864 "-plugin [file=]<file>[,<argname>=<argvalue>]\n"
4865 " load a plugin\n",
4866 QEMU_ARCH_ALL)
4867 SRST
4868 ``-plugin file=file[,argname=argvalue]``
4869 Load a plugin.
4871 ``file=file``
4872 Load the given plugin from a shared library file.
4874 ``argname=argvalue``
4875 Argument passed to the plugin. (Can be given multiple times.)
4876 ERST
4878 HXCOMM Internal use
4879 DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
4880 DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
4882 #ifdef __linux__
4883 DEF("async-teardown", 0, QEMU_OPTION_asyncteardown,
4884 "-async-teardown enable asynchronous teardown\n",
4885 QEMU_ARCH_ALL)
4886 SRST
4887 ``-async-teardown``
4888 This option is deprecated and should no longer be used. The new option
4889 ``-run-with async-teardown=on`` is a replacement.
4890 ERST
4891 #endif
4892 #ifdef CONFIG_POSIX
4893 DEF("run-with", HAS_ARG, QEMU_OPTION_run_with,
4894 "-run-with [async-teardown=on|off][,chroot=dir]\n"
4895 " Set miscellaneous QEMU process lifecycle options:\n"
4896 " async-teardown=on enables asynchronous teardown (Linux only)\n"
4897 " chroot=dir chroot to dir just before starting the VM\n",
4898 QEMU_ARCH_ALL)
4899 SRST
4900 ``-run-with [async-teardown=on|off][,chroot=dir]``
4901 Set QEMU process lifecycle options.
4903 ``async-teardown=on`` enables asynchronous teardown. A new process called
4904 "cleanup/<QEMU_PID>" will be created at startup sharing the address
4905 space with the main QEMU process, using clone. It will wait for the
4906 main QEMU process to terminate completely, and then exit. This allows
4907 QEMU to terminate very quickly even if the guest was huge, leaving the
4908 teardown of the address space to the cleanup process. Since the cleanup
4909 process shares the same cgroups as the main QEMU process, accounting is
4910 performed correctly. This only works if the cleanup process is not
4911 forcefully killed with SIGKILL before the main QEMU process has
4912 terminated completely.
4914 ``chroot=dir`` can be used for doing a chroot to the specified directory
4915 immediately before starting the guest execution. This is especially useful
4916 in combination with -runas.
4917 ERST
4918 #endif
4920 DEF("msg", HAS_ARG, QEMU_OPTION_msg,
4921 "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n"
4922 " control error message format\n"
4923 " timestamp=on enables timestamps (default: off)\n"
4924 " guest-name=on enables guest name prefix but only if\n"
4925 " -name guest option is set (default: off)\n",
4926 QEMU_ARCH_ALL)
4927 SRST
4928 ``-msg [timestamp[=on|off]][,guest-name[=on|off]]``
4929 Control error message format.
4931 ``timestamp=on|off``
4932 Prefix messages with a timestamp. Default is off.
4934 ``guest-name=on|off``
4935 Prefix messages with guest name but only if -name guest option is set
4936 otherwise the option is ignored. Default is off.
4937 ERST
4939 DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
4940 "-dump-vmstate <file>\n"
4941 " Output vmstate information in JSON format to file.\n"
4942 " Use the scripts/vmstate-static-checker.py file to\n"
4943 " check for possible regressions in migration code\n"
4944 " by comparing two such vmstate dumps.\n",
4945 QEMU_ARCH_ALL)
4946 SRST
4947 ``-dump-vmstate file``
4948 Dump json-encoded vmstate information for current machine type to
4949 file in file
4950 ERST
4952 DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
4953 "-enable-sync-profile\n"
4954 " enable synchronization profiling\n",
4955 QEMU_ARCH_ALL)
4956 SRST
4957 ``-enable-sync-profile``
4958 Enable synchronization profiling.
4959 ERST
4961 #if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
4962 DEF("perfmap", 0, QEMU_OPTION_perfmap,
4963 "-perfmap generate a /tmp/perf-${pid}.map file for perf\n",
4964 QEMU_ARCH_ALL)
4965 SRST
4966 ``-perfmap``
4967 Generate a map file for Linux perf tools that will allow basic profiling
4968 information to be broken down into basic blocks.
4969 ERST
4971 DEF("jitdump", 0, QEMU_OPTION_jitdump,
4972 "-jitdump generate a jit-${pid}.dump file for perf\n",
4973 QEMU_ARCH_ALL)
4974 SRST
4975 ``-jitdump``
4976 Generate a dump file for Linux perf tools that maps basic blocks to symbol
4977 names, line numbers and JITted code.
4978 ERST
4979 #endif
4981 DEFHEADING()
4983 DEFHEADING(Generic object creation:)
4985 DEF("object", HAS_ARG, QEMU_OPTION_object,
4986 "-object TYPENAME[,PROP1=VALUE1,...]\n"
4987 " create a new object of type TYPENAME setting properties\n"
4988 " in the order they are specified. Note that the 'id'\n"
4989 " property must be set. These objects are placed in the\n"
4990 " '/objects' path.\n",
4991 QEMU_ARCH_ALL)
4992 SRST
4993 ``-object typename[,prop1=value1,...]``
4994 Create a new object of type typename setting properties in the order
4995 they are specified. Note that the 'id' property must be set. These
4996 objects are placed in the '/objects' path.
4998 ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,offset=offset,readonly=on|off``
4999 Creates a memory file backend object, which can be used to back
5000 the guest RAM with huge pages.
5002 The ``id`` parameter is a unique ID that will be used to
5003 reference this memory region in other parameters, e.g. ``-numa``,
5004 ``-device nvdimm``, etc.
5006 The ``size`` option provides the size of the memory region, and
5007 accepts common suffixes, e.g. ``500M``.
5009 The ``mem-path`` provides the path to either a shared memory or
5010 huge page filesystem mount.
5012 The ``share`` boolean option determines whether the memory
5013 region is marked as private to QEMU, or shared. The latter
5014 allows a co-operating external process to access the QEMU memory
5015 region.
5017 The ``share`` is also required for pvrdma devices due to
5018 limitations in the RDMA API provided by Linux.
5020 Setting share=on might affect the ability to configure NUMA
5021 bindings for the memory backend under some circumstances, see
5022 Documentation/vm/numa\_memory\_policy.txt on the Linux kernel
5023 source tree for additional details.
5025 Setting the ``discard-data`` boolean option to on indicates that
5026 file contents can be destroyed when QEMU exits, to avoid
5027 unnecessarily flushing data to the backing file. Note that
5028 ``discard-data`` is only an optimization, and QEMU might not
5029 discard file contents if it aborts unexpectedly or is terminated
5030 using SIGKILL.
5032 The ``merge`` boolean option enables memory merge, also known as
5033 MADV\_MERGEABLE, so that Kernel Samepage Merging will consider
5034 the pages for memory deduplication.
5036 Setting the ``dump`` boolean option to off excludes the memory
5037 from core dumps. This feature is also known as MADV\_DONTDUMP.
5039 The ``prealloc`` boolean option enables memory preallocation.
5041 The ``host-nodes`` option binds the memory range to a list of
5042 NUMA host nodes.
5044 The ``policy`` option sets the NUMA policy to one of the
5045 following values:
5047 ``default``
5048 default host policy
5050 ``preferred``
5051 prefer the given host node list for allocation
5053 ``bind``
5054 restrict memory allocation to the given host node list
5056 ``interleave``
5057 interleave memory allocations across the given host node
5058 list
5060 The ``align`` option specifies the base address alignment when
5061 QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg
5062 ``2M``. Some backend store specified by ``mem-path`` requires an
5063 alignment different than the default one used by QEMU, eg the
5064 device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
5065 such cases, users can specify the required alignment via this
5066 option.
5068 The ``offset`` option specifies the offset into the target file
5069 that the region starts at. You can use this parameter to back
5070 multiple regions with a single file.
5072 The ``pmem`` option specifies whether the backing file specified
5073 by ``mem-path`` is in host persistent memory that can be
5074 accessed using the SNIA NVM programming model (e.g. Intel
5075 NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary
5076 operations to guarantee the persistence of its own writes to
5077 ``mem-path`` (e.g. in vNVDIMM label emulation and live
5078 migration). Also, we will map the backend-file with MAP\_SYNC
5079 flag, which ensures the file metadata is in sync for
5080 ``mem-path`` in case of host crash or a power failure. MAP\_SYNC
5081 requires support from both the host kernel (since Linux kernel
5082 4.15) and the filesystem of ``mem-path`` mounted with DAX
5083 option.
5085 The ``readonly`` option specifies whether the backing file is opened
5086 read-only or read-write (default).
5088 ``-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave``
5089 Creates a memory backend object, which can be used to back the
5090 guest RAM. Memory backend objects offer more control than the
5091 ``-m`` option that is traditionally used to define guest RAM.
5092 Please refer to ``memory-backend-file`` for a description of the
5093 options.
5095 ``-object memory-backend-memfd,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave,seal=on|off,hugetlb=on|off,hugetlbsize=size``
5096 Creates an anonymous memory file backend object, which allows
5097 QEMU to share the memory with an external process (e.g. when
5098 using vhost-user). The memory is allocated with memfd and
5099 optional sealing. (Linux only)
5101 The ``seal`` option creates a sealed-file, that will block
5102 further resizing the memory ('on' by default).
5104 The ``hugetlb`` option specify the file to be created resides in
5105 the hugetlbfs filesystem (since Linux 4.14). Used in conjunction
5106 with the ``hugetlb`` option, the ``hugetlbsize`` option specify
5107 the hugetlb page size on systems that support multiple hugetlb
5108 page sizes (it must be a power of 2 value supported by the
5109 system).
5111 In some versions of Linux, the ``hugetlb`` option is
5112 incompatible with the ``seal`` option (requires at least Linux
5113 4.16).
5115 Please refer to ``memory-backend-file`` for a description of the
5116 other options.
5118 The ``share`` boolean option is on by default with memfd.
5120 ``-object rng-builtin,id=id``
5121 Creates a random number generator backend which obtains entropy
5122 from QEMU builtin functions. The ``id`` parameter is a unique ID
5123 that will be used to reference this entropy backend from the
5124 ``virtio-rng`` device. By default, the ``virtio-rng`` device
5125 uses this RNG backend.
5127 ``-object rng-random,id=id,filename=/dev/random``
5128 Creates a random number generator backend which obtains entropy
5129 from a device on the host. The ``id`` parameter is a unique ID
5130 that will be used to reference this entropy backend from the
5131 ``virtio-rng`` device. The ``filename`` parameter specifies
5132 which file to obtain entropy from and if omitted defaults to
5133 ``/dev/urandom``.
5135 ``-object rng-egd,id=id,chardev=chardevid``
5136 Creates a random number generator backend which obtains entropy
5137 from an external daemon running on the host. The ``id``
5138 parameter is a unique ID that will be used to reference this
5139 entropy backend from the ``virtio-rng`` device. The ``chardev``
5140 parameter is the unique ID of a character device backend that
5141 provides the connection to the RNG daemon.
5143 ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off``
5144 Creates a TLS anonymous credentials object, which can be used to
5145 provide TLS support on network backends. The ``id`` parameter is
5146 a unique ID which network backends will use to access the
5147 credentials. The ``endpoint`` is either ``server`` or ``client``
5148 depending on whether the QEMU network backend that uses the
5149 credentials will be acting as a client or as a server. If
5150 ``verify-peer`` is enabled (the default) then once the handshake
5151 is completed, the peer credentials will be verified, though this
5152 is a no-op for anonymous credentials.
5154 The dir parameter tells QEMU where to find the credential files.
5155 For server endpoints, this directory may contain a file
5156 dh-params.pem providing diffie-hellman parameters to use for the
5157 TLS server. If the file is missing, QEMU will generate a set of
5158 DH parameters at startup. This is a computationally expensive
5159 operation that consumes random pool entropy, so it is
5160 recommended that a persistent set of parameters be generated
5161 upfront and saved.
5163 ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]``
5164 Creates a TLS Pre-Shared Keys (PSK) credentials object, which
5165 can be used to provide TLS support on network backends. The
5166 ``id`` parameter is a unique ID which network backends will use
5167 to access the credentials. The ``endpoint`` is either ``server``
5168 or ``client`` depending on whether the QEMU network backend that
5169 uses the credentials will be acting as a client or as a server.
5170 For clients only, ``username`` is the username which will be
5171 sent to the server. If omitted it defaults to "qemu".
5173 The dir parameter tells QEMU where to find the keys file. It is
5174 called "dir/keys.psk" and contains "username:key" pairs. This
5175 file can most easily be created using the GnuTLS ``psktool``
5176 program.
5178 For server endpoints, dir may also contain a file dh-params.pem
5179 providing diffie-hellman parameters to use for the TLS server.
5180 If the file is missing, QEMU will generate a set of DH
5181 parameters at startup. This is a computationally expensive
5182 operation that consumes random pool entropy, so it is
5183 recommended that a persistent set of parameters be generated up
5184 front and saved.
5186 ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id``
5187 Creates a TLS anonymous credentials object, which can be used to
5188 provide TLS support on network backends. The ``id`` parameter is
5189 a unique ID which network backends will use to access the
5190 credentials. The ``endpoint`` is either ``server`` or ``client``
5191 depending on whether the QEMU network backend that uses the
5192 credentials will be acting as a client or as a server. If
5193 ``verify-peer`` is enabled (the default) then once the handshake
5194 is completed, the peer credentials will be verified. With x509
5195 certificates, this implies that the clients must be provided
5196 with valid client certificates too.
5198 The dir parameter tells QEMU where to find the credential files.
5199 For server endpoints, this directory may contain a file
5200 dh-params.pem providing diffie-hellman parameters to use for the
5201 TLS server. If the file is missing, QEMU will generate a set of
5202 DH parameters at startup. This is a computationally expensive
5203 operation that consumes random pool entropy, so it is
5204 recommended that a persistent set of parameters be generated
5205 upfront and saved.
5207 For x509 certificate credentials the directory will contain
5208 further files providing the x509 certificates. The certificates
5209 must be stored in PEM format, in filenames ca-cert.pem,
5210 ca-crl.pem (optional), server-cert.pem (only servers),
5211 server-key.pem (only servers), client-cert.pem (only clients),
5212 and client-key.pem (only clients).
5214 For the server-key.pem and client-key.pem files which contain
5215 sensitive private keys, it is possible to use an encrypted
5216 version by providing the passwordid parameter. This provides the
5217 ID of a previously created ``secret`` object containing the
5218 password for decryption.
5220 The priority parameter allows to override the global default
5221 priority used by gnutls. This can be useful if the system
5222 administrator needs to use a weaker set of crypto priorities for
5223 QEMU without potentially forcing the weakness onto all
5224 applications. Or conversely if one wants wants a stronger
5225 default for QEMU than for all other applications, they can do
5226 this through this parameter. Its format is a gnutls priority
5227 string as described at
5228 https://gnutls.org/manual/html_node/Priority-Strings.html.
5230 ``-object tls-cipher-suites,id=id,priority=priority``
5231 Creates a TLS cipher suites object, which can be used to control
5232 the TLS cipher/protocol algorithms that applications are permitted
5233 to use.
5235 The ``id`` parameter is a unique ID which frontends will use to
5236 access the ordered list of permitted TLS cipher suites from the
5237 host.
5239 The ``priority`` parameter allows to override the global default
5240 priority used by gnutls. This can be useful if the system
5241 administrator needs to use a weaker set of crypto priorities for
5242 QEMU without potentially forcing the weakness onto all
5243 applications. Or conversely if one wants wants a stronger
5244 default for QEMU than for all other applications, they can do
5245 this through this parameter. Its format is a gnutls priority
5246 string as described at
5247 https://gnutls.org/manual/html_node/Priority-Strings.html.
5249 An example of use of this object is to control UEFI HTTPS Boot.
5250 The tls-cipher-suites object exposes the ordered list of permitted
5251 TLS cipher suites from the host side to the guest firmware, via
5252 fw_cfg. The list is represented as an array of IANA_TLS_CIPHER
5253 objects. The firmware uses the IANA_TLS_CIPHER array for configuring
5254 guest-side TLS.
5256 In the following example, the priority at which the host-side policy
5257 is retrieved is given by the ``priority`` property.
5258 Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to
5259 refer to /etc/crypto-policies/back-ends/gnutls.config.
5261 .. parsed-literal::
5263 # |qemu_system| \\
5264 -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \\
5265 -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0
5267 ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
5268 Interval t can't be 0, this filter batches the packet delivery:
5269 all packets arriving in a given interval on netdev netdevid are
5270 delayed until the end of the interval. Interval is in
5271 microseconds. ``status`` is optional that indicate whether the
5272 netfilter is on (enabled) or off (disabled), the default status
5273 for netfilter will be 'on'.
5275 queue all\|rx\|tx is an option that can be applied to any
5276 netfilter.
5278 ``all``: the filter is attached both to the receive and the
5279 transmit queue of the netdev (default).
5281 ``rx``: the filter is attached to the receive queue of the
5282 netdev, where it will receive packets sent to the netdev.
5284 ``tx``: the filter is attached to the transmit queue of the
5285 netdev, where it will receive packets sent by the netdev.
5287 position head\|tail\|id=<id> is an option to specify where the
5288 filter should be inserted in the filter list. It can be applied
5289 to any netfilter.
5291 ``head``: the filter is inserted at the head of the filter list,
5292 before any existing filters.
5294 ``tail``: the filter is inserted at the tail of the filter list,
5295 behind any existing filters (default).
5297 ``id=<id>``: the filter is inserted before or behind the filter
5298 specified by <id>, see the insert option below.
5300 insert behind\|before is an option to specify where to insert
5301 the new filter relative to the one specified with
5302 position=id=<id>. It can be applied to any netfilter.
5304 ``before``: insert before the specified filter.
5306 ``behind``: insert behind the specified filter (default).
5308 ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5309 filter-mirror on netdev netdevid,mirror net packet to
5310 chardevchardevid, if it has the vnet\_hdr\_support flag,
5311 filter-mirror will mirror packet with vnet\_hdr\_len.
5313 ``-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5314 filter-redirector on netdev netdevid,redirect filter's net
5315 packet to chardev chardevid,and redirect indev's packet to
5316 filter.if it has the vnet\_hdr\_support flag, filter-redirector
5317 will redirect packet with vnet\_hdr\_len. Create a
5318 filter-redirector we need to differ outdev id from indev id, id
5319 can not be the same. we can just use indev or outdev, but at
5320 least one of indev or outdev need to be specified.
5322 ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5323 Filter-rewriter is a part of COLO project.It will rewrite tcp
5324 packet to secondary from primary to keep secondary tcp
5325 connection,and rewrite tcp packet to primary from secondary make
5326 tcp packet can be handled by client.if it has the
5327 vnet\_hdr\_support flag, we can parse packet with vnet header.
5329 usage: colo secondary: -object
5330 filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
5331 filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object
5332 filter-rewriter,id=rew0,netdev=hn0,queue=all
5334 ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]``
5335 Dump the network traffic on netdev dev to the file specified by
5336 filename. At most len bytes (64k by default) per packet are
5337 stored. The file format is libpcap, so it can be analyzed with
5338 tools such as tcpdump or Wireshark.
5340 ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
5341 Colo-compare gets packet from primary\_in chardevid and
5342 secondary\_in, then compare whether the payload of primary packet
5343 and secondary packet are the same. If same, it will output
5344 primary packet to out\_dev, else it will notify COLO-framework to do
5345 checkpoint and send primary packet to out\_dev. In order to
5346 improve efficiency, we need to put the task of comparison in
5347 another iothread. If it has the vnet\_hdr\_support flag,
5348 colo compare will send/recv packet with vnet\_hdr\_len.
5349 The compare\_timeout=@var{ms} determines the maximum time of the
5350 colo-compare hold the packet. The expired\_scan\_cycle=@var{ms}
5351 is to set the period of scanning expired primary node network packets.
5352 The max\_queue\_size=@var{size} is to set the max compare queue
5353 size depend on user environment.
5354 If user want to use Xen COLO, need to add the notify\_dev to
5355 notify Xen colo-frame to do checkpoint.
5357 COLO-compare must be used with the help of filter-mirror,
5358 filter-redirector and filter-rewriter.
5362 KVM COLO
5364 primary:
5365 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
5366 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
5367 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
5368 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
5369 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
5370 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
5371 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
5372 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
5373 -object iothread,id=iothread1
5374 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
5375 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
5376 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
5377 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
5379 secondary:
5380 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
5381 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
5382 -chardev socket,id=red0,host=3.3.3.3,port=9003
5383 -chardev socket,id=red1,host=3.3.3.3,port=9004
5384 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
5385 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
5388 Xen COLO
5390 primary:
5391 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
5392 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
5393 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
5394 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
5395 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
5396 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
5397 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
5398 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
5399 -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off
5400 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
5401 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
5402 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
5403 -object iothread,id=iothread1
5404 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
5406 secondary:
5407 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
5408 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
5409 -chardev socket,id=red0,host=3.3.3.3,port=9003
5410 -chardev socket,id=red1,host=3.3.3.3,port=9004
5411 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
5412 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
5414 If you want to know the detail of above command line, you can
5415 read the colo-compare git log.
5417 ``-object cryptodev-backend-builtin,id=id[,queues=queues]``
5418 Creates a cryptodev backend which executes crypto operations from
5419 the QEMU cipher APIs. The id parameter is a unique ID that will
5420 be used to reference this cryptodev backend from the
5421 ``virtio-crypto`` device. The queues parameter is optional,
5422 which specify the queue number of cryptodev backend, the default
5423 of queues is 1.
5425 .. parsed-literal::
5427 # |qemu_system| \\
5428 [...] \\
5429 -object cryptodev-backend-builtin,id=cryptodev0 \\
5430 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\
5431 [...]
5433 ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]``
5434 Creates a vhost-user cryptodev backend, backed by a chardev
5435 chardevid. The id parameter is a unique ID that will be used to
5436 reference this cryptodev backend from the ``virtio-crypto``
5437 device. The chardev should be a unix domain socket backed one.
5438 The vhost-user uses a specifically defined protocol to pass
5439 vhost ioctl replacement messages to an application on the other
5440 end of the socket. The queues parameter is optional, which
5441 specify the queue number of cryptodev backend for multiqueue
5442 vhost-user, the default of queues is 1.
5444 .. parsed-literal::
5446 # |qemu_system| \\
5447 [...] \\
5448 -chardev socket,id=chardev0,path=/path/to/socket \\
5449 -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \\
5450 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\
5451 [...]
5453 ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]``
5455 ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]``
5456 Defines a secret to store a password, encryption key, or some
5457 other sensitive data. The sensitive data can either be passed
5458 directly via the data parameter, or indirectly via the file
5459 parameter. Using the data parameter is insecure unless the
5460 sensitive data is encrypted.
5462 The sensitive data can be provided in raw format (the default),
5463 or base64. When encoded as JSON, the raw format only supports
5464 valid UTF-8 characters, so base64 is recommended for sending
5465 binary data. QEMU will convert from which ever format is
5466 provided to the format it needs internally. eg, an RBD password
5467 can be provided in raw format, even though it will be base64
5468 encoded when passed onto the RBD sever.
5470 For added protection, it is possible to encrypt the data
5471 associated with a secret using the AES-256-CBC cipher. Use of
5472 encryption is indicated by providing the keyid and iv
5473 parameters. The keyid parameter provides the ID of a previously
5474 defined secret that contains the AES-256 decryption key. This
5475 key should be 32-bytes long and be base64 encoded. The iv
5476 parameter provides the random initialization vector used for
5477 encryption of this particular secret and should be a base64
5478 encrypted string of the 16-byte IV.
5480 The simplest (insecure) usage is to provide the secret inline
5482 .. parsed-literal::
5484 # |qemu_system| -object secret,id=sec0,data=letmein,format=raw
5486 The simplest secure usage is to provide the secret via a file
5488 # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object
5489 secret,id=sec0,file=mypasswd.txt,format=raw
5491 For greater security, AES-256-CBC should be used. To illustrate
5492 usage, consider the openssl command line tool which can encrypt
5493 the data. Note that when encrypting, the plaintext must be
5494 padded to the cipher block size (32 bytes) using the standard
5495 PKCS#5/6 compatible padding algorithm.
5497 First a master key needs to be created in base64 encoding:
5501 # openssl rand -base64 32 > key.b64
5502 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
5504 Each secret to be encrypted needs to have a random
5505 initialization vector generated. These do not need to be kept
5506 secret
5510 # openssl rand -base64 16 > iv.b64
5511 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
5513 The secret to be defined can now be encrypted, in this case
5514 we're telling openssl to base64 encode the result, but it could
5515 be left as raw bytes if desired.
5519 # SECRET=$(printf "letmein" |
5520 openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
5522 When launching QEMU, create a master secret pointing to
5523 ``key.b64`` and specify that to be used to decrypt the user
5524 password. Pass the contents of ``iv.b64`` to the second secret
5526 .. parsed-literal::
5528 # |qemu_system| \\
5529 -object secret,id=secmaster0,format=base64,file=key.b64 \\
5530 -object secret,id=sec0,keyid=secmaster0,format=base64,\\
5531 data=$SECRET,iv=$(<iv.b64)
5533 ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file,kernel-hashes=on|off]``
5534 Create a Secure Encrypted Virtualization (SEV) guest object,
5535 which can be used to provide the guest memory encryption support
5536 on AMD processors.
5538 When memory encryption is enabled, one of the physical address
5539 bit (aka the C-bit) is utilized to mark if a memory page is
5540 protected. The ``cbitpos`` is used to provide the C-bit
5541 position. The C-bit position is Host family dependent hence user
5542 must provide this value. On EPYC, the value should be 47.
5544 When memory encryption is enabled, we loose certain bits in
5545 physical address space. The ``reduced-phys-bits`` is used to
5546 provide the number of bits we loose in physical address space.
5547 Similar to C-bit, the value is Host family dependent. On EPYC,
5548 a guest will lose a maximum of 1 bit, so the value should be 1.
5550 The ``sev-device`` provides the device file to use for
5551 communicating with the SEV firmware running inside AMD Secure
5552 Processor. The default device is '/dev/sev'. If hardware
5553 supports memory encryption then /dev/sev devices are created by
5554 CCP driver.
5556 The ``policy`` provides the guest policy to be enforced by the
5557 SEV firmware and restrict what configuration and operational
5558 commands can be performed on this guest by the hypervisor. The
5559 policy should be provided by the guest owner and is bound to the
5560 guest and cannot be changed throughout the lifetime of the
5561 guest. The default is 0.
5563 If guest ``policy`` allows sharing the key with another SEV
5564 guest then ``handle`` can be use to provide handle of the guest
5565 from which to share the key.
5567 The ``dh-cert-file`` and ``session-file`` provides the guest
5568 owner's Public Diffie-Hillman key defined in SEV spec. The PDH
5569 and session parameters are used for establishing a cryptographic
5570 session with the guest owner to negotiate keys used for
5571 attestation. The file must be encoded in base64.
5573 The ``kernel-hashes`` adds the hashes of given kernel/initrd/
5574 cmdline to a designated guest firmware page for measured Linux
5575 boot with -kernel. The default is off. (Since 6.2)
5577 e.g to launch a SEV guest
5579 .. parsed-literal::
5581 # |qemu_system_x86| \\
5582 ...... \\
5583 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \\
5584 -machine ...,memory-encryption=sev0 \\
5585 .....
5587 ``-object authz-simple,id=id,identity=string``
5588 Create an authorization object that will control access to
5589 network services.
5591 The ``identity`` parameter is identifies the user and its format
5592 depends on the network service that authorization object is
5593 associated with. For authorizing based on TLS x509 certificates,
5594 the identity must be the x509 distinguished name. Note that care
5595 must be taken to escape any commas in the distinguished name.
5597 An example authorization object to validate a x509 distinguished
5598 name would look like:
5600 .. parsed-literal::
5602 # |qemu_system| \\
5603 ... \\
5604 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \\
5607 Note the use of quotes due to the x509 distinguished name
5608 containing whitespace, and escaping of ','.
5610 ``-object authz-listfile,id=id,filename=path,refresh=on|off``
5611 Create an authorization object that will control access to
5612 network services.
5614 The ``filename`` parameter is the fully qualified path to a file
5615 containing the access control list rules in JSON format.
5617 An example set of rules that match against SASL usernames might
5618 look like:
5623 "rules": [
5624 { "match": "fred", "policy": "allow", "format": "exact" },
5625 { "match": "bob", "policy": "allow", "format": "exact" },
5626 { "match": "danb", "policy": "deny", "format": "glob" },
5627 { "match": "dan*", "policy": "allow", "format": "exact" },
5629 "policy": "deny"
5632 When checking access the object will iterate over all the rules
5633 and the first rule to match will have its ``policy`` value
5634 returned as the result. If no rules match, then the default
5635 ``policy`` value is returned.
5637 The rules can either be an exact string match, or they can use
5638 the simple UNIX glob pattern matching to allow wildcards to be
5639 used.
5641 If ``refresh`` is set to true the file will be monitored and
5642 automatically reloaded whenever its content changes.
5644 As with the ``authz-simple`` object, the format of the identity
5645 strings being matched depends on the network service, but is
5646 usually a TLS x509 distinguished name, or a SASL username.
5648 An example authorization object to validate a SASL username
5649 would look like:
5651 .. parsed-literal::
5653 # |qemu_system| \\
5654 ... \\
5655 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=on \\
5658 ``-object authz-pam,id=id,service=string``
5659 Create an authorization object that will control access to
5660 network services.
5662 The ``service`` parameter provides the name of a PAM service to
5663 use for authorization. It requires that a file
5664 ``/etc/pam.d/service`` exist to provide the configuration for
5665 the ``account`` subsystem.
5667 An example authorization object to validate a TLS x509
5668 distinguished name would look like:
5670 .. parsed-literal::
5672 # |qemu_system| \\
5673 ... \\
5674 -object authz-pam,id=auth0,service=qemu-vnc \\
5677 There would then be a corresponding config file for PAM at
5678 ``/etc/pam.d/qemu-vnc`` that contains:
5682 account requisite pam_listfile.so item=user sense=allow \
5683 file=/etc/qemu/vnc.allow
5685 Finally the ``/etc/qemu/vnc.allow`` file would contain the list
5686 of x509 distinguished names that are permitted access
5690 CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
5692 ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink,aio-max-batch=aio-max-batch``
5693 Creates a dedicated event loop thread that devices can be
5694 assigned to. This is known as an IOThread. By default device
5695 emulation happens in vCPU threads or the main event loop thread.
5696 This can become a scalability bottleneck. IOThreads allow device
5697 emulation and I/O to run on other host CPUs.
5699 The ``id`` parameter is a unique ID that will be used to
5700 reference this IOThread from ``-device ...,iothread=id``.
5701 Multiple devices can be assigned to an IOThread. Note that not
5702 all devices support an ``iothread`` parameter.
5704 The ``query-iothreads`` QMP command lists IOThreads and reports
5705 their thread IDs so that the user can configure host CPU
5706 pinning/affinity.
5708 IOThreads use an adaptive polling algorithm to reduce event loop
5709 latency. Instead of entering a blocking system call to monitor
5710 file descriptors and then pay the cost of being woken up when an
5711 event occurs, the polling algorithm spins waiting for events for
5712 a short time. The algorithm's default parameters are suitable
5713 for many cases but can be adjusted based on knowledge of the
5714 workload and/or host device latency.
5716 The ``poll-max-ns`` parameter is the maximum number of
5717 nanoseconds to busy wait for events. Polling can be disabled by
5718 setting this value to 0.
5720 The ``poll-grow`` parameter is the multiplier used to increase
5721 the polling time when the algorithm detects it is missing events
5722 due to not polling long enough.
5724 The ``poll-shrink`` parameter is the divisor used to decrease
5725 the polling time when the algorithm detects it is spending too
5726 long polling without encountering events.
5728 The ``aio-max-batch`` parameter is the maximum number of requests
5729 in a batch for the AIO engine, 0 means that the engine will use
5730 its default.
5732 The IOThread parameters can be modified at run-time using the
5733 ``qom-set`` command (where ``iothread1`` is the IOThread's
5734 ``id``):
5738 (qemu) qom-set /objects/iothread1 poll-max-ns 100000
5739 ERST
5742 HXCOMM This is the last statement. Insert new options before this line!
5744 #undef DEF
5745 #undef DEFHEADING
5746 #undef ARCHHEADING