numa: remove no longer need numa_post_machine_init()
[qemu/ar7.git] / qemu-options.hx
blobe10c1454d17ff4abf75207cb6e66ebd00107097d
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
6 HXCOMM architectures.
7 HXCOMM HXCOMM can be used for comments, discarded from both texi and C
9 DEFHEADING(Standard options)
10 STEXI
11 @table @option
12 ETEXI
14 DEF("help", 0, QEMU_OPTION_h,
15 "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
16 STEXI
17 @item -h
18 @findex -h
19 Display help and exit
20 ETEXI
22 DEF("version", 0, QEMU_OPTION_version,
23 "-version display version information and exit\n", QEMU_ARCH_ALL)
24 STEXI
25 @item -version
26 @findex -version
27 Display version information and exit
28 ETEXI
30 DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
31 "-machine [type=]name[,prop[=value][,...]]\n"
32 " selects emulated machine ('-machine help' for list)\n"
33 " property accel=accel1[:accel2[:...]] selects accelerator\n"
34 " supported accelerators are kvm, xen, hax or tcg (default: tcg)\n"
35 " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
36 " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
37 " kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
38 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
39 " mem-merge=on|off controls memory merge support (default: on)\n"
40 " igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
41 " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
42 " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
43 " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
44 " nvdimm=on|off controls NVDIMM support (default=off)\n"
45 " enforce-config-section=on|off enforce configuration section migration (default=off)\n",
46 QEMU_ARCH_ALL)
47 STEXI
48 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
49 @findex -machine
50 Select the emulated machine by @var{name}. Use @code{-machine help} to list
51 available machines. Supported machine properties are:
52 @table @option
53 @item accel=@var{accels1}[:@var{accels2}[:...]]
54 This is used to enable an accelerator. Depending on the target architecture,
55 kvm, xen, hax or tcg can be available. By default, tcg is used. If there is
56 more than one accelerator specified, the next one is used if the previous one
57 fails to initialize.
58 @item kernel_irqchip=on|off
59 Controls in-kernel irqchip support for the chosen accelerator when available.
60 @item gfx_passthru=on|off
61 Enables IGD GFX passthrough support for the chosen machine when available.
62 @item vmport=on|off|auto
63 Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
64 value based on accel. For accel=xen the default is off otherwise the default
65 is on.
66 @item kvm_shadow_mem=size
67 Defines the size of the KVM shadow MMU.
68 @item dump-guest-core=on|off
69 Include guest memory in a core dump. The default is on.
70 @item mem-merge=on|off
71 Enables or disables memory merge support. This feature, when supported by
72 the host, de-duplicates identical memory pages among VMs instances
73 (enabled by default).
74 @item aes-key-wrap=on|off
75 Enables or disables AES key wrapping support on s390-ccw hosts. This feature
76 controls whether AES wrapping keys will be created to allow
77 execution of AES cryptographic functions. The default is on.
78 @item dea-key-wrap=on|off
79 Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
80 controls whether DEA wrapping keys will be created to allow
81 execution of DEA cryptographic functions. The default is on.
82 @item nvdimm=on|off
83 Enables or disables NVDIMM support. The default is off.
84 @end table
85 ETEXI
87 HXCOMM Deprecated by -machine
88 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
90 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
91 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
92 STEXI
93 @item -cpu @var{model}
94 @findex -cpu
95 Select CPU model (@code{-cpu help} for list and additional feature selection)
96 ETEXI
98 DEF("accel", HAS_ARG, QEMU_OPTION_accel,
99 "-accel [accel=]accelerator[,thread=single|multi]\n"
100 " select accelerator (kvm, xen, hax or tcg; use 'help' for a list)\n"
101 " thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL)
102 STEXI
103 @item -accel @var{name}[,prop=@var{value}[,...]]
104 @findex -accel
105 This is used to enable an accelerator. Depending on the target architecture,
106 kvm, xen, hax or tcg can be available. By default, tcg is used. If there is
107 more than one accelerator specified, the next one is used if the previous one
108 fails to initialize.
109 @table @option
110 @item thread=single|multi
111 Controls number of TCG threads. When the TCG is multi-threaded there will be one
112 thread per vCPU therefor taking advantage of additional host cores. The default
113 is to enable multi-threading where both the back-end and front-ends support it and
114 no incompatible TCG features have been enabled (e.g. icount/replay).
115 @end table
116 ETEXI
118 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
119 "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
120 " set the number of CPUs to 'n' [default=1]\n"
121 " maxcpus= maximum number of total cpus, including\n"
122 " offline CPUs for hotplug, etc\n"
123 " cores= number of CPU cores on one socket\n"
124 " threads= number of threads on one CPU core\n"
125 " sockets= number of discrete sockets in the system\n",
126 QEMU_ARCH_ALL)
127 STEXI
128 @item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
129 @findex -smp
130 Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
131 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
132 to 4.
133 For the PC target, the number of @var{cores} per socket, the number
134 of @var{threads} per cores and the total number of @var{sockets} can be
135 specified. Missing values will be computed. If any on the three values is
136 given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
137 specifies the maximum number of hotpluggable CPUs.
138 ETEXI
140 DEF("numa", HAS_ARG, QEMU_OPTION_numa,
141 "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
142 "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
143 "-numa dist,src=source,dst=destination,val=distance\n", QEMU_ARCH_ALL)
144 STEXI
145 @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
146 @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
147 @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance}
148 @findex -numa
149 Define a NUMA node and assign RAM and VCPUs to it.
150 Set the NUMA distance from a source node to a destination node.
152 @var{firstcpu} and @var{lastcpu} are CPU indexes. Each
153 @samp{cpus} option represent a contiguous range of CPU indexes
154 (or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
155 set of VCPUs can be represented by providing multiple @samp{cpus}
156 options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
157 split between them.
159 For example, the following option assigns VCPUs 0, 1, 2 and 5 to
160 a NUMA node:
161 @example
162 -numa node,cpus=0-2,cpus=5
163 @end example
165 @samp{mem} assigns a given RAM amount to a node. @samp{memdev}
166 assigns RAM from a given memory backend device to a node. If
167 @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
168 split equally between them.
170 @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
171 if one node uses @samp{memdev}, all of them have to use it.
173 @var{source} and @var{destination} are NUMA node IDs.
174 @var{distance} is the NUMA distance from @var{source} to @var{destination}.
175 The distance from a node to itself is always 10. If any pair of nodes is
176 given a distance, then all pairs must be given distances. Although, when
177 distances are only given in one direction for each pair of nodes, then
178 the distances in the opposite directions are assumed to be the same. If,
179 however, an asymmetrical pair of distances is given for even one node
180 pair, then all node pairs must be provided distance values for both
181 directions, even when they are symmetrical. When a node is unreachable
182 from another node, set the pair's distance to 255.
184 Note that the -@option{numa} option doesn't allocate any of the
185 specified resources, it just assigns existing resources to NUMA
186 nodes. This means that one still has to use the @option{-m},
187 @option{-smp} options to allocate RAM and VCPUs respectively.
189 ETEXI
191 DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
192 "-add-fd fd=fd,set=set[,opaque=opaque]\n"
193 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
194 STEXI
195 @item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
196 @findex -add-fd
198 Add a file descriptor to an fd set. Valid options are:
200 @table @option
201 @item fd=@var{fd}
202 This option defines the file descriptor of which a duplicate is added to fd set.
203 The file descriptor cannot be stdin, stdout, or stderr.
204 @item set=@var{set}
205 This option defines the ID of the fd set to add the file descriptor to.
206 @item opaque=@var{opaque}
207 This option defines a free-form string that can be used to describe @var{fd}.
208 @end table
210 You can open an image using pre-opened file descriptors from an fd set:
211 @example
212 qemu-system-i386
213 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
214 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
215 -drive file=/dev/fdset/2,index=0,media=disk
216 @end example
217 ETEXI
219 DEF("set", HAS_ARG, QEMU_OPTION_set,
220 "-set group.id.arg=value\n"
221 " set <arg> parameter for item <id> of type <group>\n"
222 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
223 STEXI
224 @item -set @var{group}.@var{id}.@var{arg}=@var{value}
225 @findex -set
226 Set parameter @var{arg} for item @var{id} of type @var{group}
227 ETEXI
229 DEF("global", HAS_ARG, QEMU_OPTION_global,
230 "-global driver.property=value\n"
231 "-global driver=driver,property=property,value=value\n"
232 " set a global default for a driver property\n",
233 QEMU_ARCH_ALL)
234 STEXI
235 @item -global @var{driver}.@var{prop}=@var{value}
236 @itemx -global driver=@var{driver},property=@var{property},value=@var{value}
237 @findex -global
238 Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
240 @example
241 qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
242 @end example
244 In particular, you can use this to set driver properties for devices which are
245 created automatically by the machine model. To create a device which is not
246 created automatically and set properties on it, use -@option{device}.
248 -global @var{driver}.@var{prop}=@var{value} is shorthand for -global
249 driver=@var{driver},property=@var{prop},value=@var{value}. The
250 longhand syntax works even when @var{driver} contains a dot.
251 ETEXI
253 DEF("boot", HAS_ARG, QEMU_OPTION_boot,
254 "-boot [order=drives][,once=drives][,menu=on|off]\n"
255 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
256 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
257 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
258 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
259 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
260 QEMU_ARCH_ALL)
261 STEXI
262 @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]
263 @findex -boot
264 Specify boot order @var{drives} as a string of drive letters. Valid
265 drive letters depend on the target architecture. The x86 PC uses: a, b
266 (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
267 from network adapter 1-4), hard disk boot is the default. To apply a
268 particular boot order only on the first startup, specify it via
269 @option{once}. Note that the @option{order} or @option{once} parameter
270 should not be used together with the @option{bootindex} property of
271 devices, since the firmware implementations normally do not support both
272 at the same time.
274 Interactive boot menus/prompts can be enabled via @option{menu=on} as far
275 as firmware/BIOS supports them. The default is non-interactive boot.
277 A splash picture could be passed to bios, enabling user to show it as logo,
278 when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
279 supports them. Currently Seabios for X86 system support it.
280 limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
281 format(true color). The resolution should be supported by the SVGA mode, so
282 the recommended is 320x240, 640x480, 800x640.
284 A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
285 when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
286 reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
287 system support it.
289 Do strict boot via @option{strict=on} as far as firmware/BIOS
290 supports it. This only effects when boot priority is changed by
291 bootindex options. The default is non-strict boot.
293 @example
294 # try to boot from network first, then from hard disk
295 qemu-system-i386 -boot order=nc
296 # boot from CD-ROM first, switch back to default order after reboot
297 qemu-system-i386 -boot once=d
298 # boot with a splash picture for 5 seconds.
299 qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
300 @end example
302 Note: The legacy format '-boot @var{drives}' is still supported but its
303 use is discouraged as it may be removed from future versions.
304 ETEXI
306 DEF("m", HAS_ARG, QEMU_OPTION_m,
307 "-m [size=]megs[,slots=n,maxmem=size]\n"
308 " configure guest RAM\n"
309 " size: initial amount of guest memory\n"
310 " slots: number of hotplug slots (default: none)\n"
311 " maxmem: maximum amount of guest memory (default: none)\n"
312 "NOTE: Some architectures might enforce a specific granularity\n",
313 QEMU_ARCH_ALL)
314 STEXI
315 @item -m [size=]@var{megs}[,slots=n,maxmem=size]
316 @findex -m
317 Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
318 Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
319 megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
320 could be used to set amount of hotpluggable memory slots and maximum amount of
321 memory. Note that @var{maxmem} must be aligned to the page size.
323 For example, the following command-line sets the guest startup RAM size to
324 1GB, creates 3 slots to hotplug additional memory and sets the maximum
325 memory the guest can reach to 4GB:
327 @example
328 qemu-system-x86_64 -m 1G,slots=3,maxmem=4G
329 @end example
331 If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
332 be enabled and the guest startup RAM will never increase.
333 ETEXI
335 DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
336 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
337 STEXI
338 @item -mem-path @var{path}
339 @findex -mem-path
340 Allocate guest RAM from a temporarily created file in @var{path}.
341 ETEXI
343 DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
344 "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
345 QEMU_ARCH_ALL)
346 STEXI
347 @item -mem-prealloc
348 @findex -mem-prealloc
349 Preallocate memory when using -mem-path.
350 ETEXI
352 DEF("k", HAS_ARG, QEMU_OPTION_k,
353 "-k language use keyboard layout (for example 'fr' for French)\n",
354 QEMU_ARCH_ALL)
355 STEXI
356 @item -k @var{language}
357 @findex -k
358 Use keyboard layout @var{language} (for example @code{fr} for
359 French). This option is only needed where it is not easy to get raw PC
360 keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
361 display). You don't normally need to use it on PC/Linux or PC/Windows
362 hosts.
364 The available layouts are:
365 @example
366 ar de-ch es fo fr-ca hu ja mk no pt-br sv
367 da en-gb et fr fr-ch is lt nl pl ru th
368 de en-us fi fr-be hr it lv nl-be pt sl tr
369 @end example
371 The default is @code{en-us}.
372 ETEXI
375 DEF("audio-help", 0, QEMU_OPTION_audio_help,
376 "-audio-help print list of audio drivers and their options\n",
377 QEMU_ARCH_ALL)
378 STEXI
379 @item -audio-help
380 @findex -audio-help
381 Will show the audio subsystem help: list of drivers, tunable
382 parameters.
383 ETEXI
385 DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
386 "-soundhw c1,... enable audio support\n"
387 " and only specified sound cards (comma separated list)\n"
388 " use '-soundhw help' to get the list of supported cards\n"
389 " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
390 STEXI
391 @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
392 @findex -soundhw
393 Enable audio and selected sound hardware. Use 'help' to print all
394 available sound hardware.
396 @example
397 qemu-system-i386 -soundhw sb16,adlib disk.img
398 qemu-system-i386 -soundhw es1370 disk.img
399 qemu-system-i386 -soundhw ac97 disk.img
400 qemu-system-i386 -soundhw hda disk.img
401 qemu-system-i386 -soundhw all disk.img
402 qemu-system-i386 -soundhw help
403 @end example
405 Note that Linux's i810_audio OSS kernel (for AC97) module might
406 require manually specifying clocking.
408 @example
409 modprobe i810_audio clocking=48000
410 @end example
411 ETEXI
413 DEF("balloon", HAS_ARG, QEMU_OPTION_balloon,
414 "-balloon none disable balloon device\n"
415 "-balloon virtio[,addr=str]\n"
416 " enable virtio balloon device (default)\n", QEMU_ARCH_ALL)
417 STEXI
418 @item -balloon none
419 @findex -balloon
420 Disable balloon device.
421 @item -balloon virtio[,addr=@var{addr}]
422 Enable virtio balloon device (default), optionally with PCI address
423 @var{addr}.
424 ETEXI
426 DEF("device", HAS_ARG, QEMU_OPTION_device,
427 "-device driver[,prop[=value][,...]]\n"
428 " add device (based on driver)\n"
429 " prop=value,... sets driver properties\n"
430 " use '-device help' to print all possible drivers\n"
431 " use '-device driver,help' to print all possible properties\n",
432 QEMU_ARCH_ALL)
433 STEXI
434 @item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
435 @findex -device
436 Add device @var{driver}. @var{prop}=@var{value} sets driver
437 properties. Valid properties depend on the driver. To get help on
438 possible drivers and properties, use @code{-device help} and
439 @code{-device @var{driver},help}.
441 Some drivers are:
442 @item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}][,sdrfile=@var{file}][,furareasize=@var{val}][,furdatafile=@var{file}]
444 Add an IPMI BMC. This is a simulation of a hardware management
445 interface processor that normally sits on a system. It provides
446 a watchdog and the ability to reset and power control the system.
447 You need to connect this to an IPMI interface to make it useful
449 The IPMI slave address to use for the BMC. The default is 0x20.
450 This address is the BMC's address on the I2C network of management
451 controllers. If you don't know what this means, it is safe to ignore
454 @table @option
455 @item bmc=@var{id}
456 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
457 @item slave_addr=@var{val}
458 Define slave address to use for the BMC. The default is 0x20.
459 @item sdrfile=@var{file}
460 file containing raw Sensor Data Records (SDR) data. The default is none.
461 @item fruareasize=@var{val}
462 size of a Field Replaceable Unit (FRU) area. The default is 1024.
463 @item frudatafile=@var{file}
464 file containing raw Field Replaceable Unit (FRU) inventory data. The default is none.
465 @end table
467 @item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
469 Add a connection to an external IPMI BMC simulator. Instead of
470 locally emulating the BMC like the above item, instead connect
471 to an external entity that provides the IPMI services.
473 A connection is made to an external BMC simulator. If you do this, it
474 is strongly recommended that you use the "reconnect=" chardev option
475 to reconnect to the simulator if the connection is lost. Note that if
476 this is not used carefully, it can be a security issue, as the
477 interface has the ability to send resets, NMIs, and power off the VM.
478 It's best if QEMU makes a connection to an external simulator running
479 on a secure port on localhost, so neither the simulator nor QEMU is
480 exposed to any outside network.
482 See the "lanserv/README.vm" file in the OpenIPMI library for more
483 details on the external interface.
485 @item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
487 Add a KCS IPMI interafce on the ISA bus. This also adds a
488 corresponding ACPI and SMBIOS entries, if appropriate.
490 @table @option
491 @item bmc=@var{id}
492 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
493 @item ioport=@var{val}
494 Define the I/O address of the interface. The default is 0xca0 for KCS.
495 @item irq=@var{val}
496 Define the interrupt to use. The default is 5. To disable interrupts,
497 set this to 0.
498 @end table
500 @item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
502 Like the KCS interface, but defines a BT interface. The default port is
503 0xe4 and the default interrupt is 5.
505 ETEXI
507 DEF("name", HAS_ARG, QEMU_OPTION_name,
508 "-name string1[,process=string2][,debug-threads=on|off]\n"
509 " set the name of the guest\n"
510 " string1 sets the window title and string2 the process name (on Linux)\n"
511 " When debug-threads is enabled, individual threads are given a separate name (on Linux)\n"
512 " NOTE: The thread names are for debugging and not a stable API.\n",
513 QEMU_ARCH_ALL)
514 STEXI
515 @item -name @var{name}
516 @findex -name
517 Sets the @var{name} of the guest.
518 This name will be displayed in the SDL window caption.
519 The @var{name} will also be used for the VNC server.
520 Also optionally set the top visible process name in Linux.
521 Naming of individual threads can also be enabled on Linux to aid debugging.
522 ETEXI
524 DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
525 "-uuid %08x-%04x-%04x-%04x-%012x\n"
526 " specify machine UUID\n", QEMU_ARCH_ALL)
527 STEXI
528 @item -uuid @var{uuid}
529 @findex -uuid
530 Set system UUID.
531 ETEXI
533 STEXI
534 @end table
535 ETEXI
536 DEFHEADING()
538 DEFHEADING(Block device options)
539 STEXI
540 @table @option
541 ETEXI
543 DEF("fda", HAS_ARG, QEMU_OPTION_fda,
544 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
545 DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
546 STEXI
547 @item -fda @var{file}
548 @itemx -fdb @var{file}
549 @findex -fda
550 @findex -fdb
551 Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
552 ETEXI
554 DEF("hda", HAS_ARG, QEMU_OPTION_hda,
555 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
556 DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
557 DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
558 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
559 DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
560 STEXI
561 @item -hda @var{file}
562 @itemx -hdb @var{file}
563 @itemx -hdc @var{file}
564 @itemx -hdd @var{file}
565 @findex -hda
566 @findex -hdb
567 @findex -hdc
568 @findex -hdd
569 Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
570 ETEXI
572 DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
573 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
574 QEMU_ARCH_ALL)
575 STEXI
576 @item -cdrom @var{file}
577 @findex -cdrom
578 Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
579 @option{-cdrom} at the same time). You can use the host CD-ROM by
580 using @file{/dev/cdrom} as filename (@pxref{host_drives}).
581 ETEXI
583 DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
584 "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
585 " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
586 " [,read-only=on|off][,detect-zeroes=on|off|unmap]\n"
587 " [,driver specific parameters...]\n"
588 " configure a block backend\n", QEMU_ARCH_ALL)
590 DEF("drive", HAS_ARG, QEMU_OPTION_drive,
591 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
592 " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
593 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
594 " [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
595 " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
596 " [,readonly=on|off][,copy-on-read=on|off]\n"
597 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
598 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
599 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
600 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
601 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
602 " [[,iops_size=is]]\n"
603 " [[,group=g]]\n"
604 " use 'file' as a drive image\n", QEMU_ARCH_ALL)
605 STEXI
606 @item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
607 @findex -drive
609 Define a new drive. Valid options are:
611 @table @option
612 @item file=@var{file}
613 This option defines which disk image (@pxref{disk_images}) to use with
614 this drive. If the filename contains comma, you must double it
615 (for instance, "file=my,,file" to use file "my,file").
617 Special files such as iSCSI devices can be specified using protocol
618 specific URLs. See the section for "Device URL Syntax" for more information.
619 @item if=@var{interface}
620 This option defines on which type on interface the drive is connected.
621 Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
622 @item bus=@var{bus},unit=@var{unit}
623 These options define where is connected the drive by defining the bus number and
624 the unit id.
625 @item index=@var{index}
626 This option defines where is connected the drive by using an index in the list
627 of available connectors of a given interface type.
628 @item media=@var{media}
629 This option defines the type of the media: disk or cdrom.
630 @item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
631 These options have the same definition as they have in @option{-hdachs}.
632 @item snapshot=@var{snapshot}
633 @var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
634 (see @option{-snapshot}).
635 @item cache=@var{cache}
636 @var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
637 @item aio=@var{aio}
638 @var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
639 @item discard=@var{discard}
640 @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap}) requests are ignored or passed to the filesystem. Some machine types may not support discard requests.
641 @item format=@var{format}
642 Specify which disk @var{format} will be used rather than detecting
643 the format. Can be used to specify format=raw to avoid interpreting
644 an untrusted format header.
645 @item serial=@var{serial}
646 This option specifies the serial number to assign to the device.
647 @item addr=@var{addr}
648 Specify the controller's PCI address (if=virtio only).
649 @item werror=@var{action},rerror=@var{action}
650 Specify which @var{action} to take on write and read errors. Valid actions are:
651 "ignore" (ignore the error and try to continue), "stop" (pause QEMU),
652 "report" (report the error to the guest), "enospc" (pause QEMU only if the
653 host disk is full; report the error to the guest otherwise).
654 The default setting is @option{werror=enospc} and @option{rerror=report}.
655 @item readonly
656 Open drive @option{file} as read-only. Guest write attempts will fail.
657 @item copy-on-read=@var{copy-on-read}
658 @var{copy-on-read} is "on" or "off" and enables whether to copy read backing
659 file sectors into the image file.
660 @item detect-zeroes=@var{detect-zeroes}
661 @var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
662 conversion of plain zero writes by the OS to driver specific optimized
663 zero write commands. You may even choose "unmap" if @var{discard} is set
664 to "unmap" to allow a zero write to be converted to an UNMAP operation.
665 @item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w}
666 Specify bandwidth throttling limits in bytes per second, either for all request
667 types or for reads or writes only. Small values can lead to timeouts or hangs
668 inside the guest. A safe minimum for disks is 2 MB/s.
669 @item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm}
670 Specify bursts in bytes per second, either for all request types or for reads
671 or writes only. Bursts allow the guest I/O to spike above the limit
672 temporarily.
673 @item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w}
674 Specify request rate limits in requests per second, either for all request
675 types or for reads or writes only.
676 @item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm}
677 Specify bursts in requests per second, either for all request types or for reads
678 or writes only. Bursts allow the guest I/O to spike above the limit
679 temporarily.
680 @item iops_size=@var{is}
681 Let every @var{is} bytes of a request count as a new request for iops
682 throttling purposes. Use this option to prevent guests from circumventing iops
683 limits by sending fewer but larger requests.
684 @item group=@var{g}
685 Join a throttling quota group with given name @var{g}. All drives that are
686 members of the same group are accounted for together. Use this option to
687 prevent guests from circumventing throttling limits by using many small disks
688 instead of a single larger disk.
689 @end table
691 By default, the @option{cache=writeback} mode is used. It will report data
692 writes as completed as soon as the data is present in the host page cache.
693 This is safe as long as your guest OS makes sure to correctly flush disk caches
694 where needed. If your guest OS does not handle volatile disk write caches
695 correctly and your host crashes or loses power, then the guest may experience
696 data corruption.
698 For such guests, you should consider using @option{cache=writethrough}. This
699 means that the host page cache will be used to read and write data, but write
700 notification will be sent to the guest only after QEMU has made sure to flush
701 each write to the disk. Be aware that this has a major impact on performance.
703 The host page cache can be avoided entirely with @option{cache=none}. This will
704 attempt to do disk IO directly to the guest's memory. QEMU may still perform
705 an internal copy of the data. Note that this is considered a writeback mode and
706 the guest OS must handle the disk write cache correctly in order to avoid data
707 corruption on host crashes.
709 The host page cache can be avoided while only sending write notifications to
710 the guest when the data has been flushed to the disk using
711 @option{cache=directsync}.
713 In case you don't care about data integrity over host failures, use
714 @option{cache=unsafe}. This option tells QEMU that it never needs to write any
715 data to the disk but can instead keep things in cache. If anything goes wrong,
716 like your host losing power, the disk storage getting disconnected accidentally,
717 etc. your image will most probably be rendered unusable. When using
718 the @option{-snapshot} option, unsafe caching is always used.
720 Copy-on-read avoids accessing the same backing file sectors repeatedly and is
721 useful when the backing file is over a slow network. By default copy-on-read
722 is off.
724 Instead of @option{-cdrom} you can use:
725 @example
726 qemu-system-i386 -drive file=file,index=2,media=cdrom
727 @end example
729 Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
730 use:
731 @example
732 qemu-system-i386 -drive file=file,index=0,media=disk
733 qemu-system-i386 -drive file=file,index=1,media=disk
734 qemu-system-i386 -drive file=file,index=2,media=disk
735 qemu-system-i386 -drive file=file,index=3,media=disk
736 @end example
738 You can open an image using pre-opened file descriptors from an fd set:
739 @example
740 qemu-system-i386
741 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
742 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
743 -drive file=/dev/fdset/2,index=0,media=disk
744 @end example
746 You can connect a CDROM to the slave of ide0:
747 @example
748 qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
749 @end example
751 If you don't specify the "file=" argument, you define an empty drive:
752 @example
753 qemu-system-i386 -drive if=ide,index=1,media=cdrom
754 @end example
756 Instead of @option{-fda}, @option{-fdb}, you can use:
757 @example
758 qemu-system-i386 -drive file=file,index=0,if=floppy
759 qemu-system-i386 -drive file=file,index=1,if=floppy
760 @end example
762 By default, @var{interface} is "ide" and @var{index} is automatically
763 incremented:
764 @example
765 qemu-system-i386 -drive file=a -drive file=b"
766 @end example
767 is interpreted like:
768 @example
769 qemu-system-i386 -hda a -hdb b
770 @end example
771 ETEXI
773 DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
774 "-mtdblock file use 'file' as on-board Flash memory image\n",
775 QEMU_ARCH_ALL)
776 STEXI
777 @item -mtdblock @var{file}
778 @findex -mtdblock
779 Use @var{file} as on-board Flash memory image.
780 ETEXI
782 DEF("sd", HAS_ARG, QEMU_OPTION_sd,
783 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
784 STEXI
785 @item -sd @var{file}
786 @findex -sd
787 Use @var{file} as SecureDigital card image.
788 ETEXI
790 DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
791 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
792 STEXI
793 @item -pflash @var{file}
794 @findex -pflash
795 Use @var{file} as a parallel flash image.
796 ETEXI
798 DEF("snapshot", 0, QEMU_OPTION_snapshot,
799 "-snapshot write to temporary files instead of disk image files\n",
800 QEMU_ARCH_ALL)
801 STEXI
802 @item -snapshot
803 @findex -snapshot
804 Write to temporary files instead of disk image files. In this case,
805 the raw disk image you use is not written back. You can however force
806 the write back by pressing @key{C-a s} (@pxref{disk_images}).
807 ETEXI
809 DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \
810 "-hdachs c,h,s[,t]\n" \
811 " force hard disk 0 physical geometry and the optional BIOS\n" \
812 " translation (t=none or lba) (usually QEMU can guess them)\n",
813 QEMU_ARCH_ALL)
814 STEXI
815 @item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
816 @findex -hdachs
817 Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=
818 @var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS
819 translation mode (@var{t}=none, lba or auto). Usually QEMU can guess
820 all those parameters. This option is deprecated, please use
821 @code{-device ide-hd,cyls=c,heads=h,secs=s,...} instead.
822 ETEXI
824 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
825 "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
826 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n"
827 " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
828 " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
829 " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
830 " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
831 " [[,throttling.iops-size=is]]\n",
832 QEMU_ARCH_ALL)
834 STEXI
836 @item -fsdev @var{fsdriver},id=@var{id},path=@var{path},[security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
837 @findex -fsdev
838 Define a new file system device. Valid options are:
839 @table @option
840 @item @var{fsdriver}
841 This option specifies the fs driver backend to use.
842 Currently "local", "handle" and "proxy" file system drivers are supported.
843 @item id=@var{id}
844 Specifies identifier for this device
845 @item path=@var{path}
846 Specifies the export path for the file system device. Files under
847 this path will be available to the 9p client on the guest.
848 @item security_model=@var{security_model}
849 Specifies the security model to be used for this export path.
850 Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
851 In "passthrough" security model, files are stored using the same
852 credentials as they are created on the guest. This requires QEMU
853 to run as root. In "mapped-xattr" security model, some of the file
854 attributes like uid, gid, mode bits and link target are stored as
855 file attributes. For "mapped-file" these attributes are stored in the
856 hidden .virtfs_metadata directory. Directories exported by this security model cannot
857 interact with other unix tools. "none" security model is same as
858 passthrough except the sever won't report failures if it fails to
859 set file attributes like ownership. Security model is mandatory
860 only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
861 security model as a parameter.
862 @item writeout=@var{writeout}
863 This is an optional argument. The only supported value is "immediate".
864 This means that host page cache will be used to read and write data but
865 write notification will be sent to the guest only when the data has been
866 reported as written by the storage subsystem.
867 @item readonly
868 Enables exporting 9p share as a readonly mount for guests. By default
869 read-write access is given.
870 @item socket=@var{socket}
871 Enables proxy filesystem driver to use passed socket file for communicating
872 with virtfs-proxy-helper
873 @item sock_fd=@var{sock_fd}
874 Enables proxy filesystem driver to use passed socket descriptor for
875 communicating with virtfs-proxy-helper. Usually a helper like libvirt
876 will create socketpair and pass one of the fds as sock_fd
877 @end table
879 -fsdev option is used along with -device driver "virtio-9p-pci".
880 @item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag}
881 Options for virtio-9p-pci driver are:
882 @table @option
883 @item fsdev=@var{id}
884 Specifies the id value specified along with -fsdev option
885 @item mount_tag=@var{mount_tag}
886 Specifies the tag name to be used by the guest to mount this export point
887 @end table
889 ETEXI
891 DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
892 "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
893 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
894 QEMU_ARCH_ALL)
896 STEXI
898 @item -virtfs @var{fsdriver}[,path=@var{path}],mount_tag=@var{mount_tag}[,security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
899 @findex -virtfs
901 The general form of a Virtual File system pass-through options are:
902 @table @option
903 @item @var{fsdriver}
904 This option specifies the fs driver backend to use.
905 Currently "local", "handle" and "proxy" file system drivers are supported.
906 @item id=@var{id}
907 Specifies identifier for this device
908 @item path=@var{path}
909 Specifies the export path for the file system device. Files under
910 this path will be available to the 9p client on the guest.
911 @item security_model=@var{security_model}
912 Specifies the security model to be used for this export path.
913 Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
914 In "passthrough" security model, files are stored using the same
915 credentials as they are created on the guest. This requires QEMU
916 to run as root. In "mapped-xattr" security model, some of the file
917 attributes like uid, gid, mode bits and link target are stored as
918 file attributes. For "mapped-file" these attributes are stored in the
919 hidden .virtfs_metadata directory. Directories exported by this security model cannot
920 interact with other unix tools. "none" security model is same as
921 passthrough except the sever won't report failures if it fails to
922 set file attributes like ownership. Security model is mandatory only
923 for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
924 model as a parameter.
925 @item writeout=@var{writeout}
926 This is an optional argument. The only supported value is "immediate".
927 This means that host page cache will be used to read and write data but
928 write notification will be sent to the guest only when the data has been
929 reported as written by the storage subsystem.
930 @item readonly
931 Enables exporting 9p share as a readonly mount for guests. By default
932 read-write access is given.
933 @item socket=@var{socket}
934 Enables proxy filesystem driver to use passed socket file for
935 communicating with virtfs-proxy-helper. Usually a helper like libvirt
936 will create socketpair and pass one of the fds as sock_fd
937 @item sock_fd
938 Enables proxy filesystem driver to use passed 'sock_fd' as the socket
939 descriptor for interfacing with virtfs-proxy-helper
940 @end table
941 ETEXI
943 DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
944 "-virtfs_synth Create synthetic file system image\n",
945 QEMU_ARCH_ALL)
946 STEXI
947 @item -virtfs_synth
948 @findex -virtfs_synth
949 Create synthetic file system image
950 ETEXI
952 STEXI
953 @end table
954 ETEXI
955 DEFHEADING()
957 DEFHEADING(USB options)
958 STEXI
959 @table @option
960 ETEXI
962 DEF("usb", 0, QEMU_OPTION_usb,
963 "-usb enable the USB driver (will be the default soon)\n",
964 QEMU_ARCH_ALL)
965 STEXI
966 @item -usb
967 @findex -usb
968 Enable the USB driver (will be the default soon)
969 ETEXI
971 DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
972 "-usbdevice name add the host or guest USB device 'name'\n",
973 QEMU_ARCH_ALL)
974 STEXI
976 @item -usbdevice @var{devname}
977 @findex -usbdevice
978 Add the USB device @var{devname}. @xref{usb_devices}.
980 @table @option
982 @item mouse
983 Virtual Mouse. This will override the PS/2 mouse emulation when activated.
985 @item tablet
986 Pointer device that uses absolute coordinates (like a touchscreen). This
987 means QEMU is able to report the mouse position without having to grab the
988 mouse. Also overrides the PS/2 mouse emulation when activated.
990 @item disk:[format=@var{format}]:@var{file}
991 Mass storage device based on file. The optional @var{format} argument
992 will be used rather than detecting the format. Can be used to specify
993 @code{format=raw} to avoid interpreting an untrusted format header.
995 @item host:@var{bus}.@var{addr}
996 Pass through the host device identified by @var{bus}.@var{addr} (Linux only).
998 @item host:@var{vendor_id}:@var{product_id}
999 Pass through the host device identified by @var{vendor_id}:@var{product_id}
1000 (Linux only).
1002 @item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
1003 Serial converter to host character device @var{dev}, see @code{-serial} for the
1004 available devices.
1006 @item braille
1007 Braille device. This will use BrlAPI to display the braille output on a real
1008 or fake device.
1010 @item net:@var{options}
1011 Network adapter that supports CDC ethernet and RNDIS protocols.
1013 @end table
1014 ETEXI
1016 STEXI
1017 @end table
1018 ETEXI
1019 DEFHEADING()
1021 DEFHEADING(Display options)
1022 STEXI
1023 @table @option
1024 ETEXI
1026 DEF("display", HAS_ARG, QEMU_OPTION_display,
1027 "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
1028 " [,window_close=on|off][,gl=on|off]\n"
1029 "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
1030 "-display vnc=<display>[,<optargs>]\n"
1031 "-display curses\n"
1032 "-display none"
1033 " select display type\n"
1034 "The default display is equivalent to\n"
1035 #if defined(CONFIG_GTK)
1036 "\t\"-display gtk\"\n"
1037 #elif defined(CONFIG_SDL)
1038 "\t\"-display sdl\"\n"
1039 #elif defined(CONFIG_COCOA)
1040 "\t\"-display cocoa\"\n"
1041 #elif defined(CONFIG_VNC)
1042 "\t\"-vnc localhost:0,to=99,id=default\"\n"
1043 #else
1044 "\t\"-display none\"\n"
1045 #endif
1046 , QEMU_ARCH_ALL)
1047 STEXI
1048 @item -display @var{type}
1049 @findex -display
1050 Select type of display to use. This option is a replacement for the
1051 old style -sdl/-curses/... options. Valid values for @var{type} are
1052 @table @option
1053 @item sdl
1054 Display video output via SDL (usually in a separate graphics
1055 window; see the SDL documentation for other possibilities).
1056 @item curses
1057 Display video output via curses. For graphics device models which
1058 support a text mode, QEMU can display this output using a
1059 curses/ncurses interface. Nothing is displayed when the graphics
1060 device is in graphical mode or if the graphics device does not support
1061 a text mode. Generally only the VGA device models support text mode.
1062 @item none
1063 Do not display video output. The guest will still see an emulated
1064 graphics card, but its output will not be displayed to the QEMU
1065 user. This option differs from the -nographic option in that it
1066 only affects what is done with video output; -nographic also changes
1067 the destination of the serial and parallel port data.
1068 @item gtk
1069 Display video output in a GTK window. This interface provides drop-down
1070 menus and other UI elements to configure and control the VM during
1071 runtime.
1072 @item vnc
1073 Start a VNC server on display <arg>
1074 @end table
1075 ETEXI
1077 DEF("nographic", 0, QEMU_OPTION_nographic,
1078 "-nographic disable graphical output and redirect serial I/Os to console\n",
1079 QEMU_ARCH_ALL)
1080 STEXI
1081 @item -nographic
1082 @findex -nographic
1083 Normally, if QEMU is compiled with graphical window support, it displays
1084 output such as guest graphics, guest console, and the QEMU monitor in a
1085 window. With this option, you can totally disable graphical output so
1086 that QEMU is a simple command line application. The emulated serial port
1087 is redirected on the console and muxed with the monitor (unless
1088 redirected elsewhere explicitly). Therefore, you can still use QEMU to
1089 debug a Linux kernel with a serial console. Use @key{C-a h} for help on
1090 switching between the console and monitor.
1091 ETEXI
1093 DEF("curses", 0, QEMU_OPTION_curses,
1094 "-curses shorthand for -display curses\n",
1095 QEMU_ARCH_ALL)
1096 STEXI
1097 @item -curses
1098 @findex -curses
1099 Normally, if QEMU is compiled with graphical window support, it displays
1100 output such as guest graphics, guest console, and the QEMU monitor in a
1101 window. With this option, QEMU can display the VGA output when in text
1102 mode using a curses/ncurses interface. Nothing is displayed in graphical
1103 mode.
1104 ETEXI
1106 DEF("no-frame", 0, QEMU_OPTION_no_frame,
1107 "-no-frame open SDL window without a frame and window decorations\n",
1108 QEMU_ARCH_ALL)
1109 STEXI
1110 @item -no-frame
1111 @findex -no-frame
1112 Do not use decorations for SDL windows and start them using the whole
1113 available screen space. This makes the using QEMU in a dedicated desktop
1114 workspace more convenient.
1115 ETEXI
1117 DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
1118 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
1119 QEMU_ARCH_ALL)
1120 STEXI
1121 @item -alt-grab
1122 @findex -alt-grab
1123 Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
1124 affects the special keys (for fullscreen, monitor-mode switching, etc).
1125 ETEXI
1127 DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
1128 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
1129 QEMU_ARCH_ALL)
1130 STEXI
1131 @item -ctrl-grab
1132 @findex -ctrl-grab
1133 Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
1134 affects the special keys (for fullscreen, monitor-mode switching, etc).
1135 ETEXI
1137 DEF("no-quit", 0, QEMU_OPTION_no_quit,
1138 "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
1139 STEXI
1140 @item -no-quit
1141 @findex -no-quit
1142 Disable SDL window close capability.
1143 ETEXI
1145 DEF("sdl", 0, QEMU_OPTION_sdl,
1146 "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
1147 STEXI
1148 @item -sdl
1149 @findex -sdl
1150 Enable SDL.
1151 ETEXI
1153 DEF("spice", HAS_ARG, QEMU_OPTION_spice,
1154 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
1155 " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
1156 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
1157 " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
1158 " [,tls-ciphers=<list>]\n"
1159 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
1160 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
1161 " [,sasl][,password=<secret>][,disable-ticketing]\n"
1162 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
1163 " [,jpeg-wan-compression=[auto|never|always]]\n"
1164 " [,zlib-glz-wan-compression=[auto|never|always]]\n"
1165 " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
1166 " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
1167 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
1168 " [,gl=[on|off]][,rendernode=<file>]\n"
1169 " enable spice\n"
1170 " at least one of {port, tls-port} is mandatory\n",
1171 QEMU_ARCH_ALL)
1172 STEXI
1173 @item -spice @var{option}[,@var{option}[,...]]
1174 @findex -spice
1175 Enable the spice remote desktop protocol. Valid options are
1177 @table @option
1179 @item port=<nr>
1180 Set the TCP port spice is listening on for plaintext channels.
1182 @item addr=<addr>
1183 Set the IP address spice is listening on. Default is any address.
1185 @item ipv4
1186 @itemx ipv6
1187 @itemx unix
1188 Force using the specified IP version.
1190 @item password=<secret>
1191 Set the password you need to authenticate.
1193 @item sasl
1194 Require that the client use SASL to authenticate with the spice.
1195 The exact choice of authentication method used is controlled from the
1196 system / user's SASL configuration file for the 'qemu' service. This
1197 is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1198 unprivileged user, an environment variable SASL_CONF_PATH can be used
1199 to make it search alternate locations for the service config.
1200 While some SASL auth methods can also provide data encryption (eg GSSAPI),
1201 it is recommended that SASL always be combined with the 'tls' and
1202 'x509' settings to enable use of SSL and server certificates. This
1203 ensures a data encryption preventing compromise of authentication
1204 credentials.
1206 @item disable-ticketing
1207 Allow client connects without authentication.
1209 @item disable-copy-paste
1210 Disable copy paste between the client and the guest.
1212 @item disable-agent-file-xfer
1213 Disable spice-vdagent based file-xfer between the client and the guest.
1215 @item tls-port=<nr>
1216 Set the TCP port spice is listening on for encrypted channels.
1218 @item x509-dir=<dir>
1219 Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
1221 @item x509-key-file=<file>
1222 @itemx x509-key-password=<file>
1223 @itemx x509-cert-file=<file>
1224 @itemx x509-cacert-file=<file>
1225 @itemx x509-dh-key-file=<file>
1226 The x509 file names can also be configured individually.
1228 @item tls-ciphers=<list>
1229 Specify which ciphers to use.
1231 @item tls-channel=[main|display|cursor|inputs|record|playback]
1232 @itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
1233 Force specific channel to be used with or without TLS encryption. The
1234 options can be specified multiple times to configure multiple
1235 channels. The special name "default" can be used to set the default
1236 mode. For channels which are not explicitly forced into one mode the
1237 spice client is allowed to pick tls/plaintext as he pleases.
1239 @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
1240 Configure image compression (lossless).
1241 Default is auto_glz.
1243 @item jpeg-wan-compression=[auto|never|always]
1244 @itemx zlib-glz-wan-compression=[auto|never|always]
1245 Configure wan image compression (lossy for slow links).
1246 Default is auto.
1248 @item streaming-video=[off|all|filter]
1249 Configure video stream detection. Default is off.
1251 @item agent-mouse=[on|off]
1252 Enable/disable passing mouse events via vdagent. Default is on.
1254 @item playback-compression=[on|off]
1255 Enable/disable audio stream compression (using celt 0.5.1). Default is on.
1257 @item seamless-migration=[on|off]
1258 Enable/disable spice seamless migration. Default is off.
1260 @item gl=[on|off]
1261 Enable/disable OpenGL context. Default is off.
1263 @item rendernode=<file>
1264 DRM render node for OpenGL rendering. If not specified, it will pick
1265 the first available. (Since 2.9)
1267 @end table
1268 ETEXI
1270 DEF("portrait", 0, QEMU_OPTION_portrait,
1271 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
1272 QEMU_ARCH_ALL)
1273 STEXI
1274 @item -portrait
1275 @findex -portrait
1276 Rotate graphical output 90 deg left (only PXA LCD).
1277 ETEXI
1279 DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
1280 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
1281 QEMU_ARCH_ALL)
1282 STEXI
1283 @item -rotate @var{deg}
1284 @findex -rotate
1285 Rotate graphical output some deg left (only PXA LCD).
1286 ETEXI
1288 DEF("vga", HAS_ARG, QEMU_OPTION_vga,
1289 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
1290 " select video card type\n", QEMU_ARCH_ALL)
1291 STEXI
1292 @item -vga @var{type}
1293 @findex -vga
1294 Select type of VGA card to emulate. Valid values for @var{type} are
1295 @table @option
1296 @item cirrus
1297 Cirrus Logic GD5446 Video card. All Windows versions starting from
1298 Windows 95 should recognize and use this graphic card. For optimal
1299 performances, use 16 bit color depth in the guest and the host OS.
1300 (This card was the default before QEMU 2.2)
1301 @item std
1302 Standard VGA card with Bochs VBE extensions. If your guest OS
1303 supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
1304 to use high resolution modes (>= 1280x1024x16) then you should use
1305 this option. (This card is the default since QEMU 2.2)
1306 @item vmware
1307 VMWare SVGA-II compatible adapter. Use it if you have sufficiently
1308 recent XFree86/XOrg server or Windows guest with a driver for this
1309 card.
1310 @item qxl
1311 QXL paravirtual graphic card. It is VGA compatible (including VESA
1312 2.0 VBE support). Works best with qxl guest drivers installed though.
1313 Recommended choice when using the spice protocol.
1314 @item tcx
1315 (sun4m only) Sun TCX framebuffer. This is the default framebuffer for
1316 sun4m machines and offers both 8-bit and 24-bit colour depths at a
1317 fixed resolution of 1024x768.
1318 @item cg3
1319 (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
1320 for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
1321 resolutions aimed at people wishing to run older Solaris versions.
1322 @item virtio
1323 Virtio VGA card.
1324 @item none
1325 Disable VGA card.
1326 @end table
1327 ETEXI
1329 DEF("full-screen", 0, QEMU_OPTION_full_screen,
1330 "-full-screen start in full screen\n", QEMU_ARCH_ALL)
1331 STEXI
1332 @item -full-screen
1333 @findex -full-screen
1334 Start in full screen.
1335 ETEXI
1337 DEF("g", 1, QEMU_OPTION_g ,
1338 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
1339 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
1340 STEXI
1341 @item -g @var{width}x@var{height}[x@var{depth}]
1342 @findex -g
1343 Set the initial graphical resolution and depth (PPC, SPARC only).
1344 ETEXI
1346 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
1347 "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
1348 STEXI
1349 @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
1350 @findex -vnc
1351 Normally, if QEMU is compiled with graphical window support, it displays
1352 output such as guest graphics, guest console, and the QEMU monitor in a
1353 window. With this option, you can have QEMU listen on VNC display
1354 @var{display} and redirect the VGA display over the VNC session. It is
1355 very useful to enable the usb tablet device when using this option
1356 (option @option{-usbdevice tablet}). When using the VNC display, you
1357 must use the @option{-k} parameter to set the keyboard layout if you are
1358 not using en-us. Valid syntax for the @var{display} is
1360 @table @option
1362 @item to=@var{L}
1364 With this option, QEMU will try next available VNC @var{display}s, until the
1365 number @var{L}, if the origianlly defined "-vnc @var{display}" is not
1366 available, e.g. port 5900+@var{display} is already used by another
1367 application. By default, to=0.
1369 @item @var{host}:@var{d}
1371 TCP connections will only be allowed from @var{host} on display @var{d}.
1372 By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
1373 be omitted in which case the server will accept connections from any host.
1375 @item unix:@var{path}
1377 Connections will be allowed over UNIX domain sockets where @var{path} is the
1378 location of a unix socket to listen for connections on.
1380 @item none
1382 VNC is initialized but not started. The monitor @code{change} command
1383 can be used to later start the VNC server.
1385 @end table
1387 Following the @var{display} value there may be one or more @var{option} flags
1388 separated by commas. Valid options are
1390 @table @option
1392 @item reverse
1394 Connect to a listening VNC client via a ``reverse'' connection. The
1395 client is specified by the @var{display}. For reverse network
1396 connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
1397 is a TCP port number, not a display number.
1399 @item websocket
1401 Opens an additional TCP listening port dedicated to VNC Websocket connections.
1402 If a bare @var{websocket} option is given, the Websocket port is
1403 5700+@var{display}. An alternative port can be specified with the
1404 syntax @code{websocket}=@var{port}.
1406 If @var{host} is specified connections will only be allowed from this host.
1407 It is possible to control the websocket listen address independently, using
1408 the syntax @code{websocket}=@var{host}:@var{port}.
1410 If no TLS credentials are provided, the websocket connection runs in
1411 unencrypted mode. If TLS credentials are provided, the websocket connection
1412 requires encrypted client connections.
1414 @item password
1416 Require that password based authentication is used for client connections.
1418 The password must be set separately using the @code{set_password} command in
1419 the @ref{pcsys_monitor}. The syntax to change your password is:
1420 @code{set_password <protocol> <password>} where <protocol> could be either
1421 "vnc" or "spice".
1423 If you would like to change <protocol> password expiration, you should use
1424 @code{expire_password <protocol> <expiration-time>} where expiration time could
1425 be one of the following options: now, never, +seconds or UNIX time of
1426 expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
1427 to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
1428 date and time).
1430 You can also use keywords "now" or "never" for the expiration time to
1431 allow <protocol> password to expire immediately or never expire.
1433 @item tls-creds=@var{ID}
1435 Provides the ID of a set of TLS credentials to use to secure the
1436 VNC server. They will apply to both the normal VNC server socket
1437 and the websocket socket (if enabled). Setting TLS credentials
1438 will cause the VNC server socket to enable the VeNCrypt auth
1439 mechanism. The credentials should have been previously created
1440 using the @option{-object tls-creds} argument.
1442 The @option{tls-creds} parameter obsoletes the @option{tls},
1443 @option{x509}, and @option{x509verify} options, and as such
1444 it is not permitted to set both new and old type options at
1445 the same time.
1447 @item tls
1449 Require that client use TLS when communicating with the VNC server. This
1450 uses anonymous TLS credentials so is susceptible to a man-in-the-middle
1451 attack. It is recommended that this option be combined with either the
1452 @option{x509} or @option{x509verify} options.
1454 This option is now deprecated in favor of using the @option{tls-creds}
1455 argument.
1457 @item x509=@var{/path/to/certificate/dir}
1459 Valid if @option{tls} is specified. Require that x509 credentials are used
1460 for negotiating the TLS session. The server will send its x509 certificate
1461 to the client. It is recommended that a password be set on the VNC server
1462 to provide authentication of the client when this is used. The path following
1463 this option specifies where the x509 certificates are to be loaded from.
1464 See the @ref{vnc_security} section for details on generating certificates.
1466 This option is now deprecated in favour of using the @option{tls-creds}
1467 argument.
1469 @item x509verify=@var{/path/to/certificate/dir}
1471 Valid if @option{tls} is specified. Require that x509 credentials are used
1472 for negotiating the TLS session. The server will send its x509 certificate
1473 to the client, and request that the client send its own x509 certificate.
1474 The server will validate the client's certificate against the CA certificate,
1475 and reject clients when validation fails. If the certificate authority is
1476 trusted, this is a sufficient authentication mechanism. You may still wish
1477 to set a password on the VNC server as a second authentication layer. The
1478 path following this option specifies where the x509 certificates are to
1479 be loaded from. See the @ref{vnc_security} section for details on generating
1480 certificates.
1482 This option is now deprecated in favour of using the @option{tls-creds}
1483 argument.
1485 @item sasl
1487 Require that the client use SASL to authenticate with the VNC server.
1488 The exact choice of authentication method used is controlled from the
1489 system / user's SASL configuration file for the 'qemu' service. This
1490 is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1491 unprivileged user, an environment variable SASL_CONF_PATH can be used
1492 to make it search alternate locations for the service config.
1493 While some SASL auth methods can also provide data encryption (eg GSSAPI),
1494 it is recommended that SASL always be combined with the 'tls' and
1495 'x509' settings to enable use of SSL and server certificates. This
1496 ensures a data encryption preventing compromise of authentication
1497 credentials. See the @ref{vnc_security} section for details on using
1498 SASL authentication.
1500 @item acl
1502 Turn on access control lists for checking of the x509 client certificate
1503 and SASL party. For x509 certs, the ACL check is made against the
1504 certificate's distinguished name. This is something that looks like
1505 @code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is
1506 made against the username, which depending on the SASL plugin, may
1507 include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}.
1508 When the @option{acl} flag is set, the initial access list will be
1509 empty, with a @code{deny} policy. Thus no one will be allowed to
1510 use the VNC server until the ACLs have been loaded. This can be
1511 achieved using the @code{acl} monitor command.
1513 @item lossy
1515 Enable lossy compression methods (gradient, JPEG, ...). If this
1516 option is set, VNC client may receive lossy framebuffer updates
1517 depending on its encoding settings. Enabling this option can save
1518 a lot of bandwidth at the expense of quality.
1520 @item non-adaptive
1522 Disable adaptive encodings. Adaptive encodings are enabled by default.
1523 An adaptive encoding will try to detect frequently updated screen regions,
1524 and send updates in these regions using a lossy encoding (like JPEG).
1525 This can be really helpful to save bandwidth when playing videos. Disabling
1526 adaptive encodings restores the original static behavior of encodings
1527 like Tight.
1529 @item share=[allow-exclusive|force-shared|ignore]
1531 Set display sharing policy. 'allow-exclusive' allows clients to ask
1532 for exclusive access. As suggested by the rfb spec this is
1533 implemented by dropping other connections. Connecting multiple
1534 clients in parallel requires all clients asking for a shared session
1535 (vncviewer: -shared switch). This is the default. 'force-shared'
1536 disables exclusive client access. Useful for shared desktop sessions,
1537 where you don't want someone forgetting specify -shared disconnect
1538 everybody else. 'ignore' completely ignores the shared flag and
1539 allows everybody connect unconditionally. Doesn't conform to the rfb
1540 spec but is traditional QEMU behavior.
1542 @item key-delay-ms
1544 Set keyboard delay, for key down and key up events, in milliseconds.
1545 Default is 1. Keyboards are low-bandwidth devices, so this slowdown
1546 can help the device and guest to keep up and not lose events in case
1547 events are arriving in bulk. Possible causes for the latter are flaky
1548 network connections, or scripts for automated testing.
1550 @end table
1551 ETEXI
1553 STEXI
1554 @end table
1555 ETEXI
1556 ARCHHEADING(, QEMU_ARCH_I386)
1558 ARCHHEADING(i386 target only, QEMU_ARCH_I386)
1559 STEXI
1560 @table @option
1561 ETEXI
1563 DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
1564 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
1565 QEMU_ARCH_I386)
1566 STEXI
1567 @item -win2k-hack
1568 @findex -win2k-hack
1569 Use it when installing Windows 2000 to avoid a disk full bug. After
1570 Windows 2000 is installed, you no longer need this option (this option
1571 slows down the IDE transfers).
1572 ETEXI
1574 HXCOMM Deprecated by -rtc
1575 DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
1577 DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
1578 "-no-fd-bootchk disable boot signature checking for floppy disks\n",
1579 QEMU_ARCH_I386)
1580 STEXI
1581 @item -no-fd-bootchk
1582 @findex -no-fd-bootchk
1583 Disable boot signature checking for floppy disks in BIOS. May
1584 be needed to boot from old floppy disks.
1585 ETEXI
1587 DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
1588 "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
1589 STEXI
1590 @item -no-acpi
1591 @findex -no-acpi
1592 Disable ACPI (Advanced Configuration and Power Interface) support. Use
1593 it if your guest OS complains about ACPI problems (PC target machine
1594 only).
1595 ETEXI
1597 DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
1598 "-no-hpet disable HPET\n", QEMU_ARCH_I386)
1599 STEXI
1600 @item -no-hpet
1601 @findex -no-hpet
1602 Disable HPET support.
1603 ETEXI
1605 DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
1606 "-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"
1607 " ACPI table description\n", QEMU_ARCH_I386)
1608 STEXI
1609 @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}]...]
1610 @findex -acpitable
1611 Add ACPI table with specified header fields and context from specified files.
1612 For file=, take whole ACPI table from the specified files, including all
1613 ACPI headers (possible overridden by other options).
1614 For data=, only data
1615 portion of the table is used, all header information is specified in the
1616 command line.
1617 If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
1618 fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
1619 to ensure the field matches required by the Microsoft SLIC spec and the ACPI
1620 spec.
1621 ETEXI
1623 DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
1624 "-smbios file=binary\n"
1625 " load SMBIOS entry from binary file\n"
1626 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
1627 " [,uefi=on|off]\n"
1628 " specify SMBIOS type 0 fields\n"
1629 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1630 " [,uuid=uuid][,sku=str][,family=str]\n"
1631 " specify SMBIOS type 1 fields\n"
1632 "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1633 " [,asset=str][,location=str]\n"
1634 " specify SMBIOS type 2 fields\n"
1635 "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
1636 " [,sku=str]\n"
1637 " specify SMBIOS type 3 fields\n"
1638 "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
1639 " [,asset=str][,part=str]\n"
1640 " specify SMBIOS type 4 fields\n"
1641 "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
1642 " [,asset=str][,part=str][,speed=%d]\n"
1643 " specify SMBIOS type 17 fields\n",
1644 QEMU_ARCH_I386 | QEMU_ARCH_ARM)
1645 STEXI
1646 @item -smbios file=@var{binary}
1647 @findex -smbios
1648 Load SMBIOS entry from binary file.
1650 @item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
1651 Specify SMBIOS type 0 fields
1653 @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}]
1654 Specify SMBIOS type 1 fields
1656 @item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}][,family=@var{str}]
1657 Specify SMBIOS type 2 fields
1659 @item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
1660 Specify SMBIOS type 3 fields
1662 @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
1663 Specify SMBIOS type 4 fields
1665 @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}]
1666 Specify SMBIOS type 17 fields
1667 ETEXI
1669 STEXI
1670 @end table
1671 ETEXI
1672 DEFHEADING()
1674 DEFHEADING(Network options)
1675 STEXI
1676 @table @option
1677 ETEXI
1679 HXCOMM Legacy slirp options (now moved to -net user):
1680 #ifdef CONFIG_SLIRP
1681 DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL)
1682 DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL)
1683 DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL)
1684 #ifndef _WIN32
1685 DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
1686 #endif
1687 #endif
1689 DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
1690 #ifdef CONFIG_SLIRP
1691 "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
1692 " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
1693 " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
1694 " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
1695 " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
1696 #ifndef _WIN32
1697 "[,smb=dir[,smbserver=addr]]\n"
1698 #endif
1699 " configure a user mode network backend with ID 'str',\n"
1700 " its DHCP server and optional services\n"
1701 #endif
1702 #ifdef _WIN32
1703 "-netdev tap,id=str,ifname=name\n"
1704 " configure a host TAP network backend with ID 'str'\n"
1705 #else
1706 "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
1707 " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
1708 " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
1709 " [,poll-us=n]\n"
1710 " configure a host TAP network backend with ID 'str'\n"
1711 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
1712 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
1713 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
1714 " to deconfigure it\n"
1715 " use '[down]script=no' to disable script execution\n"
1716 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
1717 " configure it\n"
1718 " use 'fd=h' to connect to an already opened TAP interface\n"
1719 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
1720 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
1721 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
1722 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
1723 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
1724 " use vhost=on to enable experimental in kernel accelerator\n"
1725 " (only has effect for virtio guests which use MSIX)\n"
1726 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
1727 " use 'vhostfd=h' to connect to an already opened vhost net device\n"
1728 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
1729 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
1730 " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
1731 " spent on busy polling for vhost net\n"
1732 "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
1733 " configure a host TAP network backend with ID 'str' that is\n"
1734 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
1735 " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
1736 #endif
1737 #ifdef __linux__
1738 "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
1739 " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
1740 " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
1741 " [,rxcookie=rxcookie][,offset=offset]\n"
1742 " configure a network backend with ID 'str' connected to\n"
1743 " an Ethernet over L2TPv3 pseudowire.\n"
1744 " Linux kernel 3.3+ as well as most routers can talk\n"
1745 " L2TPv3. This transport allows connecting a VM to a VM,\n"
1746 " VM to a router and even VM to Host. It is a nearly-universal\n"
1747 " standard (RFC3391). Note - this implementation uses static\n"
1748 " pre-configured tunnels (same as the Linux kernel).\n"
1749 " use 'src=' to specify source address\n"
1750 " use 'dst=' to specify destination address\n"
1751 " use 'udp=on' to specify udp encapsulation\n"
1752 " use 'srcport=' to specify source udp port\n"
1753 " use 'dstport=' to specify destination udp port\n"
1754 " use 'ipv6=on' to force v6\n"
1755 " L2TPv3 uses cookies to prevent misconfiguration as\n"
1756 " well as a weak security measure\n"
1757 " use 'rxcookie=0x012345678' to specify a rxcookie\n"
1758 " use 'txcookie=0x012345678' to specify a txcookie\n"
1759 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
1760 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
1761 " use 'pincounter=on' to work around broken counter handling in peer\n"
1762 " use 'offset=X' to add an extra offset between header and data\n"
1763 #endif
1764 "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
1765 " configure a network backend to connect to another network\n"
1766 " using a socket connection\n"
1767 "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
1768 " configure a network backend to connect to a multicast maddr and port\n"
1769 " use 'localaddr=addr' to specify the host address to send packets from\n"
1770 "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
1771 " configure a network backend to connect to another network\n"
1772 " using an UDP tunnel\n"
1773 #ifdef CONFIG_VDE
1774 "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
1775 " configure a network backend to connect to port 'n' of a vde switch\n"
1776 " running on host and listening for incoming connections on 'socketpath'.\n"
1777 " Use group 'groupname' and mode 'octalmode' to change default\n"
1778 " ownership and permissions for communication port.\n"
1779 #endif
1780 #ifdef CONFIG_NETMAP
1781 "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
1782 " attach to the existing netmap-enabled network interface 'name', or to a\n"
1783 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
1784 " netmap device, defaults to '/dev/netmap')\n"
1785 #endif
1786 "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
1787 " configure a vhost-user network, backed by a chardev 'dev'\n"
1788 "-netdev hubport,id=str,hubid=n\n"
1789 " configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL)
1790 DEF("net", HAS_ARG, QEMU_OPTION_net,
1791 "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
1792 " old way to create a new NIC and connect it to VLAN 'n'\n"
1793 " (use the '-device devtype,netdev=str' option if possible instead)\n"
1794 "-net dump[,vlan=n][,file=f][,len=n]\n"
1795 " dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
1796 "-net none use it alone to have zero network devices. If no -net option\n"
1797 " is provided, the default is '-net nic -net user'\n"
1798 "-net ["
1799 #ifdef CONFIG_SLIRP
1800 "user|"
1801 #endif
1802 "tap|"
1803 "bridge|"
1804 #ifdef CONFIG_VDE
1805 "vde|"
1806 #endif
1807 #ifdef CONFIG_NETMAP
1808 "netmap|"
1809 #endif
1810 "socket][,vlan=n][,option][,option][,...]\n"
1811 " old way to initialize a host network interface\n"
1812 " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
1813 STEXI
1814 @item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
1815 @findex -net
1816 Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
1817 = 0 is the default). The NIC is an e1000 by default on the PC
1818 target. Optionally, the MAC address can be changed to @var{mac}, the
1819 device address set to @var{addr} (PCI cards only),
1820 and a @var{name} can be assigned for use in monitor commands.
1821 Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
1822 that the card should have; this option currently only affects virtio cards; set
1823 @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
1824 NIC is created. QEMU can emulate several different models of network card.
1825 Valid values for @var{type} are
1826 @code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er},
1827 @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
1828 @code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}.
1829 Not all devices are supported on all targets. Use @code{-net nic,model=help}
1830 for a list of available devices for your target.
1832 @item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
1833 @findex -netdev
1834 @item -net user[,@var{option}][,@var{option}][,...]
1835 Use the user mode network stack which requires no administrator
1836 privilege to run. Valid options are:
1838 @table @option
1839 @item vlan=@var{n}
1840 Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
1842 @item id=@var{id}
1843 @itemx name=@var{name}
1844 Assign symbolic name for use in monitor commands.
1846 @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must
1847 be enabled. If neither is specified both protocols are enabled.
1849 @item net=@var{addr}[/@var{mask}]
1850 Set IP network address the guest will see. Optionally specify the netmask,
1851 either in the form a.b.c.d or as number of valid top-most bits. Default is
1852 10.0.2.0/24.
1854 @item host=@var{addr}
1855 Specify the guest-visible address of the host. Default is the 2nd IP in the
1856 guest network, i.e. x.x.x.2.
1858 @item ipv6-net=@var{addr}[/@var{int}]
1859 Set IPv6 network address the guest will see (default is fec0::/64). The
1860 network prefix is given in the usual hexadecimal IPv6 address
1861 notation. The prefix size is optional, and is given as the number of
1862 valid top-most bits (default is 64).
1864 @item ipv6-host=@var{addr}
1865 Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
1866 the guest network, i.e. xxxx::2.
1868 @item restrict=on|off
1869 If this option is enabled, the guest will be isolated, i.e. it will not be
1870 able to contact the host and no guest IP packets will be routed over the host
1871 to the outside. This option does not affect any explicitly set forwarding rules.
1873 @item hostname=@var{name}
1874 Specifies the client hostname reported by the built-in DHCP server.
1876 @item dhcpstart=@var{addr}
1877 Specify the first of the 16 IPs the built-in DHCP server can assign. Default
1878 is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
1880 @item dns=@var{addr}
1881 Specify the guest-visible address of the virtual nameserver. The address must
1882 be different from the host address. Default is the 3rd IP in the guest network,
1883 i.e. x.x.x.3.
1885 @item ipv6-dns=@var{addr}
1886 Specify the guest-visible address of the IPv6 virtual nameserver. The address
1887 must be different from the host address. Default is the 3rd IP in the guest
1888 network, i.e. xxxx::3.
1890 @item dnssearch=@var{domain}
1891 Provides an entry for the domain-search list sent by the built-in
1892 DHCP server. More than one domain suffix can be transmitted by specifying
1893 this option multiple times. If supported, this will cause the guest to
1894 automatically try to append the given domain suffix(es) in case a domain name
1895 can not be resolved.
1897 Example:
1898 @example
1899 qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...]
1900 @end example
1902 @item tftp=@var{dir}
1903 When using the user mode network stack, activate a built-in TFTP
1904 server. The files in @var{dir} will be exposed as the root of a TFTP server.
1905 The TFTP client on the guest must be configured in binary mode (use the command
1906 @code{bin} of the Unix TFTP client).
1908 @item bootfile=@var{file}
1909 When using the user mode network stack, broadcast @var{file} as the BOOTP
1910 filename. In conjunction with @option{tftp}, this can be used to network boot
1911 a guest from a local directory.
1913 Example (using pxelinux):
1914 @example
1915 qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
1916 @end example
1918 @item smb=@var{dir}[,smbserver=@var{addr}]
1919 When using the user mode network stack, activate a built-in SMB
1920 server so that Windows OSes can access to the host files in @file{@var{dir}}
1921 transparently. The IP address of the SMB server can be set to @var{addr}. By
1922 default the 4th IP in the guest network is used, i.e. x.x.x.4.
1924 In the guest Windows OS, the line:
1925 @example
1926 10.0.2.4 smbserver
1927 @end example
1928 must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
1929 or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
1931 Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
1933 Note that a SAMBA server must be installed on the host OS.
1934 QEMU was tested successfully with smbd versions from Red Hat 9,
1935 Fedora Core 3 and OpenSUSE 11.x.
1937 @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
1938 Redirect incoming TCP or UDP connections to the host port @var{hostport} to
1939 the guest IP address @var{guestaddr} on guest port @var{guestport}. If
1940 @var{guestaddr} is not specified, its value is x.x.x.15 (default first address
1941 given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
1942 be bound to a specific host interface. If no connection type is set, TCP is
1943 used. This option can be given multiple times.
1945 For example, to redirect host X11 connection from screen 1 to guest
1946 screen 0, use the following:
1948 @example
1949 # on the host
1950 qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
1951 # this host xterm should open in the guest X11 server
1952 xterm -display :1
1953 @end example
1955 To redirect telnet connections from host port 5555 to telnet port on
1956 the guest, use the following:
1958 @example
1959 # on the host
1960 qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...]
1961 telnet localhost 5555
1962 @end example
1964 Then when you use on the host @code{telnet localhost 5555}, you
1965 connect to the guest telnet server.
1967 @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
1968 @itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
1969 Forward guest TCP connections to the IP address @var{server} on port @var{port}
1970 to the character device @var{dev} or to a program executed by @var{cmd:command}
1971 which gets spawned for each connection. This option can be given multiple times.
1973 You can either use a chardev directly and have that one used throughout QEMU's
1974 lifetime, like in the following example:
1976 @example
1977 # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
1978 # the guest accesses it
1979 qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...]
1980 @end example
1982 Or you can execute a command on every TCP connection established by the guest,
1983 so that QEMU behaves similar to an inetd process for that virtual server:
1985 @example
1986 # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
1987 # and connect the TCP stream to its stdin/stdout
1988 qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
1989 @end example
1991 @end table
1993 Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still
1994 processed and applied to -net user. Mixing them with the new configuration
1995 syntax gives undefined results. Their use for new applications is discouraged
1996 as they will be removed from future versions.
1998 @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
1999 @itemx -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
2000 Connect the host TAP network interface @var{name} to VLAN @var{n}.
2002 Use the network script @var{file} to configure it and the network script
2003 @var{dfile} to deconfigure it. If @var{name} is not provided, the OS
2004 automatically provides one. The default network configure script is
2005 @file{/etc/qemu-ifup} and the default network deconfigure script is
2006 @file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
2007 to disable script execution.
2009 If running QEMU as an unprivileged user, use the network helper
2010 @var{helper} to configure the TAP interface and attach it to the bridge.
2011 The default network helper executable is @file{/path/to/qemu-bridge-helper}
2012 and the default bridge device is @file{br0}.
2014 @option{fd}=@var{h} can be used to specify the handle of an already
2015 opened host TAP interface.
2017 Examples:
2019 @example
2020 #launch a QEMU instance with the default network script
2021 qemu-system-i386 linux.img -net nic -net tap
2022 @end example
2024 @example
2025 #launch a QEMU instance with two NICs, each one connected
2026 #to a TAP device
2027 qemu-system-i386 linux.img \
2028 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
2029 -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
2030 @end example
2032 @example
2033 #launch a QEMU instance with the default network helper to
2034 #connect a TAP device to bridge br0
2035 qemu-system-i386 linux.img \
2036 -net nic -net tap,"helper=/path/to/qemu-bridge-helper"
2037 @end example
2039 @item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
2040 @itemx -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}]
2041 Connect a host TAP network interface to a host bridge device.
2043 Use the network helper @var{helper} to configure the TAP interface and
2044 attach it to the bridge. The default network helper executable is
2045 @file{/path/to/qemu-bridge-helper} and the default bridge
2046 device is @file{br0}.
2048 Examples:
2050 @example
2051 #launch a QEMU instance with the default network helper to
2052 #connect a TAP device to bridge br0
2053 qemu-system-i386 linux.img -net bridge -net nic,model=virtio
2054 @end example
2056 @example
2057 #launch a QEMU instance with the default network helper to
2058 #connect a TAP device to bridge qemubr0
2059 qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio
2060 @end example
2062 @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
2063 @itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
2065 Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual
2066 machine using a TCP socket connection. If @option{listen} is
2067 specified, QEMU waits for incoming connections on @var{port}
2068 (@var{host} is optional). @option{connect} is used to connect to
2069 another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
2070 specifies an already opened TCP socket.
2072 Example:
2073 @example
2074 # launch a first QEMU instance
2075 qemu-system-i386 linux.img \
2076 -net nic,macaddr=52:54:00:12:34:56 \
2077 -net socket,listen=:1234
2078 # connect the VLAN 0 of this instance to the VLAN 0
2079 # of the first instance
2080 qemu-system-i386 linux.img \
2081 -net nic,macaddr=52:54:00:12:34:57 \
2082 -net socket,connect=127.0.0.1:1234
2083 @end example
2085 @item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
2086 @itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
2088 Create a VLAN @var{n} shared with another QEMU virtual
2089 machines using a UDP multicast socket, effectively making a bus for
2090 every QEMU with same multicast address @var{maddr} and @var{port}.
2091 NOTES:
2092 @enumerate
2093 @item
2094 Several QEMU can be running on different hosts and share same bus (assuming
2095 correct multicast setup for these hosts).
2096 @item
2097 mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
2098 @url{http://user-mode-linux.sf.net}.
2099 @item
2100 Use @option{fd=h} to specify an already opened UDP multicast socket.
2101 @end enumerate
2103 Example:
2104 @example
2105 # launch one QEMU instance
2106 qemu-system-i386 linux.img \
2107 -net nic,macaddr=52:54:00:12:34:56 \
2108 -net socket,mcast=230.0.0.1:1234
2109 # launch another QEMU instance on same "bus"
2110 qemu-system-i386 linux.img \
2111 -net nic,macaddr=52:54:00:12:34:57 \
2112 -net socket,mcast=230.0.0.1:1234
2113 # launch yet another QEMU instance on same "bus"
2114 qemu-system-i386 linux.img \
2115 -net nic,macaddr=52:54:00:12:34:58 \
2116 -net socket,mcast=230.0.0.1:1234
2117 @end example
2119 Example (User Mode Linux compat.):
2120 @example
2121 # launch QEMU instance (note mcast address selected
2122 # is UML's default)
2123 qemu-system-i386 linux.img \
2124 -net nic,macaddr=52:54:00:12:34:56 \
2125 -net socket,mcast=239.192.168.1:1102
2126 # launch UML
2127 /path/to/linux ubd0=/path/to/root_fs eth0=mcast
2128 @end example
2130 Example (send packets from host's 1.2.3.4):
2131 @example
2132 qemu-system-i386 linux.img \
2133 -net nic,macaddr=52:54:00:12:34:56 \
2134 -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4
2135 @end example
2137 @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}]
2138 @itemx -net l2tpv3[,vlan=@var{n}][,name=@var{name}],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}]
2139 Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular
2140 protocol to transport Ethernet (and other Layer 2) data frames between
2141 two systems. It is present in routers, firewalls and the Linux kernel
2142 (from version 3.3 onwards).
2144 This transport allows a VM to communicate to another VM, router or firewall directly.
2146 @item src=@var{srcaddr}
2147 source address (mandatory)
2148 @item dst=@var{dstaddr}
2149 destination address (mandatory)
2150 @item udp
2151 select udp encapsulation (default is ip).
2152 @item srcport=@var{srcport}
2153 source udp port.
2154 @item dstport=@var{dstport}
2155 destination udp port.
2156 @item ipv6
2157 force v6, otherwise defaults to v4.
2158 @item rxcookie=@var{rxcookie}
2159 @itemx txcookie=@var{txcookie}
2160 Cookies are a weak form of security in the l2tpv3 specification.
2161 Their function is mostly to prevent misconfiguration. By default they are 32
2162 bit.
2163 @item cookie64
2164 Set cookie size to 64 bit instead of the default 32
2165 @item counter=off
2166 Force a 'cut-down' L2TPv3 with no counter as in
2167 draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
2168 @item pincounter=on
2169 Work around broken counter handling in peer. This may also help on
2170 networks which have packet reorder.
2171 @item offset=@var{offset}
2172 Add an extra offset between header and data
2174 For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
2175 on the remote Linux host 1.2.3.4:
2176 @example
2177 # Setup tunnel on linux host using raw ip as encapsulation
2178 # on 1.2.3.4
2179 ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
2180 encap udp udp_sport 16384 udp_dport 16384
2181 ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
2182 0xFFFFFFFF peer_session_id 0xFFFFFFFF
2183 ifconfig vmtunnel0 mtu 1500
2184 ifconfig vmtunnel0 up
2185 brctl addif br-lan vmtunnel0
2188 # on 4.3.2.1
2189 # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
2191 qemu-system-i386 linux.img -net nic -net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
2194 @end example
2196 @item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
2197 @itemx -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
2198 Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and
2199 listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
2200 and MODE @var{octalmode} to change default ownership and permissions for
2201 communication port. This option is only available if QEMU has been compiled
2202 with vde support enabled.
2204 Example:
2205 @example
2206 # launch vde switch
2207 vde_switch -F -sock /tmp/myswitch
2208 # launch QEMU instance
2209 qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch
2210 @end example
2212 @item -netdev hubport,id=@var{id},hubid=@var{hubid}
2214 Create a hub port on QEMU "vlan" @var{hubid}.
2216 The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single
2217 netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the
2218 required hub automatically.
2220 @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
2222 Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
2223 be a unix domain socket backed one. The vhost-user uses a specifically defined
2224 protocol to pass vhost ioctl replacement messages to an application on the other
2225 end of the socket. On non-MSIX guests, the feature can be forced with
2226 @var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
2227 be created for multiqueue vhost-user.
2229 Example:
2230 @example
2231 qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
2232 -numa node,memdev=mem \
2233 -chardev socket,id=chr0,path=/path/to/socket \
2234 -netdev type=vhost-user,id=net0,chardev=chr0 \
2235 -device virtio-net-pci,netdev=net0
2236 @end example
2238 @item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}]
2239 Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default).
2240 At most @var{len} bytes (64k by default) per packet are stored. The file format is
2241 libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
2242 Note: For devices created with '-netdev', use '-object filter-dump,...' instead.
2244 @item -net none
2245 Indicate that no network devices should be configured. It is used to
2246 override the default configuration (@option{-net nic -net user}) which
2247 is activated if no @option{-net} options are provided.
2248 ETEXI
2250 STEXI
2251 @end table
2252 ETEXI
2253 DEFHEADING()
2255 DEFHEADING(Character device options)
2256 STEXI
2258 The general form of a character device option is:
2259 @table @option
2260 ETEXI
2262 DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
2263 "-chardev help\n"
2264 "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2265 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
2266 " [,server][,nowait][,telnet][,reconnect=seconds][,mux=on|off]\n"
2267 " [,logfile=PATH][,logappend=on|off][,tls-creds=ID] (tcp)\n"
2268 "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,reconnect=seconds]\n"
2269 " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
2270 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
2271 " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
2272 " [,logfile=PATH][,logappend=on|off]\n"
2273 "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2274 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
2275 " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2276 "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
2277 "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2278 "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2279 #ifdef _WIN32
2280 "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2281 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2282 #else
2283 "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2284 "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
2285 #endif
2286 #ifdef CONFIG_BRLAPI
2287 "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2288 #endif
2289 #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
2290 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
2291 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2292 "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2293 #endif
2294 #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
2295 "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2296 "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2297 #endif
2298 #if defined(CONFIG_SPICE)
2299 "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2300 "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2301 #endif
2302 , QEMU_ARCH_ALL
2305 STEXI
2306 @item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}]
2307 @findex -chardev
2308 Backend is one of:
2309 @option{null},
2310 @option{socket},
2311 @option{udp},
2312 @option{msmouse},
2313 @option{vc},
2314 @option{ringbuf},
2315 @option{file},
2316 @option{pipe},
2317 @option{console},
2318 @option{serial},
2319 @option{pty},
2320 @option{stdio},
2321 @option{braille},
2322 @option{tty},
2323 @option{parallel},
2324 @option{parport},
2325 @option{spicevmc}.
2326 @option{spiceport}.
2327 The specific backend will determine the applicable options.
2329 Use "-chardev help" to print all available chardev backend types.
2331 All devices must have an id, which can be any string up to 127 characters long.
2332 It is used to uniquely identify this device in other command line directives.
2334 A character device may be used in multiplexing mode by multiple front-ends.
2335 Specify @option{mux=on} to enable this mode.
2336 A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
2337 backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
2338 If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
2339 create a multiplexer with your specified ID, and you can then configure multiple
2340 front ends to use that chardev ID for their input/output. Up to four different
2341 front ends can be connected to a single multiplexed chardev. (Without
2342 multiplexing enabled, a chardev can only be used by a single front end.)
2343 For instance you could use this to allow a single stdio chardev to be used by
2344 two serial ports and the QEMU monitor:
2346 @example
2347 -chardev stdio,mux=on,id=char0 \
2348 -mon chardev=char0,mode=readline \
2349 -serial chardev:char0 \
2350 -serial chardev:char0
2351 @end example
2353 You can have more than one multiplexer in a system configuration; for instance
2354 you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
2355 multiplexed between the QEMU monitor and a parallel port:
2357 @example
2358 -chardev stdio,mux=on,id=char0 \
2359 -mon chardev=char0,mode=readline \
2360 -parallel chardev:char0 \
2361 -chardev tcp,...,mux=on,id=char1 \
2362 -serial chardev:char1 \
2363 -serial chardev:char1
2364 @end example
2366 When you're using a multiplexed character device, some escape sequences are
2367 interpreted in the input. @xref{mux_keys, Keys in the character backend
2368 multiplexer}.
2370 Note that some other command line options may implicitly create multiplexed
2371 character backends; for instance @option{-serial mon:stdio} creates a
2372 multiplexed stdio backend connected to the serial port and the QEMU monitor,
2373 and @option{-nographic} also multiplexes the console and the monitor to
2374 stdio.
2376 There is currently no support for multiplexing in the other direction
2377 (where a single QEMU front end takes input and output from multiple chardevs).
2379 Every backend supports the @option{logfile} option, which supplies the path
2380 to a file to record all data transmitted via the backend. The @option{logappend}
2381 option controls whether the log file will be truncated or appended to when
2382 opened.
2384 Further options to each backend are described below.
2386 @item -chardev null ,id=@var{id}
2387 A void device. This device will not emit any data, and will drop any data it
2388 receives. The null backend does not take any options.
2390 @item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] [,reconnect=@var{seconds}] [,tls-creds=@var{id}]
2392 Create a two-way stream socket, which can be either a TCP or a unix socket. A
2393 unix socket will be created if @option{path} is specified. Behaviour is
2394 undefined if TCP options are specified for a unix socket.
2396 @option{server} specifies that the socket shall be a listening socket.
2398 @option{nowait} specifies that QEMU should not block waiting for a client to
2399 connect to a listening socket.
2401 @option{telnet} specifies that traffic on the socket should interpret telnet
2402 escape sequences.
2404 @option{reconnect} sets the timeout for reconnecting on non-server sockets when
2405 the remote end goes away. qemu will delay this many seconds and then attempt
2406 to reconnect. Zero disables reconnecting, and is the default.
2408 @option{tls-creds} requests enablement of the TLS protocol for encryption,
2409 and specifies the id of the TLS credentials to use for the handshake. The
2410 credentials must be previously created with the @option{-object tls-creds}
2411 argument.
2413 TCP and unix socket options are given below:
2415 @table @option
2417 @item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay]
2419 @option{host} for a listening socket specifies the local address to be bound.
2420 For a connecting socket species the remote host to connect to. @option{host} is
2421 optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
2423 @option{port} for a listening socket specifies the local port to be bound. For a
2424 connecting socket specifies the port on the remote host to connect to.
2425 @option{port} can be given as either a port number or a service name.
2426 @option{port} is required.
2428 @option{to} is only relevant to listening sockets. If it is specified, and
2429 @option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
2430 to and including @option{to} until it succeeds. @option{to} must be specified
2431 as a port number.
2433 @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2434 If neither is specified the socket may use either protocol.
2436 @option{nodelay} disables the Nagle algorithm.
2438 @item unix options: path=@var{path}
2440 @option{path} specifies the local path of the unix socket. @option{path} is
2441 required.
2443 @end table
2445 @item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6]
2447 Sends all traffic from the guest to a remote host over UDP.
2449 @option{host} specifies the remote host to connect to. If not specified it
2450 defaults to @code{localhost}.
2452 @option{port} specifies the port on the remote host to connect to. @option{port}
2453 is required.
2455 @option{localaddr} specifies the local address to bind to. If not specified it
2456 defaults to @code{0.0.0.0}.
2458 @option{localport} specifies the local port to bind to. If not specified any
2459 available local port will be used.
2461 @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2462 If neither is specified the device may use either protocol.
2464 @item -chardev msmouse ,id=@var{id}
2466 Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
2467 take any options.
2469 @item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]]
2471 Connect to a QEMU text console. @option{vc} may optionally be given a specific
2472 size.
2474 @option{width} and @option{height} specify the width and height respectively of
2475 the console, in pixels.
2477 @option{cols} and @option{rows} specify that the console be sized to fit a text
2478 console with the given dimensions.
2480 @item -chardev ringbuf ,id=@var{id} [,size=@var{size}]
2482 Create a ring buffer with fixed size @option{size}.
2483 @var{size} must be a power of two and defaults to @code{64K}.
2485 @item -chardev file ,id=@var{id} ,path=@var{path}
2487 Log all traffic received from the guest to a file.
2489 @option{path} specifies the path of the file to be opened. This file will be
2490 created if it does not already exist, and overwritten if it does. @option{path}
2491 is required.
2493 @item -chardev pipe ,id=@var{id} ,path=@var{path}
2495 Create a two-way connection to the guest. The behaviour differs slightly between
2496 Windows hosts and other hosts:
2498 On Windows, a single duplex pipe will be created at
2499 @file{\\.pipe\@option{path}}.
2501 On other hosts, 2 pipes will be created called @file{@option{path}.in} and
2502 @file{@option{path}.out}. Data written to @file{@option{path}.in} will be
2503 received by the guest. Data written by the guest can be read from
2504 @file{@option{path}.out}. QEMU will not create these fifos, and requires them to
2505 be present.
2507 @option{path} forms part of the pipe path as described above. @option{path} is
2508 required.
2510 @item -chardev console ,id=@var{id}
2512 Send traffic from the guest to QEMU's standard output. @option{console} does not
2513 take any options.
2515 @option{console} is only available on Windows hosts.
2517 @item -chardev serial ,id=@var{id} ,path=@option{path}
2519 Send traffic from the guest to a serial device on the host.
2521 On Unix hosts serial will actually accept any tty device,
2522 not only serial lines.
2524 @option{path} specifies the name of the serial device to open.
2526 @item -chardev pty ,id=@var{id}
2528 Create a new pseudo-terminal on the host and connect to it. @option{pty} does
2529 not take any options.
2531 @option{pty} is not available on Windows hosts.
2533 @item -chardev stdio ,id=@var{id} [,signal=on|off]
2534 Connect to standard input and standard output of the QEMU process.
2536 @option{signal} controls if signals are enabled on the terminal, that includes
2537 exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
2538 default, use @option{signal=off} to disable it.
2540 @item -chardev braille ,id=@var{id}
2542 Connect to a local BrlAPI server. @option{braille} does not take any options.
2544 @item -chardev tty ,id=@var{id} ,path=@var{path}
2546 @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
2547 DragonFlyBSD hosts. It is an alias for @option{serial}.
2549 @option{path} specifies the path to the tty. @option{path} is required.
2551 @item -chardev parallel ,id=@var{id} ,path=@var{path}
2552 @itemx -chardev parport ,id=@var{id} ,path=@var{path}
2554 @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
2556 Connect to a local parallel port.
2558 @option{path} specifies the path to the parallel port device. @option{path} is
2559 required.
2561 @item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2563 @option{spicevmc} is only available when spice support is built in.
2565 @option{debug} debug level for spicevmc
2567 @option{name} name of spice channel to connect to
2569 Connect to a spice virtual machine channel, such as vdiport.
2571 @item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2573 @option{spiceport} is only available when spice support is built in.
2575 @option{debug} debug level for spicevmc
2577 @option{name} name of spice port to connect to
2579 Connect to a spice port, allowing a Spice client to handle the traffic
2580 identified by a name (preferably a fqdn).
2581 ETEXI
2583 STEXI
2584 @end table
2585 ETEXI
2586 DEFHEADING()
2588 DEFHEADING(Device URL Syntax)
2589 STEXI
2591 In addition to using normal file images for the emulated storage devices,
2592 QEMU can also use networked resources such as iSCSI devices. These are
2593 specified using a special URL syntax.
2595 @table @option
2596 @item iSCSI
2597 iSCSI support allows QEMU to access iSCSI resources directly and use as
2598 images for the guest storage. Both disk and cdrom images are supported.
2600 Syntax for specifying iSCSI LUNs is
2601 ``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
2603 By default qemu will use the iSCSI initiator-name
2604 'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command
2605 line or a configuration file.
2607 Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect
2608 stalled requests and force a reestablishment of the session. The timeout
2609 is specified in seconds. The default is 0 which means no timeout. Libiscsi
2610 1.15.0 or greater is required for this feature.
2612 Example (without authentication):
2613 @example
2614 qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
2615 -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
2616 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
2617 @end example
2619 Example (CHAP username/password via URL):
2620 @example
2621 qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
2622 @end example
2624 Example (CHAP username/password via environment variables):
2625 @example
2626 LIBISCSI_CHAP_USERNAME="user" \
2627 LIBISCSI_CHAP_PASSWORD="password" \
2628 qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
2629 @end example
2631 iSCSI support is an optional feature of QEMU and only available when
2632 compiled and linked against libiscsi.
2633 ETEXI
2634 DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2635 "-iscsi [user=user][,password=password]\n"
2636 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
2637 " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
2638 " [,timeout=timeout]\n"
2639 " iSCSI session parameters\n", QEMU_ARCH_ALL)
2640 STEXI
2642 iSCSI parameters such as username and password can also be specified via
2643 a configuration file. See qemu-doc for more information and examples.
2645 @item NBD
2646 QEMU supports NBD (Network Block Devices) both using TCP protocol as well
2647 as Unix Domain Sockets.
2649 Syntax for specifying a NBD device using TCP
2650 ``nbd:<server-ip>:<port>[:exportname=<export>]''
2652 Syntax for specifying a NBD device using Unix Domain Sockets
2653 ``nbd:unix:<domain-socket>[:exportname=<export>]''
2656 Example for TCP
2657 @example
2658 qemu-system-i386 --drive file=nbd:192.0.2.1:30000
2659 @end example
2661 Example for Unix Domain Sockets
2662 @example
2663 qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket
2664 @end example
2666 @item SSH
2667 QEMU supports SSH (Secure Shell) access to remote disks.
2669 Examples:
2670 @example
2671 qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img
2672 qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
2673 @end example
2675 Currently authentication must be done using ssh-agent. Other
2676 authentication methods may be supported in future.
2678 @item Sheepdog
2679 Sheepdog is a distributed storage system for QEMU.
2680 QEMU supports using either local sheepdog devices or remote networked
2681 devices.
2683 Syntax for specifying a sheepdog device
2684 @example
2685 sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
2686 @end example
2688 Example
2689 @example
2690 qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
2691 @end example
2693 See also @url{https://sheepdog.github.io/sheepdog/}.
2695 @item GlusterFS
2696 GlusterFS is a user space distributed file system.
2697 QEMU supports the use of GlusterFS volumes for hosting VM disk images using
2698 TCP, Unix Domain Sockets and RDMA transport protocols.
2700 Syntax for specifying a VM disk image on GlusterFS volume is
2701 @example
2703 URI:
2704 gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
2706 JSON:
2707 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":N,"logfile":"...",
2708 @ "server":[@{"type":"tcp","host":"...","port":"..."@},
2709 @ @{"type":"unix","socket":"..."@}]@}@}'
2710 @end example
2713 Example
2714 @example
2715 URI:
2716 qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,
2717 @ file.debug=9,file.logfile=/var/log/qemu-gluster.log
2719 JSON:
2720 qemu-system-x86_64 'json:@{"driver":"qcow2",
2721 @ "file":@{"driver":"gluster",
2722 @ "volume":"testvol","path":"a.img",
2723 @ "debug":9,"logfile":"/var/log/qemu-gluster.log",
2724 @ "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},
2725 @ @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}'
2726 qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
2727 @ file.debug=9,file.logfile=/var/log/qemu-gluster.log,
2728 @ file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
2729 @ file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
2730 @end example
2732 See also @url{http://www.gluster.org}.
2734 @item HTTP/HTTPS/FTP/FTPS
2735 QEMU supports read-only access to files accessed over http(s) and ftp(s).
2737 Syntax using a single filename:
2738 @example
2739 <protocol>://[<username>[:<password>]@@]<host>/<path>
2740 @end example
2742 where:
2743 @table @option
2744 @item protocol
2745 'http', 'https', 'ftp', or 'ftps'.
2747 @item username
2748 Optional username for authentication to the remote server.
2750 @item password
2751 Optional password for authentication to the remote server.
2753 @item host
2754 Address of the remote server.
2756 @item path
2757 Path on the remote server, including any query string.
2758 @end table
2760 The following options are also supported:
2761 @table @option
2762 @item url
2763 The full URL when passing options to the driver explicitly.
2765 @item readahead
2766 The amount of data to read ahead with each range request to the remote server.
2767 This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
2768 does not have a suffix, it will be assumed to be in bytes. The value must be a
2769 multiple of 512 bytes. It defaults to 256k.
2771 @item sslverify
2772 Whether to verify the remote server's certificate when connecting over SSL. It
2773 can have the value 'on' or 'off'. It defaults to 'on'.
2775 @item cookie
2776 Send this cookie (it can also be a list of cookies separated by ';') with
2777 each outgoing request. Only supported when using protocols such as HTTP
2778 which support cookies, otherwise ignored.
2780 @item timeout
2781 Set the timeout in seconds of the CURL connection. This timeout is the time
2782 that CURL waits for a response from the remote server to get the size of the
2783 image to be downloaded. If not set, the default timeout of 5 seconds is used.
2784 @end table
2786 Note that when passing options to qemu explicitly, @option{driver} is the value
2787 of <protocol>.
2789 Example: boot from a remote Fedora 20 live ISO image
2790 @example
2791 qemu-system-x86_64 --drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
2793 qemu-system-x86_64 --drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
2794 @end example
2796 Example: boot from a remote Fedora 20 cloud image using a local overlay for
2797 writes, copy-on-read, and a readahead of 64k
2798 @example
2799 qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
2801 qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
2802 @end example
2804 Example: boot from an image stored on a VMware vSphere server with a self-signed
2805 certificate using a local overlay for writes, a readahead of 64k and a timeout
2806 of 10 seconds.
2807 @example
2808 qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2
2810 qemu-system-x86_64 -drive file=/tmp/test.qcow2
2811 @end example
2812 ETEXI
2814 STEXI
2815 @end table
2816 ETEXI
2818 DEFHEADING(Bluetooth(R) options)
2819 STEXI
2820 @table @option
2821 ETEXI
2823 DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
2824 "-bt hci,null dumb bluetooth HCI - doesn't respond to commands\n" \
2825 "-bt hci,host[:id]\n" \
2826 " use host's HCI with the given name\n" \
2827 "-bt hci[,vlan=n]\n" \
2828 " emulate a standard HCI in virtual scatternet 'n'\n" \
2829 "-bt vhci[,vlan=n]\n" \
2830 " add host computer to virtual scatternet 'n' using VHCI\n" \
2831 "-bt device:dev[,vlan=n]\n" \
2832 " emulate a bluetooth device 'dev' in scatternet 'n'\n",
2833 QEMU_ARCH_ALL)
2834 STEXI
2835 @item -bt hci[...]
2836 @findex -bt
2837 Defines the function of the corresponding Bluetooth HCI. -bt options
2838 are matched with the HCIs present in the chosen machine type. For
2839 example when emulating a machine with only one HCI built into it, only
2840 the first @code{-bt hci[...]} option is valid and defines the HCI's
2841 logic. The Transport Layer is decided by the machine type. Currently
2842 the machines @code{n800} and @code{n810} have one HCI and all other
2843 machines have none.
2845 @anchor{bt-hcis}
2846 The following three types are recognized:
2848 @table @option
2849 @item -bt hci,null
2850 (default) The corresponding Bluetooth HCI assumes no internal logic
2851 and will not respond to any HCI commands or emit events.
2853 @item -bt hci,host[:@var{id}]
2854 (@code{bluez} only) The corresponding HCI passes commands / events
2855 to / from the physical HCI identified by the name @var{id} (default:
2856 @code{hci0}) on the computer running QEMU. Only available on @code{bluez}
2857 capable systems like Linux.
2859 @item -bt hci[,vlan=@var{n}]
2860 Add a virtual, standard HCI that will participate in the Bluetooth
2861 scatternet @var{n} (default @code{0}). Similarly to @option{-net}
2862 VLANs, devices inside a bluetooth network @var{n} can only communicate
2863 with other devices in the same network (scatternet).
2864 @end table
2866 @item -bt vhci[,vlan=@var{n}]
2867 (Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
2868 to the host bluetooth stack instead of to the emulated target. This
2869 allows the host and target machines to participate in a common scatternet
2870 and communicate. Requires the Linux @code{vhci} driver installed. Can
2871 be used as following:
2873 @example
2874 qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
2875 @end example
2877 @item -bt device:@var{dev}[,vlan=@var{n}]
2878 Emulate a bluetooth device @var{dev} and place it in network @var{n}
2879 (default @code{0}). QEMU can only emulate one type of bluetooth devices
2880 currently:
2882 @table @option
2883 @item keyboard
2884 Virtual wireless keyboard implementing the HIDP bluetooth profile.
2885 @end table
2886 ETEXI
2888 STEXI
2889 @end table
2890 ETEXI
2891 DEFHEADING()
2893 #ifdef CONFIG_TPM
2894 DEFHEADING(TPM device options)
2896 DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
2897 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
2898 " use path to provide path to a character device; default is /dev/tpm0\n"
2899 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
2900 " not provided it will be searched for in /sys/class/misc/tpm?/device\n",
2901 QEMU_ARCH_ALL)
2902 STEXI
2904 The general form of a TPM device option is:
2905 @table @option
2907 @item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
2908 @findex -tpmdev
2909 Backend type must be:
2910 @option{passthrough}.
2912 The specific backend type will determine the applicable options.
2913 The @code{-tpmdev} option creates the TPM backend and requires a
2914 @code{-device} option that specifies the TPM frontend interface model.
2916 Options to each backend are described below.
2918 Use 'help' to print all available TPM backend types.
2919 @example
2920 qemu -tpmdev help
2921 @end example
2923 @item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path}
2925 (Linux-host only) Enable access to the host's TPM using the passthrough
2926 driver.
2928 @option{path} specifies the path to the host's TPM device, i.e., on
2929 a Linux host this would be @code{/dev/tpm0}.
2930 @option{path} is optional and by default @code{/dev/tpm0} is used.
2932 @option{cancel-path} specifies the path to the host TPM device's sysfs
2933 entry allowing for cancellation of an ongoing TPM command.
2934 @option{cancel-path} is optional and by default QEMU will search for the
2935 sysfs entry to use.
2937 Some notes about using the host's TPM with the passthrough driver:
2939 The TPM device accessed by the passthrough driver must not be
2940 used by any other application on the host.
2942 Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
2943 the VM's firmware (BIOS/UEFI) will not be able to initialize the
2944 TPM again and may therefore not show a TPM-specific menu that would
2945 otherwise allow the user to configure the TPM, e.g., allow the user to
2946 enable/disable or activate/deactivate the TPM.
2947 Further, if TPM ownership is released from within a VM then the host's TPM
2948 will get disabled and deactivated. To enable and activate the
2949 TPM again afterwards, the host has to be rebooted and the user is
2950 required to enter the firmware's menu to enable and activate the TPM.
2951 If the TPM is left disabled and/or deactivated most TPM commands will fail.
2953 To create a passthrough TPM use the following two options:
2954 @example
2955 -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
2956 @end example
2957 Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
2958 @code{tpmdev=tpm0} in the device option.
2960 @end table
2962 ETEXI
2964 DEFHEADING()
2966 #endif
2968 DEFHEADING(Linux/Multiboot boot specific)
2969 STEXI
2971 When using these options, you can use a given Linux or Multiboot
2972 kernel without installing it in the disk image. It can be useful
2973 for easier testing of various kernels.
2975 @table @option
2976 ETEXI
2978 DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
2979 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
2980 STEXI
2981 @item -kernel @var{bzImage}
2982 @findex -kernel
2983 Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
2984 or in multiboot format.
2985 ETEXI
2987 DEF("append", HAS_ARG, QEMU_OPTION_append, \
2988 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
2989 STEXI
2990 @item -append @var{cmdline}
2991 @findex -append
2992 Use @var{cmdline} as kernel command line
2993 ETEXI
2995 DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
2996 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
2997 STEXI
2998 @item -initrd @var{file}
2999 @findex -initrd
3000 Use @var{file} as initial ram disk.
3002 @item -initrd "@var{file1} arg=foo,@var{file2}"
3004 This syntax is only available with multiboot.
3006 Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
3007 first module.
3008 ETEXI
3010 DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
3011 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
3012 STEXI
3013 @item -dtb @var{file}
3014 @findex -dtb
3015 Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
3016 on boot.
3017 ETEXI
3019 STEXI
3020 @end table
3021 ETEXI
3022 DEFHEADING()
3024 DEFHEADING(Debug/Expert options)
3025 STEXI
3026 @table @option
3027 ETEXI
3029 DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
3030 "-fw_cfg [name=]<name>,file=<file>\n"
3031 " add named fw_cfg entry with contents from file\n"
3032 "-fw_cfg [name=]<name>,string=<str>\n"
3033 " add named fw_cfg entry with contents from string\n",
3034 QEMU_ARCH_ALL)
3035 STEXI
3037 @item -fw_cfg [name=]@var{name},file=@var{file}
3038 @findex -fw_cfg
3039 Add named fw_cfg entry with contents from file @var{file}.
3041 @item -fw_cfg [name=]@var{name},string=@var{str}
3042 Add named fw_cfg entry with contents from string @var{str}.
3044 The terminating NUL character of the contents of @var{str} will not be
3045 included as part of the fw_cfg item data. To insert contents with
3046 embedded NUL characters, you have to use the @var{file} parameter.
3048 The fw_cfg entries are passed by QEMU through to the guest.
3050 Example:
3051 @example
3052 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
3053 @end example
3054 creates an fw_cfg entry named opt/com.mycompany/blob with contents
3055 from ./my_blob.bin.
3057 ETEXI
3059 DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
3060 "-serial dev redirect the serial port to char device 'dev'\n",
3061 QEMU_ARCH_ALL)
3062 STEXI
3063 @item -serial @var{dev}
3064 @findex -serial
3065 Redirect the virtual serial port to host character device
3066 @var{dev}. The default device is @code{vc} in graphical mode and
3067 @code{stdio} in non graphical mode.
3069 This option can be used several times to simulate up to 4 serial
3070 ports.
3072 Use @code{-serial none} to disable all serial ports.
3074 Available character devices are:
3075 @table @option
3076 @item vc[:@var{W}x@var{H}]
3077 Virtual console. Optionally, a width and height can be given in pixel with
3078 @example
3079 vc:800x600
3080 @end example
3081 It is also possible to specify width or height in characters:
3082 @example
3083 vc:80Cx24C
3084 @end example
3085 @item pty
3086 [Linux only] Pseudo TTY (a new PTY is automatically allocated)
3087 @item none
3088 No device is allocated.
3089 @item null
3090 void device
3091 @item chardev:@var{id}
3092 Use a named character device defined with the @code{-chardev} option.
3093 @item /dev/XXX
3094 [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
3095 parameters are set according to the emulated ones.
3096 @item /dev/parport@var{N}
3097 [Linux only, parallel port only] Use host parallel port
3098 @var{N}. Currently SPP and EPP parallel port features can be used.
3099 @item file:@var{filename}
3100 Write output to @var{filename}. No character can be read.
3101 @item stdio
3102 [Unix only] standard input/output
3103 @item pipe:@var{filename}
3104 name pipe @var{filename}
3105 @item COM@var{n}
3106 [Windows only] Use host serial port @var{n}
3107 @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
3108 This implements UDP Net Console.
3109 When @var{remote_host} or @var{src_ip} are not specified
3110 they default to @code{0.0.0.0}.
3111 When not using a specified @var{src_port} a random port is automatically chosen.
3113 If you just want a simple readonly console you can use @code{netcat} or
3114 @code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
3115 @code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
3116 will appear in the netconsole session.
3118 If you plan to send characters back via netconsole or you want to stop
3119 and start QEMU a lot of times, you should have QEMU use the same
3120 source port each time by using something like @code{-serial
3121 udp::4555@@:4556} to QEMU. Another approach is to use a patched
3122 version of netcat which can listen to a TCP port and send and receive
3123 characters via udp. If you have a patched version of netcat which
3124 activates telnet remote echo and single char transfer, then you can
3125 use the following options to set up a netcat redirector to allow
3126 telnet on port 5555 to access the QEMU port.
3127 @table @code
3128 @item QEMU Options:
3129 -serial udp::4555@@:4556
3130 @item netcat options:
3131 -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
3132 @item telnet options:
3133 localhost 5555
3134 @end table
3136 @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
3137 The TCP Net Console has two modes of operation. It can send the serial
3138 I/O to a location or wait for a connection from a location. By default
3139 the TCP Net Console is sent to @var{host} at the @var{port}. If you use
3140 the @var{server} option QEMU will wait for a client socket application
3141 to connect to the port before continuing, unless the @code{nowait}
3142 option was specified. The @code{nodelay} option disables the Nagle buffering
3143 algorithm. The @code{reconnect} option only applies if @var{noserver} is
3144 set, if the connection goes down it will attempt to reconnect at the
3145 given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only
3146 one TCP connection at a time is accepted. You can use @code{telnet} to
3147 connect to the corresponding character device.
3148 @table @code
3149 @item Example to send tcp console to 192.168.0.2 port 4444
3150 -serial tcp:192.168.0.2:4444
3151 @item Example to listen and wait on port 4444 for connection
3152 -serial tcp::4444,server
3153 @item Example to not wait and listen on ip 192.168.0.100 port 4444
3154 -serial tcp:192.168.0.100:4444,server,nowait
3155 @end table
3157 @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
3158 The telnet protocol is used instead of raw tcp sockets. The options
3159 work the same as if you had specified @code{-serial tcp}. The
3160 difference is that the port acts like a telnet server or client using
3161 telnet option negotiation. This will also allow you to send the
3162 MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
3163 sequence. Typically in unix telnet you do it with Control-] and then
3164 type "send break" followed by pressing the enter key.
3166 @item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
3167 A unix domain socket is used instead of a tcp socket. The option works the
3168 same as if you had specified @code{-serial tcp} except the unix domain socket
3169 @var{path} is used for connections.
3171 @item mon:@var{dev_string}
3172 This is a special option to allow the monitor to be multiplexed onto
3173 another serial port. The monitor is accessed with key sequence of
3174 @key{Control-a} and then pressing @key{c}.
3175 @var{dev_string} should be any one of the serial devices specified
3176 above. An example to multiplex the monitor onto a telnet server
3177 listening on port 4444 would be:
3178 @table @code
3179 @item -serial mon:telnet::4444,server,nowait
3180 @end table
3181 When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
3182 QEMU any more but will be passed to the guest instead.
3184 @item braille
3185 Braille device. This will use BrlAPI to display the braille output on a real
3186 or fake device.
3188 @item msmouse
3189 Three button serial mouse. Configure the guest to use Microsoft protocol.
3190 @end table
3191 ETEXI
3193 DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
3194 "-parallel dev redirect the parallel port to char device 'dev'\n",
3195 QEMU_ARCH_ALL)
3196 STEXI
3197 @item -parallel @var{dev}
3198 @findex -parallel
3199 Redirect the virtual parallel port to host device @var{dev} (same
3200 devices as the serial port). On Linux hosts, @file{/dev/parportN} can
3201 be used to use hardware devices connected on the corresponding host
3202 parallel port.
3204 This option can be used several times to simulate up to 3 parallel
3205 ports.
3207 Use @code{-parallel none} to disable all parallel ports.
3208 ETEXI
3210 DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
3211 "-monitor dev redirect the monitor to char device 'dev'\n",
3212 QEMU_ARCH_ALL)
3213 STEXI
3214 @item -monitor @var{dev}
3215 @findex -monitor
3216 Redirect the monitor to host device @var{dev} (same devices as the
3217 serial port).
3218 The default device is @code{vc} in graphical mode and @code{stdio} in
3219 non graphical mode.
3220 Use @code{-monitor none} to disable the default monitor.
3221 ETEXI
3222 DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
3223 "-qmp dev like -monitor but opens in 'control' mode\n",
3224 QEMU_ARCH_ALL)
3225 STEXI
3226 @item -qmp @var{dev}
3227 @findex -qmp
3228 Like -monitor but opens in 'control' mode.
3229 ETEXI
3230 DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
3231 "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
3232 QEMU_ARCH_ALL)
3233 STEXI
3234 @item -qmp-pretty @var{dev}
3235 @findex -qmp-pretty
3236 Like -qmp but uses pretty JSON formatting.
3237 ETEXI
3239 DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
3240 "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
3241 STEXI
3242 @item -mon [chardev=]name[,mode=readline|control]
3243 @findex -mon
3244 Setup monitor on chardev @var{name}.
3245 ETEXI
3247 DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
3248 "-debugcon dev redirect the debug console to char device 'dev'\n",
3249 QEMU_ARCH_ALL)
3250 STEXI
3251 @item -debugcon @var{dev}
3252 @findex -debugcon
3253 Redirect the debug console to host device @var{dev} (same devices as the
3254 serial port). The debug console is an I/O port which is typically port
3255 0xe9; writing to that I/O port sends output to this device.
3256 The default device is @code{vc} in graphical mode and @code{stdio} in
3257 non graphical mode.
3258 ETEXI
3260 DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
3261 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
3262 STEXI
3263 @item -pidfile @var{file}
3264 @findex -pidfile
3265 Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
3266 from a script.
3267 ETEXI
3269 DEF("singlestep", 0, QEMU_OPTION_singlestep, \
3270 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
3271 STEXI
3272 @item -singlestep
3273 @findex -singlestep
3274 Run the emulation in single step mode.
3275 ETEXI
3277 DEF("S", 0, QEMU_OPTION_S, \
3278 "-S freeze CPU at startup (use 'c' to start execution)\n",
3279 QEMU_ARCH_ALL)
3280 STEXI
3281 @item -S
3282 @findex -S
3283 Do not start CPU at startup (you must type 'c' in the monitor).
3284 ETEXI
3286 DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
3287 "-realtime [mlock=on|off]\n"
3288 " run qemu with realtime features\n"
3289 " mlock=on|off controls mlock support (default: on)\n",
3290 QEMU_ARCH_ALL)
3291 STEXI
3292 @item -realtime mlock=on|off
3293 @findex -realtime
3294 Run qemu with realtime features.
3295 mlocking qemu and guest memory can be enabled via @option{mlock=on}
3296 (enabled by default).
3297 ETEXI
3299 DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
3300 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
3301 STEXI
3302 @item -gdb @var{dev}
3303 @findex -gdb
3304 Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
3305 connections will likely be TCP-based, but also UDP, pseudo TTY, or even
3306 stdio are reasonable use case. The latter is allowing to start QEMU from
3307 within gdb and establish the connection via a pipe:
3308 @example
3309 (gdb) target remote | exec qemu-system-i386 -gdb stdio ...
3310 @end example
3311 ETEXI
3313 DEF("s", 0, QEMU_OPTION_s, \
3314 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
3315 QEMU_ARCH_ALL)
3316 STEXI
3317 @item -s
3318 @findex -s
3319 Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
3320 (@pxref{gdb_usage}).
3321 ETEXI
3323 DEF("d", HAS_ARG, QEMU_OPTION_d, \
3324 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
3325 QEMU_ARCH_ALL)
3326 STEXI
3327 @item -d @var{item1}[,...]
3328 @findex -d
3329 Enable logging of specified items. Use '-d help' for a list of log items.
3330 ETEXI
3332 DEF("D", HAS_ARG, QEMU_OPTION_D, \
3333 "-D logfile output log to logfile (default stderr)\n",
3334 QEMU_ARCH_ALL)
3335 STEXI
3336 @item -D @var{logfile}
3337 @findex -D
3338 Output log in @var{logfile} instead of to stderr
3339 ETEXI
3341 DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
3342 "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
3343 QEMU_ARCH_ALL)
3344 STEXI
3345 @item -dfilter @var{range1}[,...]
3346 @findex -dfilter
3347 Filter debug output to that relevant to a range of target addresses. The filter
3348 spec can be either @var{start}+@var{size}, @var{start}-@var{size} or
3349 @var{start}..@var{end} where @var{start} @var{end} and @var{size} are the
3350 addresses and sizes required. For example:
3351 @example
3352 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
3353 @end example
3354 Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
3355 the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
3356 block starting at 0xffffffc00005f000.
3357 ETEXI
3359 DEF("L", HAS_ARG, QEMU_OPTION_L, \
3360 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
3361 QEMU_ARCH_ALL)
3362 STEXI
3363 @item -L @var{path}
3364 @findex -L
3365 Set the directory for the BIOS, VGA BIOS and keymaps.
3367 To list all the data directories, use @code{-L help}.
3368 ETEXI
3370 DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
3371 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
3372 STEXI
3373 @item -bios @var{file}
3374 @findex -bios
3375 Set the filename for the BIOS.
3376 ETEXI
3378 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
3379 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
3380 STEXI
3381 @item -enable-kvm
3382 @findex -enable-kvm
3383 Enable KVM full virtualization support. This option is only available
3384 if KVM support is enabled when compiling.
3385 ETEXI
3387 DEF("enable-hax", 0, QEMU_OPTION_enable_hax, \
3388 "-enable-hax enable HAX virtualization support\n", QEMU_ARCH_I386)
3389 STEXI
3390 @item -enable-hax
3391 @findex -enable-hax
3392 Enable HAX (Hardware-based Acceleration eXecution) support. This option
3393 is only available if HAX support is enabled when compiling. HAX is only
3394 applicable to MAC and Windows platform, and thus does not conflict with
3395 KVM.
3396 ETEXI
3398 DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
3399 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
3400 DEF("xen-create", 0, QEMU_OPTION_xen_create,
3401 "-xen-create create domain using xen hypercalls, bypassing xend\n"
3402 " warning: should not be used when xend is in use\n",
3403 QEMU_ARCH_ALL)
3404 DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
3405 "-xen-attach attach to existing xen domain\n"
3406 " xend will use this when starting QEMU\n",
3407 QEMU_ARCH_ALL)
3408 DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
3409 "-xen-domid-restrict restrict set of available xen operations\n"
3410 " to specified domain id. (Does not affect\n"
3411 " xenpv machine type).\n",
3412 QEMU_ARCH_ALL)
3413 STEXI
3414 @item -xen-domid @var{id}
3415 @findex -xen-domid
3416 Specify xen guest domain @var{id} (XEN only).
3417 @item -xen-create
3418 @findex -xen-create
3419 Create domain using xen hypercalls, bypassing xend.
3420 Warning: should not be used when xend is in use (XEN only).
3421 @item -xen-attach
3422 @findex -xen-attach
3423 Attach to existing xen domain.
3424 xend will use this when starting QEMU (XEN only).
3425 @findex -xen-domid-restrict
3426 Restrict set of available xen operations to specified domain id (XEN only).
3427 ETEXI
3429 DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
3430 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
3431 STEXI
3432 @item -no-reboot
3433 @findex -no-reboot
3434 Exit instead of rebooting.
3435 ETEXI
3437 DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
3438 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
3439 STEXI
3440 @item -no-shutdown
3441 @findex -no-shutdown
3442 Don't exit QEMU on guest shutdown, but instead only stop the emulation.
3443 This allows for instance switching to monitor to commit changes to the
3444 disk image.
3445 ETEXI
3447 DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
3448 "-loadvm [tag|id]\n" \
3449 " start right away with a saved state (loadvm in monitor)\n",
3450 QEMU_ARCH_ALL)
3451 STEXI
3452 @item -loadvm @var{file}
3453 @findex -loadvm
3454 Start right away with a saved state (@code{loadvm} in monitor)
3455 ETEXI
3457 #ifndef _WIN32
3458 DEF("daemonize", 0, QEMU_OPTION_daemonize, \
3459 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
3460 #endif
3461 STEXI
3462 @item -daemonize
3463 @findex -daemonize
3464 Daemonize the QEMU process after initialization. QEMU will not detach from
3465 standard IO until it is ready to receive connections on any of its devices.
3466 This option is a useful way for external programs to launch QEMU without having
3467 to cope with initialization race conditions.
3468 ETEXI
3470 DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
3471 "-option-rom rom load a file, rom, into the option ROM space\n",
3472 QEMU_ARCH_ALL)
3473 STEXI
3474 @item -option-rom @var{file}
3475 @findex -option-rom
3476 Load the contents of @var{file} as an option ROM.
3477 This option is useful to load things like EtherBoot.
3478 ETEXI
3480 HXCOMM Silently ignored for compatibility
3481 DEF("clock", HAS_ARG, QEMU_OPTION_clock, "", QEMU_ARCH_ALL)
3483 HXCOMM Options deprecated by -rtc
3484 DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL)
3485 DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL)
3487 DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
3488 "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \
3489 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
3490 QEMU_ARCH_ALL)
3492 STEXI
3494 @item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew]
3495 @findex -rtc
3496 Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
3497 UTC or local time, respectively. @code{localtime} is required for correct date in
3498 MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the
3499 format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
3501 By default the RTC is driven by the host system time. This allows using of the
3502 RTC as accurate reference clock inside the guest, specifically if the host
3503 time is smoothly following an accurate external reference clock, e.g. via NTP.
3504 If you want to isolate the guest time from the host, you can set @option{clock}
3505 to @code{rt} instead. To even prevent it from progressing during suspension,
3506 you can set it to @code{vm}.
3508 Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
3509 specifically with Windows' ACPI HAL. This option will try to figure out how
3510 many timer interrupts were not processed by the Windows guest and will
3511 re-inject them.
3512 ETEXI
3514 DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
3515 "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
3516 " enable virtual instruction counter with 2^N clock ticks per\n" \
3517 " instruction, enable aligning the host and virtual clocks\n" \
3518 " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
3519 STEXI
3520 @item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
3521 @findex -icount
3522 Enable virtual instruction counter. The virtual cpu will execute one
3523 instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
3524 then the virtual cpu speed will be automatically adjusted to keep virtual
3525 time within a few seconds of real time.
3527 When the virtual cpu is sleeping, the virtual time will advance at default
3528 speed unless @option{sleep=on|off} is specified.
3529 With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
3530 instantly whenever the virtual cpu goes to sleep mode and will not advance
3531 if no timer is enabled. This behavior give deterministic execution times from
3532 the guest point of view.
3534 Note that while this option can give deterministic behavior, it does not
3535 provide cycle accurate emulation. Modern CPUs contain superscalar out of
3536 order cores with complex cache hierarchies. The number of instructions
3537 executed often has little or no correlation with actual performance.
3539 @option{align=on} will activate the delay algorithm which will try
3540 to synchronise the host clock and the virtual clock. The goal is to
3541 have a guest running at the real frequency imposed by the shift option.
3542 Whenever the guest clock is behind the host clock and if
3543 @option{align=on} is specified then we print a message to the user
3544 to inform about the delay.
3545 Currently this option does not work when @option{shift} is @code{auto}.
3546 Note: The sync algorithm will work for those shift values for which
3547 the guest clock runs ahead of the host clock. Typically this happens
3548 when the shift value is high (how high depends on the host machine).
3550 When @option{rr} option is specified deterministic record/replay is enabled.
3551 Replay log is written into @var{filename} file in record mode and
3552 read from this file in replay mode.
3554 Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
3555 at the start of execution recording. In replay mode this option is used
3556 to load the initial VM state.
3557 ETEXI
3559 DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
3560 "-watchdog model\n" \
3561 " enable virtual hardware watchdog [default=none]\n",
3562 QEMU_ARCH_ALL)
3563 STEXI
3564 @item -watchdog @var{model}
3565 @findex -watchdog
3566 Create a virtual hardware watchdog device. Once enabled (by a guest
3567 action), the watchdog must be periodically polled by an agent inside
3568 the guest or else the guest will be restarted. Choose a model for
3569 which your guest has drivers.
3571 The @var{model} is the model of hardware watchdog to emulate. Use
3572 @code{-watchdog help} to list available hardware models. Only one
3573 watchdog can be enabled for a guest.
3575 The following models may be available:
3576 @table @option
3577 @item ib700
3578 iBASE 700 is a very simple ISA watchdog with a single timer.
3579 @item i6300esb
3580 Intel 6300ESB I/O controller hub is a much more featureful PCI-based
3581 dual-timer watchdog.
3582 @item diag288
3583 A virtual watchdog for s390x backed by the diagnose 288 hypercall
3584 (currently KVM only).
3585 @end table
3586 ETEXI
3588 DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
3589 "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \
3590 " action when watchdog fires [default=reset]\n",
3591 QEMU_ARCH_ALL)
3592 STEXI
3593 @item -watchdog-action @var{action}
3594 @findex -watchdog-action
3596 The @var{action} controls what QEMU will do when the watchdog timer
3597 expires.
3598 The default is
3599 @code{reset} (forcefully reset the guest).
3600 Other possible actions are:
3601 @code{shutdown} (attempt to gracefully shutdown the guest),
3602 @code{poweroff} (forcefully poweroff the guest),
3603 @code{pause} (pause the guest),
3604 @code{debug} (print a debug message and continue), or
3605 @code{none} (do nothing).
3607 Note that the @code{shutdown} action requires that the guest responds
3608 to ACPI signals, which it may not be able to do in the sort of
3609 situations where the watchdog would have expired, and thus
3610 @code{-watchdog-action shutdown} is not recommended for production use.
3612 Examples:
3614 @table @code
3615 @item -watchdog i6300esb -watchdog-action pause
3616 @itemx -watchdog ib700
3617 @end table
3618 ETEXI
3620 DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
3621 "-echr chr set terminal escape character instead of ctrl-a\n",
3622 QEMU_ARCH_ALL)
3623 STEXI
3625 @item -echr @var{numeric_ascii_value}
3626 @findex -echr
3627 Change the escape character used for switching to the monitor when using
3628 monitor and serial sharing. The default is @code{0x01} when using the
3629 @code{-nographic} option. @code{0x01} is equal to pressing
3630 @code{Control-a}. You can select a different character from the ascii
3631 control keys where 1 through 26 map to Control-a through Control-z. For
3632 instance you could use the either of the following to change the escape
3633 character to Control-t.
3634 @table @code
3635 @item -echr 0x14
3636 @itemx -echr 20
3637 @end table
3638 ETEXI
3640 DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \
3641 "-virtioconsole c\n" \
3642 " set virtio console\n", QEMU_ARCH_ALL)
3643 STEXI
3644 @item -virtioconsole @var{c}
3645 @findex -virtioconsole
3646 Set virtio console.
3648 This option is maintained for backward compatibility.
3650 Please use @code{-device virtconsole} for the new way of invocation.
3651 ETEXI
3653 DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
3654 "-show-cursor show cursor\n", QEMU_ARCH_ALL)
3655 STEXI
3656 @item -show-cursor
3657 @findex -show-cursor
3658 Show cursor.
3659 ETEXI
3661 DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
3662 "-tb-size n set TB size\n", QEMU_ARCH_ALL)
3663 STEXI
3664 @item -tb-size @var{n}
3665 @findex -tb-size
3666 Set TB size.
3667 ETEXI
3669 DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
3670 "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
3671 "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
3672 "-incoming unix:socketpath\n" \
3673 " prepare for incoming migration, listen on\n" \
3674 " specified protocol and socket address\n" \
3675 "-incoming fd:fd\n" \
3676 "-incoming exec:cmdline\n" \
3677 " accept incoming migration on given file descriptor\n" \
3678 " or from given external command\n" \
3679 "-incoming defer\n" \
3680 " wait for the URI to be specified via migrate_incoming\n",
3681 QEMU_ARCH_ALL)
3682 STEXI
3683 @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
3684 @itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
3685 @findex -incoming
3686 Prepare for incoming migration, listen on a given tcp port.
3688 @item -incoming unix:@var{socketpath}
3689 Prepare for incoming migration, listen on a given unix socket.
3691 @item -incoming fd:@var{fd}
3692 Accept incoming migration from a given filedescriptor.
3694 @item -incoming exec:@var{cmdline}
3695 Accept incoming migration as an output from specified external command.
3697 @item -incoming defer
3698 Wait for the URI to be specified via migrate_incoming. The monitor can
3699 be used to change settings (such as migration parameters) prior to issuing
3700 the migrate_incoming to allow the migration to begin.
3701 ETEXI
3703 DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
3704 "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
3705 STEXI
3706 @item -only-migratable
3707 @findex -only-migratable
3708 Only allow migratable devices. Devices will not be allowed to enter an
3709 unmigratable state.
3710 ETEXI
3712 DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
3713 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
3714 STEXI
3715 @item -nodefaults
3716 @findex -nodefaults
3717 Don't create default devices. Normally, QEMU sets the default devices like serial
3718 port, parallel port, virtual console, monitor device, VGA adapter, floppy and
3719 CD-ROM drive and others. The @code{-nodefaults} option will disable all those
3720 default devices.
3721 ETEXI
3723 #ifndef _WIN32
3724 DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
3725 "-chroot dir chroot to dir just before starting the VM\n",
3726 QEMU_ARCH_ALL)
3727 #endif
3728 STEXI
3729 @item -chroot @var{dir}
3730 @findex -chroot
3731 Immediately before starting guest execution, chroot to the specified
3732 directory. Especially useful in combination with -runas.
3733 ETEXI
3735 #ifndef _WIN32
3736 DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
3737 "-runas user change to user id user just before starting the VM\n",
3738 QEMU_ARCH_ALL)
3739 #endif
3740 STEXI
3741 @item -runas @var{user}
3742 @findex -runas
3743 Immediately before starting guest execution, drop root privileges, switching
3744 to the specified user.
3745 ETEXI
3747 DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
3748 "-prom-env variable=value\n"
3749 " set OpenBIOS nvram variables\n",
3750 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
3751 STEXI
3752 @item -prom-env @var{variable}=@var{value}
3753 @findex -prom-env
3754 Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
3755 ETEXI
3756 DEF("semihosting", 0, QEMU_OPTION_semihosting,
3757 "-semihosting semihosting mode\n",
3758 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3759 QEMU_ARCH_MIPS)
3760 STEXI
3761 @item -semihosting
3762 @findex -semihosting
3763 Enable semihosting mode (ARM, M68K, Xtensa, MIPS only).
3764 ETEXI
3765 DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
3766 "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\n" \
3767 " semihosting configuration\n",
3768 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3769 QEMU_ARCH_MIPS)
3770 STEXI
3771 @item -semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]
3772 @findex -semihosting-config
3773 Enable and configure semihosting (ARM, M68K, Xtensa, MIPS only).
3774 @table @option
3775 @item target=@code{native|gdb|auto}
3776 Defines where the semihosting calls will be addressed, to QEMU (@code{native})
3777 or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
3778 during debug sessions and @code{native} otherwise.
3779 @item arg=@var{str1},arg=@var{str2},...
3780 Allows the user to pass input arguments, and can be used multiple times to build
3781 up a list. The old-style @code{-kernel}/@code{-append} method of passing a
3782 command line is still supported for backward compatibility. If both the
3783 @code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
3784 specified, the former is passed to semihosting as it always takes precedence.
3785 @end table
3786 ETEXI
3787 DEF("old-param", 0, QEMU_OPTION_old_param,
3788 "-old-param old param mode\n", QEMU_ARCH_ARM)
3789 STEXI
3790 @item -old-param
3791 @findex -old-param (ARM)
3792 Old param mode (ARM only).
3793 ETEXI
3795 DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
3796 "-sandbox <arg> Enable seccomp mode 2 system call filter (default 'off').\n",
3797 QEMU_ARCH_ALL)
3798 STEXI
3799 @item -sandbox @var{arg}
3800 @findex -sandbox
3801 Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
3802 disable it. The default is 'off'.
3803 ETEXI
3805 DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
3806 "-readconfig <file>\n", QEMU_ARCH_ALL)
3807 STEXI
3808 @item -readconfig @var{file}
3809 @findex -readconfig
3810 Read device configuration from @var{file}. This approach is useful when you want to spawn
3811 QEMU process with many command line options but you don't want to exceed the command line
3812 character limit.
3813 ETEXI
3814 DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
3815 "-writeconfig <file>\n"
3816 " read/write config file\n", QEMU_ARCH_ALL)
3817 STEXI
3818 @item -writeconfig @var{file}
3819 @findex -writeconfig
3820 Write device configuration to @var{file}. The @var{file} can be either filename to save
3821 command line and device configuration into file or dash @code{-}) character to print the
3822 output to stdout. This can be later used as input file for @code{-readconfig} option.
3823 ETEXI
3824 DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
3825 "-nodefconfig\n"
3826 " do not load default config files at startup\n",
3827 QEMU_ARCH_ALL)
3828 STEXI
3829 @item -nodefconfig
3830 @findex -nodefconfig
3831 Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
3832 The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
3833 ETEXI
3834 DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
3835 "-no-user-config\n"
3836 " do not load user-provided config files at startup\n",
3837 QEMU_ARCH_ALL)
3838 STEXI
3839 @item -no-user-config
3840 @findex -no-user-config
3841 The @code{-no-user-config} option makes QEMU not load any of the user-provided
3842 config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
3843 files from @var{datadir}.
3844 ETEXI
3845 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
3846 "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
3847 " specify tracing options\n",
3848 QEMU_ARCH_ALL)
3849 STEXI
3850 HXCOMM This line is not accurate, as some sub-options are backend-specific but
3851 HXCOMM HX does not support conditional compilation of text.
3852 @item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
3853 @findex -trace
3854 @include qemu-option-trace.texi
3855 ETEXI
3857 HXCOMM Internal use
3858 DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
3859 DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
3861 #ifdef __linux__
3862 DEF("enable-fips", 0, QEMU_OPTION_enablefips,
3863 "-enable-fips enable FIPS 140-2 compliance\n",
3864 QEMU_ARCH_ALL)
3865 #endif
3866 STEXI
3867 @item -enable-fips
3868 @findex -enable-fips
3869 Enable FIPS 140-2 compliance mode.
3870 ETEXI
3872 HXCOMM Deprecated by -machine accel=tcg property
3873 DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
3875 HXCOMM Deprecated by kvm-pit driver properties
3876 DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
3877 "", QEMU_ARCH_I386)
3879 HXCOMM Deprecated (ignored)
3880 DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
3882 HXCOMM Deprecated by -machine kernel_irqchip=on|off property
3883 DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
3885 HXCOMM Deprecated (ignored)
3886 DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
3888 DEF("msg", HAS_ARG, QEMU_OPTION_msg,
3889 "-msg timestamp[=on|off]\n"
3890 " change the format of messages\n"
3891 " on|off controls leading timestamps (default:on)\n",
3892 QEMU_ARCH_ALL)
3893 STEXI
3894 @item -msg timestamp[=on|off]
3895 @findex -msg
3896 prepend a timestamp to each log message.(default:on)
3897 ETEXI
3899 DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
3900 "-dump-vmstate <file>\n"
3901 " Output vmstate information in JSON format to file.\n"
3902 " Use the scripts/vmstate-static-checker.py file to\n"
3903 " check for possible regressions in migration code\n"
3904 " by comparing two such vmstate dumps.\n",
3905 QEMU_ARCH_ALL)
3906 STEXI
3907 @item -dump-vmstate @var{file}
3908 @findex -dump-vmstate
3909 Dump json-encoded vmstate information for current machine type to file
3910 in @var{file}
3911 ETEXI
3913 STEXI
3914 @end table
3915 ETEXI
3916 DEFHEADING()
3917 DEFHEADING(Generic object creation)
3918 STEXI
3919 @table @option
3920 ETEXI
3922 DEF("object", HAS_ARG, QEMU_OPTION_object,
3923 "-object TYPENAME[,PROP1=VALUE1,...]\n"
3924 " create a new object of type TYPENAME setting properties\n"
3925 " in the order they are specified. Note that the 'id'\n"
3926 " property must be set. These objects are placed in the\n"
3927 " '/objects' path.\n",
3928 QEMU_ARCH_ALL)
3929 STEXI
3930 @item -object @var{typename}[,@var{prop1}=@var{value1},...]
3931 @findex -object
3932 Create a new object of type @var{typename} setting properties
3933 in the order they are specified. Note that the 'id'
3934 property must be set. These objects are placed in the
3935 '/objects' path.
3937 @table @option
3939 @item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off}
3941 Creates a memory file backend object, which can be used to back
3942 the guest RAM with huge pages. The @option{id} parameter is a
3943 unique ID that will be used to reference this memory region
3944 when configuring the @option{-numa} argument. The @option{size}
3945 option provides the size of the memory region, and accepts
3946 common suffixes, eg @option{500M}. The @option{mem-path} provides
3947 the path to either a shared memory or huge page filesystem mount.
3948 The @option{share} boolean option determines whether the memory
3949 region is marked as private to QEMU, or shared. The latter allows
3950 a co-operating external process to access the QEMU memory region.
3952 @item -object rng-random,id=@var{id},filename=@var{/dev/random}
3954 Creates a random number generator backend which obtains entropy from
3955 a device on the host. The @option{id} parameter is a unique ID that
3956 will be used to reference this entropy backend from the @option{virtio-rng}
3957 device. The @option{filename} parameter specifies which file to obtain
3958 entropy from and if omitted defaults to @option{/dev/random}.
3960 @item -object rng-egd,id=@var{id},chardev=@var{chardevid}
3962 Creates a random number generator backend which obtains entropy from
3963 an external daemon running on the host. The @option{id} parameter is
3964 a unique ID that will be used to reference this entropy backend from
3965 the @option{virtio-rng} device. The @option{chardev} parameter is
3966 the unique ID of a character device backend that provides the connection
3967 to the RNG daemon.
3969 @item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
3971 Creates a TLS anonymous credentials object, which can be used to provide
3972 TLS support on network backends. The @option{id} parameter is a unique
3973 ID which network backends will use to access the credentials. The
3974 @option{endpoint} is either @option{server} or @option{client} depending
3975 on whether the QEMU network backend that uses the credentials will be
3976 acting as a client or as a server. If @option{verify-peer} is enabled
3977 (the default) then once the handshake is completed, the peer credentials
3978 will be verified, though this is a no-op for anonymous credentials.
3980 The @var{dir} parameter tells QEMU where to find the credential
3981 files. For server endpoints, this directory may contain a file
3982 @var{dh-params.pem} providing diffie-hellman parameters to use
3983 for the TLS server. If the file is missing, QEMU will generate
3984 a set of DH parameters at startup. This is a computationally
3985 expensive operation that consumes random pool entropy, so it is
3986 recommended that a persistent set of parameters be generated
3987 upfront and saved.
3989 @item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off},passwordid=@var{id}
3991 Creates a TLS anonymous credentials object, which can be used to provide
3992 TLS support on network backends. The @option{id} parameter is a unique
3993 ID which network backends will use to access the credentials. The
3994 @option{endpoint} is either @option{server} or @option{client} depending
3995 on whether the QEMU network backend that uses the credentials will be
3996 acting as a client or as a server. If @option{verify-peer} is enabled
3997 (the default) then once the handshake is completed, the peer credentials
3998 will be verified. With x509 certificates, this implies that the clients
3999 must be provided with valid client certificates too.
4001 The @var{dir} parameter tells QEMU where to find the credential
4002 files. For server endpoints, this directory may contain a file
4003 @var{dh-params.pem} providing diffie-hellman parameters to use
4004 for the TLS server. If the file is missing, QEMU will generate
4005 a set of DH parameters at startup. This is a computationally
4006 expensive operation that consumes random pool entropy, so it is
4007 recommended that a persistent set of parameters be generated
4008 upfront and saved.
4010 For x509 certificate credentials the directory will contain further files
4011 providing the x509 certificates. The certificates must be stored
4012 in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
4013 @var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
4014 @var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
4016 For the @var{server-key.pem} and @var{client-key.pem} files which
4017 contain sensitive private keys, it is possible to use an encrypted
4018 version by providing the @var{passwordid} parameter. This provides
4019 the ID of a previously created @code{secret} object containing the
4020 password for decryption.
4022 @item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}]
4024 Interval @var{t} can't be 0, this filter batches the packet delivery: all
4025 packets arriving in a given interval on netdev @var{netdevid} are delayed
4026 until the end of the interval. Interval is in microseconds.
4027 @option{status} is optional that indicate whether the netfilter is
4028 on (enabled) or off (disabled), the default status for netfilter will be 'on'.
4030 queue @var{all|rx|tx} is an option that can be applied to any netfilter.
4032 @option{all}: the filter is attached both to the receive and the transmit
4033 queue of the netdev (default).
4035 @option{rx}: the filter is attached to the receive queue of the netdev,
4036 where it will receive packets sent to the netdev.
4038 @option{tx}: the filter is attached to the transmit queue of the netdev,
4039 where it will receive packets sent by the netdev.
4041 @item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
4043 filter-mirror on netdev @var{netdevid},mirror net packet to chardev
4044 @var{chardevid}
4046 @item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},
4047 outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
4049 filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
4050 @var{chardevid},and redirect indev's packet to filter.
4051 Create a filter-redirector we need to differ outdev id from indev id, id can not
4052 be the same. we can just use indev or outdev, but at least one of indev or outdev
4053 need to be specified.
4055 @item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},rewriter-mode=@var{mode}[,queue=@var{all|rx|tx}]
4057 Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
4058 secondary from primary to keep secondary tcp connection,and rewrite
4059 tcp packet to primary from secondary make tcp packet can be handled by
4060 client.
4062 usage:
4063 colo secondary:
4064 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4065 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4066 -object filter-rewriter,id=rew0,netdev=hn0,queue=all
4068 @item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
4070 Dump the network traffic on netdev @var{dev} to the file specified by
4071 @var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
4072 The file format is libpcap, so it can be analyzed with tools such as tcpdump
4073 or Wireshark.
4075 @item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},
4076 outdev=@var{chardevid}
4078 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
4079 secondary packet. If the packets are same, we will output primary
4080 packet to outdev@var{chardevid}, else we will notify colo-frame
4081 do checkpoint and send primary packet to outdev@var{chardevid}.
4083 we must use it with the help of filter-mirror and filter-redirector.
4085 @example
4087 primary:
4088 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
4089 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
4090 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
4091 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
4092 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
4093 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
4094 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
4095 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
4096 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
4097 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
4098 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
4099 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
4101 secondary:
4102 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
4103 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
4104 -chardev socket,id=red0,host=3.3.3.3,port=9003
4105 -chardev socket,id=red1,host=3.3.3.3,port=9004
4106 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4107 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4109 @end example
4111 If you want to know the detail of above command line, you can read
4112 the colo-compare git log.
4114 @item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
4116 Creates a cryptodev backend which executes crypto opreation from
4117 the QEMU cipher APIS. The @var{id} parameter is
4118 a unique ID that will be used to reference this cryptodev backend from
4119 the @option{virtio-crypto} device. The @var{queues} parameter is optional,
4120 which specify the queue number of cryptodev backend, the default of
4121 @var{queues} is 1.
4123 @example
4125 # qemu-system-x86_64 \
4126 [...] \
4127 -object cryptodev-backend-builtin,id=cryptodev0 \
4128 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
4129 [...]
4130 @end example
4132 @item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4133 @item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4135 Defines a secret to store a password, encryption key, or some other sensitive
4136 data. The sensitive data can either be passed directly via the @var{data}
4137 parameter, or indirectly via the @var{file} parameter. Using the @var{data}
4138 parameter is insecure unless the sensitive data is encrypted.
4140 The sensitive data can be provided in raw format (the default), or base64.
4141 When encoded as JSON, the raw format only supports valid UTF-8 characters,
4142 so base64 is recommended for sending binary data. QEMU will convert from
4143 which ever format is provided to the format it needs internally. eg, an
4144 RBD password can be provided in raw format, even though it will be base64
4145 encoded when passed onto the RBD sever.
4147 For added protection, it is possible to encrypt the data associated with
4148 a secret using the AES-256-CBC cipher. Use of encryption is indicated
4149 by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
4150 parameter provides the ID of a previously defined secret that contains
4151 the AES-256 decryption key. This key should be 32-bytes long and be
4152 base64 encoded. The @var{iv} parameter provides the random initialization
4153 vector used for encryption of this particular secret and should be a
4154 base64 encrypted string of the 16-byte IV.
4156 The simplest (insecure) usage is to provide the secret inline
4158 @example
4160 # $QEMU -object secret,id=sec0,data=letmein,format=raw
4162 @end example
4164 The simplest secure usage is to provide the secret via a file
4166 # echo -n "letmein" > mypasswd.txt
4167 # $QEMU -object secret,id=sec0,file=mypasswd.txt,format=raw
4169 For greater security, AES-256-CBC should be used. To illustrate usage,
4170 consider the openssl command line tool which can encrypt the data. Note
4171 that when encrypting, the plaintext must be padded to the cipher block
4172 size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
4174 First a master key needs to be created in base64 encoding:
4176 @example
4177 # openssl rand -base64 32 > key.b64
4178 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
4179 @end example
4181 Each secret to be encrypted needs to have a random initialization vector
4182 generated. These do not need to be kept secret
4184 @example
4185 # openssl rand -base64 16 > iv.b64
4186 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
4187 @end example
4189 The secret to be defined can now be encrypted, in this case we're
4190 telling openssl to base64 encode the result, but it could be left
4191 as raw bytes if desired.
4193 @example
4194 # SECRET=$(echo -n "letmein" |
4195 openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
4196 @end example
4198 When launching QEMU, create a master secret pointing to @code{key.b64}
4199 and specify that to be used to decrypt the user password. Pass the
4200 contents of @code{iv.b64} to the second secret
4202 @example
4203 # $QEMU \
4204 -object secret,id=secmaster0,format=base64,file=key.b64 \
4205 -object secret,id=sec0,keyid=secmaster0,format=base64,\
4206 data=$SECRET,iv=$(<iv.b64)
4207 @end example
4209 @end table
4211 ETEXI
4214 HXCOMM This is the last statement. Insert new options before this line!
4215 STEXI
4216 @end table
4217 ETEXI