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