1 HXCOMM Use DEFHEADING() to define headings in both help text and texi
2 HXCOMM Text between STEXI and ETEXI are copied to texi 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
7 HXCOMM HXCOMM can be used for comments, discarded from both texi and C
9 DEFHEADING(Standard options:)
14 DEF("help", 0, QEMU_OPTION_h,
15 "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
26 DEF("version", 0, QEMU_OPTION_version,
27 "-version display version information and exit\n", QEMU_ARCH_ALL)
31 Display version information and exit
35 Display version information and exit
38 DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
39 "-machine [type=]name[,prop[=value][,...]]\n"
40 " selects emulated machine ('-machine help' for list)\n"
41 " property accel=accel1[:accel2[:...]] selects accelerator\n"
42 " supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n"
43 " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
44 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
45 " mem-merge=on|off controls memory merge support (default: on)\n"
46 " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
47 " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
48 " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
49 " nvdimm=on|off controls NVDIMM support (default=off)\n"
50 " enforce-config-section=on|off enforce configuration section migration (default=off)\n"
51 " memory-encryption=@var{} memory encryption object to use (default=none)\n"
52 " hmat=on|off controls ACPI HMAT support (default=off)\n",
55 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
57 Select the emulated machine by @var{name}. Use @code{-machine help} to list
60 For architectures which aim to support live migration compatibility
61 across releases, each release will introduce a new versioned machine
62 type. For example, the 2.8.0 release introduced machine types
63 ``pc-i440fx-2.8'' and ``pc-q35-2.8'' for the x86_64/i686 architectures.
65 To allow live migration of guests from QEMU version 2.8.0, to QEMU
66 version 2.9.0, the 2.9.0 version must support the ``pc-i440fx-2.8''
67 and ``pc-q35-2.8'' machines too. To allow users live migrating VMs
68 to skip multiple intermediate releases when upgrading, new releases
69 of QEMU will support machine types from many previous versions.
71 Supported machine properties are:
73 @item accel=@var{accels1}[:@var{accels2}[:...]]
74 This is used to enable an accelerator. Depending on the target architecture,
75 kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
76 more than one accelerator specified, the next one is used if the previous one
78 @item vmport=on|off|auto
79 Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
80 value based on accel. For accel=xen the default is off otherwise the default
82 @item dump-guest-core=on|off
83 Include guest memory in a core dump. The default is on.
84 @item mem-merge=on|off
85 Enables or disables memory merge support. This feature, when supported by
86 the host, de-duplicates identical memory pages among VMs instances
88 @item aes-key-wrap=on|off
89 Enables or disables AES key wrapping support on s390-ccw hosts. This feature
90 controls whether AES wrapping keys will be created to allow
91 execution of AES cryptographic functions. The default is on.
92 @item dea-key-wrap=on|off
93 Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
94 controls whether DEA wrapping keys will be created to allow
95 execution of DEA cryptographic functions. The default is on.
97 Enables or disables NVDIMM support. The default is off.
98 @item enforce-config-section=on|off
99 If @option{enforce-config-section} is set to @var{on}, force migration
100 code to send configuration section even if the machine-type sets the
101 @option{migration.send-configuration} property to @var{off}.
102 NOTE: this parameter is deprecated. Please use @option{-global}
103 @option{migration.send-configuration}=@var{on|off} instead.
104 @item memory-encryption=@var{}
105 Memory encryption object to use. The default is none.
107 Enables or disables ACPI Heterogeneous Memory Attribute Table (HMAT) support.
112 ``-machine [type=]name[,prop=value[,...]]``
113 Select the emulated machine by name. Use ``-machine help`` to list
116 For architectures which aim to support live migration compatibility
117 across releases, each release will introduce a new versioned machine
118 type. For example, the 2.8.0 release introduced machine types
119 "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures.
121 To allow live migration of guests from QEMU version 2.8.0, to QEMU
122 version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8"
123 and "pc-q35-2.8" machines too. To allow users live migrating VMs to
124 skip multiple intermediate releases when upgrading, new releases of
125 QEMU will support machine types from many previous versions.
127 Supported machine properties are:
129 ``accel=accels1[:accels2[:...]]``
130 This is used to enable an accelerator. Depending on the target
131 architecture, kvm, xen, hax, hvf, whpx or tcg can be available.
132 By default, tcg is used. If there is more than one accelerator
133 specified, the next one is used if the previous one fails to
136 ``vmport=on|off|auto``
137 Enables emulation of VMWare IO port, for vmmouse etc. auto says
138 to select the value based on accel. For accel=xen the default is
139 off otherwise the default is on.
141 ``dump-guest-core=on|off``
142 Include guest memory in a core dump. The default is on.
145 Enables or disables memory merge support. This feature, when
146 supported by the host, de-duplicates identical memory pages
147 among VMs instances (enabled by default).
149 ``aes-key-wrap=on|off``
150 Enables or disables AES key wrapping support on s390-ccw hosts.
151 This feature controls whether AES wrapping keys will be created
152 to allow execution of AES cryptographic functions. The default
155 ``dea-key-wrap=on|off``
156 Enables or disables DEA key wrapping support on s390-ccw hosts.
157 This feature controls whether DEA wrapping keys will be created
158 to allow execution of DEA cryptographic functions. The default
162 Enables or disables NVDIMM support. The default is off.
164 ``enforce-config-section=on|off``
165 If ``enforce-config-section`` is set to on, force migration code
166 to send configuration section even if the machine-type sets the
167 ``migration.send-configuration`` property to off. NOTE: this
168 parameter is deprecated. Please use ``-global``
169 ``migration.send-configuration``\ =on\|off instead.
171 ``memory-encryption=``
172 Memory encryption object to use. The default is none.
175 Enables or disables ACPI Heterogeneous Memory Attribute Table
176 (HMAT) support. The default is off.
179 HXCOMM Deprecated by -machine
180 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
182 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
183 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
185 @item -cpu @var{model}
187 Select CPU model (@code{-cpu help} for list and additional feature selection)
191 Select CPU model (``-cpu help`` for list and additional feature
195 DEF("accel", HAS_ARG, QEMU_OPTION_accel,
196 "-accel [accel=]accelerator[,prop[=value][,...]]\n"
197 " select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
198 " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
199 " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
200 " kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
201 " tb-size=n (TCG translation block cache size)\n"
202 " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
204 @item -accel @var{name}[,prop=@var{value}[,...]]
206 This is used to enable an accelerator. Depending on the target architecture,
207 kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
208 more than one accelerator specified, the next one is used if the previous one
211 @item igd-passthru=on|off
212 When Xen is in use, this option controls whether Intel integrated graphics
213 devices can be passed through to the guest (default=off)
214 @item kernel-irqchip=on|off|split
215 Controls KVM in-kernel irqchip support. The default is full acceleration of the
216 interrupt controllers. On x86, split irqchip reduces the kernel attack
217 surface, at a performance cost for non-MSI interrupts. Disabling the in-kernel
218 irqchip completely is not recommended except for debugging purposes.
219 @item kvm-shadow-mem=size
220 Defines the size of the KVM shadow MMU.
221 @item tb-size=@var{n}
222 Controls the size (in MiB) of the TCG translation block cache.
223 @item thread=single|multi
224 Controls number of TCG threads. When the TCG is multi-threaded there will be one
225 thread per vCPU therefor taking advantage of additional host cores. The default
226 is to enable multi-threading where both the back-end and front-ends support it and
227 no incompatible TCG features have been enabled (e.g. icount/replay).
231 ``-accel name[,prop=value[,...]]``
232 This is used to enable an accelerator. Depending on the target
233 architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By
234 default, tcg is used. If there is more than one accelerator
235 specified, the next one is used if the previous one fails to
238 ``igd-passthru=on|off``
239 When Xen is in use, this option controls whether Intel
240 integrated graphics devices can be passed through to the guest
243 ``kernel-irqchip=on|off|split``
244 Controls KVM in-kernel irqchip support. The default is full
245 acceleration of the interrupt controllers. On x86, split irqchip
246 reduces the kernel attack surface, at a performance cost for
247 non-MSI interrupts. Disabling the in-kernel irqchip completely
248 is not recommended except for debugging purposes.
250 ``kvm-shadow-mem=size``
251 Defines the size of the KVM shadow MMU.
254 Controls the size (in MiB) of the TCG translation block cache.
256 ``thread=single|multi``
257 Controls number of TCG threads. When the TCG is multi-threaded
258 there will be one thread per vCPU therefor taking advantage of
259 additional host cores. The default is to enable multi-threading
260 where both the back-end and front-ends support it and no
261 incompatible TCG features have been enabled (e.g.
265 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
266 "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,dies=dies][,sockets=sockets]\n"
267 " set the number of CPUs to 'n' [default=1]\n"
268 " maxcpus= maximum number of total cpus, including\n"
269 " offline CPUs for hotplug, etc\n"
270 " cores= number of CPU cores on one socket (for PC, it's on one die)\n"
271 " threads= number of threads on one CPU core\n"
272 " dies= number of CPU dies on one socket (for PC only)\n"
273 " sockets= number of discrete sockets in the system\n",
276 @item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,dies=dies][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
278 Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
279 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
281 For the PC target, the number of @var{cores} per die, the number of @var{threads}
282 per cores, the number of @var{dies} per packages and the total number of
283 @var{sockets} can be specified. Missing values will be computed.
284 If any on the three values is given, the total number of CPUs @var{n} can be omitted.
285 @var{maxcpus} specifies the maximum number of hotpluggable CPUs.
288 ``-smp [cpus=]n[,cores=cores][,threads=threads][,dies=dies][,sockets=sockets][,maxcpus=maxcpus]``
289 Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
290 are supported. On Sparc32 target, Linux limits the number of usable
291 CPUs to 4. For the PC target, the number of cores per die, the
292 number of threads per cores, the number of dies per packages and the
293 total number of sockets can be specified. Missing values will be
294 computed. If any on the three values is given, the total number of
295 CPUs n can be omitted. maxcpus specifies the maximum number of
299 DEF("numa", HAS_ARG, QEMU_OPTION_numa,
300 "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
301 "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
302 "-numa dist,src=source,dst=destination,val=distance\n"
303 "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n"
304 "-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"
305 "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n",
308 @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}]
309 @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}]
310 @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance}
311 @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}]
312 @itemx -numa hmat-lb,initiator=@var{node},target=@var{node},hierarchy=@var{hierarchy},data-type=@var{tpye}[,latency=@var{lat}][,bandwidth=@var{bw}]
313 @itemx -numa hmat-cache,node-id=@var{node},size=@var{size},level=@var{level}[,associativity=@var{str}][,policy=@var{str}][,line=@var{size}]
315 Define a NUMA node and assign RAM and VCPUs to it.
316 Set the NUMA distance from a source node to a destination node.
317 Set the ACPI Heterogeneous Memory Attributes for the given nodes.
319 Legacy VCPU assignment uses @samp{cpus} option where
320 @var{firstcpu} and @var{lastcpu} are CPU indexes. Each
321 @samp{cpus} option represent a contiguous range of CPU indexes
322 (or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
323 set of VCPUs can be represented by providing multiple @samp{cpus}
324 options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
327 For example, the following option assigns VCPUs 0, 1, 2 and 5 to
330 -numa node,cpus=0-2,cpus=5
333 @samp{cpu} option is a new alternative to @samp{cpus} option
334 which uses @samp{socket-id|core-id|thread-id} properties to assign
335 CPU objects to a @var{node} using topology layout properties of CPU.
336 The set of properties is machine specific, and depends on used
337 machine type/@samp{smp} options. It could be queried with
338 @samp{hotpluggable-cpus} monitor command.
339 @samp{node-id} property specifies @var{node} to which CPU object
340 will be assigned, it's required for @var{node} to be declared
341 with @samp{node} option before it's used with @samp{cpu} option.
346 -smp 1,sockets=2,maxcpus=2 \
347 -numa node,nodeid=0 -numa node,nodeid=1 \
348 -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
351 @samp{mem} assigns a given RAM amount to a node. @samp{memdev}
352 assigns RAM from a given memory backend device to a node. If
353 @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
354 split equally between them.
356 @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
357 if one node uses @samp{memdev}, all of them have to use it.
359 @samp{initiator} is an additional option that points to an @var{initiator}
360 NUMA node that has best performance (the lowest latency or largest bandwidth)
361 to this NUMA @var{node}. Note that this option can be set only when
362 the machine property 'hmat' is set to 'on'.
364 Following example creates a machine with 2 NUMA nodes, node 0 has CPU.
365 node 1 has only memory, and its initiator is node 0. Note that because
366 node 0 has CPU, by default the initiator of node 0 is itself and must be
370 -m 2G,slots=2,maxmem=4G \
371 -object memory-backend-ram,size=1G,id=m0 \
372 -object memory-backend-ram,size=1G,id=m1 \
373 -numa node,nodeid=0,memdev=m0 \
374 -numa node,nodeid=1,memdev=m1,initiator=0 \
375 -smp 2,sockets=2,maxcpus=2 \
376 -numa cpu,node-id=0,socket-id=0 \
377 -numa cpu,node-id=0,socket-id=1
380 @var{source} and @var{destination} are NUMA node IDs.
381 @var{distance} is the NUMA distance from @var{source} to @var{destination}.
382 The distance from a node to itself is always 10. If any pair of nodes is
383 given a distance, then all pairs must be given distances. Although, when
384 distances are only given in one direction for each pair of nodes, then
385 the distances in the opposite directions are assumed to be the same. If,
386 however, an asymmetrical pair of distances is given for even one node
387 pair, then all node pairs must be provided distance values for both
388 directions, even when they are symmetrical. When a node is unreachable
389 from another node, set the pair's distance to 255.
391 Note that the -@option{numa} option doesn't allocate any of the
392 specified resources, it just assigns existing resources to NUMA
393 nodes. This means that one still has to use the @option{-m},
394 @option{-smp} options to allocate RAM and VCPUs respectively.
396 Use @samp{hmat-lb} to set System Locality Latency and Bandwidth Information
397 between initiator and target NUMA nodes in ACPI Heterogeneous Attribute Memory Table (HMAT).
398 Initiator NUMA node can create memory requests, usually it has one or more processors.
399 Target NUMA node contains addressable memory.
401 In @samp{hmat-lb} option, @var{node} are NUMA node IDs. @var{hierarchy} is the memory
402 hierarchy of the target NUMA node: if @var{hierarchy} is 'memory', the structure
403 represents the memory performance; if @var{hierarchy} is 'first-level|second-level|third-level',
404 this structure represents aggregated performance of memory side caches for each domain.
405 @var{type} of 'data-type' is type of data represented by this structure instance:
406 if 'hierarchy' is 'memory', 'data-type' is 'access|read|write' latency or 'access|read|write'
407 bandwidth of the target memory; if 'hierarchy' is 'first-level|second-level|third-level',
408 'data-type' is 'access|read|write' hit latency or 'access|read|write' hit bandwidth of the
409 target memory side cache.
411 @var{lat} is latency value in nanoseconds. @var{bw} is bandwidth value,
412 the possible value and units are NUM[M|G|T], mean that the bandwidth value are
413 NUM byte per second (or MB/s, GB/s or TB/s depending on used suffix).
414 Note that if latency or bandwidth value is 0, means the corresponding latency or
415 bandwidth information is not provided.
417 In @samp{hmat-cache} option, @var{node-id} is the NUMA-id of the memory belongs.
418 @var{size} is the size of memory side cache in bytes. @var{level} is the cache
419 level described in this structure, note that the cache level 0 should not be used
420 with @samp{hmat-cache} option. @var{associativity} is the cache associativity,
421 the possible value is 'none/direct(direct-mapped)/complex(complex cache indexing)'.
422 @var{policy} is the write policy. @var{line} is the cache Line size in bytes.
424 For example, the following options describe 2 NUMA nodes. Node 0 has 2 cpus and
425 a ram, node 1 has only a ram. The processors in node 0 access memory in node
426 0 with access-latency 5 nanoseconds, access-bandwidth is 200 MB/s;
427 The processors in NUMA node 0 access memory in NUMA node 1 with access-latency 10
428 nanoseconds, access-bandwidth is 100 MB/s.
429 And for memory side cache information, NUMA node 0 and 1 both have 1 level memory
430 cache, size is 10KB, policy is write-back, the cache Line size is 8 bytes:
434 -object memory-backend-ram,size=1G,id=m0 \
435 -object memory-backend-ram,size=1G,id=m1 \
437 -numa node,nodeid=0,memdev=m0 \
438 -numa node,nodeid=1,memdev=m1,initiator=0 \
439 -numa cpu,node-id=0,socket-id=0 \
440 -numa cpu,node-id=0,socket-id=1 \
441 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
442 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
443 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
444 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
445 -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
446 -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
451 ``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``; \ ``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``; \ ``-numa dist,src=source,dst=destination,val=distance``; \ ``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``; \ ``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]``; \ ``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
452 Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
453 distance from a source node to a destination node. Set the ACPI
454 Heterogeneous Memory Attributes for the given nodes.
456 Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and
457 lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a
458 contiguous range of CPU indexes (or a single VCPU if lastcpu is
459 omitted). A non-contiguous set of VCPUs can be represented by
460 providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is
461 omitted on all nodes, VCPUs are automatically split between them.
463 For example, the following option assigns VCPUs 0, 1, 2 and 5 to a
468 -numa node,cpus=0-2,cpus=5
470 '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option
471 which uses '\ ``socket-id|core-id|thread-id``\ ' properties to
472 assign CPU objects to a node using topology layout properties of
473 CPU. The set of properties is machine specific, and depends on used
474 machine type/'\ ``smp``\ ' options. It could be queried with
475 '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ '
476 property specifies node to which CPU object will be assigned, it's
477 required for node to be declared with '\ ``node``\ ' option before
478 it's used with '\ ``cpu``\ ' option.
485 -smp 1,sockets=2,maxcpus=2 \
486 -numa node,nodeid=0 -numa node,nodeid=1 \
487 -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
489 '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
490 assigns RAM from a given memory backend device to a node. If
491 '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
492 split equally between them.
494 '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
495 Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
498 '\ ``initiator``\ ' is an additional option that points to an
499 initiator NUMA node that has best performance (the lowest latency or
500 largest bandwidth) to this NUMA node. Note that this option can be
501 set only when the machine property 'hmat' is set to 'on'.
503 Following example creates a machine with 2 NUMA nodes, node 0 has
504 CPU. node 1 has only memory, and its initiator is node 0. Note that
505 because node 0 has CPU, by default the initiator of node 0 is itself
511 -m 2G,slots=2,maxmem=4G \
512 -object memory-backend-ram,size=1G,id=m0 \
513 -object memory-backend-ram,size=1G,id=m1 \
514 -numa node,nodeid=0,memdev=m0 \
515 -numa node,nodeid=1,memdev=m1,initiator=0 \
516 -smp 2,sockets=2,maxcpus=2 \
517 -numa cpu,node-id=0,socket-id=0 \
518 -numa cpu,node-id=0,socket-id=1
520 source and destination are NUMA node IDs. distance is the NUMA
521 distance from source to destination. The distance from a node to
522 itself is always 10. If any pair of nodes is given a distance, then
523 all pairs must be given distances. Although, when distances are only
524 given in one direction for each pair of nodes, then the distances in
525 the opposite directions are assumed to be the same. If, however, an
526 asymmetrical pair of distances is given for even one node pair, then
527 all node pairs must be provided distance values for both directions,
528 even when they are symmetrical. When a node is unreachable from
529 another node, set the pair's distance to 255.
531 Note that the -``numa`` option doesn't allocate any of the specified
532 resources, it just assigns existing resources to NUMA nodes. This
533 means that one still has to use the ``-m``, ``-smp`` options to
534 allocate RAM and VCPUs respectively.
536 Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth
537 Information between initiator and target NUMA nodes in ACPI
538 Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can
539 create memory requests, usually it has one or more processors.
540 Target NUMA node contains addressable memory.
542 In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is
543 the memory hierarchy of the target NUMA node: if hierarchy is
544 'memory', the structure represents the memory performance; if
545 hierarchy is 'first-level\|second-level\|third-level', this
546 structure represents aggregated performance of memory side caches
547 for each domain. type of 'data-type' is type of data represented by
548 this structure instance: if 'hierarchy' is 'memory', 'data-type' is
549 'access\|read\|write' latency or 'access\|read\|write' bandwidth of
550 the target memory; if 'hierarchy' is
551 'first-level\|second-level\|third-level', 'data-type' is
552 'access\|read\|write' hit latency or 'access\|read\|write' hit
553 bandwidth of the target memory side cache.
555 lat is latency value in nanoseconds. bw is bandwidth value, the
556 possible value and units are NUM[M\|G\|T], mean that the bandwidth
557 value are NUM byte per second (or MB/s, GB/s or TB/s depending on
558 used suffix). Note that if latency or bandwidth value is 0, means
559 the corresponding latency or bandwidth information is not provided.
561 In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory
562 belongs. size is the size of memory side cache in bytes. level is
563 the cache level described in this structure, note that the cache
564 level 0 should not be used with '\ ``hmat-cache``\ ' option.
565 associativity is the cache associativity, the possible value is
566 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy
567 is the write policy. line is the cache Line size in bytes.
569 For example, the following options describe 2 NUMA nodes. Node 0 has
570 2 cpus and a ram, node 1 has only a ram. The processors in node 0
571 access memory in node 0 with access-latency 5 nanoseconds,
572 access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
573 memory in NUMA node 1 with access-latency 10 nanoseconds,
574 access-bandwidth is 100 MB/s. And for memory side cache information,
575 NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
576 policy is write-back, the cache Line size is 8 bytes:
582 -object memory-backend-ram,size=1G,id=m0 \
583 -object memory-backend-ram,size=1G,id=m1 \
585 -numa node,nodeid=0,memdev=m0 \
586 -numa node,nodeid=1,memdev=m1,initiator=0 \
587 -numa cpu,node-id=0,socket-id=0 \
588 -numa cpu,node-id=0,socket-id=1 \
589 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
590 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
591 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
592 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
593 -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
594 -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
597 DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
598 "-add-fd fd=fd,set=set[,opaque=opaque]\n"
599 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
601 @item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
604 Add a file descriptor to an fd set. Valid options are:
608 This option defines the file descriptor of which a duplicate is added to fd set.
609 The file descriptor cannot be stdin, stdout, or stderr.
611 This option defines the ID of the fd set to add the file descriptor to.
612 @item opaque=@var{opaque}
613 This option defines a free-form string that can be used to describe @var{fd}.
616 You can open an image using pre-opened file descriptors from an fd set:
618 @value{qemu_system} \
619 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
620 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
621 -drive file=/dev/fdset/2,index=0,media=disk
625 ``-add-fd fd=fd,set=set[,opaque=opaque]``
626 Add a file descriptor to an fd set. Valid options are:
629 This option defines the file descriptor of which a duplicate is
630 added to fd set. The file descriptor cannot be stdin, stdout, or
634 This option defines the ID of the fd set to add the file
638 This option defines a free-form string that can be used to
641 You can open an image using pre-opened file descriptors from an fd
647 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
648 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
649 -drive file=/dev/fdset/2,index=0,media=disk
652 DEF("set", HAS_ARG, QEMU_OPTION_set,
653 "-set group.id.arg=value\n"
654 " set <arg> parameter for item <id> of type <group>\n"
655 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
657 @item -set @var{group}.@var{id}.@var{arg}=@var{value}
659 Set parameter @var{arg} for item @var{id} of type @var{group}
662 ``-set group.id.arg=value``
663 Set parameter arg for item id of type group
666 DEF("global", HAS_ARG, QEMU_OPTION_global,
667 "-global driver.property=value\n"
668 "-global driver=driver,property=property,value=value\n"
669 " set a global default for a driver property\n",
672 @item -global @var{driver}.@var{prop}=@var{value}
673 @itemx -global driver=@var{driver},property=@var{property},value=@var{value}
675 Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
678 @value{qemu_system_x86} -global ide-hd.physical_block_size=4096 disk-image.img
681 In particular, you can use this to set driver properties for devices which are
682 created automatically by the machine model. To create a device which is not
683 created automatically and set properties on it, use -@option{device}.
685 -global @var{driver}.@var{prop}=@var{value} is shorthand for -global
686 driver=@var{driver},property=@var{prop},value=@var{value}. The
687 longhand syntax works even when @var{driver} contains a dot.
690 ``-global driver.prop=value``; \ ``-global driver=driver,property=property,value=value``
691 Set default value of driver's property prop to value, e.g.:
695 |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img
697 In particular, you can use this to set driver properties for devices
698 which are created automatically by the machine model. To create a
699 device which is not created automatically and set properties on it,
702 -global driver.prop=value is shorthand for -global
703 driver=driver,property=prop,value=value. The longhand syntax works
704 even when driver contains a dot.
707 DEF("boot", HAS_ARG, QEMU_OPTION_boot,
708 "-boot [order=drives][,once=drives][,menu=on|off]\n"
709 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
710 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
711 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
712 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
713 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
716 @item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off]
718 Specify boot order @var{drives} as a string of drive letters. Valid
719 drive letters depend on the target architecture. The x86 PC uses: a, b
720 (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
721 from network adapter 1-4), hard disk boot is the default. To apply a
722 particular boot order only on the first startup, specify it via
723 @option{once}. Note that the @option{order} or @option{once} parameter
724 should not be used together with the @option{bootindex} property of
725 devices, since the firmware implementations normally do not support both
728 Interactive boot menus/prompts can be enabled via @option{menu=on} as far
729 as firmware/BIOS supports them. The default is non-interactive boot.
731 A splash picture could be passed to bios, enabling user to show it as logo,
732 when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
733 supports them. Currently Seabios for X86 system support it.
734 limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
735 format(true color). The resolution should be supported by the SVGA mode, so
736 the recommended is 320x240, 640x480, 800x640.
738 A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
739 when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
740 reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
743 Do strict boot via @option{strict=on} as far as firmware/BIOS
744 supports it. This only effects when boot priority is changed by
745 bootindex options. The default is non-strict boot.
748 # try to boot from network first, then from hard disk
749 @value{qemu_system_x86} -boot order=nc
750 # boot from CD-ROM first, switch back to default order after reboot
751 @value{qemu_system_x86} -boot once=d
752 # boot with a splash picture for 5 seconds.
753 @value{qemu_system_x86} -boot menu=on,splash=/root/boot.bmp,splash-time=5000
756 Note: The legacy format '-boot @var{drives}' is still supported but its
757 use is discouraged as it may be removed from future versions.
760 ``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]``
761 Specify boot order drives as a string of drive letters. Valid drive
762 letters depend on the target architecture. The x86 PC uses: a, b
763 (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p
764 (Etherboot from network adapter 1-4), hard disk boot is the default.
765 To apply a particular boot order only on the first startup, specify
766 it via ``once``. Note that the ``order`` or ``once`` parameter
767 should not be used together with the ``bootindex`` property of
768 devices, since the firmware implementations normally do not support
769 both at the same time.
771 Interactive boot menus/prompts can be enabled via ``menu=on`` as far
772 as firmware/BIOS supports them. The default is non-interactive boot.
774 A splash picture could be passed to bios, enabling user to show it
775 as logo, when option splash=sp\_name is given and menu=on, If
776 firmware/BIOS supports them. Currently Seabios for X86 system
777 support it. limitation: The splash file could be a jpeg file or a
778 BMP file in 24 BPP format(true color). The resolution should be
779 supported by the SVGA mode, so the recommended is 320x240, 640x480,
782 A timeout could be passed to bios, guest will pause for rb\_timeout
783 ms when boot failed, then reboot. If rb\_timeout is '-1', guest will
784 not reboot, qemu passes '-1' to bios by default. Currently Seabios
785 for X86 system support it.
787 Do strict boot via ``strict=on`` as far as firmware/BIOS supports
788 it. This only effects when boot priority is changed by bootindex
789 options. The default is non-strict boot.
793 # try to boot from network first, then from hard disk
794 |qemu_system_x86| -boot order=nc
795 # boot from CD-ROM first, switch back to default order after reboot
796 |qemu_system_x86| -boot once=d
797 # boot with a splash picture for 5 seconds.
798 |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000
800 Note: The legacy format '-boot drives' is still supported but its
801 use is discouraged as it may be removed from future versions.
804 DEF("m", HAS_ARG, QEMU_OPTION_m,
805 "-m [size=]megs[,slots=n,maxmem=size]\n"
806 " configure guest RAM\n"
807 " size: initial amount of guest memory\n"
808 " slots: number of hotplug slots (default: none)\n"
809 " maxmem: maximum amount of guest memory (default: none)\n"
810 "NOTE: Some architectures might enforce a specific granularity\n",
813 @item -m [size=]@var{megs}[,slots=n,maxmem=size]
815 Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
816 Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
817 megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
818 could be used to set amount of hotpluggable memory slots and maximum amount of
819 memory. Note that @var{maxmem} must be aligned to the page size.
821 For example, the following command-line sets the guest startup RAM size to
822 1GB, creates 3 slots to hotplug additional memory and sets the maximum
823 memory the guest can reach to 4GB:
826 @value{qemu_system} -m 1G,slots=3,maxmem=4G
829 If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
830 be enabled and the guest startup RAM will never increase.
833 ``-m [size=]megs[,slots=n,maxmem=size]``
834 Sets guest startup RAM size to megs megabytes. Default is 128 MiB.
835 Optionally, a suffix of "M" or "G" can be used to signify a value in
836 megabytes or gigabytes respectively. Optional pair slots, maxmem
837 could be used to set amount of hotpluggable memory slots and maximum
838 amount of memory. Note that maxmem must be aligned to the page size.
840 For example, the following command-line sets the guest startup RAM
841 size to 1GB, creates 3 slots to hotplug additional memory and sets
842 the maximum memory the guest can reach to 4GB:
846 |qemu_system| -m 1G,slots=3,maxmem=4G
848 If slots and maxmem are not specified, memory hotplug won't be
849 enabled and the guest startup RAM will never increase.
852 DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
853 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
855 @item -mem-path @var{path}
857 Allocate guest RAM from a temporarily created file in @var{path}.
861 Allocate guest RAM from a temporarily created file in path.
864 DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
865 "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
869 @findex -mem-prealloc
870 Preallocate memory when using -mem-path.
874 Preallocate memory when using -mem-path.
877 DEF("k", HAS_ARG, QEMU_OPTION_k,
878 "-k language use keyboard layout (for example 'fr' for French)\n",
881 @item -k @var{language}
883 Use keyboard layout @var{language} (for example @code{fr} for
884 French). This option is only needed where it is not easy to get raw PC
885 keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
886 display). You don't normally need to use it on PC/Linux or PC/Windows
889 The available layouts are:
891 ar de-ch es fo fr-ca hu ja mk no pt-br sv
892 da en-gb et fr fr-ch is lt nl pl ru th
893 de en-us fi fr-be hr it lv nl-be pt sl tr
896 The default is @code{en-us}.
900 Use keyboard layout language (for example ``fr`` for French). This
901 option is only needed where it is not easy to get raw PC keycodes
902 (e.g. on Macs, with some X11 servers or with a VNC or curses
903 display). You don't normally need to use it on PC/Linux or
906 The available layouts are:
910 ar de-ch es fo fr-ca hu ja mk no pt-br sv
911 da en-gb et fr fr-ch is lt nl pl ru th
912 de en-us fi fr-be hr it lv nl-be pt sl tr
914 The default is ``en-us``.
918 HXCOMM Deprecated by -audiodev
919 DEF("audio-help", 0, QEMU_OPTION_audio_help,
920 "-audio-help show -audiodev equivalent of the currently specified audio settings\n",
925 Will show the -audiodev equivalent of the currently specified
926 (deprecated) environment variables.
930 Will show the -audiodev equivalent of the currently specified
931 (deprecated) environment variables.
934 DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
935 "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
936 " specifies the audio backend to use\n"
937 " id= identifier of the backend\n"
938 " timer-period= timer period in microseconds\n"
939 " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
940 " in|out.fixed-settings= use fixed settings for host audio\n"
941 " in|out.frequency= frequency to use with fixed settings\n"
942 " in|out.channels= number of channels to use with fixed settings\n"
943 " in|out.format= sample format to use with fixed settings\n"
944 " valid values: s8, s16, s32, u8, u16, u32\n"
945 " in|out.voices= number of voices to use\n"
946 " in|out.buffer-length= length of buffer in microseconds\n"
947 "-audiodev none,id=id,[,prop[=value][,...]]\n"
948 " dummy driver that discards all output\n"
949 #ifdef CONFIG_AUDIO_ALSA
950 "-audiodev alsa,id=id[,prop[=value][,...]]\n"
951 " in|out.dev= name of the audio device to use\n"
952 " in|out.period-length= length of period in microseconds\n"
953 " in|out.try-poll= attempt to use poll mode\n"
954 " threshold= threshold (in microseconds) when playback starts\n"
956 #ifdef CONFIG_AUDIO_COREAUDIO
957 "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
958 " in|out.buffer-count= number of buffers\n"
960 #ifdef CONFIG_AUDIO_DSOUND
961 "-audiodev dsound,id=id[,prop[=value][,...]]\n"
962 " latency= add extra latency to playback in microseconds\n"
964 #ifdef CONFIG_AUDIO_OSS
965 "-audiodev oss,id=id[,prop[=value][,...]]\n"
966 " in|out.dev= path of the audio device to use\n"
967 " in|out.buffer-count= number of buffers\n"
968 " in|out.try-poll= attempt to use poll mode\n"
969 " try-mmap= try using memory mapped access\n"
970 " exclusive= open device in exclusive mode\n"
971 " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
973 #ifdef CONFIG_AUDIO_PA
974 "-audiodev pa,id=id[,prop[=value][,...]]\n"
975 " server= PulseAudio server address\n"
976 " in|out.name= source/sink device name\n"
977 " in|out.latency= desired latency in microseconds\n"
979 #ifdef CONFIG_AUDIO_SDL
980 "-audiodev sdl,id=id[,prop[=value][,...]]\n"
983 "-audiodev spice,id=id[,prop[=value][,...]]\n"
985 "-audiodev wav,id=id[,prop[=value][,...]]\n"
986 " path= path of wav file to record\n",
989 @item -audiodev [driver=]@var{driver},id=@var{id}[,@var{prop}[=@var{value}][,...]]
991 Adds a new audio backend @var{driver} identified by @var{id}. There are
992 global and driver specific properties. Some values can be set
993 differently for input and output, they're marked with @code{in|out.}.
994 You can set the input's property with @code{in.@var{prop}} and the
995 output's property with @code{out.@var{prop}}. For example:
997 -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
998 -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
1001 NOTE: parameter validation is known to be incomplete, in many cases
1002 specifying an invalid option causes QEMU to print an error message and
1003 continue emulation without sound.
1005 Valid global options are:
1008 @item id=@var{identifier}
1009 Identifies the audio backend.
1011 @item timer-period=@var{period}
1012 Sets the timer @var{period} used by the audio subsystem in microseconds.
1013 Default is 10000 (10 ms).
1015 @item in|out.mixing-engine=on|off
1016 Use QEMU's mixing engine to mix all streams inside QEMU and convert
1017 audio formats when not supported by the backend. When off,
1018 @var{fixed-settings} must be off too. Note that disabling this option
1019 means that the selected backend must support multiple streams and the
1020 audio formats used by the virtual cards, otherwise you'll get no sound.
1021 It's not recommended to disable this option unless you want to use 5.1
1022 or 7.1 audio, as mixing engine only supports mono and stereo audio.
1025 @item in|out.fixed-settings=on|off
1026 Use fixed settings for host audio. When off, it will change based on
1027 how the guest opens the sound card. In this case you must not specify
1028 @var{frequency}, @var{channels} or @var{format}. Default is on.
1030 @item in|out.frequency=@var{frequency}
1031 Specify the @var{frequency} to use when using @var{fixed-settings}.
1034 @item in|out.channels=@var{channels}
1035 Specify the number of @var{channels} to use when using
1036 @var{fixed-settings}. Default is 2 (stereo).
1038 @item in|out.format=@var{format}
1039 Specify the sample @var{format} to use when using @var{fixed-settings}.
1040 Valid values are: @code{s8}, @code{s16}, @code{s32}, @code{u8},
1041 @code{u16}, @code{u32}. Default is @code{s16}.
1043 @item in|out.voices=@var{voices}
1044 Specify the number of @var{voices} to use. Default is 1.
1046 @item in|out.buffer-length=@var{usecs}
1047 Sets the size of the buffer in microseconds.
1051 @item -audiodev none,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1052 Creates a dummy backend that discards all outputs. This backend has no
1053 backend specific properties.
1055 @item -audiodev alsa,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1056 Creates backend using the ALSA. This backend is only available on
1059 ALSA specific options are:
1063 @item in|out.dev=@var{device}
1064 Specify the ALSA @var{device} to use for input and/or output. Default
1067 @item in|out.period-length=@var{usecs}
1068 Sets the period length in microseconds.
1070 @item in|out.try-poll=on|off
1071 Attempt to use poll mode with the device. Default is on.
1073 @item threshold=@var{threshold}
1074 Threshold (in microseconds) when playback starts. Default is 0.
1078 @item -audiodev coreaudio,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1079 Creates a backend using Apple's Core Audio. This backend is only
1080 available on Mac OS and only supports playback.
1082 Core Audio specific options are:
1086 @item in|out.buffer-count=@var{count}
1087 Sets the @var{count} of the buffers.
1091 @item -audiodev dsound,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1092 Creates a backend using Microsoft's DirectSound. This backend is only
1093 available on Windows and only supports playback.
1095 DirectSound specific options are:
1099 @item latency=@var{usecs}
1100 Add extra @var{usecs} microseconds latency to playback. Default is
1105 @item -audiodev oss,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1106 Creates a backend using OSS. This backend is available on most
1109 OSS specific options are:
1113 @item in|out.dev=@var{device}
1114 Specify the file name of the OSS @var{device} to use. Default is
1117 @item in|out.buffer-count=@var{count}
1118 Sets the @var{count} of the buffers.
1120 @item in|out.try-poll=on|of
1121 Attempt to use poll mode with the device. Default is on.
1123 @item try-mmap=on|off
1124 Try using memory mapped device access. Default is off.
1126 @item exclusive=on|off
1127 Open the device in exclusive mode (vmix won't work in this case).
1130 @item dsp-policy=@var{policy}
1131 Sets the timing policy (between 0 and 10, where smaller number means
1132 smaller latency but higher CPU usage). Use -1 to use buffer sizes
1133 specified by @code{buffer} and @code{buffer-count}. This option is
1134 ignored if you do not have OSS 4. Default is 5.
1138 @item -audiodev pa,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1139 Creates a backend using PulseAudio. This backend is available on most
1142 PulseAudio specific options are:
1146 @item server=@var{server}
1147 Sets the PulseAudio @var{server} to connect to.
1149 @item in|out.name=@var{sink}
1150 Use the specified source/sink for recording/playback.
1152 @item in|out.latency=@var{usecs}
1153 Desired latency in microseconds. The PulseAudio server will try to honor this
1154 value but actual latencies may be lower or higher.
1158 @item -audiodev sdl,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1159 Creates a backend using SDL. This backend is available on most systems,
1160 but you should use your platform's native backend if possible. This
1161 backend has no backend specific properties.
1163 @item -audiodev spice,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1164 Creates a backend that sends audio through SPICE. This backend requires
1165 @code{-spice} and automatically selected in that case, so usually you
1166 can ignore this option. This backend has no backend specific
1169 @item -audiodev wav,id=@var{id}[,@var{prop}[=@var{value}][,...]]
1170 Creates a backend that writes audio to a WAV file.
1172 Backend specific options are:
1176 @item path=@var{path}
1177 Write recorded audio into the specified file. Default is
1183 ``-audiodev [driver=]driver,id=id[,prop[=value][,...]]``
1184 Adds a new audio backend driver identified by id. There are global
1185 and driver specific properties. Some values can be set differently
1186 for input and output, they're marked with ``in|out.``. You can set
1187 the input's property with ``in.prop`` and the output's property with
1188 ``out.prop``. For example:
1192 -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
1193 -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
1195 NOTE: parameter validation is known to be incomplete, in many cases
1196 specifying an invalid option causes QEMU to print an error message
1197 and continue emulation without sound.
1199 Valid global options are:
1202 Identifies the audio backend.
1204 ``timer-period=period``
1205 Sets the timer period used by the audio subsystem in
1206 microseconds. Default is 10000 (10 ms).
1208 ``in|out.mixing-engine=on|off``
1209 Use QEMU's mixing engine to mix all streams inside QEMU and
1210 convert audio formats when not supported by the backend. When
1211 off, fixed-settings must be off too. Note that disabling this
1212 option means that the selected backend must support multiple
1213 streams and the audio formats used by the virtual cards,
1214 otherwise you'll get no sound. It's not recommended to disable
1215 this option unless you want to use 5.1 or 7.1 audio, as mixing
1216 engine only supports mono and stereo audio. Default is on.
1218 ``in|out.fixed-settings=on|off``
1219 Use fixed settings for host audio. When off, it will change
1220 based on how the guest opens the sound card. In this case you
1221 must not specify frequency, channels or format. Default is on.
1223 ``in|out.frequency=frequency``
1224 Specify the frequency to use when using fixed-settings. Default
1227 ``in|out.channels=channels``
1228 Specify the number of channels to use when using fixed-settings.
1229 Default is 2 (stereo).
1231 ``in|out.format=format``
1232 Specify the sample format to use when using fixed-settings.
1233 Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``,
1234 ``u32``. Default is ``s16``.
1236 ``in|out.voices=voices``
1237 Specify the number of voices to use. Default is 1.
1239 ``in|out.buffer-length=usecs``
1240 Sets the size of the buffer in microseconds.
1242 ``-audiodev none,id=id[,prop[=value][,...]]``
1243 Creates a dummy backend that discards all outputs. This backend has
1244 no backend specific properties.
1246 ``-audiodev alsa,id=id[,prop[=value][,...]]``
1247 Creates backend using the ALSA. This backend is only available on
1250 ALSA specific options are:
1252 ``in|out.dev=device``
1253 Specify the ALSA device to use for input and/or output. Default
1256 ``in|out.period-length=usecs``
1257 Sets the period length in microseconds.
1259 ``in|out.try-poll=on|off``
1260 Attempt to use poll mode with the device. Default is on.
1262 ``threshold=threshold``
1263 Threshold (in microseconds) when playback starts. Default is 0.
1265 ``-audiodev coreaudio,id=id[,prop[=value][,...]]``
1266 Creates a backend using Apple's Core Audio. This backend is only
1267 available on Mac OS and only supports playback.
1269 Core Audio specific options are:
1271 ``in|out.buffer-count=count``
1272 Sets the count of the buffers.
1274 ``-audiodev dsound,id=id[,prop[=value][,...]]``
1275 Creates a backend using Microsoft's DirectSound. This backend is
1276 only available on Windows and only supports playback.
1278 DirectSound specific options are:
1281 Add extra usecs microseconds latency to playback. Default is
1284 ``-audiodev oss,id=id[,prop[=value][,...]]``
1285 Creates a backend using OSS. This backend is available on most
1288 OSS specific options are:
1290 ``in|out.dev=device``
1291 Specify the file name of the OSS device to use. Default is
1294 ``in|out.buffer-count=count``
1295 Sets the count of the buffers.
1297 ``in|out.try-poll=on|of``
1298 Attempt to use poll mode with the device. Default is on.
1301 Try using memory mapped device access. Default is off.
1303 ``exclusive=on|off``
1304 Open the device in exclusive mode (vmix won't work in this
1305 case). Default is off.
1307 ``dsp-policy=policy``
1308 Sets the timing policy (between 0 and 10, where smaller number
1309 means smaller latency but higher CPU usage). Use -1 to use
1310 buffer sizes specified by ``buffer`` and ``buffer-count``. This
1311 option is ignored if you do not have OSS 4. Default is 5.
1313 ``-audiodev pa,id=id[,prop[=value][,...]]``
1314 Creates a backend using PulseAudio. This backend is available on
1317 PulseAudio specific options are:
1320 Sets the PulseAudio server to connect to.
1322 ``in|out.name=sink``
1323 Use the specified source/sink for recording/playback.
1325 ``in|out.latency=usecs``
1326 Desired latency in microseconds. The PulseAudio server will try
1327 to honor this value but actual latencies may be lower or higher.
1329 ``-audiodev sdl,id=id[,prop[=value][,...]]``
1330 Creates a backend using SDL. This backend is available on most
1331 systems, but you should use your platform's native backend if
1332 possible. This backend has no backend specific properties.
1334 ``-audiodev spice,id=id[,prop[=value][,...]]``
1335 Creates a backend that sends audio through SPICE. This backend
1336 requires ``-spice`` and automatically selected in that case, so
1337 usually you can ignore this option. This backend has no backend
1338 specific properties.
1340 ``-audiodev wav,id=id[,prop[=value][,...]]``
1341 Creates a backend that writes audio to a WAV file.
1343 Backend specific options are:
1346 Write recorded audio into the specified file. Default is
1350 DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
1351 "-soundhw c1,... enable audio support\n"
1352 " and only specified sound cards (comma separated list)\n"
1353 " use '-soundhw help' to get the list of supported cards\n"
1354 " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
1356 @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
1358 Enable audio and selected sound hardware. Use 'help' to print all
1359 available sound hardware. For example:
1362 @value{qemu_system_x86} -soundhw sb16,adlib disk.img
1363 @value{qemu_system_x86} -soundhw es1370 disk.img
1364 @value{qemu_system_x86} -soundhw ac97 disk.img
1365 @value{qemu_system_x86} -soundhw hda disk.img
1366 @value{qemu_system_x86} -soundhw all disk.img
1367 @value{qemu_system_x86} -soundhw help
1370 Note that Linux's i810_audio OSS kernel (for AC97) module might
1371 require manually specifying clocking.
1374 modprobe i810_audio clocking=48000
1378 ``-soundhw card1[,card2,...] or -soundhw all``
1379 Enable audio and selected sound hardware. Use 'help' to print all
1380 available sound hardware. For example:
1384 |qemu_system_x86| -soundhw sb16,adlib disk.img
1385 |qemu_system_x86| -soundhw es1370 disk.img
1386 |qemu_system_x86| -soundhw ac97 disk.img
1387 |qemu_system_x86| -soundhw hda disk.img
1388 |qemu_system_x86| -soundhw all disk.img
1389 |qemu_system_x86| -soundhw help
1391 Note that Linux's i810\_audio OSS kernel (for AC97) module might
1392 require manually specifying clocking.
1396 modprobe i810_audio clocking=48000
1399 DEF("device", HAS_ARG, QEMU_OPTION_device,
1400 "-device driver[,prop[=value][,...]]\n"
1401 " add device (based on driver)\n"
1402 " prop=value,... sets driver properties\n"
1403 " use '-device help' to print all possible drivers\n"
1404 " use '-device driver,help' to print all possible properties\n",
1407 @item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
1409 Add device @var{driver}. @var{prop}=@var{value} sets driver
1410 properties. Valid properties depend on the driver. To get help on
1411 possible drivers and properties, use @code{-device help} and
1412 @code{-device @var{driver},help}.
1415 @item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}][,sdrfile=@var{file}][,furareasize=@var{val}][,furdatafile=@var{file}][,guid=@var{uuid}]
1417 Add an IPMI BMC. This is a simulation of a hardware management
1418 interface processor that normally sits on a system. It provides
1419 a watchdog and the ability to reset and power control the system.
1420 You need to connect this to an IPMI interface to make it useful
1422 The IPMI slave address to use for the BMC. The default is 0x20.
1423 This address is the BMC's address on the I2C network of management
1424 controllers. If you don't know what this means, it is safe to ignore
1429 The BMC id for interfaces to use this device.
1430 @item slave_addr=@var{val}
1431 Define slave address to use for the BMC. The default is 0x20.
1432 @item sdrfile=@var{file}
1433 file containing raw Sensor Data Records (SDR) data. The default is none.
1434 @item fruareasize=@var{val}
1435 size of a Field Replaceable Unit (FRU) area. The default is 1024.
1436 @item frudatafile=@var{file}
1437 file containing raw Field Replaceable Unit (FRU) inventory data. The default is none.
1438 @item guid=@var{uuid}
1439 value for the GUID for the BMC, in standard UUID format. If this is set,
1440 get "Get GUID" command to the BMC will return it. Otherwise "Get GUID"
1441 will return an error.
1444 @item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
1446 Add a connection to an external IPMI BMC simulator. Instead of
1447 locally emulating the BMC like the above item, instead connect
1448 to an external entity that provides the IPMI services.
1450 A connection is made to an external BMC simulator. If you do this, it
1451 is strongly recommended that you use the "reconnect=" chardev option
1452 to reconnect to the simulator if the connection is lost. Note that if
1453 this is not used carefully, it can be a security issue, as the
1454 interface has the ability to send resets, NMIs, and power off the VM.
1455 It's best if QEMU makes a connection to an external simulator running
1456 on a secure port on localhost, so neither the simulator nor QEMU is
1457 exposed to any outside network.
1459 See the "lanserv/README.vm" file in the OpenIPMI library for more
1460 details on the external interface.
1462 @item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
1464 Add a KCS IPMI interafce on the ISA bus. This also adds a
1465 corresponding ACPI and SMBIOS entries, if appropriate.
1469 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
1470 @item ioport=@var{val}
1471 Define the I/O address of the interface. The default is 0xca0 for KCS.
1473 Define the interrupt to use. The default is 5. To disable interrupts,
1477 @item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
1479 Like the KCS interface, but defines a BT interface. The default port is
1480 0xe4 and the default interrupt is 5.
1484 ``-device driver[,prop[=value][,...]]``
1485 Add device driver. prop=value sets driver properties. Valid
1486 properties depend on the driver. To get help on possible drivers and
1487 properties, use ``-device help`` and ``-device driver,help``.
1491 ``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]``
1492 Add an IPMI BMC. This is a simulation of a hardware management
1493 interface processor that normally sits on a system. It provides a
1494 watchdog and the ability to reset and power control the system. You
1495 need to connect this to an IPMI interface to make it useful
1497 The IPMI slave address to use for the BMC. The default is 0x20. This
1498 address is the BMC's address on the I2C network of management
1499 controllers. If you don't know what this means, it is safe to ignore
1503 The BMC id for interfaces to use this device.
1506 Define slave address to use for the BMC. The default is 0x20.
1509 file containing raw Sensor Data Records (SDR) data. The default
1513 size of a Field Replaceable Unit (FRU) area. The default is
1516 ``frudatafile=file``
1517 file containing raw Field Replaceable Unit (FRU) inventory data.
1518 The default is none.
1521 value for the GUID for the BMC, in standard UUID format. If this
1522 is set, get "Get GUID" command to the BMC will return it.
1523 Otherwise "Get GUID" will return an error.
1525 ``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]``
1526 Add a connection to an external IPMI BMC simulator. Instead of
1527 locally emulating the BMC like the above item, instead connect to an
1528 external entity that provides the IPMI services.
1530 A connection is made to an external BMC simulator. If you do this,
1531 it is strongly recommended that you use the "reconnect=" chardev
1532 option to reconnect to the simulator if the connection is lost. Note
1533 that if this is not used carefully, it can be a security issue, as
1534 the interface has the ability to send resets, NMIs, and power off
1535 the VM. It's best if QEMU makes a connection to an external
1536 simulator running on a secure port on localhost, so neither the
1537 simulator nor QEMU is exposed to any outside network.
1539 See the "lanserv/README.vm" file in the OpenIPMI library for more
1540 details on the external interface.
1542 ``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
1543 Add a KCS IPMI interafce on the ISA bus. This also adds a
1544 corresponding ACPI and SMBIOS entries, if appropriate.
1547 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern
1551 Define the I/O address of the interface. The default is 0xca0
1555 Define the interrupt to use. The default is 5. To disable
1556 interrupts, set this to 0.
1558 ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
1559 Like the KCS interface, but defines a BT interface. The default port
1560 is 0xe4 and the default interrupt is 5.
1563 DEF("name", HAS_ARG, QEMU_OPTION_name,
1564 "-name string1[,process=string2][,debug-threads=on|off]\n"
1565 " set the name of the guest\n"
1566 " string1 sets the window title and string2 the process name\n"
1567 " When debug-threads is enabled, individual threads are given a separate name\n"
1568 " NOTE: The thread names are for debugging and not a stable API.\n",
1571 @item -name @var{name}
1573 Sets the @var{name} of the guest.
1574 This name will be displayed in the SDL window caption.
1575 The @var{name} will also be used for the VNC server.
1576 Also optionally set the top visible process name in Linux.
1577 Naming of individual threads can also be enabled on Linux to aid debugging.
1581 Sets the name of the guest. This name will be displayed in the SDL
1582 window caption. The name will also be used for the VNC server. Also
1583 optionally set the top visible process name in Linux. Naming of
1584 individual threads can also be enabled on Linux to aid debugging.
1587 DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
1588 "-uuid %08x-%04x-%04x-%04x-%012x\n"
1589 " specify machine UUID\n", QEMU_ARCH_ALL)
1591 @item -uuid @var{uuid}
1605 DEFHEADING(Block device options:)
1610 DEF("fda", HAS_ARG, QEMU_OPTION_fda,
1611 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
1612 DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
1614 @item -fda @var{file}
1615 @itemx -fdb @var{file}
1618 Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
1621 ``-fda file``; \ ``-fdb file``
1622 Use file as floppy disk 0/1 image (see
1623 :ref:`disk_005fimages`).
1626 DEF("hda", HAS_ARG, QEMU_OPTION_hda,
1627 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
1628 DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
1629 DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
1630 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
1631 DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
1633 @item -hda @var{file}
1634 @itemx -hdb @var{file}
1635 @itemx -hdc @var{file}
1636 @itemx -hdd @var{file}
1641 Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
1644 ``-hda file``; \ ``-hdb file``; \ ``-hdc file``; \ ``-hdd file``
1645 Use file as hard disk 0, 1, 2 or 3 image (see
1646 :ref:`disk_005fimages`).
1649 DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
1650 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
1653 @item -cdrom @var{file}
1655 Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
1656 @option{-cdrom} at the same time). You can use the host CD-ROM by
1657 using @file{/dev/cdrom} as filename.
1661 Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at
1662 the same time). You can use the host CD-ROM by using ``/dev/cdrom``
1666 DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
1667 "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
1668 " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
1669 " [,read-only=on|off][,auto-read-only=on|off]\n"
1670 " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
1671 " [,driver specific parameters...]\n"
1672 " configure a block backend\n", QEMU_ARCH_ALL)
1674 @item -blockdev @var{option}[,@var{option}[,@var{option}[,...]]]
1677 Define a new block driver node. Some of the options apply to all block drivers,
1678 other options are only accepted for a specific block driver. See below for a
1679 list of generic options and options for the most common block drivers.
1681 Options that expect a reference to another node (e.g. @code{file}) can be
1682 given in two ways. Either you specify the node name of an already existing node
1683 (file=@var{node-name}), or you define a new node inline, adding options
1684 for the referenced node after a dot (file.filename=@var{path},file.aio=native).
1686 A block driver node created with @option{-blockdev} can be used for a guest
1687 device by specifying its node name for the @code{drive} property in a
1688 @option{-device} argument that defines a block device.
1691 @item Valid options for any block driver node:
1695 Specifies the block driver to use for the given node.
1697 This defines the name of the block driver node by which it will be referenced
1698 later. The name must be unique, i.e. it must not match the name of a different
1699 block driver node, or (if you use @option{-drive} as well) the ID of a drive.
1701 If no node name is specified, it is automatically generated. The generated node
1702 name is not intended to be predictable and changes between QEMU invocations.
1703 For the top level, an explicit node name must be specified.
1705 Open the node read-only. Guest write attempts will fail.
1707 Note that some block drivers support only read-only access, either generally or
1708 in certain configurations. In this case, the default value
1709 @option{read-only=off} does not work and the option must be specified
1711 @item auto-read-only
1712 If @option{auto-read-only=on} is set, QEMU may fall back to read-only usage
1713 even when @option{read-only=off} is requested, or even switch between modes as
1714 needed, e.g. depending on whether the image file is writable or whether a
1715 writing user is attached to the node.
1717 Override the image locking system of QEMU by forcing the node to utilize
1718 weaker shared access for permissions where it would normally request exclusive
1719 access. When there is the potential for multiple instances to have the same
1720 file open (whether this invocation of QEMU is the first or the second
1721 instance), both instances must permit shared access for the second instance to
1722 succeed at opening the file.
1724 Enabling @option{force-share=on} requires @option{read-only=on}.
1726 The host page cache can be avoided with @option{cache.direct=on}. This will
1727 attempt to do disk IO directly to the guest's memory. QEMU may still perform an
1728 internal copy of the data.
1729 @item cache.no-flush
1730 In case you don't care about data integrity over host failures, you can use
1731 @option{cache.no-flush=on}. This option tells QEMU that it never needs to write
1732 any data to the disk but can instead keep things in cache. If anything goes
1733 wrong, like your host losing power, the disk storage getting disconnected
1734 accidentally, etc. your image will most probably be rendered unusable.
1735 @item discard=@var{discard}
1736 @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls
1737 whether @code{discard} (also known as @code{trim} or @code{unmap}) requests are
1738 ignored or passed to the filesystem. Some machine types may not support
1740 @item detect-zeroes=@var{detect-zeroes}
1741 @var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
1742 conversion of plain zero writes by the OS to driver specific optimized
1743 zero write commands. You may even choose "unmap" if @var{discard} is set
1744 to "unmap" to allow a zero write to be converted to an @code{unmap} operation.
1747 @item Driver-specific options for @code{file}
1749 This is the protocol-level block driver for accessing regular files.
1753 The path to the image file in the local filesystem
1755 Specifies the AIO backend (threads/native, default: threads)
1757 Specifies whether the image file is protected with Linux OFD / POSIX locks. The
1758 default is to use the Linux Open File Descriptor API if available, otherwise no
1759 lock is applied. (auto/on/off, default: auto)
1763 -blockdev driver=file,node-name=disk,filename=disk.img
1766 @item Driver-specific options for @code{raw}
1768 This is the image format block driver for raw images. It is usually
1769 stacked on top of a protocol level block driver such as @code{file}.
1773 Reference to or definition of the data source block driver node
1774 (e.g. a @code{file} driver node)
1778 -blockdev driver=file,node-name=disk_file,filename=disk.img
1779 -blockdev driver=raw,node-name=disk,file=disk_file
1783 -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
1786 @item Driver-specific options for @code{qcow2}
1788 This is the image format block driver for qcow2 images. It is usually
1789 stacked on top of a protocol level block driver such as @code{file}.
1793 Reference to or definition of the data source block driver node
1794 (e.g. a @code{file} driver node)
1797 Reference to or definition of the backing file block device (default is taken
1798 from the image file). It is allowed to pass @code{null} here in order to disable
1799 the default backing file.
1801 @item lazy-refcounts
1802 Whether to enable the lazy refcounts feature (on/off; default is taken from the
1806 The maximum total size of the L2 table and refcount block caches in bytes
1807 (default: the sum of l2-cache-size and refcount-cache-size)
1810 The maximum size of the L2 table cache in bytes
1811 (default: if cache-size is not specified - 32M on Linux platforms, and 8M on
1812 non-Linux platforms; otherwise, as large as possible within the cache-size,
1813 while permitting the requested or the minimal refcount cache size)
1815 @item refcount-cache-size
1816 The maximum size of the refcount block cache in bytes
1817 (default: 4 times the cluster size; or if cache-size is specified, the part of
1818 it which is not used for the L2 cache)
1820 @item cache-clean-interval
1821 Clean unused entries in the L2 and refcount caches. The interval is in seconds.
1822 The default value is 600 on supporting platforms, and 0 on other platforms.
1823 Setting it to 0 disables this feature.
1825 @item pass-discard-request
1826 Whether discard requests to the qcow2 device should be forwarded to the data
1827 source (on/off; default: on if discard=unmap is specified, off otherwise)
1829 @item pass-discard-snapshot
1830 Whether discard requests for the data source should be issued when a snapshot
1831 operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/off;
1834 @item pass-discard-other
1835 Whether discard requests for the data source should be issued on other
1836 occasions where a cluster gets freed (on/off; default: off)
1839 Which overlap checks to perform for writes to the image
1840 (none/constant/cached/all; default: cached). For details or finer
1841 granularity control refer to the QAPI documentation of @code{blockdev-add}.
1846 -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
1847 -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
1851 -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
1854 @item Driver-specific options for other drivers
1855 Please refer to the QAPI documentation of the @code{blockdev-add} QMP command.
1861 ``-blockdev option[,option[,option[,...]]]``
1862 Define a new block driver node. Some of the options apply to all
1863 block drivers, other options are only accepted for a specific block
1864 driver. See below for a list of generic options and options for the
1865 most common block drivers.
1867 Options that expect a reference to another node (e.g. ``file``) can
1868 be given in two ways. Either you specify the node name of an already
1869 existing node (file=node-name), or you define a new node inline,
1870 adding options for the referenced node after a dot
1871 (file.filename=path,file.aio=native).
1873 A block driver node created with ``-blockdev`` can be used for a
1874 guest device by specifying its node name for the ``drive`` property
1875 in a ``-device`` argument that defines a block device.
1877 ``Valid options for any block driver node:``
1879 Specifies the block driver to use for the given node.
1882 This defines the name of the block driver node by which it
1883 will be referenced later. The name must be unique, i.e. it
1884 must not match the name of a different block driver node, or
1885 (if you use ``-drive`` as well) the ID of a drive.
1887 If no node name is specified, it is automatically generated.
1888 The generated node name is not intended to be predictable
1889 and changes between QEMU invocations. For the top level, an
1890 explicit node name must be specified.
1893 Open the node read-only. Guest write attempts will fail.
1895 Note that some block drivers support only read-only access,
1896 either generally or in certain configurations. In this case,
1897 the default value ``read-only=off`` does not work and the
1898 option must be specified explicitly.
1901 If ``auto-read-only=on`` is set, QEMU may fall back to
1902 read-only usage even when ``read-only=off`` is requested, or
1903 even switch between modes as needed, e.g. depending on
1904 whether the image file is writable or whether a writing user
1905 is attached to the node.
1908 Override the image locking system of QEMU by forcing the
1909 node to utilize weaker shared access for permissions where
1910 it would normally request exclusive access. When there is
1911 the potential for multiple instances to have the same file
1912 open (whether this invocation of QEMU is the first or the
1913 second instance), both instances must permit shared access
1914 for the second instance to succeed at opening the file.
1916 Enabling ``force-share=on`` requires ``read-only=on``.
1919 The host page cache can be avoided with ``cache.direct=on``.
1920 This will attempt to do disk IO directly to the guest's
1921 memory. QEMU may still perform an internal copy of the data.
1924 In case you don't care about data integrity over host
1925 failures, you can use ``cache.no-flush=on``. This option
1926 tells QEMU that it never needs to write any data to the disk
1927 but can instead keep things in cache. If anything goes
1928 wrong, like your host losing power, the disk storage getting
1929 disconnected accidentally, etc. your image will most
1930 probably be rendered unusable.
1933 discard is one of "ignore" (or "off") or "unmap" (or "on")
1934 and controls whether ``discard`` (also known as ``trim`` or
1935 ``unmap``) requests are ignored or passed to the filesystem.
1936 Some machine types may not support discard requests.
1938 ``detect-zeroes=detect-zeroes``
1939 detect-zeroes is "off", "on" or "unmap" and enables the
1940 automatic conversion of plain zero writes by the OS to
1941 driver specific optimized zero write commands. You may even
1942 choose "unmap" if discard is set to "unmap" to allow a zero
1943 write to be converted to an ``unmap`` operation.
1945 ``Driver-specific options for file``
1946 This is the protocol-level block driver for accessing regular
1950 The path to the image file in the local filesystem
1953 Specifies the AIO backend (threads/native, default: threads)
1956 Specifies whether the image file is protected with Linux OFD
1957 / POSIX locks. The default is to use the Linux Open File
1958 Descriptor API if available, otherwise no lock is applied.
1959 (auto/on/off, default: auto)
1965 -blockdev driver=file,node-name=disk,filename=disk.img
1967 ``Driver-specific options for raw``
1968 This is the image format block driver for raw images. It is
1969 usually stacked on top of a protocol level block driver such as
1973 Reference to or definition of the data source block driver
1974 node (e.g. a ``file`` driver node)
1980 -blockdev driver=file,node-name=disk_file,filename=disk.img
1981 -blockdev driver=raw,node-name=disk,file=disk_file
1987 -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
1989 ``Driver-specific options for qcow2``
1990 This is the image format block driver for qcow2 images. It is
1991 usually stacked on top of a protocol level block driver such as
1995 Reference to or definition of the data source block driver
1996 node (e.g. a ``file`` driver node)
1999 Reference to or definition of the backing file block device
2000 (default is taken from the image file). It is allowed to
2001 pass ``null`` here in order to disable the default backing
2005 Whether to enable the lazy refcounts feature (on/off;
2006 default is taken from the image file)
2009 The maximum total size of the L2 table and refcount block
2010 caches in bytes (default: the sum of l2-cache-size and
2011 refcount-cache-size)
2014 The maximum size of the L2 table cache in bytes (default: if
2015 cache-size is not specified - 32M on Linux platforms, and 8M
2016 on non-Linux platforms; otherwise, as large as possible
2017 within the cache-size, while permitting the requested or the
2018 minimal refcount cache size)
2020 ``refcount-cache-size``
2021 The maximum size of the refcount block cache in bytes
2022 (default: 4 times the cluster size; or if cache-size is
2023 specified, the part of it which is not used for the L2
2026 ``cache-clean-interval``
2027 Clean unused entries in the L2 and refcount caches. The
2028 interval is in seconds. The default value is 600 on
2029 supporting platforms, and 0 on other platforms. Setting it
2030 to 0 disables this feature.
2032 ``pass-discard-request``
2033 Whether discard requests to the qcow2 device should be
2034 forwarded to the data source (on/off; default: on if
2035 discard=unmap is specified, off otherwise)
2037 ``pass-discard-snapshot``
2038 Whether discard requests for the data source should be
2039 issued when a snapshot operation (e.g. deleting a snapshot)
2040 frees clusters in the qcow2 file (on/off; default: on)
2042 ``pass-discard-other``
2043 Whether discard requests for the data source should be
2044 issued on other occasions where a cluster gets freed
2045 (on/off; default: off)
2048 Which overlap checks to perform for writes to the image
2049 (none/constant/cached/all; default: cached). For details or
2050 finer granularity control refer to the QAPI documentation of
2057 -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
2058 -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
2064 -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
2066 ``Driver-specific options for other drivers``
2067 Please refer to the QAPI documentation of the ``blockdev-add``
2071 DEF("drive", HAS_ARG, QEMU_OPTION_drive,
2072 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
2073 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
2074 " [,snapshot=on|off][,rerror=ignore|stop|report]\n"
2075 " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
2076 " [,readonly=on|off][,copy-on-read=on|off]\n"
2077 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
2078 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
2079 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
2080 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
2081 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
2082 " [[,iops_size=is]]\n"
2084 " use 'file' as a drive image\n", QEMU_ARCH_ALL)
2086 @item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
2089 Define a new drive. This includes creating a block driver node (the backend) as
2090 well as a guest device, and is mostly a shortcut for defining the corresponding
2091 @option{-blockdev} and @option{-device} options.
2093 @option{-drive} accepts all options that are accepted by @option{-blockdev}. In
2094 addition, it knows the following options:
2097 @item file=@var{file}
2098 This option defines which disk image (@pxref{disk_images}) to use with
2099 this drive. If the filename contains comma, you must double it
2100 (for instance, "file=my,,file" to use file "my,file").
2102 Special files such as iSCSI devices can be specified using protocol
2103 specific URLs. See the section for "Device URL Syntax" for more information.
2104 @item if=@var{interface}
2105 This option defines on which type on interface the drive is connected.
2106 Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none.
2107 @item bus=@var{bus},unit=@var{unit}
2108 These options define where is connected the drive by defining the bus number and
2110 @item index=@var{index}
2111 This option defines where is connected the drive by using an index in the list
2112 of available connectors of a given interface type.
2113 @item media=@var{media}
2114 This option defines the type of the media: disk or cdrom.
2115 @item snapshot=@var{snapshot}
2116 @var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
2117 (see @option{-snapshot}).
2118 @item cache=@var{cache}
2119 @var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough"
2120 and controls how the host cache is used to access block data. This is a
2121 shortcut that sets the @option{cache.direct} and @option{cache.no-flush}
2122 options (as in @option{-blockdev}), and additionally @option{cache.writeback},
2123 which provides a default for the @option{write-cache} option of block guest
2124 devices (as in @option{-device}). The modes correspond to the following
2127 @c Our texi2pod.pl script doesn't support @multitable, so fall back to using
2128 @c plain ASCII art (well, UTF-8 art really). This looks okay both in the manpage
2129 @c and the HTML output.
2131 @ │ cache.writeback cache.direct cache.no-flush
2132 ─────────────┼─────────────────────────────────────────────────
2133 writeback │ on off off
2135 writethrough │ off off off
2136 directsync │ off on off
2137 unsafe │ on off on
2140 The default mode is @option{cache=writeback}.
2143 @var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
2144 @item format=@var{format}
2145 Specify which disk @var{format} will be used rather than detecting
2146 the format. Can be used to specify format=raw to avoid interpreting
2147 an untrusted format header.
2148 @item werror=@var{action},rerror=@var{action}
2149 Specify which @var{action} to take on write and read errors. Valid actions are:
2150 "ignore" (ignore the error and try to continue), "stop" (pause QEMU),
2151 "report" (report the error to the guest), "enospc" (pause QEMU only if the
2152 host disk is full; report the error to the guest otherwise).
2153 The default setting is @option{werror=enospc} and @option{rerror=report}.
2154 @item copy-on-read=@var{copy-on-read}
2155 @var{copy-on-read} is "on" or "off" and enables whether to copy read backing
2156 file sectors into the image file.
2157 @item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w}
2158 Specify bandwidth throttling limits in bytes per second, either for all request
2159 types or for reads or writes only. Small values can lead to timeouts or hangs
2160 inside the guest. A safe minimum for disks is 2 MB/s.
2161 @item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm}
2162 Specify bursts in bytes per second, either for all request types or for reads
2163 or writes only. Bursts allow the guest I/O to spike above the limit
2165 @item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w}
2166 Specify request rate limits in requests per second, either for all request
2167 types or for reads or writes only.
2168 @item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm}
2169 Specify bursts in requests per second, either for all request types or for reads
2170 or writes only. Bursts allow the guest I/O to spike above the limit
2172 @item iops_size=@var{is}
2173 Let every @var{is} bytes of a request count as a new request for iops
2174 throttling purposes. Use this option to prevent guests from circumventing iops
2175 limits by sending fewer but larger requests.
2177 Join a throttling quota group with given name @var{g}. All drives that are
2178 members of the same group are accounted for together. Use this option to
2179 prevent guests from circumventing throttling limits by using many small disks
2180 instead of a single larger disk.
2183 By default, the @option{cache.writeback=on} mode is used. It will report data
2184 writes as completed as soon as the data is present in the host page cache.
2185 This is safe as long as your guest OS makes sure to correctly flush disk caches
2186 where needed. If your guest OS does not handle volatile disk write caches
2187 correctly and your host crashes or loses power, then the guest may experience
2190 For such guests, you should consider using @option{cache.writeback=off}. This
2191 means that the host page cache will be used to read and write data, but write
2192 notification will be sent to the guest only after QEMU has made sure to flush
2193 each write to the disk. Be aware that this has a major impact on performance.
2195 When using the @option{-snapshot} option, unsafe caching is always used.
2197 Copy-on-read avoids accessing the same backing file sectors repeatedly and is
2198 useful when the backing file is over a slow network. By default copy-on-read
2201 Instead of @option{-cdrom} you can use:
2203 @value{qemu_system} -drive file=file,index=2,media=cdrom
2206 Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
2209 @value{qemu_system} -drive file=file,index=0,media=disk
2210 @value{qemu_system} -drive file=file,index=1,media=disk
2211 @value{qemu_system} -drive file=file,index=2,media=disk
2212 @value{qemu_system} -drive file=file,index=3,media=disk
2215 You can open an image using pre-opened file descriptors from an fd set:
2217 @value{qemu_system} \
2218 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
2219 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
2220 -drive file=/dev/fdset/2,index=0,media=disk
2223 You can connect a CDROM to the slave of ide0:
2225 @value{qemu_system_x86} -drive file=file,if=ide,index=1,media=cdrom
2228 If you don't specify the "file=" argument, you define an empty drive:
2230 @value{qemu_system_x86} -drive if=ide,index=1,media=cdrom
2233 Instead of @option{-fda}, @option{-fdb}, you can use:
2235 @value{qemu_system_x86} -drive file=file,index=0,if=floppy
2236 @value{qemu_system_x86} -drive file=file,index=1,if=floppy
2239 By default, @var{interface} is "ide" and @var{index} is automatically
2242 @value{qemu_system_x86} -drive file=a -drive file=b"
2244 is interpreted like:
2246 @value{qemu_system_x86} -hda a -hdb b
2250 ``-drive option[,option[,option[,...]]]``
2251 Define a new drive. This includes creating a block driver node (the
2252 backend) as well as a guest device, and is mostly a shortcut for
2253 defining the corresponding ``-blockdev`` and ``-device`` options.
2255 ``-drive`` accepts all options that are accepted by ``-blockdev``.
2256 In addition, it knows the following options:
2259 This option defines which disk image (see
2260 :ref:`disk_005fimages`) to use with this drive. If
2261 the filename contains comma, you must double it (for instance,
2262 "file=my,,file" to use file "my,file").
2264 Special files such as iSCSI devices can be specified using
2265 protocol specific URLs. See the section for "Device URL Syntax"
2266 for more information.
2269 This option defines on which type on interface the drive is
2270 connected. Available types are: ide, scsi, sd, mtd, floppy,
2271 pflash, virtio, none.
2273 ``bus=bus,unit=unit``
2274 These options define where is connected the drive by defining
2275 the bus number and the unit id.
2278 This option defines where is connected the drive by using an
2279 index in the list of available connectors of a given interface
2283 This option defines the type of the media: disk or cdrom.
2285 ``snapshot=snapshot``
2286 snapshot is "on" or "off" and controls snapshot mode for the
2287 given drive (see ``-snapshot``).
2290 cache is "none", "writeback", "unsafe", "directsync" or
2291 "writethrough" and controls how the host cache is used to access
2292 block data. This is a shortcut that sets the ``cache.direct``
2293 and ``cache.no-flush`` options (as in ``-blockdev``), and
2294 additionally ``cache.writeback``, which provides a default for
2295 the ``write-cache`` option of block guest devices (as in
2296 ``-device``). The modes correspond to the following settings:
2300  â
\94\82 cache.writeback cache.direct cache.no-flush
2301 ─────────────┼─────────────────────────────────────────────────
2302 writeback │ on off off
2304 writethrough │ off off off
2305 directsync │ off on off
2306 unsafe │ on off on
2308 The default mode is ``cache=writeback``.
2311 aio is "threads", or "native" and selects between pthread based
2312 disk I/O and native Linux AIO.
2315 Specify which disk format will be used rather than detecting the
2316 format. Can be used to specify format=raw to avoid interpreting
2317 an untrusted format header.
2319 ``werror=action,rerror=action``
2320 Specify which action to take on write and read errors. Valid
2321 actions are: "ignore" (ignore the error and try to continue),
2322 "stop" (pause QEMU), "report" (report the error to the guest),
2323 "enospc" (pause QEMU only if the host disk is full; report the
2324 error to the guest otherwise). The default setting is
2325 ``werror=enospc`` and ``rerror=report``.
2327 ``copy-on-read=copy-on-read``
2328 copy-on-read is "on" or "off" and enables whether to copy read
2329 backing file sectors into the image file.
2331 ``bps=b,bps_rd=r,bps_wr=w``
2332 Specify bandwidth throttling limits in bytes per second, either
2333 for all request types or for reads or writes only. Small values
2334 can lead to timeouts or hangs inside the guest. A safe minimum
2335 for disks is 2 MB/s.
2337 ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
2338 Specify bursts in bytes per second, either for all request types
2339 or for reads or writes only. Bursts allow the guest I/O to spike
2340 above the limit temporarily.
2342 ``iops=i,iops_rd=r,iops_wr=w``
2343 Specify request rate limits in requests per second, either for
2344 all request types or for reads or writes only.
2346 ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm``
2347 Specify bursts in requests per second, either for all request
2348 types or for reads or writes only. Bursts allow the guest I/O to
2349 spike above the limit temporarily.
2352 Let every is bytes of a request count as a new request for iops
2353 throttling purposes. Use this option to prevent guests from
2354 circumventing iops limits by sending fewer but larger requests.
2357 Join a throttling quota group with given name g. All drives that
2358 are members of the same group are accounted for together. Use
2359 this option to prevent guests from circumventing throttling
2360 limits by using many small disks instead of a single larger
2363 By default, the ``cache.writeback=on`` mode is used. It will report
2364 data writes as completed as soon as the data is present in the host
2365 page cache. This is safe as long as your guest OS makes sure to
2366 correctly flush disk caches where needed. If your guest OS does not
2367 handle volatile disk write caches correctly and your host crashes or
2368 loses power, then the guest may experience data corruption.
2370 For such guests, you should consider using ``cache.writeback=off``.
2371 This means that the host page cache will be used to read and write
2372 data, but write notification will be sent to the guest only after
2373 QEMU has made sure to flush each write to the disk. Be aware that
2374 this has a major impact on performance.
2376 When using the ``-snapshot`` option, unsafe caching is always used.
2378 Copy-on-read avoids accessing the same backing file sectors
2379 repeatedly and is useful when the backing file is over a slow
2380 network. By default copy-on-read is off.
2382 Instead of ``-cdrom`` you can use:
2386 |qemu_system| -drive file=file,index=2,media=cdrom
2388 Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use:
2392 |qemu_system| -drive file=file,index=0,media=disk
2393 |qemu_system| -drive file=file,index=1,media=disk
2394 |qemu_system| -drive file=file,index=2,media=disk
2395 |qemu_system| -drive file=file,index=3,media=disk
2397 You can open an image using pre-opened file descriptors from an fd
2403 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
2404 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
2405 -drive file=/dev/fdset/2,index=0,media=disk
2407 You can connect a CDROM to the slave of ide0:
2411 |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom
2413 If you don't specify the "file=" argument, you define an empty
2418 |qemu_system_x86| -drive if=ide,index=1,media=cdrom
2420 Instead of ``-fda``, ``-fdb``, you can use:
2424 |qemu_system_x86| -drive file=file,index=0,if=floppy
2425 |qemu_system_x86| -drive file=file,index=1,if=floppy
2427 By default, interface is "ide" and index is automatically
2432 |qemu_system_x86| -drive file=a -drive file=b"
2434 is interpreted like:
2438 |qemu_system_x86| -hda a -hdb b
2441 DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
2442 "-mtdblock file use 'file' as on-board Flash memory image\n",
2445 @item -mtdblock @var{file}
2447 Use @var{file} as on-board Flash memory image.
2451 Use file as on-board Flash memory image.
2454 DEF("sd", HAS_ARG, QEMU_OPTION_sd,
2455 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
2457 @item -sd @var{file}
2459 Use @var{file} as SecureDigital card image.
2463 Use file as SecureDigital card image.
2466 DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
2467 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
2469 @item -pflash @var{file}
2471 Use @var{file} as a parallel flash image.
2475 Use file as a parallel flash image.
2478 DEF("snapshot", 0, QEMU_OPTION_snapshot,
2479 "-snapshot write to temporary files instead of disk image files\n",
2484 Write to temporary files instead of disk image files. In this case,
2485 the raw disk image you use is not written back. You can however force
2486 the write back by pressing @key{C-a s} (@pxref{disk_images}).
2490 Write to temporary files instead of disk image files. In this case,
2491 the raw disk image you use is not written back. You can however
2492 force the write back by pressing C-a s (see
2493 :ref:`disk_005fimages`).
2496 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
2497 "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
2498 " [,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode]\n"
2499 " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
2500 " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
2501 " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
2502 " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
2503 " [[,throttling.iops-size=is]]\n"
2504 "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly]\n"
2505 "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly]\n"
2506 "-fsdev synth,id=id\n",
2511 @item -fsdev local,id=@var{id},path=@var{path},security_model=@var{security_model} [,writeout=@var{writeout}][,readonly][,fmode=@var{fmode}][,dmode=@var{dmode}] [,throttling.@var{option}=@var{value}[,throttling.@var{option}=@var{value}[,...]]]
2512 @itemx -fsdev proxy,id=@var{id},socket=@var{socket}[,writeout=@var{writeout}][,readonly]
2513 @itemx -fsdev proxy,id=@var{id},sock_fd=@var{sock_fd}[,writeout=@var{writeout}][,readonly]
2514 @itemx -fsdev synth,id=@var{id}[,readonly]
2516 Define a new file system device. Valid options are:
2519 Accesses to the filesystem are done by QEMU.
2521 Accesses to the filesystem are done by virtfs-proxy-helper(1).
2523 Synthetic filesystem, only used by QTests.
2525 Specifies identifier for this device.
2526 @item path=@var{path}
2527 Specifies the export path for the file system device. Files under
2528 this path will be available to the 9p client on the guest.
2529 @item security_model=@var{security_model}
2530 Specifies the security model to be used for this export path.
2531 Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
2532 In "passthrough" security model, files are stored using the same
2533 credentials as they are created on the guest. This requires QEMU
2534 to run as root. In "mapped-xattr" security model, some of the file
2535 attributes like uid, gid, mode bits and link target are stored as
2536 file attributes. For "mapped-file" these attributes are stored in the
2537 hidden .virtfs_metadata directory. Directories exported by this security model cannot
2538 interact with other unix tools. "none" security model is same as
2539 passthrough except the sever won't report failures if it fails to
2540 set file attributes like ownership. Security model is mandatory
2541 only for local fsdriver. Other fsdrivers (like proxy) don't take
2542 security model as a parameter.
2543 @item writeout=@var{writeout}
2544 This is an optional argument. The only supported value is "immediate".
2545 This means that host page cache will be used to read and write data but
2546 write notification will be sent to the guest only when the data has been
2547 reported as written by the storage subsystem.
2549 Enables exporting 9p share as a readonly mount for guests. By default
2550 read-write access is given.
2551 @item socket=@var{socket}
2552 Enables proxy filesystem driver to use passed socket file for communicating
2553 with virtfs-proxy-helper(1).
2554 @item sock_fd=@var{sock_fd}
2555 Enables proxy filesystem driver to use passed socket descriptor for
2556 communicating with virtfs-proxy-helper(1). Usually a helper like libvirt
2557 will create socketpair and pass one of the fds as sock_fd.
2558 @item fmode=@var{fmode}
2559 Specifies the default mode for newly created files on the host. Works only
2560 with security models "mapped-xattr" and "mapped-file".
2561 @item dmode=@var{dmode}
2562 Specifies the default mode for newly created directories on the host. Works
2563 only with security models "mapped-xattr" and "mapped-file".
2564 @item throttling.bps-total=@var{b},throttling.bps-read=@var{r},throttling.bps-write=@var{w}
2565 Specify bandwidth throttling limits in bytes per second, either for all request
2566 types or for reads or writes only.
2567 @item throttling.bps-total-max=@var{bm},bps-read-max=@var{rm},bps-write-max=@var{wm}
2568 Specify bursts in bytes per second, either for all request types or for reads
2569 or writes only. Bursts allow the guest I/O to spike above the limit
2571 @item throttling.iops-total=@var{i},throttling.iops-read=@var{r}, throttling.iops-write=@var{w}
2572 Specify request rate limits in requests per second, either for all request
2573 types or for reads or writes only.
2574 @item throttling.iops-total-max=@var{im},throttling.iops-read-max=@var{irm}, throttling.iops-write-max=@var{iwm}
2575 Specify bursts in requests per second, either for all request types or for reads
2576 or writes only. Bursts allow the guest I/O to spike above the limit temporarily.
2577 @item throttling.iops-size=@var{is}
2578 Let every @var{is} bytes of a request count as a new request for iops
2579 throttling purposes.
2582 -fsdev option is used along with -device driver "virtio-9p-...".
2583 @item -device virtio-9p-@var{type},fsdev=@var{id},mount_tag=@var{mount_tag}
2584 Options for virtio-9p-... driver are:
2587 Specifies the variant to be used. Supported values are "pci", "ccw" or "device",
2588 depending on the machine type.
2589 @item fsdev=@var{id}
2590 Specifies the id value specified along with -fsdev option.
2591 @item mount_tag=@var{mount_tag}
2592 Specifies the tag name to be used by the guest to mount this export point.
2597 ``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]``; \ ``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly]``; \ ``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly]``; \ ``-fsdev synth,id=id[,readonly]``
2598 Define a new file system device. Valid options are:
2601 Accesses to the filesystem are done by QEMU.
2604 Accesses to the filesystem are done by virtfs-proxy-helper(1).
2607 Synthetic filesystem, only used by QTests.
2610 Specifies identifier for this device.
2613 Specifies the export path for the file system device. Files
2614 under this path will be available to the 9p client on the guest.
2616 ``security_model=security_model``
2617 Specifies the security model to be used for this export path.
2618 Supported security models are "passthrough", "mapped-xattr",
2619 "mapped-file" and "none". In "passthrough" security model, files
2620 are stored using the same credentials as they are created on the
2621 guest. This requires QEMU to run as root. In "mapped-xattr"
2622 security model, some of the file attributes like uid, gid, mode
2623 bits and link target are stored as file attributes. For
2624 "mapped-file" these attributes are stored in the hidden
2625 .virtfs\_metadata directory. Directories exported by this
2626 security model cannot interact with other unix tools. "none"
2627 security model is same as passthrough except the sever won't
2628 report failures if it fails to set file attributes like
2629 ownership. Security model is mandatory only for local fsdriver.
2630 Other fsdrivers (like proxy) don't take security model as a
2633 ``writeout=writeout``
2634 This is an optional argument. The only supported value is
2635 "immediate". This means that host page cache will be used to
2636 read and write data but write notification will be sent to the
2637 guest only when the data has been reported as written by the
2641 Enables exporting 9p share as a readonly mount for guests. By
2642 default read-write access is given.
2645 Enables proxy filesystem driver to use passed socket file for
2646 communicating with virtfs-proxy-helper(1).
2649 Enables proxy filesystem driver to use passed socket descriptor
2650 for communicating with virtfs-proxy-helper(1). Usually a helper
2651 like libvirt will create socketpair and pass one of the fds as
2655 Specifies the default mode for newly created files on the host.
2656 Works only with security models "mapped-xattr" and
2660 Specifies the default mode for newly created directories on the
2661 host. Works only with security models "mapped-xattr" and
2664 ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
2665 Specify bandwidth throttling limits in bytes per second, either
2666 for all request types or for reads or writes only.
2668 ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm``
2669 Specify bursts in bytes per second, either for all request types
2670 or for reads or writes only. Bursts allow the guest I/O to spike
2671 above the limit temporarily.
2673 ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w``
2674 Specify request rate limits in requests per second, either for
2675 all request types or for reads or writes only.
2677 ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm``
2678 Specify bursts in requests per second, either for all request
2679 types or for reads or writes only. Bursts allow the guest I/O to
2680 spike above the limit temporarily.
2682 ``throttling.iops-size=is``
2683 Let every is bytes of a request count as a new request for iops
2684 throttling purposes.
2686 -fsdev option is used along with -device driver "virtio-9p-...".
2688 ``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag``
2689 Options for virtio-9p-... driver are:
2692 Specifies the variant to be used. Supported values are "pci",
2693 "ccw" or "device", depending on the machine type.
2696 Specifies the id value specified along with -fsdev option.
2698 ``mount_tag=mount_tag``
2699 Specifies the tag name to be used by the guest to mount this
2703 DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
2704 "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
2705 " [,id=id][,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
2706 "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly]\n"
2707 "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly]\n"
2708 "-virtfs synth,mount_tag=tag[,id=id][,readonly]\n",
2713 @item -virtfs local,path=@var{path},mount_tag=@var{mount_tag} ,security_model=@var{security_model}[,writeout=@var{writeout}][,readonly] [,fmode=@var{fmode}][,dmode=@var{dmode}][,multidevs=@var{multidevs}]
2714 @itemx -virtfs proxy,socket=@var{socket},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly]
2715 @itemx -virtfs proxy,sock_fd=@var{sock_fd},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly]
2716 @itemx -virtfs synth,mount_tag=@var{mount_tag}
2719 Define a new filesystem device and expose it to the guest using a virtio-9p-device. The general form of a Virtual File system pass-through options are:
2722 Accesses to the filesystem are done by QEMU.
2724 Accesses to the filesystem are done by virtfs-proxy-helper(1).
2726 Synthetic filesystem, only used by QTests.
2728 Specifies identifier for the filesystem device
2729 @item path=@var{path}
2730 Specifies the export path for the file system device. Files under
2731 this path will be available to the 9p client on the guest.
2732 @item security_model=@var{security_model}
2733 Specifies the security model to be used for this export path.
2734 Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
2735 In "passthrough" security model, files are stored using the same
2736 credentials as they are created on the guest. This requires QEMU
2737 to run as root. In "mapped-xattr" security model, some of the file
2738 attributes like uid, gid, mode bits and link target are stored as
2739 file attributes. For "mapped-file" these attributes are stored in the
2740 hidden .virtfs_metadata directory. Directories exported by this security model cannot
2741 interact with other unix tools. "none" security model is same as
2742 passthrough except the sever won't report failures if it fails to
2743 set file attributes like ownership. Security model is mandatory only
2744 for local fsdriver. Other fsdrivers (like proxy) don't take security
2745 model as a parameter.
2746 @item writeout=@var{writeout}
2747 This is an optional argument. The only supported value is "immediate".
2748 This means that host page cache will be used to read and write data but
2749 write notification will be sent to the guest only when the data has been
2750 reported as written by the storage subsystem.
2752 Enables exporting 9p share as a readonly mount for guests. By default
2753 read-write access is given.
2754 @item socket=@var{socket}
2755 Enables proxy filesystem driver to use passed socket file for
2756 communicating with virtfs-proxy-helper(1). Usually a helper like libvirt
2757 will create socketpair and pass one of the fds as sock_fd.
2759 Enables proxy filesystem driver to use passed 'sock_fd' as the socket
2760 descriptor for interfacing with virtfs-proxy-helper(1).
2761 @item fmode=@var{fmode}
2762 Specifies the default mode for newly created files on the host. Works only
2763 with security models "mapped-xattr" and "mapped-file".
2764 @item dmode=@var{dmode}
2765 Specifies the default mode for newly created directories on the host. Works
2766 only with security models "mapped-xattr" and "mapped-file".
2767 @item mount_tag=@var{mount_tag}
2768 Specifies the tag name to be used by the guest to mount this export point.
2769 @item multidevs=@var{multidevs}
2770 Specifies how to deal with multiple devices being shared with a 9p export.
2771 Supported behaviours are either "remap", "forbid" or "warn". The latter is
2772 the default behaviour on which virtfs 9p expects only one device to be
2773 shared with the same export, and if more than one device is shared and
2774 accessed via the same 9p export then only a warning message is logged
2775 (once) by qemu on host side. In order to avoid file ID collisions on guest
2776 you should either create a separate virtfs export for each device to be
2777 shared with guests (recommended way) or you might use "remap" instead which
2778 allows you to share multiple devices with only one export instead, which is
2779 achieved by remapping the original inode numbers from host to guest in a
2780 way that would prevent such collisions. Remapping inodes in such use cases
2781 is required because the original device IDs from host are never passed and
2782 exposed on guest. Instead all files of an export shared with virtfs always
2783 share the same device id on guest. So two files with identical inode
2784 numbers but from actually different devices on host would otherwise cause a
2785 file ID collision and hence potential misbehaviours on guest. "forbid" on
2786 the other hand assumes like "warn" that only one device is shared by the
2787 same export, however it will not only log a warning message but also
2788 deny access to additional devices on guest. Note though that "forbid" does
2789 currently not block all possible file access operations (e.g. readdir()
2790 would still return entries from other devices).
2794 ``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]``; \ ``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly]``; \ ``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly]``; \ ``-virtfs synth,mount_tag=mount_tag``
2795 Define a new filesystem device and expose it to the guest using a
2796 virtio-9p-device. The general form of a Virtual File system
2797 pass-through options are:
2800 Accesses to the filesystem are done by QEMU.
2803 Accesses to the filesystem are done by virtfs-proxy-helper(1).
2806 Synthetic filesystem, only used by QTests.
2809 Specifies identifier for the filesystem device
2812 Specifies the export path for the file system device. Files
2813 under this path will be available to the 9p client on the guest.
2815 ``security_model=security_model``
2816 Specifies the security model to be used for this export path.
2817 Supported security models are "passthrough", "mapped-xattr",
2818 "mapped-file" and "none". In "passthrough" security model, files
2819 are stored using the same credentials as they are created on the
2820 guest. This requires QEMU to run as root. In "mapped-xattr"
2821 security model, some of the file attributes like uid, gid, mode
2822 bits and link target are stored as file attributes. For
2823 "mapped-file" these attributes are stored in the hidden
2824 .virtfs\_metadata directory. Directories exported by this
2825 security model cannot interact with other unix tools. "none"
2826 security model is same as passthrough except the sever won't
2827 report failures if it fails to set file attributes like
2828 ownership. Security model is mandatory only for local fsdriver.
2829 Other fsdrivers (like proxy) don't take security model as a
2832 ``writeout=writeout``
2833 This is an optional argument. The only supported value is
2834 "immediate". This means that host page cache will be used to
2835 read and write data but write notification will be sent to the
2836 guest only when the data has been reported as written by the
2840 Enables exporting 9p share as a readonly mount for guests. By
2841 default read-write access is given.
2844 Enables proxy filesystem driver to use passed socket file for
2845 communicating with virtfs-proxy-helper(1). Usually a helper like
2846 libvirt will create socketpair and pass one of the fds as
2850 Enables proxy filesystem driver to use passed 'sock\_fd' as the
2851 socket descriptor for interfacing with virtfs-proxy-helper(1).
2854 Specifies the default mode for newly created files on the host.
2855 Works only with security models "mapped-xattr" and
2859 Specifies the default mode for newly created directories on the
2860 host. Works only with security models "mapped-xattr" and
2863 ``mount_tag=mount_tag``
2864 Specifies the tag name to be used by the guest to mount this
2867 ``multidevs=multidevs``
2868 Specifies how to deal with multiple devices being shared with a
2869 9p export. Supported behaviours are either "remap", "forbid" or
2870 "warn". The latter is the default behaviour on which virtfs 9p
2871 expects only one device to be shared with the same export, and
2872 if more than one device is shared and accessed via the same 9p
2873 export then only a warning message is logged (once) by qemu on
2874 host side. In order to avoid file ID collisions on guest you
2875 should either create a separate virtfs export for each device to
2876 be shared with guests (recommended way) or you might use "remap"
2877 instead which allows you to share multiple devices with only one
2878 export instead, which is achieved by remapping the original
2879 inode numbers from host to guest in a way that would prevent
2880 such collisions. Remapping inodes in such use cases is required
2881 because the original device IDs from host are never passed and
2882 exposed on guest. Instead all files of an export shared with
2883 virtfs always share the same device id on guest. So two files
2884 with identical inode numbers but from actually different devices
2885 on host would otherwise cause a file ID collision and hence
2886 potential misbehaviours on guest. "forbid" on the other hand
2887 assumes like "warn" that only one device is shared by the same
2888 export, however it will not only log a warning message but also
2889 deny access to additional devices on guest. Note though that
2890 "forbid" does currently not block all possible file access
2891 operations (e.g. readdir() would still return entries from other
2895 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2896 "-iscsi [user=user][,password=password]\n"
2897 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
2898 " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
2899 " [,timeout=timeout]\n"
2900 " iSCSI session parameters\n", QEMU_ARCH_ALL)
2905 Configure iSCSI session parameters.
2909 Configure iSCSI session parameters.
2917 DEFHEADING(USB options:)
2922 DEF("usb", 0, QEMU_OPTION_usb,
2923 "-usb enable on-board USB host controller (if not enabled by default)\n",
2928 Enable USB emulation on machine types with an on-board USB host controller (if
2929 not enabled by default). Note that on-board USB host controllers may not
2930 support USB 3.0. In this case @option{-device qemu-xhci} can be used instead
2931 on machines with PCI.
2935 Enable USB emulation on machine types with an on-board USB host
2936 controller (if not enabled by default). Note that on-board USB host
2937 controllers may not support USB 3.0. In this case
2938 ``-device qemu-xhci`` can be used instead on machines with PCI.
2941 DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
2942 "-usbdevice name add the host or guest USB device 'name'\n",
2946 @item -usbdevice @var{devname}
2948 Add the USB device @var{devname}. Note that this option is deprecated,
2949 please use @code{-device usb-...} instead. @xref{usb_devices}.
2954 Virtual Mouse. This will override the PS/2 mouse emulation when activated.
2957 Pointer device that uses absolute coordinates (like a touchscreen). This
2958 means QEMU is able to report the mouse position without having to grab the
2959 mouse. Also overrides the PS/2 mouse emulation when activated.
2962 Braille device. This will use BrlAPI to display the braille output on a real
2968 ``-usbdevice devname``
2969 Add the USB device devname. Note that this option is deprecated,
2970 please use ``-device usb-...`` instead. See
2971 :ref:`usb_005fdevices`.
2974 Virtual Mouse. This will override the PS/2 mouse emulation when
2978 Pointer device that uses absolute coordinates (like a
2979 touchscreen). This means QEMU is able to report the mouse
2980 position without having to grab the mouse. Also overrides the
2981 PS/2 mouse emulation when activated.
2984 Braille device. This will use BrlAPI to display the braille
2985 output on a real or fake device.
2993 DEFHEADING(Display options:)
2998 DEF("display", HAS_ARG, QEMU_OPTION_display,
2999 #if defined(CONFIG_SPICE)
3000 "-display spice-app[,gl=on|off]\n"
3002 #if defined(CONFIG_SDL)
3003 "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
3004 " [,window_close=on|off][,gl=on|core|es|off]\n"
3006 #if defined(CONFIG_GTK)
3007 "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
3009 #if defined(CONFIG_VNC)
3010 "-display vnc=<display>[,<optargs>]\n"
3012 #if defined(CONFIG_CURSES)
3013 "-display curses[,charset=<encoding>]\n"
3015 #if defined(CONFIG_OPENGL)
3016 "-display egl-headless[,rendernode=<file>]\n"
3019 " select display backend type\n"
3020 " The default display is equivalent to\n "
3021 #if defined(CONFIG_GTK)
3022 "\"-display gtk\"\n"
3023 #elif defined(CONFIG_SDL)
3024 "\"-display sdl\"\n"
3025 #elif defined(CONFIG_COCOA)
3026 "\"-display cocoa\"\n"
3027 #elif defined(CONFIG_VNC)
3028 "\"-vnc localhost:0,to=99,id=default\"\n"
3030 "\"-display none\"\n"
3034 @item -display @var{type}
3036 Select type of display to use. This option is a replacement for the
3037 old style -sdl/-curses/... options. Use @code{-display help} to list
3038 the available display types. Valid values for @var{type} are
3041 Display video output via SDL (usually in a separate graphics
3042 window; see the SDL documentation for other possibilities).
3044 Display video output via curses. For graphics device models which
3045 support a text mode, QEMU can display this output using a
3046 curses/ncurses interface. Nothing is displayed when the graphics
3047 device is in graphical mode or if the graphics device does not support
3048 a text mode. Generally only the VGA device models support text mode.
3049 The font charset used by the guest can be specified with the
3050 @code{charset} option, for example @code{charset=CP850} for IBM CP850
3051 encoding. The default is @code{CP437}.
3053 Do not display video output. The guest will still see an emulated
3054 graphics card, but its output will not be displayed to the QEMU
3055 user. This option differs from the -nographic option in that it
3056 only affects what is done with video output; -nographic also changes
3057 the destination of the serial and parallel port data.
3059 Display video output in a GTK window. This interface provides drop-down
3060 menus and other UI elements to configure and control the VM during
3063 Start a VNC server on display <arg>
3065 Offload all OpenGL operations to a local DRI device. For any graphical display,
3066 this display needs to be paired with either VNC or SPICE displays.
3068 Start QEMU as a Spice server and launch the default Spice client
3069 application. The Spice server will redirect the serial consoles and
3070 QEMU monitors. (Since 4.0)
3075 Select type of display to use. This option is a replacement for the
3076 old style -sdl/-curses/... options. Use ``-display help`` to list
3077 the available display types. Valid values for type are
3080 Display video output via SDL (usually in a separate graphics
3081 window; see the SDL documentation for other possibilities).
3084 Display video output via curses. For graphics device models
3085 which support a text mode, QEMU can display this output using a
3086 curses/ncurses interface. Nothing is displayed when the graphics
3087 device is in graphical mode or if the graphics device does not
3088 support a text mode. Generally only the VGA device models
3089 support text mode. The font charset used by the guest can be
3090 specified with the ``charset`` option, for example
3091 ``charset=CP850`` for IBM CP850 encoding. The default is
3095 Do not display video output. The guest will still see an
3096 emulated graphics card, but its output will not be displayed to
3097 the QEMU user. This option differs from the -nographic option in
3098 that it only affects what is done with video output; -nographic
3099 also changes the destination of the serial and parallel port
3103 Display video output in a GTK window. This interface provides
3104 drop-down menus and other UI elements to configure and control
3105 the VM during runtime.
3108 Start a VNC server on display <arg>
3111 Offload all OpenGL operations to a local DRI device. For any
3112 graphical display, this display needs to be paired with either
3113 VNC or SPICE displays.
3116 Start QEMU as a Spice server and launch the default Spice client
3117 application. The Spice server will redirect the serial consoles
3118 and QEMU monitors. (Since 4.0)
3121 DEF("nographic", 0, QEMU_OPTION_nographic,
3122 "-nographic disable graphical output and redirect serial I/Os to console\n",
3127 Normally, if QEMU is compiled with graphical window support, it displays
3128 output such as guest graphics, guest console, and the QEMU monitor in a
3129 window. With this option, you can totally disable graphical output so
3130 that QEMU is a simple command line application. The emulated serial port
3131 is redirected on the console and muxed with the monitor (unless
3132 redirected elsewhere explicitly). Therefore, you can still use QEMU to
3133 debug a Linux kernel with a serial console. Use @key{C-a h} for help on
3134 switching between the console and monitor.
3138 Normally, if QEMU is compiled with graphical window support, it
3139 displays output such as guest graphics, guest console, and the QEMU
3140 monitor in a window. With this option, you can totally disable
3141 graphical output so that QEMU is a simple command line application.
3142 The emulated serial port is redirected on the console and muxed with
3143 the monitor (unless redirected elsewhere explicitly). Therefore, you
3144 can still use QEMU to debug a Linux kernel with a serial console.
3145 Use C-a h for help on switching between the console and monitor.
3148 DEF("curses", 0, QEMU_OPTION_curses,
3149 "-curses shorthand for -display curses\n",
3154 Normally, if QEMU is compiled with graphical window support, it displays
3155 output such as guest graphics, guest console, and the QEMU monitor in a
3156 window. With this option, QEMU can display the VGA output when in text
3157 mode using a curses/ncurses interface. Nothing is displayed in graphical
3162 Normally, if QEMU is compiled with graphical window support, it
3163 displays output such as guest graphics, guest console, and the QEMU
3164 monitor in a window. With this option, QEMU can display the VGA
3165 output when in text mode using a curses/ncurses interface. Nothing
3166 is displayed in graphical mode.
3169 DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
3170 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
3175 Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
3176 affects the special keys (for fullscreen, monitor-mode switching, etc).
3180 Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
3181 this also affects the special keys (for fullscreen, monitor-mode
3185 DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
3186 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
3191 Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
3192 affects the special keys (for fullscreen, monitor-mode switching, etc).
3196 Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
3197 also affects the special keys (for fullscreen, monitor-mode
3201 DEF("no-quit", 0, QEMU_OPTION_no_quit,
3202 "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
3206 Disable SDL window close capability.
3210 Disable SDL window close capability.
3213 DEF("sdl", 0, QEMU_OPTION_sdl,
3214 "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
3225 DEF("spice", HAS_ARG, QEMU_OPTION_spice,
3226 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
3227 " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
3228 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
3229 " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
3230 " [,tls-ciphers=<list>]\n"
3231 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
3232 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
3233 " [,sasl][,password=<secret>][,disable-ticketing]\n"
3234 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
3235 " [,jpeg-wan-compression=[auto|never|always]]\n"
3236 " [,zlib-glz-wan-compression=[auto|never|always]]\n"
3237 " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
3238 " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
3239 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
3240 " [,gl=[on|off]][,rendernode=<file>]\n"
3242 " at least one of {port, tls-port} is mandatory\n",
3245 @item -spice @var{option}[,@var{option}[,...]]
3247 Enable the spice remote desktop protocol. Valid options are
3252 Set the TCP port spice is listening on for plaintext channels.
3255 Set the IP address spice is listening on. Default is any address.
3260 Force using the specified IP version.
3262 @item password=<secret>
3263 Set the password you need to authenticate.
3266 Require that the client use SASL to authenticate with the spice.
3267 The exact choice of authentication method used is controlled from the
3268 system / user's SASL configuration file for the 'qemu' service. This
3269 is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
3270 unprivileged user, an environment variable SASL_CONF_PATH can be used
3271 to make it search alternate locations for the service config.
3272 While some SASL auth methods can also provide data encryption (eg GSSAPI),
3273 it is recommended that SASL always be combined with the 'tls' and
3274 'x509' settings to enable use of SSL and server certificates. This
3275 ensures a data encryption preventing compromise of authentication
3278 @item disable-ticketing
3279 Allow client connects without authentication.
3281 @item disable-copy-paste
3282 Disable copy paste between the client and the guest.
3284 @item disable-agent-file-xfer
3285 Disable spice-vdagent based file-xfer between the client and the guest.
3288 Set the TCP port spice is listening on for encrypted channels.
3290 @item x509-dir=<dir>
3291 Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
3293 @item x509-key-file=<file>
3294 @itemx x509-key-password=<file>
3295 @itemx x509-cert-file=<file>
3296 @itemx x509-cacert-file=<file>
3297 @itemx x509-dh-key-file=<file>
3298 The x509 file names can also be configured individually.
3300 @item tls-ciphers=<list>
3301 Specify which ciphers to use.
3303 @item tls-channel=[main|display|cursor|inputs|record|playback]
3304 @itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
3305 Force specific channel to be used with or without TLS encryption. The
3306 options can be specified multiple times to configure multiple
3307 channels. The special name "default" can be used to set the default
3308 mode. For channels which are not explicitly forced into one mode the
3309 spice client is allowed to pick tls/plaintext as he pleases.
3311 @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
3312 Configure image compression (lossless).
3313 Default is auto_glz.
3315 @item jpeg-wan-compression=[auto|never|always]
3316 @itemx zlib-glz-wan-compression=[auto|never|always]
3317 Configure wan image compression (lossy for slow links).
3320 @item streaming-video=[off|all|filter]
3321 Configure video stream detection. Default is off.
3323 @item agent-mouse=[on|off]
3324 Enable/disable passing mouse events via vdagent. Default is on.
3326 @item playback-compression=[on|off]
3327 Enable/disable audio stream compression (using celt 0.5.1). Default is on.
3329 @item seamless-migration=[on|off]
3330 Enable/disable spice seamless migration. Default is off.
3333 Enable/disable OpenGL context. Default is off.
3335 @item rendernode=<file>
3336 DRM render node for OpenGL rendering. If not specified, it will pick
3337 the first available. (Since 2.9)
3342 ``-spice option[,option[,...]]``
3343 Enable the spice remote desktop protocol. Valid options are
3346 Set the TCP port spice is listening on for plaintext channels.
3349 Set the IP address spice is listening on. Default is any
3352 ``ipv4``; \ ``ipv6``; \ ``unix``
3353 Force using the specified IP version.
3355 ``password=<secret>``
3356 Set the password you need to authenticate.
3359 Require that the client use SASL to authenticate with the spice.
3360 The exact choice of authentication method used is controlled
3361 from the system / user's SASL configuration file for the 'qemu'
3362 service. This is typically found in /etc/sasl2/qemu.conf. If
3363 running QEMU as an unprivileged user, an environment variable
3364 SASL\_CONF\_PATH can be used to make it search alternate
3365 locations for the service config. While some SASL auth methods
3366 can also provide data encryption (eg GSSAPI), it is recommended
3367 that SASL always be combined with the 'tls' and 'x509' settings
3368 to enable use of SSL and server certificates. This ensures a
3369 data encryption preventing compromise of authentication
3372 ``disable-ticketing``
3373 Allow client connects without authentication.
3375 ``disable-copy-paste``
3376 Disable copy paste between the client and the guest.
3378 ``disable-agent-file-xfer``
3379 Disable spice-vdagent based file-xfer between the client and the
3383 Set the TCP port spice is listening on for encrypted channels.
3386 Set the x509 file directory. Expects same filenames as -vnc
3389 ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>``
3390 The x509 file names can also be configured individually.
3392 ``tls-ciphers=<list>``
3393 Specify which ciphers to use.
3395 ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]``
3396 Force specific channel to be used with or without TLS
3397 encryption. The options can be specified multiple times to
3398 configure multiple channels. The special name "default" can be
3399 used to set the default mode. For channels which are not
3400 explicitly forced into one mode the spice client is allowed to
3401 pick tls/plaintext as he pleases.
3403 ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]``
3404 Configure image compression (lossless). Default is auto\_glz.
3406 ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]``
3407 Configure wan image compression (lossy for slow links). Default
3410 ``streaming-video=[off|all|filter]``
3411 Configure video stream detection. Default is off.
3413 ``agent-mouse=[on|off]``
3414 Enable/disable passing mouse events via vdagent. Default is on.
3416 ``playback-compression=[on|off]``
3417 Enable/disable audio stream compression (using celt 0.5.1).
3420 ``seamless-migration=[on|off]``
3421 Enable/disable spice seamless migration. Default is off.
3424 Enable/disable OpenGL context. Default is off.
3426 ``rendernode=<file>``
3427 DRM render node for OpenGL rendering. If not specified, it will
3428 pick the first available. (Since 2.9)
3431 DEF("portrait", 0, QEMU_OPTION_portrait,
3432 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
3437 Rotate graphical output 90 deg left (only PXA LCD).
3441 Rotate graphical output 90 deg left (only PXA LCD).
3444 DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
3445 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
3448 @item -rotate @var{deg}
3450 Rotate graphical output some deg left (only PXA LCD).
3454 Rotate graphical output some deg left (only PXA LCD).
3457 DEF("vga", HAS_ARG, QEMU_OPTION_vga,
3458 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
3459 " select video card type\n", QEMU_ARCH_ALL)
3461 @item -vga @var{type}
3463 Select type of VGA card to emulate. Valid values for @var{type} are
3466 Cirrus Logic GD5446 Video card. All Windows versions starting from
3467 Windows 95 should recognize and use this graphic card. For optimal
3468 performances, use 16 bit color depth in the guest and the host OS.
3469 (This card was the default before QEMU 2.2)
3471 Standard VGA card with Bochs VBE extensions. If your guest OS
3472 supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
3473 to use high resolution modes (>= 1280x1024x16) then you should use
3474 this option. (This card is the default since QEMU 2.2)
3476 VMWare SVGA-II compatible adapter. Use it if you have sufficiently
3477 recent XFree86/XOrg server or Windows guest with a driver for this
3480 QXL paravirtual graphic card. It is VGA compatible (including VESA
3481 2.0 VBE support). Works best with qxl guest drivers installed though.
3482 Recommended choice when using the spice protocol.
3484 (sun4m only) Sun TCX framebuffer. This is the default framebuffer for
3485 sun4m machines and offers both 8-bit and 24-bit colour depths at a
3486 fixed resolution of 1024x768.
3488 (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
3489 for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
3490 resolutions aimed at people wishing to run older Solaris versions.
3499 Select type of VGA card to emulate. Valid values for type are
3502 Cirrus Logic GD5446 Video card. All Windows versions starting
3503 from Windows 95 should recognize and use this graphic card. For
3504 optimal performances, use 16 bit color depth in the guest and
3505 the host OS. (This card was the default before QEMU 2.2)
3508 Standard VGA card with Bochs VBE extensions. If your guest OS
3509 supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if
3510 you want to use high resolution modes (>= 1280x1024x16) then you
3511 should use this option. (This card is the default since QEMU
3515 VMWare SVGA-II compatible adapter. Use it if you have
3516 sufficiently recent XFree86/XOrg server or Windows guest with a
3517 driver for this card.
3520 QXL paravirtual graphic card. It is VGA compatible (including
3521 VESA 2.0 VBE support). Works best with qxl guest drivers
3522 installed though. Recommended choice when using the spice
3526 (sun4m only) Sun TCX framebuffer. This is the default
3527 framebuffer for sun4m machines and offers both 8-bit and 24-bit
3528 colour depths at a fixed resolution of 1024x768.
3531 (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit
3532 framebuffer for sun4m machines available in both 1024x768
3533 (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people
3534 wishing to run older Solaris versions.
3543 DEF("full-screen", 0, QEMU_OPTION_full_screen,
3544 "-full-screen start in full screen\n", QEMU_ARCH_ALL)
3547 @findex -full-screen
3548 Start in full screen.
3552 Start in full screen.
3555 DEF("g", HAS_ARG, QEMU_OPTION_g ,
3556 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
3557 QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
3559 @item -g @var{width}x@var{height}[x@var{depth}]
3561 Set the initial graphical resolution and depth (PPC, SPARC only).
3563 For PPC the default is 800x600x32.
3565 For SPARC with the TCX graphics device, the default is 1024x768x8 with the
3566 option of 1024x768x24. For cgthree, the default is 1024x768x8 with the option
3567 of 1152x900x8 for people who wish to use OBP.
3571 ``-g widthxheight[xdepth]``
3572 Set the initial graphical resolution and depth (PPC, SPARC only).
3574 For PPC the default is 800x600x32.
3576 For SPARC with the TCX graphics device, the default is 1024x768x8
3577 with the option of 1024x768x24. For cgthree, the default is
3578 1024x768x8 with the option of 1152x900x8 for people who wish to use
3582 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
3583 "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
3585 @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
3587 Normally, if QEMU is compiled with graphical window support, it displays
3588 output such as guest graphics, guest console, and the QEMU monitor in a
3589 window. With this option, you can have QEMU listen on VNC display
3590 @var{display} and redirect the VGA display over the VNC session. It is
3591 very useful to enable the usb tablet device when using this option
3592 (option @option{-device usb-tablet}). When using the VNC display, you
3593 must use the @option{-k} parameter to set the keyboard layout if you are
3594 not using en-us. Valid syntax for the @var{display} is
3600 With this option, QEMU will try next available VNC @var{display}s, until the
3601 number @var{L}, if the origianlly defined "-vnc @var{display}" is not
3602 available, e.g. port 5900+@var{display} is already used by another
3603 application. By default, to=0.
3605 @item @var{host}:@var{d}
3607 TCP connections will only be allowed from @var{host} on display @var{d}.
3608 By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
3609 be omitted in which case the server will accept connections from any host.
3611 @item unix:@var{path}
3613 Connections will be allowed over UNIX domain sockets where @var{path} is the
3614 location of a unix socket to listen for connections on.
3618 VNC is initialized but not started. The monitor @code{change} command
3619 can be used to later start the VNC server.
3623 Following the @var{display} value there may be one or more @var{option} flags
3624 separated by commas. Valid options are
3630 Connect to a listening VNC client via a ``reverse'' connection. The
3631 client is specified by the @var{display}. For reverse network
3632 connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
3633 is a TCP port number, not a display number.
3637 Opens an additional TCP listening port dedicated to VNC Websocket connections.
3638 If a bare @var{websocket} option is given, the Websocket port is
3639 5700+@var{display}. An alternative port can be specified with the
3640 syntax @code{websocket}=@var{port}.
3642 If @var{host} is specified connections will only be allowed from this host.
3643 It is possible to control the websocket listen address independently, using
3644 the syntax @code{websocket}=@var{host}:@var{port}.
3646 If no TLS credentials are provided, the websocket connection runs in
3647 unencrypted mode. If TLS credentials are provided, the websocket connection
3648 requires encrypted client connections.
3652 Require that password based authentication is used for client connections.
3654 The password must be set separately using the @code{set_password} command in
3655 the @ref{pcsys_monitor}. The syntax to change your password is:
3656 @code{set_password <protocol> <password>} where <protocol> could be either
3659 If you would like to change <protocol> password expiration, you should use
3660 @code{expire_password <protocol> <expiration-time>} where expiration time could
3661 be one of the following options: now, never, +seconds or UNIX time of
3662 expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
3663 to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
3666 You can also use keywords "now" or "never" for the expiration time to
3667 allow <protocol> password to expire immediately or never expire.
3669 @item tls-creds=@var{ID}
3671 Provides the ID of a set of TLS credentials to use to secure the
3672 VNC server. They will apply to both the normal VNC server socket
3673 and the websocket socket (if enabled). Setting TLS credentials
3674 will cause the VNC server socket to enable the VeNCrypt auth
3675 mechanism. The credentials should have been previously created
3676 using the @option{-object tls-creds} argument.
3678 @item tls-authz=@var{ID}
3680 Provides the ID of the QAuthZ authorization object against which
3681 the client's x509 distinguished name will validated. This object is
3682 only resolved at time of use, so can be deleted and recreated on the
3683 fly while the VNC server is active. If missing, it will default
3688 Require that the client use SASL to authenticate with the VNC server.
3689 The exact choice of authentication method used is controlled from the
3690 system / user's SASL configuration file for the 'qemu' service. This
3691 is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
3692 unprivileged user, an environment variable SASL_CONF_PATH can be used
3693 to make it search alternate locations for the service config.
3694 While some SASL auth methods can also provide data encryption (eg GSSAPI),
3695 it is recommended that SASL always be combined with the 'tls' and
3696 'x509' settings to enable use of SSL and server certificates. This
3697 ensures a data encryption preventing compromise of authentication
3698 credentials. See the @ref{vnc_security} section for details on using
3699 SASL authentication.
3701 @item sasl-authz=@var{ID}
3703 Provides the ID of the QAuthZ authorization object against which
3704 the client's SASL username will validated. This object is
3705 only resolved at time of use, so can be deleted and recreated on the
3706 fly while the VNC server is active. If missing, it will default
3711 Legacy method for enabling authorization of clients against the
3712 x509 distinguished name and SASL username. It results in the creation
3713 of two @code{authz-list} objects with IDs of @code{vnc.username} and
3714 @code{vnc.x509dname}. The rules for these objects must be configured
3715 with the HMP ACL commands.
3717 This option is deprecated and should no longer be used. The new
3718 @option{sasl-authz} and @option{tls-authz} options are a
3723 Enable lossy compression methods (gradient, JPEG, ...). If this
3724 option is set, VNC client may receive lossy framebuffer updates
3725 depending on its encoding settings. Enabling this option can save
3726 a lot of bandwidth at the expense of quality.
3730 Disable adaptive encodings. Adaptive encodings are enabled by default.
3731 An adaptive encoding will try to detect frequently updated screen regions,
3732 and send updates in these regions using a lossy encoding (like JPEG).
3733 This can be really helpful to save bandwidth when playing videos. Disabling
3734 adaptive encodings restores the original static behavior of encodings
3737 @item share=[allow-exclusive|force-shared|ignore]
3739 Set display sharing policy. 'allow-exclusive' allows clients to ask
3740 for exclusive access. As suggested by the rfb spec this is
3741 implemented by dropping other connections. Connecting multiple
3742 clients in parallel requires all clients asking for a shared session
3743 (vncviewer: -shared switch). This is the default. 'force-shared'
3744 disables exclusive client access. Useful for shared desktop sessions,
3745 where you don't want someone forgetting specify -shared disconnect
3746 everybody else. 'ignore' completely ignores the shared flag and
3747 allows everybody connect unconditionally. Doesn't conform to the rfb
3748 spec but is traditional QEMU behavior.
3752 Set keyboard delay, for key down and key up events, in milliseconds.
3753 Default is 10. Keyboards are low-bandwidth devices, so this slowdown
3754 can help the device and guest to keep up and not lose events in case
3755 events are arriving in bulk. Possible causes for the latter are flaky
3756 network connections, or scripts for automated testing.
3758 @item audiodev=@var{audiodev}
3760 Use the specified @var{audiodev} when the VNC client requests audio
3761 transmission. When not using an -audiodev argument, this option must
3762 be omitted, otherwise is must be present and specify a valid audiodev.
3767 ``-vnc display[,option[,option[,...]]]``
3768 Normally, if QEMU is compiled with graphical window support, it
3769 displays output such as guest graphics, guest console, and the QEMU
3770 monitor in a window. With this option, you can have QEMU listen on
3771 VNC display display and redirect the VGA display over the VNC
3772 session. It is very useful to enable the usb tablet device when
3773 using this option (option ``-device usb-tablet``). When using the
3774 VNC display, you must use the ``-k`` parameter to set the keyboard
3775 layout if you are not using en-us. Valid syntax for the display is
3778 With this option, QEMU will try next available VNC displays,
3779 until the number L, if the origianlly defined "-vnc display" is
3780 not available, e.g. port 5900+display is already used by another
3781 application. By default, to=0.
3784 TCP connections will only be allowed from host on display d. By
3785 convention the TCP port is 5900+d. Optionally, host can be
3786 omitted in which case the server will accept connections from
3790 Connections will be allowed over UNIX domain sockets where path
3791 is the location of a unix socket to listen for connections on.
3794 VNC is initialized but not started. The monitor ``change``
3795 command can be used to later start the VNC server.
3797 Following the display value there may be one or more option flags
3798 separated by commas. Valid options are
3801 Connect to a listening VNC client via a "reverse" connection.
3802 The client is specified by the display. For reverse network
3803 connections (host:d,``reverse``), the d argument is a TCP port
3804 number, not a display number.
3807 Opens an additional TCP listening port dedicated to VNC
3808 Websocket connections. If a bare websocket option is given, the
3809 Websocket port is 5700+display. An alternative port can be
3810 specified with the syntax ``websocket``\ =port.
3812 If host is specified connections will only be allowed from this
3813 host. It is possible to control the websocket listen address
3814 independently, using the syntax ``websocket``\ =host:port.
3816 If no TLS credentials are provided, the websocket connection
3817 runs in unencrypted mode. If TLS credentials are provided, the
3818 websocket connection requires encrypted client connections.
3821 Require that password based authentication is used for client
3824 The password must be set separately using the ``set_password``
3825 command in the :ref:`pcsys_005fmonitor`. The
3826 syntax to change your password is:
3827 ``set_password <protocol> <password>`` where <protocol> could be
3828 either "vnc" or "spice".
3830 If you would like to change <protocol> password expiration, you
3831 should use ``expire_password <protocol> <expiration-time>``
3832 where expiration time could be one of the following options:
3833 now, never, +seconds or UNIX time of expiration, e.g. +60 to
3834 make password expire in 60 seconds, or 1335196800 to make
3835 password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for
3836 this date and time).
3838 You can also use keywords "now" or "never" for the expiration
3839 time to allow <protocol> password to expire immediately or never
3843 Provides the ID of a set of TLS credentials to use to secure the
3844 VNC server. They will apply to both the normal VNC server socket
3845 and the websocket socket (if enabled). Setting TLS credentials
3846 will cause the VNC server socket to enable the VeNCrypt auth
3847 mechanism. The credentials should have been previously created
3848 using the ``-object tls-creds`` argument.
3851 Provides the ID of the QAuthZ authorization object against which
3852 the client's x509 distinguished name will validated. This object
3853 is only resolved at time of use, so can be deleted and recreated
3854 on the fly while the VNC server is active. If missing, it will
3855 default to denying access.
3858 Require that the client use SASL to authenticate with the VNC
3859 server. The exact choice of authentication method used is
3860 controlled from the system / user's SASL configuration file for
3861 the 'qemu' service. This is typically found in
3862 /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user,
3863 an environment variable SASL\_CONF\_PATH can be used to make it
3864 search alternate locations for the service config. While some
3865 SASL auth methods can also provide data encryption (eg GSSAPI),
3866 it is recommended that SASL always be combined with the 'tls'
3867 and 'x509' settings to enable use of SSL and server
3868 certificates. This ensures a data encryption preventing
3869 compromise of authentication credentials. See the
3870 :ref:`vnc_005fsecurity` section for details on
3871 using SASL authentication.
3874 Provides the ID of the QAuthZ authorization object against which
3875 the client's SASL username will validated. This object is only
3876 resolved at time of use, so can be deleted and recreated on the
3877 fly while the VNC server is active. If missing, it will default
3881 Legacy method for enabling authorization of clients against the
3882 x509 distinguished name and SASL username. It results in the
3883 creation of two ``authz-list`` objects with IDs of
3884 ``vnc.username`` and ``vnc.x509dname``. The rules for these
3885 objects must be configured with the HMP ACL commands.
3887 This option is deprecated and should no longer be used. The new
3888 ``sasl-authz`` and ``tls-authz`` options are a replacement.
3891 Enable lossy compression methods (gradient, JPEG, ...). If this
3892 option is set, VNC client may receive lossy framebuffer updates
3893 depending on its encoding settings. Enabling this option can
3894 save a lot of bandwidth at the expense of quality.
3897 Disable adaptive encodings. Adaptive encodings are enabled by
3898 default. An adaptive encoding will try to detect frequently
3899 updated screen regions, and send updates in these regions using
3900 a lossy encoding (like JPEG). This can be really helpful to save
3901 bandwidth when playing videos. Disabling adaptive encodings
3902 restores the original static behavior of encodings like Tight.
3904 ``share=[allow-exclusive|force-shared|ignore]``
3905 Set display sharing policy. 'allow-exclusive' allows clients to
3906 ask for exclusive access. As suggested by the rfb spec this is
3907 implemented by dropping other connections. Connecting multiple
3908 clients in parallel requires all clients asking for a shared
3909 session (vncviewer: -shared switch). This is the default.
3910 'force-shared' disables exclusive client access. Useful for
3911 shared desktop sessions, where you don't want someone forgetting
3912 specify -shared disconnect everybody else. 'ignore' completely
3913 ignores the shared flag and allows everybody connect
3914 unconditionally. Doesn't conform to the rfb spec but is
3915 traditional QEMU behavior.
3918 Set keyboard delay, for key down and key up events, in
3919 milliseconds. Default is 10. Keyboards are low-bandwidth
3920 devices, so this slowdown can help the device and guest to keep
3921 up and not lose events in case events are arriving in bulk.
3922 Possible causes for the latter are flaky network connections, or
3923 scripts for automated testing.
3925 ``audiodev=audiodev``
3926 Use the specified audiodev when the VNC client requests audio
3927 transmission. When not using an -audiodev argument, this option
3928 must be omitted, otherwise is must be present and specify a
3935 ARCHHEADING(, QEMU_ARCH_I386)
3937 ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
3942 DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
3943 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
3948 Use it when installing Windows 2000 to avoid a disk full bug. After
3949 Windows 2000 is installed, you no longer need this option (this option
3950 slows down the IDE transfers).
3954 Use it when installing Windows 2000 to avoid a disk full bug. After
3955 Windows 2000 is installed, you no longer need this option (this
3956 option slows down the IDE transfers).
3959 DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
3960 "-no-fd-bootchk disable boot signature checking for floppy disks\n",
3963 @item -no-fd-bootchk
3964 @findex -no-fd-bootchk
3965 Disable boot signature checking for floppy disks in BIOS. May
3966 be needed to boot from old floppy disks.
3970 Disable boot signature checking for floppy disks in BIOS. May be
3971 needed to boot from old floppy disks.
3974 DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
3975 "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
3979 Disable ACPI (Advanced Configuration and Power Interface) support. Use
3980 it if your guest OS complains about ACPI problems (PC target machine
3985 Disable ACPI (Advanced Configuration and Power Interface) support.
3986 Use it if your guest OS complains about ACPI problems (PC target
3990 DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
3991 "-no-hpet disable HPET\n", QEMU_ARCH_I386)
3995 Disable HPET support.
3999 Disable HPET support.
4002 DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
4003 "-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"
4004 " ACPI table description\n", QEMU_ARCH_I386)
4006 @item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...]
4008 Add ACPI table with specified header fields and context from specified files.
4009 For file=, take whole ACPI table from the specified files, including all
4010 ACPI headers (possible overridden by other options).
4011 For data=, only data
4012 portion of the table is used, all header information is specified in the
4014 If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
4015 fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
4016 to ensure the field matches required by the Microsoft SLIC spec and the ACPI
4020 ``-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]...]``
4021 Add ACPI table with specified header fields and context from
4022 specified files. For file=, take whole ACPI table from the specified
4023 files, including all ACPI headers (possible overridden by other
4024 options). For data=, only data portion of the table is used, all
4025 header information is specified in the command line. If a SLIC table
4026 is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id
4027 fields will override the same in the RSDT and the FADT (a.k.a.
4028 FACP), in order to ensure the field matches required by the
4029 Microsoft SLIC spec and the ACPI spec.
4032 DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
4033 "-smbios file=binary\n"
4034 " load SMBIOS entry from binary file\n"
4035 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
4037 " specify SMBIOS type 0 fields\n"
4038 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
4039 " [,uuid=uuid][,sku=str][,family=str]\n"
4040 " specify SMBIOS type 1 fields\n"
4041 "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
4042 " [,asset=str][,location=str]\n"
4043 " specify SMBIOS type 2 fields\n"
4044 "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
4046 " specify SMBIOS type 3 fields\n"
4047 "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
4048 " [,asset=str][,part=str]\n"
4049 " specify SMBIOS type 4 fields\n"
4050 "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
4051 " [,asset=str][,part=str][,speed=%d]\n"
4052 " specify SMBIOS type 17 fields\n",
4053 QEMU_ARCH_I386 | QEMU_ARCH_ARM)
4055 @item -smbios file=@var{binary}
4057 Load SMBIOS entry from binary file.
4059 @item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
4060 Specify SMBIOS type 0 fields
4062 @item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}]
4063 Specify SMBIOS type 1 fields
4065 @item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}]
4066 Specify SMBIOS type 2 fields
4068 @item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
4069 Specify SMBIOS type 3 fields
4071 @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
4072 Specify SMBIOS type 4 fields
4074 @item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}]
4075 Specify SMBIOS type 17 fields
4078 ``-smbios file=binary``
4079 Load SMBIOS entry from binary file.
4081 ``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]``
4082 Specify SMBIOS type 0 fields
4084 ``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]``
4085 Specify SMBIOS type 1 fields
4087 ``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]``
4088 Specify SMBIOS type 2 fields
4090 ``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
4091 Specify SMBIOS type 3 fields
4093 ``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]``
4094 Specify SMBIOS type 4 fields
4096 ``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]``
4097 Specify SMBIOS type 17 fields
4105 DEFHEADING(Network options:)
4110 DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
4112 "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
4113 " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
4114 " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
4115 " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
4116 " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
4118 "[,smb=dir[,smbserver=addr]]\n"
4120 " configure a user mode network backend with ID 'str',\n"
4121 " its DHCP server and optional services\n"
4124 "-netdev tap,id=str,ifname=name\n"
4125 " configure a host TAP network backend with ID 'str'\n"
4127 "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
4128 " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
4129 " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
4131 " configure a host TAP network backend with ID 'str'\n"
4132 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
4133 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
4134 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
4135 " to deconfigure it\n"
4136 " use '[down]script=no' to disable script execution\n"
4137 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
4139 " use 'fd=h' to connect to an already opened TAP interface\n"
4140 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
4141 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
4142 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
4143 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
4144 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
4145 " use vhost=on to enable experimental in kernel accelerator\n"
4146 " (only has effect for virtio guests which use MSIX)\n"
4147 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
4148 " use 'vhostfd=h' to connect to an already opened vhost net device\n"
4149 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
4150 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
4151 " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
4152 " spent on busy polling for vhost net\n"
4153 "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
4154 " configure a host TAP network backend with ID 'str' that is\n"
4155 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
4156 " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
4159 "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
4160 " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
4161 " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
4162 " [,rxcookie=rxcookie][,offset=offset]\n"
4163 " configure a network backend with ID 'str' connected to\n"
4164 " an Ethernet over L2TPv3 pseudowire.\n"
4165 " Linux kernel 3.3+ as well as most routers can talk\n"
4166 " L2TPv3. This transport allows connecting a VM to a VM,\n"
4167 " VM to a router and even VM to Host. It is a nearly-universal\n"
4168 " standard (RFC3931). Note - this implementation uses static\n"
4169 " pre-configured tunnels (same as the Linux kernel).\n"
4170 " use 'src=' to specify source address\n"
4171 " use 'dst=' to specify destination address\n"
4172 " use 'udp=on' to specify udp encapsulation\n"
4173 " use 'srcport=' to specify source udp port\n"
4174 " use 'dstport=' to specify destination udp port\n"
4175 " use 'ipv6=on' to force v6\n"
4176 " L2TPv3 uses cookies to prevent misconfiguration as\n"
4177 " well as a weak security measure\n"
4178 " use 'rxcookie=0x012345678' to specify a rxcookie\n"
4179 " use 'txcookie=0x012345678' to specify a txcookie\n"
4180 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
4181 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
4182 " use 'pincounter=on' to work around broken counter handling in peer\n"
4183 " use 'offset=X' to add an extra offset between header and data\n"
4185 "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
4186 " configure a network backend to connect to another network\n"
4187 " using a socket connection\n"
4188 "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
4189 " configure a network backend to connect to a multicast maddr and port\n"
4190 " use 'localaddr=addr' to specify the host address to send packets from\n"
4191 "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
4192 " configure a network backend to connect to another network\n"
4193 " using an UDP tunnel\n"
4195 "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
4196 " configure a network backend to connect to port 'n' of a vde switch\n"
4197 " running on host and listening for incoming connections on 'socketpath'.\n"
4198 " Use group 'groupname' and mode 'octalmode' to change default\n"
4199 " ownership and permissions for communication port.\n"
4201 #ifdef CONFIG_NETMAP
4202 "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
4203 " attach to the existing netmap-enabled network interface 'name', or to a\n"
4204 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
4205 " netmap device, defaults to '/dev/netmap')\n"
4208 "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
4209 " configure a vhost-user network, backed by a chardev 'dev'\n"
4211 "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
4212 " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
4213 DEF("nic", HAS_ARG, QEMU_OPTION_nic,
4224 #ifdef CONFIG_NETMAP
4230 "socket][,option][,...][mac=macaddr]\n"
4231 " initialize an on-board / default host NIC (using MAC address\n"
4232 " macaddr) and connect it to the given host network backend\n"
4233 "-nic none use it alone to have zero network devices (the default is to\n"
4234 " provided a 'user' network connection)\n",
4236 DEF("net", HAS_ARG, QEMU_OPTION_net,
4237 "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
4238 " configure or create an on-board (or machine default) NIC and\n"
4239 " connect it to hub 0 (please use -nic unless you need a hub)\n"
4249 #ifdef CONFIG_NETMAP
4252 "socket][,option][,option][,...]\n"
4253 " old way to initialize a host network interface\n"
4254 " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
4256 @item -nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]
4258 This option is a shortcut for configuring both the on-board (default) guest
4259 NIC hardware and the host network backend in one go. The host backend options
4260 are the same as with the corresponding @option{-netdev} options below.
4261 The guest NIC model can be set with @option{model=@var{modelname}}.
4262 Use @option{model=help} to list the available device types.
4263 The hardware MAC address can be set with @option{mac=@var{macaddr}}.
4265 The following two example do exactly the same, to show how @option{-nic} can
4266 be used to shorten the command line length:
4268 @value{qemu_system} -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
4269 @value{qemu_system} -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
4273 Indicate that no network devices should be configured. It is used to override
4274 the default configuration (default NIC with ``user'' host network backend)
4275 which is activated if no other networking options are provided.
4277 @item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
4279 Configure user mode host network backend which requires no administrator
4280 privilege to run. Valid options are:
4284 Assign symbolic name for use in monitor commands.
4286 @item ipv4=on|off and ipv6=on|off
4287 Specify that either IPv4 or IPv6 must be enabled. If neither is specified
4288 both protocols are enabled.
4290 @item net=@var{addr}[/@var{mask}]
4291 Set IP network address the guest will see. Optionally specify the netmask,
4292 either in the form a.b.c.d or as number of valid top-most bits. Default is
4295 @item host=@var{addr}
4296 Specify the guest-visible address of the host. Default is the 2nd IP in the
4297 guest network, i.e. x.x.x.2.
4299 @item ipv6-net=@var{addr}[/@var{int}]
4300 Set IPv6 network address the guest will see (default is fec0::/64). The
4301 network prefix is given in the usual hexadecimal IPv6 address
4302 notation. The prefix size is optional, and is given as the number of
4303 valid top-most bits (default is 64).
4305 @item ipv6-host=@var{addr}
4306 Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
4307 the guest network, i.e. xxxx::2.
4309 @item restrict=on|off
4310 If this option is enabled, the guest will be isolated, i.e. it will not be
4311 able to contact the host and no guest IP packets will be routed over the host
4312 to the outside. This option does not affect any explicitly set forwarding rules.
4314 @item hostname=@var{name}
4315 Specifies the client hostname reported by the built-in DHCP server.
4317 @item dhcpstart=@var{addr}
4318 Specify the first of the 16 IPs the built-in DHCP server can assign. Default
4319 is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
4321 @item dns=@var{addr}
4322 Specify the guest-visible address of the virtual nameserver. The address must
4323 be different from the host address. Default is the 3rd IP in the guest network,
4326 @item ipv6-dns=@var{addr}
4327 Specify the guest-visible address of the IPv6 virtual nameserver. The address
4328 must be different from the host address. Default is the 3rd IP in the guest
4329 network, i.e. xxxx::3.
4331 @item dnssearch=@var{domain}
4332 Provides an entry for the domain-search list sent by the built-in
4333 DHCP server. More than one domain suffix can be transmitted by specifying
4334 this option multiple times. If supported, this will cause the guest to
4335 automatically try to append the given domain suffix(es) in case a domain name
4336 can not be resolved.
4340 @value{qemu_system} -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
4343 @item domainname=@var{domain}
4344 Specifies the client domain name reported by the built-in DHCP server.
4346 @item tftp=@var{dir}
4347 When using the user mode network stack, activate a built-in TFTP
4348 server. The files in @var{dir} will be exposed as the root of a TFTP server.
4349 The TFTP client on the guest must be configured in binary mode (use the command
4350 @code{bin} of the Unix TFTP client).
4352 @item tftp-server-name=@var{name}
4353 In BOOTP reply, broadcast @var{name} as the "TFTP server name" (RFC2132 option
4354 66). This can be used to advise the guest to load boot files or configurations
4355 from a different server than the host address.
4357 @item bootfile=@var{file}
4358 When using the user mode network stack, broadcast @var{file} as the BOOTP
4359 filename. In conjunction with @option{tftp}, this can be used to network boot
4360 a guest from a local directory.
4362 Example (using pxelinux):
4364 @value{qemu_system} -hda linux.img -boot n -device e1000,netdev=n1 \
4365 -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
4368 @item smb=@var{dir}[,smbserver=@var{addr}]
4369 When using the user mode network stack, activate a built-in SMB
4370 server so that Windows OSes can access to the host files in @file{@var{dir}}
4371 transparently. The IP address of the SMB server can be set to @var{addr}. By
4372 default the 4th IP in the guest network is used, i.e. x.x.x.4.
4374 In the guest Windows OS, the line:
4378 must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
4379 or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
4381 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
4383 Note that a SAMBA server must be installed on the host OS.
4385 @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
4386 Redirect incoming TCP or UDP connections to the host port @var{hostport} to
4387 the guest IP address @var{guestaddr} on guest port @var{guestport}. If
4388 @var{guestaddr} is not specified, its value is x.x.x.15 (default first address
4389 given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
4390 be bound to a specific host interface. If no connection type is set, TCP is
4391 used. This option can be given multiple times.
4393 For example, to redirect host X11 connection from screen 1 to guest
4394 screen 0, use the following:
4398 @value{qemu_system} -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
4399 # this host xterm should open in the guest X11 server
4403 To redirect telnet connections from host port 5555 to telnet port on
4404 the guest, use the following:
4408 @value{qemu_system} -nic user,hostfwd=tcp::5555-:23
4409 telnet localhost 5555
4412 Then when you use on the host @code{telnet localhost 5555}, you
4413 connect to the guest telnet server.
4415 @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
4416 @itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
4417 Forward guest TCP connections to the IP address @var{server} on port @var{port}
4418 to the character device @var{dev} or to a program executed by @var{cmd:command}
4419 which gets spawned for each connection. This option can be given multiple times.
4421 You can either use a chardev directly and have that one used throughout QEMU's
4422 lifetime, like in the following example:
4425 # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
4426 # the guest accesses it
4427 @value{qemu_system} -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
4430 Or you can execute a command on every TCP connection established by the guest,
4431 so that QEMU behaves similar to an inetd process for that virtual server:
4434 # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
4435 # and connect the TCP stream to its stdin/stdout
4436 @value{qemu_system} -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
4441 @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
4442 Configure a host TAP network backend with ID @var{id}.
4444 Use the network script @var{file} to configure it and the network script
4445 @var{dfile} to deconfigure it. If @var{name} is not provided, the OS
4446 automatically provides one. The default network configure script is
4447 @file{/etc/qemu-ifup} and the default network deconfigure script is
4448 @file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
4449 to disable script execution.
4451 If running QEMU as an unprivileged user, use the network helper
4452 @var{helper} to configure the TAP interface and attach it to the bridge.
4453 The default network helper executable is @file{/path/to/qemu-bridge-helper}
4454 and the default bridge device is @file{br0}.
4456 @option{fd}=@var{h} can be used to specify the handle of an already
4457 opened host TAP interface.
4462 #launch a QEMU instance with the default network script
4463 @value{qemu_system} linux.img -nic tap
4467 #launch a QEMU instance with two NICs, each one connected
4469 @value{qemu_system} linux.img \
4470 -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \
4471 -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
4475 #launch a QEMU instance with the default network helper to
4476 #connect a TAP device to bridge br0
4477 @value{qemu_system} linux.img -device virtio-net-pci,netdev=n1 \
4478 -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
4481 @item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
4482 Connect a host TAP network interface to a host bridge device.
4484 Use the network helper @var{helper} to configure the TAP interface and
4485 attach it to the bridge. The default network helper executable is
4486 @file{/path/to/qemu-bridge-helper} and the default bridge
4487 device is @file{br0}.
4492 #launch a QEMU instance with the default network helper to
4493 #connect a TAP device to bridge br0
4494 @value{qemu_system} linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
4498 #launch a QEMU instance with the default network helper to
4499 #connect a TAP device to bridge qemubr0
4500 @value{qemu_system} linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
4503 @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
4505 This host network backend can be used to connect the guest's network to
4506 another QEMU virtual machine using a TCP socket connection. If @option{listen}
4507 is specified, QEMU waits for incoming connections on @var{port}
4508 (@var{host} is optional). @option{connect} is used to connect to
4509 another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
4510 specifies an already opened TCP socket.
4514 # launch a first QEMU instance
4515 @value{qemu_system} linux.img \
4516 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4517 -netdev socket,id=n1,listen=:1234
4518 # connect the network of this instance to the network of the first instance
4519 @value{qemu_system} linux.img \
4520 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
4521 -netdev socket,id=n2,connect=127.0.0.1:1234
4524 @item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
4526 Configure a socket host network backend to share the guest's network traffic
4527 with another QEMU virtual machines using a UDP multicast socket, effectively
4528 making a bus for every QEMU with same multicast address @var{maddr} and @var{port}.
4532 Several QEMU can be running on different hosts and share same bus (assuming
4533 correct multicast setup for these hosts).
4535 mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
4536 @url{http://user-mode-linux.sf.net}.
4538 Use @option{fd=h} to specify an already opened UDP multicast socket.
4543 # launch one QEMU instance
4544 @value{qemu_system} linux.img \
4545 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4546 -netdev socket,id=n1,mcast=230.0.0.1:1234
4547 # launch another QEMU instance on same "bus"
4548 @value{qemu_system} linux.img \
4549 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
4550 -netdev socket,id=n2,mcast=230.0.0.1:1234
4551 # launch yet another QEMU instance on same "bus"
4552 @value{qemu_system} linux.img \
4553 -device e1000,netdev=n3,mac=52:54:00:12:34:58 \
4554 -netdev socket,id=n3,mcast=230.0.0.1:1234
4557 Example (User Mode Linux compat.):
4559 # launch QEMU instance (note mcast address selected is UML's default)
4560 @value{qemu_system} linux.img \
4561 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4562 -netdev socket,id=n1,mcast=239.192.168.1:1102
4564 /path/to/linux ubd0=/path/to/root_fs eth0=mcast
4567 Example (send packets from host's 1.2.3.4):
4569 @value{qemu_system} linux.img \
4570 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4571 -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
4574 @item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
4575 Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) is a
4576 popular protocol to transport Ethernet (and other Layer 2) data frames between
4577 two systems. It is present in routers, firewalls and the Linux kernel
4578 (from version 3.3 onwards).
4580 This transport allows a VM to communicate to another VM, router or firewall directly.
4583 @item src=@var{srcaddr}
4584 source address (mandatory)
4585 @item dst=@var{dstaddr}
4586 destination address (mandatory)
4588 select udp encapsulation (default is ip).
4589 @item srcport=@var{srcport}
4591 @item dstport=@var{dstport}
4592 destination udp port.
4594 force v6, otherwise defaults to v4.
4595 @item rxcookie=@var{rxcookie}
4596 @itemx txcookie=@var{txcookie}
4597 Cookies are a weak form of security in the l2tpv3 specification.
4598 Their function is mostly to prevent misconfiguration. By default they are 32
4601 Set cookie size to 64 bit instead of the default 32
4603 Force a 'cut-down' L2TPv3 with no counter as in
4604 draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
4606 Work around broken counter handling in peer. This may also help on
4607 networks which have packet reorder.
4608 @item offset=@var{offset}
4609 Add an extra offset between header and data
4612 For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
4613 on the remote Linux host 1.2.3.4:
4615 # Setup tunnel on linux host using raw ip as encapsulation
4617 ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
4618 encap udp udp_sport 16384 udp_dport 16384
4619 ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
4620 0xFFFFFFFF peer_session_id 0xFFFFFFFF
4621 ifconfig vmtunnel0 mtu 1500
4622 ifconfig vmtunnel0 up
4623 brctl addif br-lan vmtunnel0
4627 # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
4629 @value{qemu_system} linux.img -device e1000,netdev=n1 \
4630 -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
4634 @item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
4635 Configure VDE backend to connect to PORT @var{n} of a vde switch running on host and
4636 listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
4637 and MODE @var{octalmode} to change default ownership and permissions for
4638 communication port. This option is only available if QEMU has been compiled
4639 with vde support enabled.
4644 vde_switch -F -sock /tmp/myswitch
4645 # launch QEMU instance
4646 @value{qemu_system} linux.img -nic vde,sock=/tmp/myswitch
4649 @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
4651 Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
4652 be a unix domain socket backed one. The vhost-user uses a specifically defined
4653 protocol to pass vhost ioctl replacement messages to an application on the other
4654 end of the socket. On non-MSIX guests, the feature can be forced with
4655 @var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
4656 be created for multiqueue vhost-user.
4660 qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
4661 -numa node,memdev=mem \
4662 -chardev socket,id=chr0,path=/path/to/socket \
4663 -netdev type=vhost-user,id=net0,chardev=chr0 \
4664 -device virtio-net-pci,netdev=net0
4667 @item -netdev hubport,id=@var{id},hubid=@var{hubid}[,netdev=@var{nd}]
4669 Create a hub port on the emulated hub with ID @var{hubid}.
4671 The hubport netdev lets you connect a NIC to a QEMU emulated hub instead of a
4672 single netdev. Alternatively, you can also connect the hubport to another
4673 netdev with ID @var{nd} by using the @option{netdev=@var{nd}} option.
4675 @item -net nic[,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
4677 Legacy option to configure or create an on-board (or machine default) Network
4678 Interface Card(NIC) and connect it either to the emulated hub with ID 0 (i.e.
4679 the default hub), or to the netdev @var{nd}.
4680 If @var{model} is omitted, then the default NIC model associated with
4681 the machine type is used. Note that the default NIC model may change in
4682 future QEMU releases, so it is highly recommended to always specify a model.
4683 Optionally, the MAC address can be changed to @var{mac}, the device
4684 address set to @var{addr} (PCI cards only), and a @var{name} can be
4685 assigned for use in monitor commands.
4686 Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
4687 that the card should have; this option currently only affects virtio cards; set
4688 @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
4689 NIC is created. QEMU can emulate several different models of network card.
4690 Use @code{-net nic,model=help} for a list of available devices for your target.
4692 @item -net user|tap|bridge|socket|l2tpv3|vde[,...][,name=@var{name}]
4693 Configure a host network backend (with the options corresponding to the same
4694 @option{-netdev} option) and connect it to the emulated hub 0 (the default
4695 hub). Use @var{name} to specify the name of the hub port.
4698 ``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
4699 This option is a shortcut for configuring both the on-board
4700 (default) guest NIC hardware and the host network backend in one go.
4701 The host backend options are the same as with the corresponding
4702 ``-netdev`` options below. The guest NIC model can be set with
4703 ``model=modelname``. Use ``model=help`` to list the available device
4704 types. The hardware MAC address can be set with ``mac=macaddr``.
4706 The following two example do exactly the same, to show how ``-nic``
4707 can be used to shorten the command line length:
4711 |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
4712 |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
4715 Indicate that no network devices should be configured. It is used to
4716 override the default configuration (default NIC with "user" host
4717 network backend) which is activated if no other networking options
4720 ``-netdev user,id=id[,option][,option][,...]``
4721 Configure user mode host network backend which requires no
4722 administrator privilege to run. Valid options are:
4725 Assign symbolic name for use in monitor commands.
4727 ``ipv4=on|off and ipv6=on|off``
4728 Specify that either IPv4 or IPv6 must be enabled. If neither is
4729 specified both protocols are enabled.
4732 Set IP network address the guest will see. Optionally specify
4733 the netmask, either in the form a.b.c.d or as number of valid
4734 top-most bits. Default is 10.0.2.0/24.
4737 Specify the guest-visible address of the host. Default is the
4738 2nd IP in the guest network, i.e. x.x.x.2.
4740 ``ipv6-net=addr[/int]``
4741 Set IPv6 network address the guest will see (default is
4742 fec0::/64). The network prefix is given in the usual hexadecimal
4743 IPv6 address notation. The prefix size is optional, and is given
4744 as the number of valid top-most bits (default is 64).
4747 Specify the guest-visible IPv6 address of the host. Default is
4748 the 2nd IPv6 in the guest network, i.e. xxxx::2.
4751 If this option is enabled, the guest will be isolated, i.e. it
4752 will not be able to contact the host and no guest IP packets
4753 will be routed over the host to the outside. This option does
4754 not affect any explicitly set forwarding rules.
4757 Specifies the client hostname reported by the built-in DHCP
4761 Specify the first of the 16 IPs the built-in DHCP server can
4762 assign. Default is the 15th to 31st IP in the guest network,
4763 i.e. x.x.x.15 to x.x.x.31.
4766 Specify the guest-visible address of the virtual nameserver. The
4767 address must be different from the host address. Default is the
4768 3rd IP in the guest network, i.e. x.x.x.3.
4771 Specify the guest-visible address of the IPv6 virtual
4772 nameserver. The address must be different from the host address.
4773 Default is the 3rd IP in the guest network, i.e. xxxx::3.
4775 ``dnssearch=domain``
4776 Provides an entry for the domain-search list sent by the
4777 built-in DHCP server. More than one domain suffix can be
4778 transmitted by specifying this option multiple times. If
4779 supported, this will cause the guest to automatically try to
4780 append the given domain suffix(es) in case a domain name can not
4787 |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
4789 ``domainname=domain``
4790 Specifies the client domain name reported by the built-in DHCP
4794 When using the user mode network stack, activate a built-in TFTP
4795 server. The files in dir will be exposed as the root of a TFTP
4796 server. The TFTP client on the guest must be configured in
4797 binary mode (use the command ``bin`` of the Unix TFTP client).
4799 ``tftp-server-name=name``
4800 In BOOTP reply, broadcast name as the "TFTP server name"
4801 (RFC2132 option 66). This can be used to advise the guest to
4802 load boot files or configurations from a different server than
4806 When using the user mode network stack, broadcast file as the
4807 BOOTP filename. In conjunction with ``tftp``, this can be used
4808 to network boot a guest from a local directory.
4810 Example (using pxelinux):
4814 |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \
4815 -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
4817 ``smb=dir[,smbserver=addr]``
4818 When using the user mode network stack, activate a built-in SMB
4819 server so that Windows OSes can access to the host files in
4820 ``dir`` transparently. The IP address of the SMB server can be
4821 set to addr. By default the 4th IP in the guest network is used,
4824 In the guest Windows OS, the line:
4830 must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
4831 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
4834 Then ``dir`` can be accessed in ``\\smbserver\qemu``.
4836 Note that a SAMBA server must be installed on the host OS.
4838 ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport``
4839 Redirect incoming TCP or UDP connections to the host port
4840 hostport to the guest IP address guestaddr on guest port
4841 guestport. If guestaddr is not specified, its value is x.x.x.15
4842 (default first address given by the built-in DHCP server). By
4843 specifying hostaddr, the rule can be bound to a specific host
4844 interface. If no connection type is set, TCP is used. This
4845 option can be given multiple times.
4847 For example, to redirect host X11 connection from screen 1 to
4848 guest screen 0, use the following:
4853 |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
4854 # this host xterm should open in the guest X11 server
4857 To redirect telnet connections from host port 5555 to telnet
4858 port on the guest, use the following:
4863 |qemu_system| -nic user,hostfwd=tcp::5555-:23
4864 telnet localhost 5555
4866 Then when you use on the host ``telnet localhost 5555``, you
4867 connect to the guest telnet server.
4869 ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command``
4870 Forward guest TCP connections to the IP address server on port
4871 port to the character device dev or to a program executed by
4872 cmd:command which gets spawned for each connection. This option
4873 can be given multiple times.
4875 You can either use a chardev directly and have that one used
4876 throughout QEMU's lifetime, like in the following example:
4880 # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
4881 # the guest accesses it
4882 |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
4884 Or you can execute a command on every TCP connection established
4885 by the guest, so that QEMU behaves similar to an inetd process
4886 for that virtual server:
4890 # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
4891 # and connect the TCP stream to its stdin/stdout
4892 |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
4894 ``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]``
4895 Configure a host TAP network backend with ID id.
4897 Use the network script file to configure it and the network script
4898 dfile to deconfigure it. If name is not provided, the OS
4899 automatically provides one. The default network configure script is
4900 ``/etc/qemu-ifup`` and the default network deconfigure script is
4901 ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to
4902 disable script execution.
4904 If running QEMU as an unprivileged user, use the network helper
4905 helper to configure the TAP interface and attach it to the bridge.
4906 The default network helper executable is
4907 ``/path/to/qemu-bridge-helper`` and the default bridge device is
4910 ``fd``\ =h can be used to specify the handle of an already opened
4917 #launch a QEMU instance with the default network script
4918 |qemu_system| linux.img -nic tap
4922 #launch a QEMU instance with two NICs, each one connected
4924 |qemu_system| linux.img \
4925 -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \
4926 -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
4930 #launch a QEMU instance with the default network helper to
4931 #connect a TAP device to bridge br0
4932 |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \
4933 -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
4935 ``-netdev bridge,id=id[,br=bridge][,helper=helper]``
4936 Connect a host TAP network interface to a host bridge device.
4938 Use the network helper helper to configure the TAP interface and
4939 attach it to the bridge. The default network helper executable is
4940 ``/path/to/qemu-bridge-helper`` and the default bridge device is
4947 #launch a QEMU instance with the default network helper to
4948 #connect a TAP device to bridge br0
4949 |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
4953 #launch a QEMU instance with the default network helper to
4954 #connect a TAP device to bridge qemubr0
4955 |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
4957 ``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]``
4958 This host network backend can be used to connect the guest's network
4959 to another QEMU virtual machine using a TCP socket connection. If
4960 ``listen`` is specified, QEMU waits for incoming connections on port
4961 (host is optional). ``connect`` is used to connect to another QEMU
4962 instance using the ``listen`` option. ``fd``\ =h specifies an
4963 already opened TCP socket.
4969 # launch a first QEMU instance
4970 |qemu_system| linux.img \
4971 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4972 -netdev socket,id=n1,listen=:1234
4973 # connect the network of this instance to the network of the first instance
4974 |qemu_system| linux.img \
4975 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
4976 -netdev socket,id=n2,connect=127.0.0.1:1234
4978 ``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]``
4979 Configure a socket host network backend to share the guest's network
4980 traffic with another QEMU virtual machines using a UDP multicast
4981 socket, effectively making a bus for every QEMU with same multicast
4982 address maddr and port. NOTES:
4984 1. Several QEMU can be running on different hosts and share same bus
4985 (assuming correct multicast setup for these hosts).
4987 2. mcast support is compatible with User Mode Linux (argument
4988 ``ethN=mcast``), see http://user-mode-linux.sf.net.
4990 3. Use ``fd=h`` to specify an already opened UDP multicast socket.
4996 # launch one QEMU instance
4997 |qemu_system| linux.img \
4998 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
4999 -netdev socket,id=n1,mcast=230.0.0.1:1234
5000 # launch another QEMU instance on same "bus"
5001 |qemu_system| linux.img \
5002 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
5003 -netdev socket,id=n2,mcast=230.0.0.1:1234
5004 # launch yet another QEMU instance on same "bus"
5005 |qemu_system| linux.img \
5006 -device e1000,netdev=n3,mac=52:54:00:12:34:58 \
5007 -netdev socket,id=n3,mcast=230.0.0.1:1234
5009 Example (User Mode Linux compat.):
5013 # launch QEMU instance (note mcast address selected is UML's default)
5014 |qemu_system| linux.img \
5015 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
5016 -netdev socket,id=n1,mcast=239.192.168.1:1102
5018 /path/to/linux ubd0=/path/to/root_fs eth0=mcast
5020 Example (send packets from host's 1.2.3.4):
5024 |qemu_system| linux.img \
5025 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
5026 -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
5028 ``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
5029 Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
5030 is a popular protocol to transport Ethernet (and other Layer 2) data
5031 frames between two systems. It is present in routers, firewalls and
5032 the Linux kernel (from version 3.3 onwards).
5034 This transport allows a VM to communicate to another VM, router or
5038 source address (mandatory)
5041 destination address (mandatory)
5044 select udp encapsulation (default is ip).
5050 destination udp port.
5053 force v6, otherwise defaults to v4.
5055 ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
5056 Cookies are a weak form of security in the l2tpv3 specification.
5057 Their function is mostly to prevent misconfiguration. By default
5061 Set cookie size to 64 bit instead of the default 32
5064 Force a 'cut-down' L2TPv3 with no counter as in
5065 draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
5068 Work around broken counter handling in peer. This may also help
5069 on networks which have packet reorder.
5072 Add an extra offset between header and data
5074 For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to
5075 the bridge br-lan on the remote Linux host 1.2.3.4:
5079 # Setup tunnel on linux host using raw ip as encapsulation
5081 ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
5082 encap udp udp_sport 16384 udp_dport 16384
5083 ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
5084 0xFFFFFFFF peer_session_id 0xFFFFFFFF
5085 ifconfig vmtunnel0 mtu 1500
5086 ifconfig vmtunnel0 up
5087 brctl addif br-lan vmtunnel0
5091 # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
5093 |qemu_system| linux.img -device e1000,netdev=n1 \
5094 -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
5096 ``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
5097 Configure VDE backend to connect to PORT n of a vde switch running
5098 on host and listening for incoming connections on socketpath. Use
5099 GROUP groupname and MODE octalmode to change default ownership and
5100 permissions for communication port. This option is only available if
5101 QEMU has been compiled with vde support enabled.
5108 vde_switch -F -sock /tmp/myswitch
5109 # launch QEMU instance
5110 |qemu_system| linux.img -nic vde,sock=/tmp/myswitch
5112 ``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
5113 Establish a vhost-user netdev, backed by a chardev id. The chardev
5114 should be a unix domain socket backed one. The vhost-user uses a
5115 specifically defined protocol to pass vhost ioctl replacement
5116 messages to an application on the other end of the socket. On
5117 non-MSIX guests, the feature can be forced with vhostforce. Use
5118 'queues=n' to specify the number of queues to be created for
5119 multiqueue vhost-user.
5125 qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
5126 -numa node,memdev=mem \
5127 -chardev socket,id=chr0,path=/path/to/socket \
5128 -netdev type=vhost-user,id=net0,chardev=chr0 \
5129 -device virtio-net-pci,netdev=net0
5131 ``-netdev hubport,id=id,hubid=hubid[,netdev=nd]``
5132 Create a hub port on the emulated hub with ID hubid.
5134 The hubport netdev lets you connect a NIC to a QEMU emulated hub
5135 instead of a single netdev. Alternatively, you can also connect the
5136 hubport to another netdev with ID nd by using the ``netdev=nd``
5139 ``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]``
5140 Legacy option to configure or create an on-board (or machine
5141 default) Network Interface Card(NIC) and connect it either to the
5142 emulated hub with ID 0 (i.e. the default hub), or to the netdev nd.
5143 If model is omitted, then the default NIC model associated with the
5144 machine type is used. Note that the default NIC model may change in
5145 future QEMU releases, so it is highly recommended to always specify
5146 a model. Optionally, the MAC address can be changed to mac, the
5147 device address set to addr (PCI cards only), and a name can be
5148 assigned for use in monitor commands. Optionally, for PCI cards, you
5149 can specify the number v of MSI-X vectors that the card should have;
5150 this option currently only affects virtio cards; set v = 0 to
5151 disable MSI-X. If no ``-net`` option is specified, a single NIC is
5152 created. QEMU can emulate several different models of network card.
5153 Use ``-net nic,model=help`` for a list of available devices for your
5156 ``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]``
5157 Configure a host network backend (with the options corresponding to
5158 the same ``-netdev`` option) and connect it to the emulated hub 0
5159 (the default hub). Use name to specify the name of the hub port.
5167 DEFHEADING(Character device options:)
5169 DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
5171 "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5172 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
5173 " [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n"
5174 " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
5175 "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n"
5176 " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
5177 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
5178 " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
5179 " [,logfile=PATH][,logappend=on|off]\n"
5180 "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5181 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
5182 " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5183 "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
5184 "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5185 "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5187 "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5188 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5190 "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5191 "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
5193 #ifdef CONFIG_BRLAPI
5194 "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5196 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
5197 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
5198 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5199 "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5201 #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
5202 "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5203 "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5205 #if defined(CONFIG_SPICE)
5206 "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
5207 "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
5214 The general form of a character device option is:
5216 @item -chardev @var{backend},id=@var{id}[,mux=on|off][,@var{options}]
5237 The specific backend will determine the applicable options.
5239 Use @code{-chardev help} to print all available chardev backend types.
5241 All devices must have an id, which can be any string up to 127 characters long.
5242 It is used to uniquely identify this device in other command line directives.
5244 A character device may be used in multiplexing mode by multiple front-ends.
5245 Specify @option{mux=on} to enable this mode.
5246 A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
5247 backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
5248 If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
5249 create a multiplexer with your specified ID, and you can then configure multiple
5250 front ends to use that chardev ID for their input/output. Up to four different
5251 front ends can be connected to a single multiplexed chardev. (Without
5252 multiplexing enabled, a chardev can only be used by a single front end.)
5253 For instance you could use this to allow a single stdio chardev to be used by
5254 two serial ports and the QEMU monitor:
5257 -chardev stdio,mux=on,id=char0 \
5258 -mon chardev=char0,mode=readline \
5259 -serial chardev:char0 \
5260 -serial chardev:char0
5263 You can have more than one multiplexer in a system configuration; for instance
5264 you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
5265 multiplexed between the QEMU monitor and a parallel port:
5268 -chardev stdio,mux=on,id=char0 \
5269 -mon chardev=char0,mode=readline \
5270 -parallel chardev:char0 \
5271 -chardev tcp,...,mux=on,id=char1 \
5272 -serial chardev:char1 \
5273 -serial chardev:char1
5276 When you're using a multiplexed character device, some escape sequences are
5277 interpreted in the input. @xref{mux_keys, Keys in the character backend
5280 Note that some other command line options may implicitly create multiplexed
5281 character backends; for instance @option{-serial mon:stdio} creates a
5282 multiplexed stdio backend connected to the serial port and the QEMU monitor,
5283 and @option{-nographic} also multiplexes the console and the monitor to
5286 There is currently no support for multiplexing in the other direction
5287 (where a single QEMU front end takes input and output from multiple chardevs).
5289 Every backend supports the @option{logfile} option, which supplies the path
5290 to a file to record all data transmitted via the backend. The @option{logappend}
5291 option controls whether the log file will be truncated or appended to when
5296 The available backends are:
5299 @item -chardev null,id=@var{id}
5300 A void device. This device will not emit any data, and will drop any data it
5301 receives. The null backend does not take any options.
5303 @item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,websocket][,reconnect=@var{seconds}][,tls-creds=@var{id}][,tls-authz=@var{id}]
5305 Create a two-way stream socket, which can be either a TCP or a unix socket. A
5306 unix socket will be created if @option{path} is specified. Behaviour is
5307 undefined if TCP options are specified for a unix socket.
5309 @option{server} specifies that the socket shall be a listening socket.
5311 @option{nowait} specifies that QEMU should not block waiting for a client to
5312 connect to a listening socket.
5314 @option{telnet} specifies that traffic on the socket should interpret telnet
5317 @option{websocket} specifies that the socket uses WebSocket protocol for
5320 @option{reconnect} sets the timeout for reconnecting on non-server sockets when
5321 the remote end goes away. qemu will delay this many seconds and then attempt
5322 to reconnect. Zero disables reconnecting, and is the default.
5324 @option{tls-creds} requests enablement of the TLS protocol for encryption,
5325 and specifies the id of the TLS credentials to use for the handshake. The
5326 credentials must be previously created with the @option{-object tls-creds}
5329 @option{tls-auth} provides the ID of the QAuthZ authorization object against
5330 which the client's x509 distinguished name will be validated. This object is
5331 only resolved at time of use, so can be deleted and recreated on the fly
5332 while the chardev server is active. If missing, it will default to denying
5335 TCP and unix socket options are given below:
5339 @item TCP options: port=@var{port}[,host=@var{host}][,to=@var{to}][,ipv4][,ipv6][,nodelay]
5341 @option{host} for a listening socket specifies the local address to be bound.
5342 For a connecting socket species the remote host to connect to. @option{host} is
5343 optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
5345 @option{port} for a listening socket specifies the local port to be bound. For a
5346 connecting socket specifies the port on the remote host to connect to.
5347 @option{port} can be given as either a port number or a service name.
5348 @option{port} is required.
5350 @option{to} is only relevant to listening sockets. If it is specified, and
5351 @option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
5352 to and including @option{to} until it succeeds. @option{to} must be specified
5355 @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
5356 If neither is specified the socket may use either protocol.
5358 @option{nodelay} disables the Nagle algorithm.
5360 @item unix options: path=@var{path}
5362 @option{path} specifies the local path of the unix socket. @option{path} is
5367 @item -chardev udp,id=@var{id}[,host=@var{host}],port=@var{port}[,localaddr=@var{localaddr}][,localport=@var{localport}][,ipv4][,ipv6]
5369 Sends all traffic from the guest to a remote host over UDP.
5371 @option{host} specifies the remote host to connect to. If not specified it
5372 defaults to @code{localhost}.
5374 @option{port} specifies the port on the remote host to connect to. @option{port}
5377 @option{localaddr} specifies the local address to bind to. If not specified it
5378 defaults to @code{0.0.0.0}.
5380 @option{localport} specifies the local port to bind to. If not specified any
5381 available local port will be used.
5383 @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
5384 If neither is specified the device may use either protocol.
5386 @item -chardev msmouse,id=@var{id}
5388 Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
5391 @item -chardev vc,id=@var{id}[[,width=@var{width}][,height=@var{height}]][[,cols=@var{cols}][,rows=@var{rows}]]
5393 Connect to a QEMU text console. @option{vc} may optionally be given a specific
5396 @option{width} and @option{height} specify the width and height respectively of
5397 the console, in pixels.
5399 @option{cols} and @option{rows} specify that the console be sized to fit a text
5400 console with the given dimensions.
5402 @item -chardev ringbuf,id=@var{id}[,size=@var{size}]
5404 Create a ring buffer with fixed size @option{size}.
5405 @var{size} must be a power of two and defaults to @code{64K}.
5407 @item -chardev file,id=@var{id},path=@var{path}
5409 Log all traffic received from the guest to a file.
5411 @option{path} specifies the path of the file to be opened. This file will be
5412 created if it does not already exist, and overwritten if it does. @option{path}
5415 @item -chardev pipe,id=@var{id},path=@var{path}
5417 Create a two-way connection to the guest. The behaviour differs slightly between
5418 Windows hosts and other hosts:
5420 On Windows, a single duplex pipe will be created at
5421 @file{\\.pipe\@option{path}}.
5423 On other hosts, 2 pipes will be created called @file{@option{path}.in} and
5424 @file{@option{path}.out}. Data written to @file{@option{path}.in} will be
5425 received by the guest. Data written by the guest can be read from
5426 @file{@option{path}.out}. QEMU will not create these fifos, and requires them to
5429 @option{path} forms part of the pipe path as described above. @option{path} is
5432 @item -chardev console,id=@var{id}
5434 Send traffic from the guest to QEMU's standard output. @option{console} does not
5437 @option{console} is only available on Windows hosts.
5439 @item -chardev serial,id=@var{id},path=@option{path}
5441 Send traffic from the guest to a serial device on the host.
5443 On Unix hosts serial will actually accept any tty device,
5444 not only serial lines.
5446 @option{path} specifies the name of the serial device to open.
5448 @item -chardev pty,id=@var{id}
5450 Create a new pseudo-terminal on the host and connect to it. @option{pty} does
5451 not take any options.
5453 @option{pty} is not available on Windows hosts.
5455 @item -chardev stdio,id=@var{id}[,signal=on|off]
5456 Connect to standard input and standard output of the QEMU process.
5458 @option{signal} controls if signals are enabled on the terminal, that includes
5459 exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
5460 default, use @option{signal=off} to disable it.
5462 @item -chardev braille,id=@var{id}
5464 Connect to a local BrlAPI server. @option{braille} does not take any options.
5466 @item -chardev tty,id=@var{id},path=@var{path}
5468 @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
5469 DragonFlyBSD hosts. It is an alias for @option{serial}.
5471 @option{path} specifies the path to the tty. @option{path} is required.
5473 @item -chardev parallel,id=@var{id},path=@var{path}
5474 @itemx -chardev parport,id=@var{id},path=@var{path}
5476 @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
5478 Connect to a local parallel port.
5480 @option{path} specifies the path to the parallel port device. @option{path} is
5483 @item -chardev spicevmc,id=@var{id},debug=@var{debug},name=@var{name}
5485 @option{spicevmc} is only available when spice support is built in.
5487 @option{debug} debug level for spicevmc
5489 @option{name} name of spice channel to connect to
5491 Connect to a spice virtual machine channel, such as vdiport.
5493 @item -chardev spiceport,id=@var{id},debug=@var{debug},name=@var{name}
5495 @option{spiceport} is only available when spice support is built in.
5497 @option{debug} debug level for spicevmc
5499 @option{name} name of spice port to connect to
5501 Connect to a spice port, allowing a Spice client to handle the traffic
5502 identified by a name (preferably a fqdn).
5505 The general form of a character device option is:
5507 ``-chardev backend,id=id[,mux=on|off][,options]``
5508 Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
5509 ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
5510 ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
5511 ``spicevmc``, ``spiceport``. The specific backend will determine the
5514 Use ``-chardev help`` to print all available chardev backend types.
5516 All devices must have an id, which can be any string up to 127
5517 characters long. It is used to uniquely identify this device in
5518 other command line directives.
5520 A character device may be used in multiplexing mode by multiple
5521 front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is
5522 a "1:N" device, and here the "1" end is your specified chardev
5523 backend, and the "N" end is the various parts of QEMU that can talk
5524 to a chardev. If you create a chardev with ``id=myid`` and
5525 ``mux=on``, QEMU will create a multiplexer with your specified ID,
5526 and you can then configure multiple front ends to use that chardev
5527 ID for their input/output. Up to four different front ends can be
5528 connected to a single multiplexed chardev. (Without multiplexing
5529 enabled, a chardev can only be used by a single front end.) For
5530 instance you could use this to allow a single stdio chardev to be
5531 used by two serial ports and the QEMU monitor:
5535 -chardev stdio,mux=on,id=char0 \
5536 -mon chardev=char0,mode=readline \
5537 -serial chardev:char0 \
5538 -serial chardev:char0
5540 You can have more than one multiplexer in a system configuration;
5541 for instance you could have a TCP port multiplexed between UART 0
5542 and UART 1, and stdio multiplexed between the QEMU monitor and a
5547 -chardev stdio,mux=on,id=char0 \
5548 -mon chardev=char0,mode=readline \
5549 -parallel chardev:char0 \
5550 -chardev tcp,...,mux=on,id=char1 \
5551 -serial chardev:char1 \
5552 -serial chardev:char1
5554 When you're using a multiplexed character device, some escape
5555 sequences are interpreted in the input. See :ref:`mux_005fkeys`.
5557 Note that some other command line options may implicitly create
5558 multiplexed character backends; for instance ``-serial mon:stdio``
5559 creates a multiplexed stdio backend connected to the serial port and
5560 the QEMU monitor, and ``-nographic`` also multiplexes the console
5561 and the monitor to stdio.
5563 There is currently no support for multiplexing in the other
5564 direction (where a single QEMU front end takes input and output from
5567 Every backend supports the ``logfile`` option, which supplies the
5568 path to a file to record all data transmitted via the backend. The
5569 ``logappend`` option controls whether the log file will be truncated
5570 or appended to when opened.
5572 The available backends are:
5574 ``-chardev null,id=id``
5575 A void device. This device will not emit any data, and will drop any
5576 data it receives. The null backend does not take any options.
5578 ``-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
5579 Create a two-way stream socket, which can be either a TCP or a unix
5580 socket. A unix socket will be created if ``path`` is specified.
5581 Behaviour is undefined if TCP options are specified for a unix
5584 ``server`` specifies that the socket shall be a listening socket.
5586 ``nowait`` specifies that QEMU should not block waiting for a client
5587 to connect to a listening socket.
5589 ``telnet`` specifies that traffic on the socket should interpret
5590 telnet escape sequences.
5592 ``websocket`` specifies that the socket uses WebSocket protocol for
5595 ``reconnect`` sets the timeout for reconnecting on non-server
5596 sockets when the remote end goes away. qemu will delay this many
5597 seconds and then attempt to reconnect. Zero disables reconnecting,
5600 ``tls-creds`` requests enablement of the TLS protocol for
5601 encryption, and specifies the id of the TLS credentials to use for
5602 the handshake. The credentials must be previously created with the
5603 ``-object tls-creds`` argument.
5605 ``tls-auth`` provides the ID of the QAuthZ authorization object
5606 against which the client's x509 distinguished name will be
5607 validated. This object is only resolved at time of use, so can be
5608 deleted and recreated on the fly while the chardev server is active.
5609 If missing, it will default to denying access.
5611 TCP and unix socket options are given below:
5613 ``TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]``
5614 ``host`` for a listening socket specifies the local address to
5615 be bound. For a connecting socket species the remote host to
5616 connect to. ``host`` is optional for listening sockets. If not
5617 specified it defaults to ``0.0.0.0``.
5619 ``port`` for a listening socket specifies the local port to be
5620 bound. For a connecting socket specifies the port on the remote
5621 host to connect to. ``port`` can be given as either a port
5622 number or a service name. ``port`` is required.
5624 ``to`` is only relevant to listening sockets. If it is
5625 specified, and ``port`` cannot be bound, QEMU will attempt to
5626 bind to subsequent ports up to and including ``to`` until it
5627 succeeds. ``to`` must be specified as a port number.
5629 ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be
5630 used. If neither is specified the socket may use either
5633 ``nodelay`` disables the Nagle algorithm.
5635 ``unix options: path=path``
5636 ``path`` specifies the local path of the unix socket. ``path``
5639 ``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]``
5640 Sends all traffic from the guest to a remote host over UDP.
5642 ``host`` specifies the remote host to connect to. If not specified
5643 it defaults to ``localhost``.
5645 ``port`` specifies the port on the remote host to connect to.
5646 ``port`` is required.
5648 ``localaddr`` specifies the local address to bind to. If not
5649 specified it defaults to ``0.0.0.0``.
5651 ``localport`` specifies the local port to bind to. If not specified
5652 any available local port will be used.
5654 ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be used.
5655 If neither is specified the device may use either protocol.
5657 ``-chardev msmouse,id=id``
5658 Forward QEMU's emulated msmouse events to the guest. ``msmouse``
5659 does not take any options.
5661 ``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
5662 Connect to a QEMU text console. ``vc`` may optionally be given a
5665 ``width`` and ``height`` specify the width and height respectively
5666 of the console, in pixels.
5668 ``cols`` and ``rows`` specify that the console be sized to fit a
5669 text console with the given dimensions.
5671 ``-chardev ringbuf,id=id[,size=size]``
5672 Create a ring buffer with fixed size ``size``. size must be a power
5673 of two and defaults to ``64K``.
5675 ``-chardev file,id=id,path=path``
5676 Log all traffic received from the guest to a file.
5678 ``path`` specifies the path of the file to be opened. This file will
5679 be created if it does not already exist, and overwritten if it does.
5680 ``path`` is required.
5682 ``-chardev pipe,id=id,path=path``
5683 Create a two-way connection to the guest. The behaviour differs
5684 slightly between Windows hosts and other hosts:
5686 On Windows, a single duplex pipe will be created at
5689 On other hosts, 2 pipes will be created called ``path.in`` and
5690 ``path.out``. Data written to ``path.in`` will be received by the
5691 guest. Data written by the guest can be read from ``path.out``. QEMU
5692 will not create these fifos, and requires them to be present.
5694 ``path`` forms part of the pipe path as described above. ``path`` is
5697 ``-chardev console,id=id``
5698 Send traffic from the guest to QEMU's standard output. ``console``
5699 does not take any options.
5701 ``console`` is only available on Windows hosts.
5703 ``-chardev serial,id=id,path=path``
5704 Send traffic from the guest to a serial device on the host.
5706 On Unix hosts serial will actually accept any tty device, not only
5709 ``path`` specifies the name of the serial device to open.
5711 ``-chardev pty,id=id``
5712 Create a new pseudo-terminal on the host and connect to it. ``pty``
5713 does not take any options.
5715 ``pty`` is not available on Windows hosts.
5717 ``-chardev stdio,id=id[,signal=on|off]``
5718 Connect to standard input and standard output of the QEMU process.
5720 ``signal`` controls if signals are enabled on the terminal, that
5721 includes exiting QEMU with the key sequence Control-c. This option
5722 is enabled by default, use ``signal=off`` to disable it.
5724 ``-chardev braille,id=id``
5725 Connect to a local BrlAPI server. ``braille`` does not take any
5728 ``-chardev tty,id=id,path=path``
5729 ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
5730 and DragonFlyBSD hosts. It is an alias for ``serial``.
5732 ``path`` specifies the path to the tty. ``path`` is required.
5734 ``-chardev parallel,id=id,path=path``; \ ``-chardev parport,id=id,path=path``
5735 ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
5738 Connect to a local parallel port.
5740 ``path`` specifies the path to the parallel port device. ``path`` is
5743 ``-chardev spicevmc,id=id,debug=debug,name=name``
5744 ``spicevmc`` is only available when spice support is built in.
5746 ``debug`` debug level for spicevmc
5748 ``name`` name of spice channel to connect to
5750 Connect to a spice virtual machine channel, such as vdiport.
5752 ``-chardev spiceport,id=id,debug=debug,name=name``
5753 ``spiceport`` is only available when spice support is built in.
5755 ``debug`` debug level for spicevmc
5757 ``name`` name of spice port to connect to
5759 Connect to a spice port, allowing a Spice client to handle the
5760 traffic identified by a name (preferably a fqdn).
5769 DEFHEADING(TPM device options:)
5771 DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
5772 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
5773 " use path to provide path to a character device; default is /dev/tpm0\n"
5774 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
5775 " not provided it will be searched for in /sys/class/misc/tpm?/device\n"
5776 "-tpmdev emulator,id=id,chardev=dev\n"
5777 " configure the TPM device using chardev backend\n",
5781 The general form of a TPM device option is:
5784 @item -tpmdev @var{backend},id=@var{id}[,@var{options}]
5787 The specific backend type will determine the applicable options.
5788 The @code{-tpmdev} option creates the TPM backend and requires a
5789 @code{-device} option that specifies the TPM frontend interface model.
5791 Use @code{-tpmdev help} to print all available TPM backend types.
5795 The available backends are:
5799 @item -tpmdev passthrough,id=@var{id},path=@var{path},cancel-path=@var{cancel-path}
5801 (Linux-host only) Enable access to the host's TPM using the passthrough
5804 @option{path} specifies the path to the host's TPM device, i.e., on
5805 a Linux host this would be @code{/dev/tpm0}.
5806 @option{path} is optional and by default @code{/dev/tpm0} is used.
5808 @option{cancel-path} specifies the path to the host TPM device's sysfs
5809 entry allowing for cancellation of an ongoing TPM command.
5810 @option{cancel-path} is optional and by default QEMU will search for the
5813 Some notes about using the host's TPM with the passthrough driver:
5815 The TPM device accessed by the passthrough driver must not be
5816 used by any other application on the host.
5818 Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
5819 the VM's firmware (BIOS/UEFI) will not be able to initialize the
5820 TPM again and may therefore not show a TPM-specific menu that would
5821 otherwise allow the user to configure the TPM, e.g., allow the user to
5822 enable/disable or activate/deactivate the TPM.
5823 Further, if TPM ownership is released from within a VM then the host's TPM
5824 will get disabled and deactivated. To enable and activate the
5825 TPM again afterwards, the host has to be rebooted and the user is
5826 required to enter the firmware's menu to enable and activate the TPM.
5827 If the TPM is left disabled and/or deactivated most TPM commands will fail.
5829 To create a passthrough TPM use the following two options:
5831 -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
5833 Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
5834 @code{tpmdev=tpm0} in the device option.
5836 @item -tpmdev emulator,id=@var{id},chardev=@var{dev}
5838 (Linux-host only) Enable access to a TPM emulator using Unix domain socket based
5841 @option{chardev} specifies the unique ID of a character device backend that provides connection to the software TPM server.
5843 To create a TPM emulator backend device with chardev socket backend:
5846 -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
5852 The general form of a TPM device option is:
5854 ``-tpmdev backend,id=id[,options]``
5855 The specific backend type will determine the applicable options. The
5856 ``-tpmdev`` option creates the TPM backend and requires a
5857 ``-device`` option that specifies the TPM frontend interface model.
5859 Use ``-tpmdev help`` to print all available TPM backend types.
5861 The available backends are:
5863 ``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path``
5864 (Linux-host only) Enable access to the host's TPM using the
5867 ``path`` specifies the path to the host's TPM device, i.e., on a
5868 Linux host this would be ``/dev/tpm0``. ``path`` is optional and by
5869 default ``/dev/tpm0`` is used.
5871 ``cancel-path`` specifies the path to the host TPM device's sysfs
5872 entry allowing for cancellation of an ongoing TPM command.
5873 ``cancel-path`` is optional and by default QEMU will search for the
5876 Some notes about using the host's TPM with the passthrough driver:
5878 The TPM device accessed by the passthrough driver must not be used
5879 by any other application on the host.
5881 Since the host's firmware (BIOS/UEFI) has already initialized the
5882 TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize
5883 the TPM again and may therefore not show a TPM-specific menu that
5884 would otherwise allow the user to configure the TPM, e.g., allow the
5885 user to enable/disable or activate/deactivate the TPM. Further, if
5886 TPM ownership is released from within a VM then the host's TPM will
5887 get disabled and deactivated. To enable and activate the TPM again
5888 afterwards, the host has to be rebooted and the user is required to
5889 enter the firmware's menu to enable and activate the TPM. If the TPM
5890 is left disabled and/or deactivated most TPM commands will fail.
5892 To create a passthrough TPM use the following two options:
5896 -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
5898 Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by
5899 ``tpmdev=tpm0`` in the device option.
5901 ``-tpmdev emulator,id=id,chardev=dev``
5902 (Linux-host only) Enable access to a TPM emulator using Unix domain
5903 socket based chardev backend.
5905 ``chardev`` specifies the unique ID of a character device backend
5906 that provides connection to the software TPM server.
5908 To create a TPM emulator backend device with chardev socket backend:
5912 -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
5922 DEFHEADING(Linux/Multiboot boot specific:)
5925 When using these options, you can use a given Linux or Multiboot
5926 kernel without installing it in the disk image. It can be useful
5927 for easier testing of various kernels.
5932 When using these options, you can use a given Linux or Multiboot kernel
5933 without installing it in the disk image. It can be useful for easier
5934 testing of various kernels.
5939 DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
5940 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
5942 @item -kernel @var{bzImage}
5944 Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
5945 or in multiboot format.
5949 Use bzImage as kernel image. The kernel can be either a Linux kernel
5950 or in multiboot format.
5953 DEF("append", HAS_ARG, QEMU_OPTION_append, \
5954 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
5956 @item -append @var{cmdline}
5958 Use @var{cmdline} as kernel command line
5962 Use cmdline as kernel command line
5965 DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
5966 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
5968 @item -initrd @var{file}
5970 Use @var{file} as initial ram disk.
5972 @item -initrd "@var{file1} arg=foo,@var{file2}"
5974 This syntax is only available with multiboot.
5976 Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
5981 Use file as initial ram disk.
5983 ``-initrd "file1 arg=foo,file2"``
5984 This syntax is only available with multiboot.
5986 Use file1 and file2 as modules and pass arg=foo as parameter to the
5990 DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
5991 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
5993 @item -dtb @var{file}
5995 Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
6000 Use file as a device tree binary (dtb) image and pass it to the
6009 DEFHEADING(Debug/Expert options:)
6014 DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
6015 "-fw_cfg [name=]<name>,file=<file>\n"
6016 " add named fw_cfg entry with contents from file\n"
6017 "-fw_cfg [name=]<name>,string=<str>\n"
6018 " add named fw_cfg entry with contents from string\n",
6022 @item -fw_cfg [name=]@var{name},file=@var{file}
6024 Add named fw_cfg entry with contents from file @var{file}.
6026 @item -fw_cfg [name=]@var{name},string=@var{str}
6027 Add named fw_cfg entry with contents from string @var{str}.
6029 The terminating NUL character of the contents of @var{str} will not be
6030 included as part of the fw_cfg item data. To insert contents with
6031 embedded NUL characters, you have to use the @var{file} parameter.
6033 The fw_cfg entries are passed by QEMU through to the guest.
6037 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
6039 creates an fw_cfg entry named opt/com.mycompany/blob with contents
6044 ``-fw_cfg [name=]name,file=file``
6045 Add named fw\_cfg entry with contents from file file.
6047 ``-fw_cfg [name=]name,string=str``
6048 Add named fw\_cfg entry with contents from string str.
6050 The terminating NUL character of the contents of str will not be
6051 included as part of the fw\_cfg item data. To insert contents with
6052 embedded NUL characters, you have to use the file parameter.
6054 The fw\_cfg entries are passed by QEMU through to the guest.
6060 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
6062 creates an fw\_cfg entry named opt/com.mycompany/blob with contents
6063 from ./my\_blob.bin.
6066 DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
6067 "-serial dev redirect the serial port to char device 'dev'\n",
6070 @item -serial @var{dev}
6072 Redirect the virtual serial port to host character device
6073 @var{dev}. The default device is @code{vc} in graphical mode and
6074 @code{stdio} in non graphical mode.
6076 This option can be used several times to simulate up to 4 serial
6079 Use @code{-serial none} to disable all serial ports.
6081 Available character devices are:
6083 @item vc[:@var{W}x@var{H}]
6084 Virtual console. Optionally, a width and height can be given in pixel with
6088 It is also possible to specify width or height in characters:
6093 [Linux only] Pseudo TTY (a new PTY is automatically allocated)
6095 No device is allocated.
6098 @item chardev:@var{id}
6099 Use a named character device defined with the @code{-chardev} option.
6101 [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
6102 parameters are set according to the emulated ones.
6103 @item /dev/parport@var{N}
6104 [Linux only, parallel port only] Use host parallel port
6105 @var{N}. Currently SPP and EPP parallel port features can be used.
6106 @item file:@var{filename}
6107 Write output to @var{filename}. No character can be read.
6109 [Unix only] standard input/output
6110 @item pipe:@var{filename}
6111 name pipe @var{filename}
6113 [Windows only] Use host serial port @var{n}
6114 @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
6115 This implements UDP Net Console.
6116 When @var{remote_host} or @var{src_ip} are not specified
6117 they default to @code{0.0.0.0}.
6118 When not using a specified @var{src_port} a random port is automatically chosen.
6120 If you just want a simple readonly console you can use @code{netcat} or
6121 @code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
6122 @code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
6123 will appear in the netconsole session.
6125 If you plan to send characters back via netconsole or you want to stop
6126 and start QEMU a lot of times, you should have QEMU use the same
6127 source port each time by using something like @code{-serial
6128 udp::4555@@:4556} to QEMU. Another approach is to use a patched
6129 version of netcat which can listen to a TCP port and send and receive
6130 characters via udp. If you have a patched version of netcat which
6131 activates telnet remote echo and single char transfer, then you can
6132 use the following options to set up a netcat redirector to allow
6133 telnet on port 5555 to access the QEMU port.
6136 -serial udp::4555@@:4556
6137 @item netcat options:
6138 -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
6139 @item telnet options:
6143 @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
6144 The TCP Net Console has two modes of operation. It can send the serial
6145 I/O to a location or wait for a connection from a location. By default
6146 the TCP Net Console is sent to @var{host} at the @var{port}. If you use
6147 the @var{server} option QEMU will wait for a client socket application
6148 to connect to the port before continuing, unless the @code{nowait}
6149 option was specified. The @code{nodelay} option disables the Nagle buffering
6150 algorithm. The @code{reconnect} option only applies if @var{noserver} is
6151 set, if the connection goes down it will attempt to reconnect at the
6152 given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only
6153 one TCP connection at a time is accepted. You can use @code{telnet} to
6154 connect to the corresponding character device.
6156 @item Example to send tcp console to 192.168.0.2 port 4444
6157 -serial tcp:192.168.0.2:4444
6158 @item Example to listen and wait on port 4444 for connection
6159 -serial tcp::4444,server
6160 @item Example to not wait and listen on ip 192.168.0.100 port 4444
6161 -serial tcp:192.168.0.100:4444,server,nowait
6164 @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
6165 The telnet protocol is used instead of raw tcp sockets. The options
6166 work the same as if you had specified @code{-serial tcp}. The
6167 difference is that the port acts like a telnet server or client using
6168 telnet option negotiation. This will also allow you to send the
6169 MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
6170 sequence. Typically in unix telnet you do it with Control-] and then
6171 type "send break" followed by pressing the enter key.
6173 @item websocket:@var{host}:@var{port},server[,nowait][,nodelay]
6174 The WebSocket protocol is used instead of raw tcp socket. The port acts as
6175 a WebSocket server. Client mode is not supported.
6177 @item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
6178 A unix domain socket is used instead of a tcp socket. The option works the
6179 same as if you had specified @code{-serial tcp} except the unix domain socket
6180 @var{path} is used for connections.
6182 @item mon:@var{dev_string}
6183 This is a special option to allow the monitor to be multiplexed onto
6184 another serial port. The monitor is accessed with key sequence of
6185 @key{Control-a} and then pressing @key{c}.
6186 @var{dev_string} should be any one of the serial devices specified
6187 above. An example to multiplex the monitor onto a telnet server
6188 listening on port 4444 would be:
6190 @item -serial mon:telnet::4444,server,nowait
6192 When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
6193 QEMU any more but will be passed to the guest instead.
6196 Braille device. This will use BrlAPI to display the braille output on a real
6200 Three button serial mouse. Configure the guest to use Microsoft protocol.
6205 Redirect the virtual serial port to host character device dev. The
6206 default device is ``vc`` in graphical mode and ``stdio`` in non
6209 This option can be used several times to simulate up to 4 serial
6212 Use ``-serial none`` to disable all serial ports.
6214 Available character devices are:
6217 Virtual console. Optionally, a width and height can be given in
6224 It is also possible to specify width or height in characters:
6231 [Linux only] Pseudo TTY (a new PTY is automatically allocated)
6234 No device is allocated.
6240 Use a named character device defined with the ``-chardev``
6244 [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial
6245 port parameters are set according to the emulated ones.
6248 [Linux only, parallel port only] Use host parallel port N.
6249 Currently SPP and EPP parallel port features can be used.
6252 Write output to filename. No character can be read.
6255 [Unix only] standard input/output
6261 [Windows only] Use host serial port n
6263 ``udp:[remote_host]:remote_port[@[src_ip]:src_port]``
6264 This implements UDP Net Console. When remote\_host or src\_ip
6265 are not specified they default to ``0.0.0.0``. When not using a
6266 specified src\_port a random port is automatically chosen.
6268 If you just want a simple readonly console you can use
6269 ``netcat`` or ``nc``, by starting QEMU with:
6270 ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time
6271 QEMU writes something to that port it will appear in the
6274 If you plan to send characters back via netconsole or you want
6275 to stop and start QEMU a lot of times, you should have QEMU use
6276 the same source port each time by using something like ``-serial
6277 udp::4555@:4556`` to QEMU. Another approach is to use a patched
6278 version of netcat which can listen to a TCP port and send and
6279 receive characters via udp. If you have a patched version of
6280 netcat which activates telnet remote echo and single char
6281 transfer, then you can use the following options to set up a
6282 netcat redirector to allow telnet on port 5555 to access the
6286 -serial udp::4555@:4556
6289 -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
6294 ``tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]``
6295 The TCP Net Console has two modes of operation. It can send the
6296 serial I/O to a location or wait for a connection from a
6297 location. By default the TCP Net Console is sent to host at the
6298 port. If you use the server option QEMU will wait for a client
6299 socket application to connect to the port before continuing,
6300 unless the ``nowait`` option was specified. The ``nodelay``
6301 option disables the Nagle buffering algorithm. The ``reconnect``
6302 option only applies if noserver is set, if the connection goes
6303 down it will attempt to reconnect at the given interval. If host
6304 is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
6305 time is accepted. You can use ``telnet`` to connect to the
6306 corresponding character device.
6308 ``Example to send tcp console to 192.168.0.2 port 4444``
6309 -serial tcp:192.168.0.2:4444
6311 ``Example to listen and wait on port 4444 for connection``
6312 -serial tcp::4444,server
6314 ``Example to not wait and listen on ip 192.168.0.100 port 4444``
6315 -serial tcp:192.168.0.100:4444,server,nowait
6317 ``telnet:host:port[,server][,nowait][,nodelay]``
6318 The telnet protocol is used instead of raw tcp sockets. The
6319 options work the same as if you had specified ``-serial tcp``.
6320 The difference is that the port acts like a telnet server or
6321 client using telnet option negotiation. This will also allow you
6322 to send the MAGIC\_SYSRQ sequence if you use a telnet that
6323 supports sending the break sequence. Typically in unix telnet
6324 you do it with Control-] and then type "send break" followed by
6325 pressing the enter key.
6327 ``websocket:host:port,server[,nowait][,nodelay]``
6328 The WebSocket protocol is used instead of raw tcp socket. The
6329 port acts as a WebSocket server. Client mode is not supported.
6331 ``unix:path[,server][,nowait][,reconnect=seconds]``
6332 A unix domain socket is used instead of a tcp socket. The option
6333 works the same as if you had specified ``-serial tcp`` except
6334 the unix domain socket path is used for connections.
6337 This is a special option to allow the monitor to be multiplexed
6338 onto another serial port. The monitor is accessed with key
6339 sequence of Control-a and then pressing c. dev\_string should be
6340 any one of the serial devices specified above. An example to
6341 multiplex the monitor onto a telnet server listening on port
6344 ``-serial mon:telnet::4444,server,nowait``
6346 When the monitor is multiplexed to stdio in this way, Ctrl+C
6347 will not terminate QEMU any more but will be passed to the guest
6351 Braille device. This will use BrlAPI to display the braille
6352 output on a real or fake device.
6355 Three button serial mouse. Configure the guest to use Microsoft
6359 DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
6360 "-parallel dev redirect the parallel port to char device 'dev'\n",
6363 @item -parallel @var{dev}
6365 Redirect the virtual parallel port to host device @var{dev} (same
6366 devices as the serial port). On Linux hosts, @file{/dev/parportN} can
6367 be used to use hardware devices connected on the corresponding host
6370 This option can be used several times to simulate up to 3 parallel
6373 Use @code{-parallel none} to disable all parallel ports.
6377 Redirect the virtual parallel port to host device dev (same devices
6378 as the serial port). On Linux hosts, ``/dev/parportN`` can be used
6379 to use hardware devices connected on the corresponding host parallel
6382 This option can be used several times to simulate up to 3 parallel
6385 Use ``-parallel none`` to disable all parallel ports.
6388 DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
6389 "-monitor dev redirect the monitor to char device 'dev'\n",
6392 @item -monitor @var{dev}
6394 Redirect the monitor to host device @var{dev} (same devices as the
6396 The default device is @code{vc} in graphical mode and @code{stdio} in
6398 Use @code{-monitor none} to disable the default monitor.
6402 Redirect the monitor to host device dev (same devices as the serial
6403 port). The default device is ``vc`` in graphical mode and ``stdio``
6404 in non graphical mode. Use ``-monitor none`` to disable the default
6407 DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
6408 "-qmp dev like -monitor but opens in 'control' mode\n",
6411 @item -qmp @var{dev}
6413 Like -monitor but opens in 'control' mode.
6417 Like -monitor but opens in 'control' mode.
6419 DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
6420 "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
6423 @item -qmp-pretty @var{dev}
6425 Like -qmp but uses pretty JSON formatting.
6429 Like -qmp but uses pretty JSON formatting.
6432 DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
6433 "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
6435 @item -mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]
6437 Setup monitor on chardev @var{name}. @code{pretty} turns on JSON pretty printing
6438 easing human reading and debugging.
6441 ``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
6442 Setup monitor on chardev name. ``pretty`` turns on JSON pretty
6443 printing easing human reading and debugging.
6446 DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
6447 "-debugcon dev redirect the debug console to char device 'dev'\n",
6450 @item -debugcon @var{dev}
6452 Redirect the debug console to host device @var{dev} (same devices as the
6453 serial port). The debug console is an I/O port which is typically port
6454 0xe9; writing to that I/O port sends output to this device.
6455 The default device is @code{vc} in graphical mode and @code{stdio} in
6460 Redirect the debug console to host device dev (same devices as the
6461 serial port). The debug console is an I/O port which is typically
6462 port 0xe9; writing to that I/O port sends output to this device. The
6463 default device is ``vc`` in graphical mode and ``stdio`` in non
6467 DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
6468 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
6470 @item -pidfile @var{file}
6472 Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
6477 Store the QEMU process PID in file. It is useful if you launch QEMU
6481 DEF("singlestep", 0, QEMU_OPTION_singlestep, \
6482 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
6486 Run the emulation in single step mode.
6490 Run the emulation in single step mode.
6493 DEF("preconfig", 0, QEMU_OPTION_preconfig, \
6494 "--preconfig pause QEMU before machine is initialized (experimental)\n",
6499 Pause QEMU for interactive configuration before the machine is created,
6500 which allows querying and configuring properties that will affect
6501 machine initialization. Use QMP command 'x-exit-preconfig' to exit
6502 the preconfig state and move to the next state (i.e. run guest if -S
6503 isn't used or pause the second time if -S is used). This option is
6508 Pause QEMU for interactive configuration before the machine is
6509 created, which allows querying and configuring properties that will
6510 affect machine initialization. Use QMP command 'x-exit-preconfig' to
6511 exit the preconfig state and move to the next state (i.e. run guest
6512 if -S isn't used or pause the second time if -S is used). This
6513 option is experimental.
6516 DEF("S", 0, QEMU_OPTION_S, \
6517 "-S freeze CPU at startup (use 'c' to start execution)\n",
6522 Do not start CPU at startup (you must type 'c' in the monitor).
6526 Do not start CPU at startup (you must type 'c' in the monitor).
6529 DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
6530 "-realtime [mlock=on|off]\n"
6531 " run qemu with realtime features\n"
6532 " mlock=on|off controls mlock support (default: on)\n",
6535 @item -realtime mlock=on|off
6537 Run qemu with realtime features.
6538 mlocking qemu and guest memory can be enabled via @option{mlock=on}
6539 (enabled by default).
6542 ``-realtime mlock=on|off``
6543 Run qemu with realtime features. mlocking qemu and guest memory can
6544 be enabled via ``mlock=on`` (enabled by default).
6547 DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
6548 "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
6549 " run qemu with overcommit hints\n"
6550 " mem-lock=on|off controls memory lock support (default: off)\n"
6551 " cpu-pm=on|off controls cpu power management (default: off)\n",
6554 @item -overcommit mem-lock=on|off
6555 @item -overcommit cpu-pm=on|off
6557 Run qemu with hints about host resource overcommit. The default is
6558 to assume that host overcommits all resources.
6560 Locking qemu and guest memory can be enabled via @option{mem-lock=on} (disabled
6561 by default). This works when host memory is not overcommitted and reduces the
6562 worst-case latency for guest. This is equivalent to @option{realtime}.
6564 Guest ability to manage power state of host cpus (increasing latency for other
6565 processes on the same host cpu, but decreasing latency for guest) can be
6566 enabled via @option{cpu-pm=on} (disabled by default). This works best when
6567 host CPU is not overcommitted. When used, host estimates of CPU cycle and power
6568 utilization will be incorrect, not taking into account guest idle time.
6571 ``-overcommit mem-lock=on|off``
6572 ``-overcommit cpu-pm=on|off``
6573 Run qemu with hints about host resource overcommit. The default is
6574 to assume that host overcommits all resources.
6576 Locking qemu and guest memory can be enabled via ``mem-lock=on``
6577 (disabled by default). This works when host memory is not
6578 overcommitted and reduces the worst-case latency for guest. This is
6579 equivalent to ``realtime``.
6581 Guest ability to manage power state of host cpus (increasing latency
6582 for other processes on the same host cpu, but decreasing latency for
6583 guest) can be enabled via ``cpu-pm=on`` (disabled by default). This
6584 works best when host CPU is not overcommitted. When used, host
6585 estimates of CPU cycle and power utilization will be incorrect, not
6586 taking into account guest idle time.
6589 DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
6590 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
6592 @item -gdb @var{dev}
6594 Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
6595 connections will likely be TCP-based, but also UDP, pseudo TTY, or even
6596 stdio are reasonable use case. The latter is allowing to start QEMU from
6597 within gdb and establish the connection via a pipe:
6599 (gdb) target remote | exec @value{qemu_system} -gdb stdio ...
6604 Wait for gdb connection on device dev (see
6605 :ref:`gdb_005fusage`). Typical connections will likely be
6606 TCP-based, but also UDP, pseudo TTY, or even stdio are reasonable
6607 use case. The latter is allowing to start QEMU from within gdb and
6608 establish the connection via a pipe:
6612 (gdb) target remote | exec |qemu_system| -gdb stdio ...
6615 DEF("s", 0, QEMU_OPTION_s, \
6616 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
6621 Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
6622 (@pxref{gdb_usage}).
6626 Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
6627 (see :ref:`gdb_005fusage`).
6630 DEF("d", HAS_ARG, QEMU_OPTION_d, \
6631 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
6634 @item -d @var{item1}[,...]
6636 Enable logging of specified items. Use '-d help' for a list of log items.
6640 Enable logging of specified items. Use '-d help' for a list of log
6644 DEF("D", HAS_ARG, QEMU_OPTION_D, \
6645 "-D logfile output log to logfile (default stderr)\n",
6648 @item -D @var{logfile}
6650 Output log in @var{logfile} instead of to stderr
6654 Output log in logfile instead of to stderr
6657 DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
6658 "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
6661 @item -dfilter @var{range1}[,...]
6663 Filter debug output to that relevant to a range of target addresses. The filter
6664 spec can be either @var{start}+@var{size}, @var{start}-@var{size} or
6665 @var{start}..@var{end} where @var{start} @var{end} and @var{size} are the
6666 addresses and sizes required. For example:
6668 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
6670 Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
6671 the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
6672 block starting at 0xffffffc00005f000.
6675 ``-dfilter range1[,...]``
6676 Filter debug output to that relevant to a range of target addresses.
6677 The filter spec can be either start+size, start-size or start..end
6678 where start end and size are the addresses and sizes required. For
6683 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
6685 Will dump output for any code in the 0x1000 sized block starting at
6686 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and
6687 another 0x1000 sized block starting at 0xffffffc00005f000.
6690 DEF("seed", HAS_ARG, QEMU_OPTION_seed, \
6691 "-seed number seed the pseudo-random number generator\n",
6694 @item -seed @var{number}
6696 Force the guest to use a deterministic pseudo-random number generator, seeded
6697 with @var{number}. This does not affect crypto routines within the host.
6701 Force the guest to use a deterministic pseudo-random number
6702 generator, seeded with number. This does not affect crypto routines
6706 DEF("L", HAS_ARG, QEMU_OPTION_L, \
6707 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
6712 Set the directory for the BIOS, VGA BIOS and keymaps.
6714 To list all the data directories, use @code{-L help}.
6718 Set the directory for the BIOS, VGA BIOS and keymaps.
6720 To list all the data directories, use ``-L help``.
6723 DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
6724 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
6726 @item -bios @var{file}
6728 Set the filename for the BIOS.
6732 Set the filename for the BIOS.
6735 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
6736 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
6740 Enable KVM full virtualization support. This option is only available
6741 if KVM support is enabled when compiling.
6745 Enable KVM full virtualization support. This option is only
6746 available if KVM support is enabled when compiling.
6749 DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
6750 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
6751 DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
6752 "-xen-attach attach to existing xen domain\n"
6753 " libxl will use this when starting QEMU\n",
6755 DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
6756 "-xen-domid-restrict restrict set of available xen operations\n"
6757 " to specified domain id. (Does not affect\n"
6758 " xenpv machine type).\n",
6761 @item -xen-domid @var{id}
6763 Specify xen guest domain @var{id} (XEN only).
6766 Attach to existing xen domain.
6767 libxl will use this when starting QEMU (XEN only).
6768 @findex -xen-domid-restrict
6769 Restrict set of available xen operations to specified domain id (XEN only).
6773 Specify xen guest domain id (XEN only).
6776 Attach to existing xen domain. libxl will use this when starting
6777 QEMU (XEN only). Restrict set of available xen operations to
6778 specified domain id (XEN only).
6781 DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
6782 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
6786 Exit instead of rebooting.
6790 Exit instead of rebooting.
6793 DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
6794 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
6797 @findex -no-shutdown
6798 Don't exit QEMU on guest shutdown, but instead only stop the emulation.
6799 This allows for instance switching to monitor to commit changes to the
6804 Don't exit QEMU on guest shutdown, but instead only stop the
6805 emulation. This allows for instance switching to monitor to commit
6806 changes to the disk image.
6809 DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
6810 "-loadvm [tag|id]\n" \
6811 " start right away with a saved state (loadvm in monitor)\n",
6814 @item -loadvm @var{file}
6816 Start right away with a saved state (@code{loadvm} in monitor)
6820 Start right away with a saved state (``loadvm`` in monitor)
6824 DEF("daemonize", 0, QEMU_OPTION_daemonize, \
6825 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
6830 Daemonize the QEMU process after initialization. QEMU will not detach from
6831 standard IO until it is ready to receive connections on any of its devices.
6832 This option is a useful way for external programs to launch QEMU without having
6833 to cope with initialization race conditions.
6837 Daemonize the QEMU process after initialization. QEMU will not
6838 detach from standard IO until it is ready to receive connections on
6839 any of its devices. This option is a useful way for external
6840 programs to launch QEMU without having to cope with initialization
6844 DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
6845 "-option-rom rom load a file, rom, into the option ROM space\n",
6848 @item -option-rom @var{file}
6850 Load the contents of @var{file} as an option ROM.
6851 This option is useful to load things like EtherBoot.
6854 ``-option-rom file``
6855 Load the contents of file as an option ROM. This option is useful to
6856 load things like EtherBoot.
6859 DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
6860 "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
6861 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
6866 @item -rtc [base=utc|localtime|@var{datetime}][,clock=host|rt|vm][,driftfix=none|slew]
6868 Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
6869 UTC or local time, respectively. @code{localtime} is required for correct date in
6870 MS-DOS or Windows. To start at a specific point in time, provide @var{datetime} in the
6871 format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
6873 By default the RTC is driven by the host system time. This allows using of the
6874 RTC as accurate reference clock inside the guest, specifically if the host
6875 time is smoothly following an accurate external reference clock, e.g. via NTP.
6876 If you want to isolate the guest time from the host, you can set @option{clock}
6877 to @code{rt} instead, which provides a host monotonic clock if host support it.
6878 To even prevent the RTC from progressing during suspension, you can set @option{clock}
6879 to @code{vm} (virtual clock). @samp{clock=vm} is recommended especially in
6880 icount mode in order to preserve determinism; however, note that in icount mode
6881 the speed of the virtual clock is variable and can in general differ from the
6884 Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
6885 specifically with Windows' ACPI HAL. This option will try to figure out how
6886 many timer interrupts were not processed by the Windows guest and will
6890 ``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]``
6891 Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at
6892 the current UTC or local time, respectively. ``localtime`` is
6893 required for correct date in MS-DOS or Windows. To start at a
6894 specific point in time, provide datetime in the format
6895 ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC.
6897 By default the RTC is driven by the host system time. This allows
6898 using of the RTC as accurate reference clock inside the guest,
6899 specifically if the host time is smoothly following an accurate
6900 external reference clock, e.g. via NTP. If you want to isolate the
6901 guest time from the host, you can set ``clock`` to ``rt`` instead,
6902 which provides a host monotonic clock if host support it. To even
6903 prevent the RTC from progressing during suspension, you can set
6904 ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is
6905 recommended especially in icount mode in order to preserve
6906 determinism; however, note that in icount mode the speed of the
6907 virtual clock is variable and can in general differ from the host
6910 Enable ``driftfix`` (i386 targets only) if you experience time drift
6911 problems, specifically with Windows' ACPI HAL. This option will try
6912 to figure out how many timer interrupts were not processed by the
6913 Windows guest and will re-inject them.
6916 DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
6917 "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
6918 " enable virtual instruction counter with 2^N clock ticks per\n" \
6919 " instruction, enable aligning the host and virtual clocks\n" \
6920 " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
6922 @item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
6924 Enable virtual instruction counter. The virtual cpu will execute one
6925 instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
6926 then the virtual cpu speed will be automatically adjusted to keep virtual
6927 time within a few seconds of real time.
6929 When the virtual cpu is sleeping, the virtual time will advance at default
6930 speed unless @option{sleep=on|off} is specified.
6931 With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
6932 instantly whenever the virtual cpu goes to sleep mode and will not advance
6933 if no timer is enabled. This behavior give deterministic execution times from
6934 the guest point of view.
6936 Note that while this option can give deterministic behavior, it does not
6937 provide cycle accurate emulation. Modern CPUs contain superscalar out of
6938 order cores with complex cache hierarchies. The number of instructions
6939 executed often has little or no correlation with actual performance.
6941 @option{align=on} will activate the delay algorithm which will try
6942 to synchronise the host clock and the virtual clock. The goal is to
6943 have a guest running at the real frequency imposed by the shift option.
6944 Whenever the guest clock is behind the host clock and if
6945 @option{align=on} is specified then we print a message to the user
6946 to inform about the delay.
6947 Currently this option does not work when @option{shift} is @code{auto}.
6948 Note: The sync algorithm will work for those shift values for which
6949 the guest clock runs ahead of the host clock. Typically this happens
6950 when the shift value is high (how high depends on the host machine).
6952 When @option{rr} option is specified deterministic record/replay is enabled.
6953 Replay log is written into @var{filename} file in record mode and
6954 read from this file in replay mode.
6956 Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
6957 at the start of execution recording. In replay mode this option is used
6958 to load the initial VM state.
6961 ``-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]``
6962 Enable virtual instruction counter. The virtual cpu will execute one
6963 instruction every 2^N ns of virtual time. If ``auto`` is specified
6964 then the virtual cpu speed will be automatically adjusted to keep
6965 virtual time within a few seconds of real time.
6967 When the virtual cpu is sleeping, the virtual time will advance at
6968 default speed unless ``sleep=on|off`` is specified. With
6969 ``sleep=on|off``, the virtual time will jump to the next timer
6970 deadline instantly whenever the virtual cpu goes to sleep mode and
6971 will not advance if no timer is enabled. This behavior give
6972 deterministic execution times from the guest point of view.
6974 Note that while this option can give deterministic behavior, it does
6975 not provide cycle accurate emulation. Modern CPUs contain
6976 superscalar out of order cores with complex cache hierarchies. The
6977 number of instructions executed often has little or no correlation
6978 with actual performance.
6980 ``align=on`` will activate the delay algorithm which will try to
6981 synchronise the host clock and the virtual clock. The goal is to
6982 have a guest running at the real frequency imposed by the shift
6983 option. Whenever the guest clock is behind the host clock and if
6984 ``align=on`` is specified then we print a message to the user to
6985 inform about the delay. Currently this option does not work when
6986 ``shift`` is ``auto``. Note: The sync algorithm will work for those
6987 shift values for which the guest clock runs ahead of the host clock.
6988 Typically this happens when the shift value is high (how high
6989 depends on the host machine).
6991 When ``rr`` option is specified deterministic record/replay is
6992 enabled. Replay log is written into filename file in record mode and
6993 read from this file in replay mode.
6995 Option rrsnapshot is used to create new vm snapshot named snapshot
6996 at the start of execution recording. In replay mode this option is
6997 used to load the initial VM state.
7000 DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
7001 "-watchdog model\n" \
7002 " enable virtual hardware watchdog [default=none]\n",
7005 @item -watchdog @var{model}
7007 Create a virtual hardware watchdog device. Once enabled (by a guest
7008 action), the watchdog must be periodically polled by an agent inside
7009 the guest or else the guest will be restarted. Choose a model for
7010 which your guest has drivers.
7012 The @var{model} is the model of hardware watchdog to emulate. Use
7013 @code{-watchdog help} to list available hardware models. Only one
7014 watchdog can be enabled for a guest.
7016 The following models may be available:
7019 iBASE 700 is a very simple ISA watchdog with a single timer.
7021 Intel 6300ESB I/O controller hub is a much more featureful PCI-based
7022 dual-timer watchdog.
7024 A virtual watchdog for s390x backed by the diagnose 288 hypercall
7025 (currently KVM only).
7030 Create a virtual hardware watchdog device. Once enabled (by a guest
7031 action), the watchdog must be periodically polled by an agent inside
7032 the guest or else the guest will be restarted. Choose a model for
7033 which your guest has drivers.
7035 The model is the model of hardware watchdog to emulate. Use
7036 ``-watchdog help`` to list available hardware models. Only one
7037 watchdog can be enabled for a guest.
7039 The following models may be available:
7042 iBASE 700 is a very simple ISA watchdog with a single timer.
7045 Intel 6300ESB I/O controller hub is a much more featureful
7046 PCI-based dual-timer watchdog.
7049 A virtual watchdog for s390x backed by the diagnose 288
7050 hypercall (currently KVM only).
7053 DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
7054 "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
7055 " action when watchdog fires [default=reset]\n",
7058 @item -watchdog-action @var{action}
7059 @findex -watchdog-action
7061 The @var{action} controls what QEMU will do when the watchdog timer
7064 @code{reset} (forcefully reset the guest).
7065 Other possible actions are:
7066 @code{shutdown} (attempt to gracefully shutdown the guest),
7067 @code{poweroff} (forcefully poweroff the guest),
7068 @code{inject-nmi} (inject a NMI into the guest),
7069 @code{pause} (pause the guest),
7070 @code{debug} (print a debug message and continue), or
7071 @code{none} (do nothing).
7073 Note that the @code{shutdown} action requires that the guest responds
7074 to ACPI signals, which it may not be able to do in the sort of
7075 situations where the watchdog would have expired, and thus
7076 @code{-watchdog-action shutdown} is not recommended for production use.
7081 @item -watchdog i6300esb -watchdog-action pause
7082 @itemx -watchdog ib700
7086 ``-watchdog-action action``
7087 The action controls what QEMU will do when the watchdog timer
7088 expires. The default is ``reset`` (forcefully reset the guest).
7089 Other possible actions are: ``shutdown`` (attempt to gracefully
7090 shutdown the guest), ``poweroff`` (forcefully poweroff the guest),
7091 ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the
7092 guest), ``debug`` (print a debug message and continue), or ``none``
7095 Note that the ``shutdown`` action requires that the guest responds
7096 to ACPI signals, which it may not be able to do in the sort of
7097 situations where the watchdog would have expired, and thus
7098 ``-watchdog-action shutdown`` is not recommended for production use.
7102 ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700``
7106 DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
7107 "-echr chr set terminal escape character instead of ctrl-a\n",
7111 @item -echr @var{numeric_ascii_value}
7113 Change the escape character used for switching to the monitor when using
7114 monitor and serial sharing. The default is @code{0x01} when using the
7115 @code{-nographic} option. @code{0x01} is equal to pressing
7116 @code{Control-a}. You can select a different character from the ascii
7117 control keys where 1 through 26 map to Control-a through Control-z. For
7118 instance you could use the either of the following to change the escape
7119 character to Control-t.
7126 ``-echr numeric_ascii_value``
7127 Change the escape character used for switching to the monitor when
7128 using monitor and serial sharing. The default is ``0x01`` when using
7129 the ``-nographic`` option. ``0x01`` is equal to pressing
7130 ``Control-a``. You can select a different character from the ascii
7131 control keys where 1 through 26 map to Control-a through Control-z.
7132 For instance you could use the either of the following to change the
7133 escape character to Control-t.
7135 ``-echr 0x14``; \ ``-echr 20``
7139 DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
7140 "-show-cursor show cursor\n", QEMU_ARCH_ALL)
7143 @findex -show-cursor
7151 DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
7152 "-tb-size n set TB size\n", QEMU_ARCH_ALL)
7154 @item -tb-size @var{n}
7156 Set TCG translation block cache size. Deprecated, use @samp{-accel tcg,tb-size=@var{n}}
7161 Set TCG translation block cache size. Deprecated, use
7162 '\ ``-accel tcg,tb-size=n``\ ' instead.
7165 DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
7166 "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
7167 "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
7168 "-incoming unix:socketpath\n" \
7169 " prepare for incoming migration, listen on\n" \
7170 " specified protocol and socket address\n" \
7171 "-incoming fd:fd\n" \
7172 "-incoming exec:cmdline\n" \
7173 " accept incoming migration on given file descriptor\n" \
7174 " or from given external command\n" \
7175 "-incoming defer\n" \
7176 " wait for the URI to be specified via migrate_incoming\n",
7179 @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
7180 @itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
7182 Prepare for incoming migration, listen on a given tcp port.
7184 @item -incoming unix:@var{socketpath}
7185 Prepare for incoming migration, listen on a given unix socket.
7187 @item -incoming fd:@var{fd}
7188 Accept incoming migration from a given filedescriptor.
7190 @item -incoming exec:@var{cmdline}
7191 Accept incoming migration as an output from specified external command.
7193 @item -incoming defer
7194 Wait for the URI to be specified via migrate_incoming. The monitor can
7195 be used to change settings (such as migration parameters) prior to issuing
7196 the migrate_incoming to allow the migration to begin.
7199 ``-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]``; \ ``-incoming rdma:host:port[,ipv4][,ipv6]``
7200 Prepare for incoming migration, listen on a given tcp port.
7202 ``-incoming unix:socketpath``
7203 Prepare for incoming migration, listen on a given unix socket.
7206 Accept incoming migration from a given filedescriptor.
7208 ``-incoming exec:cmdline``
7209 Accept incoming migration as an output from specified external
7213 Wait for the URI to be specified via migrate\_incoming. The monitor
7214 can be used to change settings (such as migration parameters) prior
7215 to issuing the migrate\_incoming to allow the migration to begin.
7218 DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
7219 "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
7221 @item -only-migratable
7222 @findex -only-migratable
7223 Only allow migratable devices. Devices will not be allowed to enter an
7227 ``-only-migratable``
7228 Only allow migratable devices. Devices will not be allowed to enter
7229 an unmigratable state.
7232 DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
7233 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
7237 Don't create default devices. Normally, QEMU sets the default devices like serial
7238 port, parallel port, virtual console, monitor device, VGA adapter, floppy and
7239 CD-ROM drive and others. The @code{-nodefaults} option will disable all those
7244 Don't create default devices. Normally, QEMU sets the default
7245 devices like serial port, parallel port, virtual console, monitor
7246 device, VGA adapter, floppy and CD-ROM drive and others. The
7247 ``-nodefaults`` option will disable all those default devices.
7251 DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
7252 "-chroot dir chroot to dir just before starting the VM\n",
7256 @item -chroot @var{dir}
7258 Immediately before starting guest execution, chroot to the specified
7259 directory. Especially useful in combination with -runas.
7263 Immediately before starting guest execution, chroot to the specified
7264 directory. Especially useful in combination with -runas.
7268 DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
7269 "-runas user change to user id user just before starting the VM\n" \
7270 " user can be numeric uid:gid instead\n",
7274 @item -runas @var{user}
7276 Immediately before starting guest execution, drop root privileges, switching
7277 to the specified user.
7281 Immediately before starting guest execution, drop root privileges,
7282 switching to the specified user.
7285 DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
7286 "-prom-env variable=value\n"
7287 " set OpenBIOS nvram variables\n",
7288 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
7290 @item -prom-env @var{variable}=@var{value}
7292 Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
7295 qemu-system-sparc -prom-env 'auto-boot?=false' \
7296 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
7300 qemu-system-ppc -prom-env 'auto-boot?=false' \
7301 -prom-env 'boot-device=hd:2,\yaboot' \
7302 -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
7307 ``-prom-env variable=value``
7308 Set OpenBIOS nvram variable to given value (PPC, SPARC only).
7312 qemu-system-sparc -prom-env 'auto-boot?=false' \
7313 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
7317 qemu-system-ppc -prom-env 'auto-boot?=false' \
7318 -prom-env 'boot-device=hd:2,\yaboot' \
7319 -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
7321 DEF("semihosting", 0, QEMU_OPTION_semihosting,
7322 "-semihosting semihosting mode\n",
7323 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
7324 QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
7327 @findex -semihosting
7328 Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only).
7330 Note that this allows guest direct access to the host filesystem, so
7331 should only be used with a trusted guest OS.
7333 See the -semihosting-config option documentation for further information
7334 about the facilities this enables.
7338 Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only).
7340 Note that this allows guest direct access to the host filesystem, so
7341 should only be used with a trusted guest OS.
7343 See the -semihosting-config option documentation for further
7344 information about the facilities this enables.
7346 DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
7347 "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \
7348 " semihosting configuration\n",
7349 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
7350 QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
7352 @item -semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]
7353 @findex -semihosting-config
7354 Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II only).
7356 Note that this allows guest direct access to the host filesystem, so
7357 should only be used with a trusted guest OS.
7359 On Arm this implements the standard semihosting API, version 2.0.
7361 On M68K this implements the "ColdFire GDB" interface used by libgloss.
7363 Xtensa semihosting provides basic file IO calls, such as
7364 open/read/write/seek/select. Tensilica baremetal libc for ISS and
7365 linux platform "sim" use this interface.
7368 @item target=@code{native|gdb|auto}
7369 Defines where the semihosting calls will be addressed, to QEMU (@code{native})
7370 or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
7371 during debug sessions and @code{native} otherwise.
7372 @item chardev=@var{str1}
7373 Send the output to a chardev backend output for native or auto output when not in gdb
7374 @item arg=@var{str1},arg=@var{str2},...
7375 Allows the user to pass input arguments, and can be used multiple times to build
7376 up a list. The old-style @code{-kernel}/@code{-append} method of passing a
7377 command line is still supported for backward compatibility. If both the
7378 @code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
7379 specified, the former is passed to semihosting as it always takes precedence.
7383 ``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]``
7384 Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II
7387 Note that this allows guest direct access to the host filesystem, so
7388 should only be used with a trusted guest OS.
7390 On Arm this implements the standard semihosting API, version 2.0.
7392 On M68K this implements the "ColdFire GDB" interface used by
7395 Xtensa semihosting provides basic file IO calls, such as
7396 open/read/write/seek/select. Tensilica baremetal libc for ISS and
7397 linux platform "sim" use this interface.
7399 ``target=native|gdb|auto``
7400 Defines where the semihosting calls will be addressed, to QEMU
7401 (``native``) or to GDB (``gdb``). The default is ``auto``, which
7402 means ``gdb`` during debug sessions and ``native`` otherwise.
7405 Send the output to a chardev backend output for native or auto
7406 output when not in gdb
7408 ``arg=str1,arg=str2,...``
7409 Allows the user to pass input arguments, and can be used
7410 multiple times to build up a list. The old-style
7411 ``-kernel``/``-append`` method of passing a command line is
7412 still supported for backward compatibility. If both the
7413 ``--semihosting-config arg`` and the ``-kernel``/``-append`` are
7414 specified, the former is passed to semihosting as it always
7417 DEF("old-param", 0, QEMU_OPTION_old_param,
7418 "-old-param old param mode\n", QEMU_ARCH_ARM)
7421 @findex -old-param (ARM)
7422 Old param mode (ARM only).
7426 Old param mode (ARM only).
7429 DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
7430 "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
7431 " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
7432 " Enable seccomp mode 2 system call filter (default 'off').\n" \
7433 " use 'obsolete' to allow obsolete system calls that are provided\n" \
7434 " by the kernel, but typically no longer used by modern\n" \
7435 " C library implementations.\n" \
7436 " use 'elevateprivileges' to allow or deny QEMU process to elevate\n" \
7437 " its privileges by blacklisting all set*uid|gid system calls.\n" \
7438 " The value 'children' will deny set*uid|gid system calls for\n" \
7439 " main QEMU process but will allow forks and execves to run unprivileged\n" \
7440 " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
7441 " blacklisting *fork and execve\n" \
7442 " use 'resourcecontrol' to disable process affinity and schedular priority\n",
7445 @item -sandbox @var{arg}[,obsolete=@var{string}][,elevateprivileges=@var{string}][,spawn=@var{string}][,resourcecontrol=@var{string}]
7447 Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
7448 disable it. The default is 'off'.
7450 @item obsolete=@var{string}
7451 Enable Obsolete system calls
7452 @item elevateprivileges=@var{string}
7453 Disable set*uid|gid system calls
7454 @item spawn=@var{string}
7455 Disable *fork and execve
7456 @item resourcecontrol=@var{string}
7457 Disable process affinity and schedular priority
7461 ``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
7462 Enable Seccomp mode 2 system call filter. 'on' will enable syscall
7463 filtering and 'off' will disable it. The default is 'off'.
7466 Enable Obsolete system calls
7468 ``elevateprivileges=string``
7469 Disable set\*uid\|gid system calls
7472 Disable \*fork and execve
7474 ``resourcecontrol=string``
7475 Disable process affinity and schedular priority
7478 DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
7479 "-readconfig <file>\n", QEMU_ARCH_ALL)
7481 @item -readconfig @var{file}
7483 Read device configuration from @var{file}. This approach is useful when you want to spawn
7484 QEMU process with many command line options but you don't want to exceed the command line
7488 ``-readconfig file``
7489 Read device configuration from file. This approach is useful when
7490 you want to spawn QEMU process with many command line options but
7491 you don't want to exceed the command line character limit.
7493 DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
7494 "-writeconfig <file>\n"
7495 " read/write config file\n", QEMU_ARCH_ALL)
7497 @item -writeconfig @var{file}
7498 @findex -writeconfig
7499 Write device configuration to @var{file}. The @var{file} can be either filename to save
7500 command line and device configuration into file or dash @code{-}) character to print the
7501 output to stdout. This can be later used as input file for @code{-readconfig} option.
7504 ``-writeconfig file``
7505 Write device configuration to file. The file can be either filename
7506 to save command line and device configuration into file or dash
7507 ``-``) character to print the output to stdout. This can be later
7508 used as input file for ``-readconfig`` option.
7511 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
7513 " do not load default user-provided config files at startup\n",
7516 @item -no-user-config
7517 @findex -no-user-config
7518 The @code{-no-user-config} option makes QEMU not load any of the user-provided
7519 config files on @var{sysconfdir}.
7523 The ``-no-user-config`` option makes QEMU not load any of the
7524 user-provided config files on sysconfdir.
7527 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
7528 "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
7529 " specify tracing options\n",
7532 HXCOMM This line is not accurate, as some sub-options are backend-specific but
7533 HXCOMM HX does not support conditional compilation of text.
7534 @item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
7536 @include docs/system/qemu-option-trace.texi
7539 ``-trace [[enable=]pattern][,events=file][,file=file]``
7540 Specify tracing options.
7542 ``[enable=]pattern``
7543 Immediately enable events matching pattern (either event name or
7544 a globbing pattern). This option is only available if QEMU has
7545 been compiled with the simple, log or ftrace tracing backend. To
7546 specify multiple events or patterns, specify the ``-trace``
7547 option multiple times.
7549 Use ``-trace help`` to print a list of names of trace points.
7552 Immediately enable events listed in file. The file must contain
7553 one event name (as listed in the ``trace-events-all`` file) per
7554 line; globbing patterns are accepted too. This option is only
7555 available if QEMU has been compiled with the simple, log or
7556 ftrace tracing backend.
7559 Log output traces to file. This option is only available if QEMU
7560 has been compiled with the simple tracing backend.
7562 DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
7563 "-plugin [file=]<file>[,arg=<string>]\n"
7567 @item -plugin file=@var{file}[,arg=@var{string}]
7573 @item file=@var{file}
7574 Load the given plugin from a shared library file.
7575 @item arg=@var{string}
7576 Argument string passed to the plugin. (Can be given multiple times.)
7580 ``-plugin file=file[,arg=string]``
7584 Load the given plugin from a shared library file.
7587 Argument string passed to the plugin. (Can be given multiple
7592 DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
7593 DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
7596 DEF("enable-fips", 0, QEMU_OPTION_enablefips,
7597 "-enable-fips enable FIPS 140-2 compliance\n",
7602 @findex -enable-fips
7603 Enable FIPS 140-2 compliance mode.
7607 Enable FIPS 140-2 compliance mode.
7610 HXCOMM Deprecated by -accel tcg
7611 DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
7613 DEF("msg", HAS_ARG, QEMU_OPTION_msg,
7614 "-msg timestamp[=on|off]\n"
7615 " control error message format\n"
7616 " timestamp=on enables timestamps (default: off)\n",
7619 @item -msg timestamp[=on|off]
7621 Control error message format.
7623 @item timestamp=on|off
7624 Prefix messages with a timestamp. Default is off.
7628 ``-msg timestamp[=on|off]``
7629 Control error message format.
7631 ``timestamp=on|off``
7632 Prefix messages with a timestamp. Default is off.
7635 DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
7636 "-dump-vmstate <file>\n"
7637 " Output vmstate information in JSON format to file.\n"
7638 " Use the scripts/vmstate-static-checker.py file to\n"
7639 " check for possible regressions in migration code\n"
7640 " by comparing two such vmstate dumps.\n",
7643 @item -dump-vmstate @var{file}
7644 @findex -dump-vmstate
7645 Dump json-encoded vmstate information for current machine type to file
7649 ``-dump-vmstate file``
7650 Dump json-encoded vmstate information for current machine type to
7654 DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
7655 "-enable-sync-profile\n"
7656 " enable synchronization profiling\n",
7659 @item -enable-sync-profile
7660 @findex -enable-sync-profile
7661 Enable synchronization profiling.
7664 ``-enable-sync-profile``
7665 Enable synchronization profiling.
7673 DEFHEADING(Generic object creation:)
7678 DEF("object", HAS_ARG, QEMU_OPTION_object,
7679 "-object TYPENAME[,PROP1=VALUE1,...]\n"
7680 " create a new object of type TYPENAME setting properties\n"
7681 " in the order they are specified. Note that the 'id'\n"
7682 " property must be set. These objects are placed in the\n"
7683 " '/objects' path.\n",
7686 @item -object @var{typename}[,@var{prop1}=@var{value1},...]
7688 Create a new object of type @var{typename} setting properties
7689 in the order they are specified. Note that the 'id'
7690 property must be set. These objects are placed in the
7695 @item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off},discard-data=@var{on|off},merge=@var{on|off},dump=@var{on|off},prealloc=@var{on|off},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},align=@var{align}
7697 Creates a memory file backend object, which can be used to back
7698 the guest RAM with huge pages.
7700 The @option{id} parameter is a unique ID that will be used to reference this
7701 memory region when configuring the @option{-numa} argument.
7703 The @option{size} option provides the size of the memory region, and accepts
7704 common suffixes, eg @option{500M}.
7706 The @option{mem-path} provides the path to either a shared memory or huge page
7709 The @option{share} boolean option determines whether the memory
7710 region is marked as private to QEMU, or shared. The latter allows
7711 a co-operating external process to access the QEMU memory region.
7713 The @option{share} is also required for pvrdma devices due to
7714 limitations in the RDMA API provided by Linux.
7716 Setting share=on might affect the ability to configure NUMA
7717 bindings for the memory backend under some circumstances, see
7718 Documentation/vm/numa_memory_policy.txt on the Linux kernel
7719 source tree for additional details.
7721 Setting the @option{discard-data} boolean option to @var{on}
7722 indicates that file contents can be destroyed when QEMU exits,
7723 to avoid unnecessarily flushing data to the backing file. Note
7724 that @option{discard-data} is only an optimization, and QEMU
7725 might not discard file contents if it aborts unexpectedly or is
7726 terminated using SIGKILL.
7728 The @option{merge} boolean option enables memory merge, also known as
7729 MADV_MERGEABLE, so that Kernel Samepage Merging will consider the pages for
7730 memory deduplication.
7732 Setting the @option{dump} boolean option to @var{off} excludes the memory from
7733 core dumps. This feature is also known as MADV_DONTDUMP.
7735 The @option{prealloc} boolean option enables memory preallocation.
7737 The @option{host-nodes} option binds the memory range to a list of NUMA host
7740 The @option{policy} option sets the NUMA policy to one of the following values:
7746 @item @var{preferred}
7747 prefer the given host node list for allocation
7750 restrict memory allocation to the given host node list
7752 @item @var{interleave}
7753 interleave memory allocations across the given host node list
7756 The @option{align} option specifies the base address alignment when
7757 QEMU mmap(2) @option{mem-path}, and accepts common suffixes, eg
7758 @option{2M}. Some backend store specified by @option{mem-path}
7759 requires an alignment different than the default one used by QEMU, eg
7760 the device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
7761 such cases, users can specify the required alignment via this option.
7763 The @option{pmem} option specifies whether the backing file specified
7764 by @option{mem-path} is in host persistent memory that can be accessed
7765 using the SNIA NVM programming model (e.g. Intel NVDIMM).
7766 If @option{pmem} is set to 'on', QEMU will take necessary operations to
7767 guarantee the persistence of its own writes to @option{mem-path}
7768 (e.g. in vNVDIMM label emulation and live migration).
7769 Also, we will map the backend-file with MAP_SYNC flag, which ensures the
7770 file metadata is in sync for @option{mem-path} in case of host crash
7771 or a power failure. MAP_SYNC requires support from both the host kernel
7772 (since Linux kernel 4.15) and the filesystem of @option{mem-path} mounted
7775 @item -object memory-backend-ram,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave}
7777 Creates a memory backend object, which can be used to back the guest RAM.
7778 Memory backend objects offer more control than the @option{-m} option that is
7779 traditionally used to define guest RAM. Please refer to
7780 @option{memory-backend-file} for a description of the options.
7782 @item -object memory-backend-memfd,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},seal=@var{on|off},hugetlb=@var{on|off},hugetlbsize=@var{size}
7784 Creates an anonymous memory file backend object, which allows QEMU to
7785 share the memory with an external process (e.g. when using
7786 vhost-user). The memory is allocated with memfd and optional
7787 sealing. (Linux only)
7789 The @option{seal} option creates a sealed-file, that will block
7790 further resizing the memory ('on' by default).
7792 The @option{hugetlb} option specify the file to be created resides in
7793 the hugetlbfs filesystem (since Linux 4.14). Used in conjunction with
7794 the @option{hugetlb} option, the @option{hugetlbsize} option specify
7795 the hugetlb page size on systems that support multiple hugetlb page
7796 sizes (it must be a power of 2 value supported by the system).
7798 In some versions of Linux, the @option{hugetlb} option is incompatible
7799 with the @option{seal} option (requires at least Linux 4.16).
7801 Please refer to @option{memory-backend-file} for a description of the
7804 The @option{share} boolean option is @var{on} by default with memfd.
7806 @item -object rng-builtin,id=@var{id}
7808 Creates a random number generator backend which obtains entropy from
7809 QEMU builtin functions. The @option{id} parameter is a unique ID that
7810 will be used to reference this entropy backend from the @option{virtio-rng}
7811 device. By default, the @option{virtio-rng} device uses this RNG backend.
7813 @item -object rng-random,id=@var{id},filename=@var{/dev/random}
7815 Creates a random number generator backend which obtains entropy from
7816 a device on the host. The @option{id} parameter is a unique ID that
7817 will be used to reference this entropy backend from the @option{virtio-rng}
7818 device. The @option{filename} parameter specifies which file to obtain
7819 entropy from and if omitted defaults to @option{/dev/urandom}.
7821 @item -object rng-egd,id=@var{id},chardev=@var{chardevid}
7823 Creates a random number generator backend which obtains entropy from
7824 an external daemon running on the host. The @option{id} parameter is
7825 a unique ID that will be used to reference this entropy backend from
7826 the @option{virtio-rng} device. The @option{chardev} parameter is
7827 the unique ID of a character device backend that provides the connection
7830 @item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
7832 Creates a TLS anonymous credentials object, which can be used to provide
7833 TLS support on network backends. The @option{id} parameter is a unique
7834 ID which network backends will use to access the credentials. The
7835 @option{endpoint} is either @option{server} or @option{client} depending
7836 on whether the QEMU network backend that uses the credentials will be
7837 acting as a client or as a server. If @option{verify-peer} is enabled
7838 (the default) then once the handshake is completed, the peer credentials
7839 will be verified, though this is a no-op for anonymous credentials.
7841 The @var{dir} parameter tells QEMU where to find the credential
7842 files. For server endpoints, this directory may contain a file
7843 @var{dh-params.pem} providing diffie-hellman parameters to use
7844 for the TLS server. If the file is missing, QEMU will generate
7845 a set of DH parameters at startup. This is a computationally
7846 expensive operation that consumes random pool entropy, so it is
7847 recommended that a persistent set of parameters be generated
7850 @item -object tls-creds-psk,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/keys/dir}[,username=@var{username}]
7852 Creates a TLS Pre-Shared Keys (PSK) credentials object, which can be used to provide
7853 TLS support on network backends. The @option{id} parameter is a unique
7854 ID which network backends will use to access the credentials. The
7855 @option{endpoint} is either @option{server} or @option{client} depending
7856 on whether the QEMU network backend that uses the credentials will be
7857 acting as a client or as a server. For clients only, @option{username}
7858 is the username which will be sent to the server. If omitted
7859 it defaults to ``qemu''.
7861 The @var{dir} parameter tells QEMU where to find the keys file.
7862 It is called ``@var{dir}/keys.psk'' and contains ``username:key''
7863 pairs. This file can most easily be created using the GnuTLS
7864 @code{psktool} program.
7866 For server endpoints, @var{dir} may also contain a file
7867 @var{dh-params.pem} providing diffie-hellman parameters to use
7868 for the TLS server. If the file is missing, QEMU will generate
7869 a set of DH parameters at startup. This is a computationally
7870 expensive operation that consumes random pool entropy, so it is
7871 recommended that a persistent set of parameters be generated
7874 @item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},priority=@var{priority},verify-peer=@var{on|off},passwordid=@var{id}
7876 Creates a TLS anonymous credentials object, which can be used to provide
7877 TLS support on network backends. The @option{id} parameter is a unique
7878 ID which network backends will use to access the credentials. The
7879 @option{endpoint} is either @option{server} or @option{client} depending
7880 on whether the QEMU network backend that uses the credentials will be
7881 acting as a client or as a server. If @option{verify-peer} is enabled
7882 (the default) then once the handshake is completed, the peer credentials
7883 will be verified. With x509 certificates, this implies that the clients
7884 must be provided with valid client certificates too.
7886 The @var{dir} parameter tells QEMU where to find the credential
7887 files. For server endpoints, this directory may contain a file
7888 @var{dh-params.pem} providing diffie-hellman parameters to use
7889 for the TLS server. If the file is missing, QEMU will generate
7890 a set of DH parameters at startup. This is a computationally
7891 expensive operation that consumes random pool entropy, so it is
7892 recommended that a persistent set of parameters be generated
7895 For x509 certificate credentials the directory will contain further files
7896 providing the x509 certificates. The certificates must be stored
7897 in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
7898 @var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
7899 @var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
7901 For the @var{server-key.pem} and @var{client-key.pem} files which
7902 contain sensitive private keys, it is possible to use an encrypted
7903 version by providing the @var{passwordid} parameter. This provides
7904 the ID of a previously created @code{secret} object containing the
7905 password for decryption.
7907 The @var{priority} parameter allows to override the global default
7908 priority used by gnutls. This can be useful if the system administrator
7909 needs to use a weaker set of crypto priorities for QEMU without
7910 potentially forcing the weakness onto all applications. Or conversely
7911 if one wants wants a stronger default for QEMU than for all other
7912 applications, they can do this through this parameter. Its format is
7913 a gnutls priority string as described at
7914 @url{https://gnutls.org/manual/html_node/Priority-Strings.html}.
7916 @item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}]
7918 Interval @var{t} can't be 0, this filter batches the packet delivery: all
7919 packets arriving in a given interval on netdev @var{netdevid} are delayed
7920 until the end of the interval. Interval is in microseconds.
7921 @option{status} is optional that indicate whether the netfilter is
7922 on (enabled) or off (disabled), the default status for netfilter will be 'on'.
7924 queue @var{all|rx|tx} is an option that can be applied to any netfilter.
7926 @option{all}: the filter is attached both to the receive and the transmit
7927 queue of the netdev (default).
7929 @option{rx}: the filter is attached to the receive queue of the netdev,
7930 where it will receive packets sent to the netdev.
7932 @option{tx}: the filter is attached to the transmit queue of the netdev,
7933 where it will receive packets sent by the netdev.
7935 position @var{head|tail|id=<id>} is an option to specify where the
7936 filter should be inserted in the filter list. It can be applied to any
7939 @option{head}: the filter is inserted at the head of the filter
7940 list, before any existing filters.
7942 @option{tail}: the filter is inserted at the tail of the filter
7943 list, behind any existing filters (default).
7945 @option{id=<id>}: the filter is inserted before or behind the filter
7946 specified by <id>, see the insert option below.
7948 insert @var{behind|before} is an option to specify where to insert the
7949 new filter relative to the one specified with position=id=<id>. It can
7950 be applied to any netfilter.
7952 @option{before}: insert before the specified filter.
7954 @option{behind}: insert behind the specified filter (default).
7956 @item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}]
7958 filter-mirror on netdev @var{netdevid},mirror net packet to chardev@var{chardevid}, if it has the vnet_hdr_support flag, filter-mirror will mirror packet with vnet_hdr_len.
7960 @item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}]
7962 filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
7963 @var{chardevid},and redirect indev's packet to filter.if it has the vnet_hdr_support flag,
7964 filter-redirector will redirect packet with vnet_hdr_len.
7965 Create a filter-redirector we need to differ outdev id from indev id, id can not
7966 be the same. we can just use indev or outdev, but at least one of indev or outdev
7967 need to be specified.
7969 @item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},queue=@var{all|rx|tx},[vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}]
7971 Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
7972 secondary from primary to keep secondary tcp connection,and rewrite
7973 tcp packet to primary from secondary make tcp packet can be handled by
7974 client.if it has the vnet_hdr_support flag, we can parse packet with vnet header.
7978 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
7979 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
7980 -object filter-rewriter,id=rew0,netdev=hn0,queue=all
7982 @item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}]
7984 Dump the network traffic on netdev @var{dev} to the file specified by
7985 @var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
7986 The file format is libpcap, so it can be analyzed with tools such as tcpdump
7989 @item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid},iothread=@var{id}[,vnet_hdr_support][,notify_dev=@var{id}]
7991 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
7992 secondary packet. If the packets are same, we will output primary
7993 packet to outdev@var{chardevid}, else we will notify colo-frame
7994 do checkpoint and send primary packet to outdev@var{chardevid}.
7995 In order to improve efficiency, we need to put the task of comparison
7996 in another thread. If it has the vnet_hdr_support flag, colo compare
7997 will send/recv packet with vnet_hdr_len.
7998 If you want to use Xen COLO, will need the notify_dev to notify Xen
7999 colo-frame to do checkpoint.
8001 we must use it with the help of filter-mirror and filter-redirector.
8008 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
8009 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
8010 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
8011 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
8012 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
8013 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
8014 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
8015 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
8016 -object iothread,id=iothread1
8017 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
8018 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
8019 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
8020 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
8023 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
8024 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
8025 -chardev socket,id=red0,host=3.3.3.3,port=9003
8026 -chardev socket,id=red1,host=3.3.3.3,port=9004
8027 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
8028 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
8034 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
8035 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
8036 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
8037 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
8038 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
8039 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
8040 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
8041 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
8042 -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
8043 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
8044 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
8045 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
8046 -object iothread,id=iothread1
8047 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
8050 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
8051 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
8052 -chardev socket,id=red0,host=3.3.3.3,port=9003
8053 -chardev socket,id=red1,host=3.3.3.3,port=9004
8054 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
8055 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
8059 If you want to know the detail of above command line, you can read
8060 the colo-compare git log.
8062 @item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
8064 Creates a cryptodev backend which executes crypto opreation from
8065 the QEMU cipher APIS. The @var{id} parameter is
8066 a unique ID that will be used to reference this cryptodev backend from
8067 the @option{virtio-crypto} device. The @var{queues} parameter is optional,
8068 which specify the queue number of cryptodev backend, the default of
8073 # @value{qemu_system} \
8075 -object cryptodev-backend-builtin,id=cryptodev0 \
8076 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
8080 @item -object cryptodev-vhost-user,id=@var{id},chardev=@var{chardevid}[,queues=@var{queues}]
8082 Creates a vhost-user cryptodev backend, backed by a chardev @var{chardevid}.
8083 The @var{id} parameter is a unique ID that will be used to reference this
8084 cryptodev backend from the @option{virtio-crypto} device.
8085 The chardev should be a unix domain socket backed one. The vhost-user uses
8086 a specifically defined protocol to pass vhost ioctl replacement messages
8087 to an application on the other end of the socket.
8088 The @var{queues} parameter is optional, which specify the queue number
8089 of cryptodev backend for multiqueue vhost-user, the default of @var{queues} is 1.
8093 # @value{qemu_system} \
8095 -chardev socket,id=chardev0,path=/path/to/socket \
8096 -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
8097 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
8101 @item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
8102 @item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
8104 Defines a secret to store a password, encryption key, or some other sensitive
8105 data. The sensitive data can either be passed directly via the @var{data}
8106 parameter, or indirectly via the @var{file} parameter. Using the @var{data}
8107 parameter is insecure unless the sensitive data is encrypted.
8109 The sensitive data can be provided in raw format (the default), or base64.
8110 When encoded as JSON, the raw format only supports valid UTF-8 characters,
8111 so base64 is recommended for sending binary data. QEMU will convert from
8112 which ever format is provided to the format it needs internally. eg, an
8113 RBD password can be provided in raw format, even though it will be base64
8114 encoded when passed onto the RBD sever.
8116 For added protection, it is possible to encrypt the data associated with
8117 a secret using the AES-256-CBC cipher. Use of encryption is indicated
8118 by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
8119 parameter provides the ID of a previously defined secret that contains
8120 the AES-256 decryption key. This key should be 32-bytes long and be
8121 base64 encoded. The @var{iv} parameter provides the random initialization
8122 vector used for encryption of this particular secret and should be a
8123 base64 encrypted string of the 16-byte IV.
8125 The simplest (insecure) usage is to provide the secret inline
8129 # @value{qemu_system} -object secret,id=sec0,data=letmein,format=raw
8133 The simplest secure usage is to provide the secret via a file
8135 # printf "letmein" > mypasswd.txt
8136 # @value{qemu_system} -object secret,id=sec0,file=mypasswd.txt,format=raw
8138 For greater security, AES-256-CBC should be used. To illustrate usage,
8139 consider the openssl command line tool which can encrypt the data. Note
8140 that when encrypting, the plaintext must be padded to the cipher block
8141 size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
8143 First a master key needs to be created in base64 encoding:
8146 # openssl rand -base64 32 > key.b64
8147 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
8150 Each secret to be encrypted needs to have a random initialization vector
8151 generated. These do not need to be kept secret
8154 # openssl rand -base64 16 > iv.b64
8155 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
8158 The secret to be defined can now be encrypted, in this case we're
8159 telling openssl to base64 encode the result, but it could be left
8160 as raw bytes if desired.
8163 # SECRET=$(printf "letmein" |
8164 openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
8167 When launching QEMU, create a master secret pointing to @code{key.b64}
8168 and specify that to be used to decrypt the user password. Pass the
8169 contents of @code{iv.b64} to the second secret
8172 # @value{qemu_system} \
8173 -object secret,id=secmaster0,format=base64,file=key.b64 \
8174 -object secret,id=sec0,keyid=secmaster0,format=base64,\
8175 data=$SECRET,iv=$(<iv.b64)
8178 @item -object sev-guest,id=@var{id},cbitpos=@var{cbitpos},reduced-phys-bits=@var{val},[sev-device=@var{string},policy=@var{policy},handle=@var{handle},dh-cert-file=@var{file},session-file=@var{file}]
8180 Create a Secure Encrypted Virtualization (SEV) guest object, which can be used
8181 to provide the guest memory encryption support on AMD processors.
8183 When memory encryption is enabled, one of the physical address bit (aka the
8184 C-bit) is utilized to mark if a memory page is protected. The @option{cbitpos}
8185 is used to provide the C-bit position. The C-bit position is Host family dependent
8186 hence user must provide this value. On EPYC, the value should be 47.
8188 When memory encryption is enabled, we loose certain bits in physical address space.
8189 The @option{reduced-phys-bits} is used to provide the number of bits we loose in
8190 physical address space. Similar to C-bit, the value is Host family dependent.
8191 On EPYC, the value should be 5.
8193 The @option{sev-device} provides the device file to use for communicating with
8194 the SEV firmware running inside AMD Secure Processor. The default device is
8195 '/dev/sev'. If hardware supports memory encryption then /dev/sev devices are
8196 created by CCP driver.
8198 The @option{policy} provides the guest policy to be enforced by the SEV firmware
8199 and restrict what configuration and operational commands can be performed on this
8200 guest by the hypervisor. The policy should be provided by the guest owner and is
8201 bound to the guest and cannot be changed throughout the lifetime of the guest.
8204 If guest @option{policy} allows sharing the key with another SEV guest then
8205 @option{handle} can be use to provide handle of the guest from which to share
8208 The @option{dh-cert-file} and @option{session-file} provides the guest owner's
8209 Public Diffie-Hillman key defined in SEV spec. The PDH and session parameters
8210 are used for establishing a cryptographic session with the guest owner to
8211 negotiate keys used for attestation. The file must be encoded in base64.
8213 e.g to launch a SEV guest
8215 # @value{qemu_system_x86} \
8217 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \
8218 -machine ...,memory-encryption=sev0
8224 @item -object authz-simple,id=@var{id},identity=@var{string}
8226 Create an authorization object that will control access to network services.
8228 The @option{identity} parameter is identifies the user and its format
8229 depends on the network service that authorization object is associated
8230 with. For authorizing based on TLS x509 certificates, the identity must
8231 be the x509 distinguished name. Note that care must be taken to escape
8232 any commas in the distinguished name.
8234 An example authorization object to validate a x509 distinguished name
8237 # @value{qemu_system} \
8239 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \
8243 Note the use of quotes due to the x509 distinguished name containing
8244 whitespace, and escaping of ','.
8246 @item -object authz-listfile,id=@var{id},filename=@var{path},refresh=@var{yes|no}
8248 Create an authorization object that will control access to network services.
8250 The @option{filename} parameter is the fully qualified path to a file
8251 containing the access control list rules in JSON format.
8253 An example set of rules that match against SASL usernames might look
8259 @{ "match": "fred", "policy": "allow", "format": "exact" @},
8260 @{ "match": "bob", "policy": "allow", "format": "exact" @},
8261 @{ "match": "danb", "policy": "deny", "format": "glob" @},
8262 @{ "match": "dan*", "policy": "allow", "format": "exact" @},
8268 When checking access the object will iterate over all the rules and
8269 the first rule to match will have its @option{policy} value returned
8270 as the result. If no rules match, then the default @option{policy}
8273 The rules can either be an exact string match, or they can use the
8274 simple UNIX glob pattern matching to allow wildcards to be used.
8276 If @option{refresh} is set to true the file will be monitored
8277 and automatically reloaded whenever its content changes.
8279 As with the @code{authz-simple} object, the format of the identity
8280 strings being matched depends on the network service, but is usually
8281 a TLS x509 distinguished name, or a SASL username.
8283 An example authorization object to validate a SASL username
8286 # @value{qemu_system} \
8288 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes
8292 @item -object authz-pam,id=@var{id},service=@var{string}
8294 Create an authorization object that will control access to network services.
8296 The @option{service} parameter provides the name of a PAM service to use
8297 for authorization. It requires that a file @code{/etc/pam.d/@var{service}}
8298 exist to provide the configuration for the @code{account} subsystem.
8300 An example authorization object to validate a TLS x509 distinguished
8301 name would look like:
8304 # @value{qemu_system} \
8306 -object authz-pam,id=auth0,service=qemu-vnc
8310 There would then be a corresponding config file for PAM at
8311 @code{/etc/pam.d/qemu-vnc} that contains:
8314 account requisite pam_listfile.so item=user sense=allow \
8315 file=/etc/qemu/vnc.allow
8318 Finally the @code{/etc/qemu/vnc.allow} file would contain
8319 the list of x509 distingished names that are permitted
8323 CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
8326 @item -object iothread,id=@var{id},poll-max-ns=@var{poll-max-ns},poll-grow=@var{poll-grow},poll-shrink=@var{poll-shrink}
8328 Creates a dedicated event loop thread that devices can be assigned to. This is
8329 known as an IOThread. By default device emulation happens in vCPU threads or
8330 the main event loop thread. This can become a scalability bottleneck.
8331 IOThreads allow device emulation and I/O to run on other host CPUs.
8333 The @option{id} parameter is a unique ID that will be used to reference this
8334 IOThread from @option{-device ...,iothread=@var{id}}. Multiple devices can be
8335 assigned to an IOThread. Note that not all devices support an
8336 @option{iothread} parameter.
8338 The @code{query-iothreads} QMP command lists IOThreads and reports their thread
8339 IDs so that the user can configure host CPU pinning/affinity.
8341 IOThreads use an adaptive polling algorithm to reduce event loop latency.
8342 Instead of entering a blocking system call to monitor file descriptors and then
8343 pay the cost of being woken up when an event occurs, the polling algorithm
8344 spins waiting for events for a short time. The algorithm's default parameters
8345 are suitable for many cases but can be adjusted based on knowledge of the
8346 workload and/or host device latency.
8348 The @option{poll-max-ns} parameter is the maximum number of nanoseconds to busy
8349 wait for events. Polling can be disabled by setting this value to 0.
8351 The @option{poll-grow} parameter is the multiplier used to increase the polling
8352 time when the algorithm detects it is missing events due to not polling long
8355 The @option{poll-shrink} parameter is the divisor used to decrease the polling
8356 time when the algorithm detects it is spending too long polling without
8357 encountering events.
8359 The polling parameters can be modified at run-time using the @code{qom-set} command (where @code{iothread1} is the IOThread's @code{id}):
8362 (qemu) qom-set /objects/iothread1 poll-max-ns 100000
8369 ``-object typename[,prop1=value1,...]``
8370 Create a new object of type typename setting properties in the order
8371 they are specified. Note that the 'id' property must be set. These
8372 objects are placed in the '/objects' path.
8374 ``-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``
8375 Creates a memory file backend object, which can be used to back
8376 the guest RAM with huge pages.
8378 The ``id`` parameter is a unique ID that will be used to
8379 reference this memory region when configuring the ``-numa``
8382 The ``size`` option provides the size of the memory region, and
8383 accepts common suffixes, eg ``500M``.
8385 The ``mem-path`` provides the path to either a shared memory or
8386 huge page filesystem mount.
8388 The ``share`` boolean option determines whether the memory
8389 region is marked as private to QEMU, or shared. The latter
8390 allows a co-operating external process to access the QEMU memory
8393 The ``share`` is also required for pvrdma devices due to
8394 limitations in the RDMA API provided by Linux.
8396 Setting share=on might affect the ability to configure NUMA
8397 bindings for the memory backend under some circumstances, see
8398 Documentation/vm/numa\_memory\_policy.txt on the Linux kernel
8399 source tree for additional details.
8401 Setting the ``discard-data`` boolean option to on indicates that
8402 file contents can be destroyed when QEMU exits, to avoid
8403 unnecessarily flushing data to the backing file. Note that
8404 ``discard-data`` is only an optimization, and QEMU might not
8405 discard file contents if it aborts unexpectedly or is terminated
8408 The ``merge`` boolean option enables memory merge, also known as
8409 MADV\_MERGEABLE, so that Kernel Samepage Merging will consider
8410 the pages for memory deduplication.
8412 Setting the ``dump`` boolean option to off excludes the memory
8413 from core dumps. This feature is also known as MADV\_DONTDUMP.
8415 The ``prealloc`` boolean option enables memory preallocation.
8417 The ``host-nodes`` option binds the memory range to a list of
8420 The ``policy`` option sets the NUMA policy to one of the
8427 prefer the given host node list for allocation
8430 restrict memory allocation to the given host node list
8433 interleave memory allocations across the given host node
8436 The ``align`` option specifies the base address alignment when
8437 QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg
8438 ``2M``. Some backend store specified by ``mem-path`` requires an
8439 alignment different than the default one used by QEMU, eg the
8440 device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
8441 such cases, users can specify the required alignment via this
8444 The ``pmem`` option specifies whether the backing file specified
8445 by ``mem-path`` is in host persistent memory that can be
8446 accessed using the SNIA NVM programming model (e.g. Intel
8447 NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary
8448 operations to guarantee the persistence of its own writes to
8449 ``mem-path`` (e.g. in vNVDIMM label emulation and live
8450 migration). Also, we will map the backend-file with MAP\_SYNC
8451 flag, which ensures the file metadata is in sync for
8452 ``mem-path`` in case of host crash or a power failure. MAP\_SYNC
8453 requires support from both the host kernel (since Linux kernel
8454 4.15) and the filesystem of ``mem-path`` mounted with DAX
8457 ``-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``
8458 Creates a memory backend object, which can be used to back the
8459 guest RAM. Memory backend objects offer more control than the
8460 ``-m`` option that is traditionally used to define guest RAM.
8461 Please refer to ``memory-backend-file`` for a description of the
8464 ``-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``
8465 Creates an anonymous memory file backend object, which allows
8466 QEMU to share the memory with an external process (e.g. when
8467 using vhost-user). The memory is allocated with memfd and
8468 optional sealing. (Linux only)
8470 The ``seal`` option creates a sealed-file, that will block
8471 further resizing the memory ('on' by default).
8473 The ``hugetlb`` option specify the file to be created resides in
8474 the hugetlbfs filesystem (since Linux 4.14). Used in conjunction
8475 with the ``hugetlb`` option, the ``hugetlbsize`` option specify
8476 the hugetlb page size on systems that support multiple hugetlb
8477 page sizes (it must be a power of 2 value supported by the
8480 In some versions of Linux, the ``hugetlb`` option is
8481 incompatible with the ``seal`` option (requires at least Linux
8484 Please refer to ``memory-backend-file`` for a description of the
8487 The ``share`` boolean option is on by default with memfd.
8489 ``-object rng-builtin,id=id``
8490 Creates a random number generator backend which obtains entropy
8491 from QEMU builtin functions. The ``id`` parameter is a unique ID
8492 that will be used to reference this entropy backend from the
8493 ``virtio-rng`` device. By default, the ``virtio-rng`` device
8494 uses this RNG backend.
8496 ``-object rng-random,id=id,filename=/dev/random``
8497 Creates a random number generator backend which obtains entropy
8498 from a device on the host. The ``id`` parameter is a unique ID
8499 that will be used to reference this entropy backend from the
8500 ``virtio-rng`` device. The ``filename`` parameter specifies
8501 which file to obtain entropy from and if omitted defaults to
8504 ``-object rng-egd,id=id,chardev=chardevid``
8505 Creates a random number generator backend which obtains entropy
8506 from an external daemon running on the host. The ``id``
8507 parameter is a unique ID that will be used to reference this
8508 entropy backend from the ``virtio-rng`` device. The ``chardev``
8509 parameter is the unique ID of a character device backend that
8510 provides the connection to the RNG daemon.
8512 ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off``
8513 Creates a TLS anonymous credentials object, which can be used to
8514 provide TLS support on network backends. The ``id`` parameter is
8515 a unique ID which network backends will use to access the
8516 credentials. The ``endpoint`` is either ``server`` or ``client``
8517 depending on whether the QEMU network backend that uses the
8518 credentials will be acting as a client or as a server. If
8519 ``verify-peer`` is enabled (the default) then once the handshake
8520 is completed, the peer credentials will be verified, though this
8521 is a no-op for anonymous credentials.
8523 The dir parameter tells QEMU where to find the credential files.
8524 For server endpoints, this directory may contain a file
8525 dh-params.pem providing diffie-hellman parameters to use for the
8526 TLS server. If the file is missing, QEMU will generate a set of
8527 DH parameters at startup. This is a computationally expensive
8528 operation that consumes random pool entropy, so it is
8529 recommended that a persistent set of parameters be generated
8532 ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]``
8533 Creates a TLS Pre-Shared Keys (PSK) credentials object, which
8534 can be used to provide TLS support on network backends. The
8535 ``id`` parameter is a unique ID which network backends will use
8536 to access the credentials. The ``endpoint`` is either ``server``
8537 or ``client`` depending on whether the QEMU network backend that
8538 uses the credentials will be acting as a client or as a server.
8539 For clients only, ``username`` is the username which will be
8540 sent to the server. If omitted it defaults to "qemu".
8542 The dir parameter tells QEMU where to find the keys file. It is
8543 called "dir/keys.psk" and contains "username:key" pairs. This
8544 file can most easily be created using the GnuTLS ``psktool``
8547 For server endpoints, dir may also contain a file dh-params.pem
8548 providing diffie-hellman parameters to use for the TLS server.
8549 If the file is missing, QEMU will generate a set of DH
8550 parameters at startup. This is a computationally expensive
8551 operation that consumes random pool entropy, so it is
8552 recommended that a persistent set of parameters be generated up
8555 ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id``
8556 Creates a TLS anonymous credentials object, which can be used to
8557 provide TLS support on network backends. The ``id`` parameter is
8558 a unique ID which network backends will use to access the
8559 credentials. The ``endpoint`` is either ``server`` or ``client``
8560 depending on whether the QEMU network backend that uses the
8561 credentials will be acting as a client or as a server. If
8562 ``verify-peer`` is enabled (the default) then once the handshake
8563 is completed, the peer credentials will be verified. With x509
8564 certificates, this implies that the clients must be provided
8565 with valid client certificates too.
8567 The dir parameter tells QEMU where to find the credential files.
8568 For server endpoints, this directory may contain a file
8569 dh-params.pem providing diffie-hellman parameters to use for the
8570 TLS server. If the file is missing, QEMU will generate a set of
8571 DH parameters at startup. This is a computationally expensive
8572 operation that consumes random pool entropy, so it is
8573 recommended that a persistent set of parameters be generated
8576 For x509 certificate credentials the directory will contain
8577 further files providing the x509 certificates. The certificates
8578 must be stored in PEM format, in filenames ca-cert.pem,
8579 ca-crl.pem (optional), server-cert.pem (only servers),
8580 server-key.pem (only servers), client-cert.pem (only clients),
8581 and client-key.pem (only clients).
8583 For the server-key.pem and client-key.pem files which contain
8584 sensitive private keys, it is possible to use an encrypted
8585 version by providing the passwordid parameter. This provides the
8586 ID of a previously created ``secret`` object containing the
8587 password for decryption.
8589 The priority parameter allows to override the global default
8590 priority used by gnutls. This can be useful if the system
8591 administrator needs to use a weaker set of crypto priorities for
8592 QEMU without potentially forcing the weakness onto all
8593 applications. Or conversely if one wants wants a stronger
8594 default for QEMU than for all other applications, they can do
8595 this through this parameter. Its format is a gnutls priority
8596 string as described at
8597 https://gnutls.org/manual/html_node/Priority-Strings.html.
8599 ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
8600 Interval t can't be 0, this filter batches the packet delivery:
8601 all packets arriving in a given interval on netdev netdevid are
8602 delayed until the end of the interval. Interval is in
8603 microseconds. ``status`` is optional that indicate whether the
8604 netfilter is on (enabled) or off (disabled), the default status
8605 for netfilter will be 'on'.
8607 queue all\|rx\|tx is an option that can be applied to any
8610 ``all``: the filter is attached both to the receive and the
8611 transmit queue of the netdev (default).
8613 ``rx``: the filter is attached to the receive queue of the
8614 netdev, where it will receive packets sent to the netdev.
8616 ``tx``: the filter is attached to the transmit queue of the
8617 netdev, where it will receive packets sent by the netdev.
8619 position head\|tail\|id=<id> is an option to specify where the
8620 filter should be inserted in the filter list. It can be applied
8623 ``head``: the filter is inserted at the head of the filter list,
8624 before any existing filters.
8626 ``tail``: the filter is inserted at the tail of the filter list,
8627 behind any existing filters (default).
8629 ``id=<id>``: the filter is inserted before or behind the filter
8630 specified by <id>, see the insert option below.
8632 insert behind\|before is an option to specify where to insert
8633 the new filter relative to the one specified with
8634 position=id=<id>. It can be applied to any netfilter.
8636 ``before``: insert before the specified filter.
8638 ``behind``: insert behind the specified filter (default).
8640 ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
8641 filter-mirror on netdev netdevid,mirror net packet to
8642 chardevchardevid, if it has the vnet\_hdr\_support flag,
8643 filter-mirror will mirror packet with vnet\_hdr\_len.
8645 ``-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]``
8646 filter-redirector on netdev netdevid,redirect filter's net
8647 packet to chardev chardevid,and redirect indev's packet to
8648 filter.if it has the vnet\_hdr\_support flag, filter-redirector
8649 will redirect packet with vnet\_hdr\_len. Create a
8650 filter-redirector we need to differ outdev id from indev id, id
8651 can not be the same. we can just use indev or outdev, but at
8652 least one of indev or outdev need to be specified.
8654 ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
8655 Filter-rewriter is a part of COLO project.It will rewrite tcp
8656 packet to secondary from primary to keep secondary tcp
8657 connection,and rewrite tcp packet to primary from secondary make
8658 tcp packet can be handled by client.if it has the
8659 vnet\_hdr\_support flag, we can parse packet with vnet header.
8661 usage: colo secondary: -object
8662 filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
8663 filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object
8664 filter-rewriter,id=rew0,netdev=hn0,queue=all
8666 ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]``
8667 Dump the network traffic on netdev dev to the file specified by
8668 filename. At most len bytes (64k by default) per packet are
8669 stored. The file format is libpcap, so it can be analyzed with
8670 tools such as tcpdump or Wireshark.
8672 ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id]``
8673 Colo-compare gets packet from primary\_inchardevid and
8674 secondary\_inchardevid, than compare primary packet with
8675 secondary packet. If the packets are same, we will output
8676 primary packet to outdevchardevid, else we will notify
8677 colo-frame do checkpoint and send primary packet to
8678 outdevchardevid. In order to improve efficiency, we need to put
8679 the task of comparison in another thread. If it has the
8680 vnet\_hdr\_support flag, colo compare will send/recv packet with
8681 vnet\_hdr\_len. If you want to use Xen COLO, will need the
8682 notify\_dev to notify Xen colo-frame to do checkpoint.
8684 we must use it with the help of filter-mirror and
8692 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
8693 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
8694 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
8695 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
8696 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
8697 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
8698 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
8699 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
8700 -object iothread,id=iothread1
8701 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
8702 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
8703 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
8704 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
8707 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
8708 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
8709 -chardev socket,id=red0,host=3.3.3.3,port=9003
8710 -chardev socket,id=red1,host=3.3.3.3,port=9004
8711 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
8712 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
8718 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
8719 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
8720 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
8721 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
8722 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
8723 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
8724 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
8725 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
8726 -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
8727 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
8728 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
8729 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
8730 -object iothread,id=iothread1
8731 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
8734 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
8735 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
8736 -chardev socket,id=red0,host=3.3.3.3,port=9003
8737 -chardev socket,id=red1,host=3.3.3.3,port=9004
8738 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
8739 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
8741 If you want to know the detail of above command line, you can
8742 read the colo-compare git log.
8744 ``-object cryptodev-backend-builtin,id=id[,queues=queues]``
8745 Creates a cryptodev backend which executes crypto opreation from
8746 the QEMU cipher APIS. The id parameter is a unique ID that will
8747 be used to reference this cryptodev backend from the
8748 ``virtio-crypto`` device. The queues parameter is optional,
8749 which specify the queue number of cryptodev backend, the default
8756 -object cryptodev-backend-builtin,id=cryptodev0 \
8757 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
8760 ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]``
8761 Creates a vhost-user cryptodev backend, backed by a chardev
8762 chardevid. The id parameter is a unique ID that will be used to
8763 reference this cryptodev backend from the ``virtio-crypto``
8764 device. The chardev should be a unix domain socket backed one.
8765 The vhost-user uses a specifically defined protocol to pass
8766 vhost ioctl replacement messages to an application on the other
8767 end of the socket. The queues parameter is optional, which
8768 specify the queue number of cryptodev backend for multiqueue
8769 vhost-user, the default of queues is 1.
8775 -chardev socket,id=chardev0,path=/path/to/socket \
8776 -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
8777 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
8780 ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]``
8781 ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]``
8782 Defines a secret to store a password, encryption key, or some
8783 other sensitive data. The sensitive data can either be passed
8784 directly via the data parameter, or indirectly via the file
8785 parameter. Using the data parameter is insecure unless the
8786 sensitive data is encrypted.
8788 The sensitive data can be provided in raw format (the default),
8789 or base64. When encoded as JSON, the raw format only supports
8790 valid UTF-8 characters, so base64 is recommended for sending
8791 binary data. QEMU will convert from which ever format is
8792 provided to the format it needs internally. eg, an RBD password
8793 can be provided in raw format, even though it will be base64
8794 encoded when passed onto the RBD sever.
8796 For added protection, it is possible to encrypt the data
8797 associated with a secret using the AES-256-CBC cipher. Use of
8798 encryption is indicated by providing the keyid and iv
8799 parameters. The keyid parameter provides the ID of a previously
8800 defined secret that contains the AES-256 decryption key. This
8801 key should be 32-bytes long and be base64 encoded. The iv
8802 parameter provides the random initialization vector used for
8803 encryption of this particular secret and should be a base64
8804 encrypted string of the 16-byte IV.
8806 The simplest (insecure) usage is to provide the secret inline
8810 # |qemu_system| -object secret,id=sec0,data=letmein,format=raw
8812 The simplest secure usage is to provide the secret via a file
8814 # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object
8815 secret,id=sec0,file=mypasswd.txt,format=raw
8817 For greater security, AES-256-CBC should be used. To illustrate
8818 usage, consider the openssl command line tool which can encrypt
8819 the data. Note that when encrypting, the plaintext must be
8820 padded to the cipher block size (32 bytes) using the standard
8821 PKCS#5/6 compatible padding algorithm.
8823 First a master key needs to be created in base64 encoding:
8827 # openssl rand -base64 32 > key.b64
8828 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
8830 Each secret to be encrypted needs to have a random
8831 initialization vector generated. These do not need to be kept
8836 # openssl rand -base64 16 > iv.b64
8837 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
8839 The secret to be defined can now be encrypted, in this case
8840 we're telling openssl to base64 encode the result, but it could
8841 be left as raw bytes if desired.
8845 # SECRET=$(printf "letmein" |
8846 openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
8848 When launching QEMU, create a master secret pointing to
8849 ``key.b64`` and specify that to be used to decrypt the user
8850 password. Pass the contents of ``iv.b64`` to the second secret
8855 -object secret,id=secmaster0,format=base64,file=key.b64 \
8856 -object secret,id=sec0,keyid=secmaster0,format=base64,\
8857 data=$SECRET,iv=$(<iv.b64)
8859 ``-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]``
8860 Create a Secure Encrypted Virtualization (SEV) guest object,
8861 which can be used to provide the guest memory encryption support
8864 When memory encryption is enabled, one of the physical address
8865 bit (aka the C-bit) is utilized to mark if a memory page is
8866 protected. The ``cbitpos`` is used to provide the C-bit
8867 position. The C-bit position is Host family dependent hence user
8868 must provide this value. On EPYC, the value should be 47.
8870 When memory encryption is enabled, we loose certain bits in
8871 physical address space. The ``reduced-phys-bits`` is used to
8872 provide the number of bits we loose in physical address space.
8873 Similar to C-bit, the value is Host family dependent. On EPYC,
8874 the value should be 5.
8876 The ``sev-device`` provides the device file to use for
8877 communicating with the SEV firmware running inside AMD Secure
8878 Processor. The default device is '/dev/sev'. If hardware
8879 supports memory encryption then /dev/sev devices are created by
8882 The ``policy`` provides the guest policy to be enforced by the
8883 SEV firmware and restrict what configuration and operational
8884 commands can be performed on this guest by the hypervisor. The
8885 policy should be provided by the guest owner and is bound to the
8886 guest and cannot be changed throughout the lifetime of the
8887 guest. The default is 0.
8889 If guest ``policy`` allows sharing the key with another SEV
8890 guest then ``handle`` can be use to provide handle of the guest
8891 from which to share the key.
8893 The ``dh-cert-file`` and ``session-file`` provides the guest
8894 owner's Public Diffie-Hillman key defined in SEV spec. The PDH
8895 and session parameters are used for establishing a cryptographic
8896 session with the guest owner to negotiate keys used for
8897 attestation. The file must be encoded in base64.
8899 e.g to launch a SEV guest
8903 # |qemu_system_x86| \
8905 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \
8906 -machine ...,memory-encryption=sev0
8909 ``-object authz-simple,id=id,identity=string``
8910 Create an authorization object that will control access to
8913 The ``identity`` parameter is identifies the user and its format
8914 depends on the network service that authorization object is
8915 associated with. For authorizing based on TLS x509 certificates,
8916 the identity must be the x509 distinguished name. Note that care
8917 must be taken to escape any commas in the distinguished name.
8919 An example authorization object to validate a x509 distinguished
8920 name would look like:
8926 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \
8929 Note the use of quotes due to the x509 distinguished name
8930 containing whitespace, and escaping of ','.
8932 ``-object authz-listfile,id=id,filename=path,refresh=yes|no``
8933 Create an authorization object that will control access to
8936 The ``filename`` parameter is the fully qualified path to a file
8937 containing the access control list rules in JSON format.
8939 An example set of rules that match against SASL usernames might
8946 { "match": "fred", "policy": "allow", "format": "exact" },
8947 { "match": "bob", "policy": "allow", "format": "exact" },
8948 { "match": "danb", "policy": "deny", "format": "glob" },
8949 { "match": "dan*", "policy": "allow", "format": "exact" },
8954 When checking access the object will iterate over all the rules
8955 and the first rule to match will have its ``policy`` value
8956 returned as the result. If no rules match, then the default
8957 ``policy`` value is returned.
8959 The rules can either be an exact string match, or they can use
8960 the simple UNIX glob pattern matching to allow wildcards to be
8963 If ``refresh`` is set to true the file will be monitored and
8964 automatically reloaded whenever its content changes.
8966 As with the ``authz-simple`` object, the format of the identity
8967 strings being matched depends on the network service, but is
8968 usually a TLS x509 distinguished name, or a SASL username.
8970 An example authorization object to validate a SASL username
8977 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes
8980 ``-object authz-pam,id=id,service=string``
8981 Create an authorization object that will control access to
8984 The ``service`` parameter provides the name of a PAM service to
8985 use for authorization. It requires that a file
8986 ``/etc/pam.d/service`` exist to provide the configuration for
8987 the ``account`` subsystem.
8989 An example authorization object to validate a TLS x509
8990 distinguished name would look like:
8996 -object authz-pam,id=auth0,service=qemu-vnc
8999 There would then be a corresponding config file for PAM at
9000 ``/etc/pam.d/qemu-vnc`` that contains:
9004 account requisite pam_listfile.so item=user sense=allow \
9005 file=/etc/qemu/vnc.allow
9007 Finally the ``/etc/qemu/vnc.allow`` file would contain the list
9008 of x509 distingished names that are permitted access
9012 CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
9014 ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink``
9015 Creates a dedicated event loop thread that devices can be
9016 assigned to. This is known as an IOThread. By default device
9017 emulation happens in vCPU threads or the main event loop thread.
9018 This can become a scalability bottleneck. IOThreads allow device
9019 emulation and I/O to run on other host CPUs.
9021 The ``id`` parameter is a unique ID that will be used to
9022 reference this IOThread from ``-device ...,iothread=id``.
9023 Multiple devices can be assigned to an IOThread. Note that not
9024 all devices support an ``iothread`` parameter.
9026 The ``query-iothreads`` QMP command lists IOThreads and reports
9027 their thread IDs so that the user can configure host CPU
9030 IOThreads use an adaptive polling algorithm to reduce event loop
9031 latency. Instead of entering a blocking system call to monitor
9032 file descriptors and then pay the cost of being woken up when an
9033 event occurs, the polling algorithm spins waiting for events for
9034 a short time. The algorithm's default parameters are suitable
9035 for many cases but can be adjusted based on knowledge of the
9036 workload and/or host device latency.
9038 The ``poll-max-ns`` parameter is the maximum number of
9039 nanoseconds to busy wait for events. Polling can be disabled by
9040 setting this value to 0.
9042 The ``poll-grow`` parameter is the multiplier used to increase
9043 the polling time when the algorithm detects it is missing events
9044 due to not polling long enough.
9046 The ``poll-shrink`` parameter is the divisor used to decrease
9047 the polling time when the algorithm detects it is spending too
9048 long polling without encountering events.
9050 The polling parameters can be modified at run-time using the
9051 ``qom-set`` command (where ``iothread1`` is the IOThread's
9056 (qemu) qom-set /objects/iothread1 poll-max-ns 100000
9060 HXCOMM This is the last statement. Insert new options before this line!