]> git.proxmox.com Git - mirror_qemu.git/blame - qemu-options.hx
target/i386/cpu.h: declare TCG_GUEST_DEFAULT_MO
[mirror_qemu.git] / qemu-options.hx
CommitLineData
5824d651
BS
1HXCOMM Use DEFHEADING() to define headings in both help text and texi
2HXCOMM Text between STEXI and ETEXI are copied to texi version and
3HXCOMM discarded from C version
ad96090a
BS
4HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
5HXCOMM construct option structures, enums and help message for specified
6HXCOMM architectures.
5824d651
BS
7HXCOMM HXCOMM can be used for comments, discarded from both texi and C
8
43f187a5 9DEFHEADING(Standard options)
5824d651
BS
10STEXI
11@table @option
12ETEXI
13
14DEF("help", 0, QEMU_OPTION_h,
ad96090a 15 "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
5824d651
BS
16STEXI
17@item -h
6616b2ad 18@findex -h
5824d651
BS
19Display help and exit
20ETEXI
21
9bd7e6d9 22DEF("version", 0, QEMU_OPTION_version,
ad96090a 23 "-version display version information and exit\n", QEMU_ARCH_ALL)
9bd7e6d9
PB
24STEXI
25@item -version
6616b2ad 26@findex -version
9bd7e6d9
PB
27Display version information and exit
28ETEXI
29
80f52a66
JK
30DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
31 "-machine [type=]name[,prop[=value][,...]]\n"
585f6036 32 " selects emulated machine ('-machine help' for list)\n"
80f52a66 33 " property accel=accel1[:accel2[:...]] selects accelerator\n"
6a48ffaa 34 " supported accelerators are kvm, xen, tcg (default: tcg)\n"
32c18a2d 35 " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
d1048bef 36 " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
96404013 37 " kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
8490fc78 38 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
a52a7fdf 39 " mem-merge=on|off controls memory merge support (default: on)\n"
79814179 40 " igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
2eb1cd07 41 " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
9850c604 42 " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
87252e1b 43 " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
902c053d
GK
44 " nvdimm=on|off controls NVDIMM support (default=off)\n"
45 " enforce-config-section=on|off enforce configuration section migration (default=off)\n",
80f52a66 46 QEMU_ARCH_ALL)
5824d651 47STEXI
80f52a66
JK
48@item -machine [type=]@var{name}[,prop=@var{value}[,...]]
49@findex -machine
585f6036 50Select the emulated machine by @var{name}. Use @code{-machine help} to list
80f52a66
JK
51available machines. Supported machine properties are:
52@table @option
53@item accel=@var{accels1}[:@var{accels2}[:...]]
54This is used to enable an accelerator. Depending on the target architecture,
55kvm, xen, or tcg can be available. By default, tcg is used. If there is more
56than one accelerator specified, the next one is used if the previous one fails
57to initialize.
6a48ffaa 58@item kernel_irqchip=on|off
32c18a2d 59Controls in-kernel irqchip support for the chosen accelerator when available.
79814179
TC
60@item gfx_passthru=on|off
61Enables IGD GFX passthrough support for the chosen machine when available.
d1048bef
DS
62@item vmport=on|off|auto
63Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
64value based on accel. For accel=xen the default is off otherwise the default
65is on.
39d6960a
JK
66@item kvm_shadow_mem=size
67Defines the size of the KVM shadow MMU.
ddb97f1d
JB
68@item dump-guest-core=on|off
69Include guest memory in a core dump. The default is on.
8490fc78
LC
70@item mem-merge=on|off
71Enables or disables memory merge support. This feature, when supported by
72the host, de-duplicates identical memory pages among VMs instances
73(enabled by default).
2eb1cd07
TK
74@item aes-key-wrap=on|off
75Enables or disables AES key wrapping support on s390-ccw hosts. This feature
76controls whether AES wrapping keys will be created to allow
77execution of AES cryptographic functions. The default is on.
78@item dea-key-wrap=on|off
79Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
80controls whether DEA wrapping keys will be created to allow
81execution of DEA cryptographic functions. The default is on.
87252e1b
XG
82@item nvdimm=on|off
83Enables or disables NVDIMM support. The default is off.
80f52a66 84@end table
5824d651
BS
85ETEXI
86
80f52a66
JK
87HXCOMM Deprecated by -machine
88DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
89
5824d651 90DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
585f6036 91 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
5824d651
BS
92STEXI
93@item -cpu @var{model}
6616b2ad 94@findex -cpu
585f6036 95Select CPU model (@code{-cpu help} for list and additional feature selection)
5824d651
BS
96ETEXI
97
8d4e9146
FK
98DEF("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)
102STEXI
103@item -accel @var{name}[,prop=@var{value}[,...]]
104@findex -accel
105This is used to enable an accelerator. Depending on the target architecture,
106kvm, xen, or tcg can be available. By default, tcg is used. If there is more
107than one accelerator specified, the next one is used if the previous one fails
108to initialize.
109@table @option
110@item thread=single|multi
111Controls number of TCG threads. When the TCG is multi-threaded there will be one
112thread per vCPU therefor taking advantage of additional host cores. The default
113is to enable multi-threading where both the back-end and front-ends support it and
114no incompatible TCG features have been enabled (e.g. icount/replay).
115@end table
116ETEXI
117
5824d651 118DEF("smp", HAS_ARG, QEMU_OPTION_smp,
12b7f57e 119 "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
6be68d7e
JS
120 " set the number of CPUs to 'n' [default=1]\n"
121 " maxcpus= maximum number of total cpus, including\n"
ca1a8a06 122 " offline CPUs for hotplug, etc\n"
58a04db1
AP
123 " cores= number of CPU cores on one socket\n"
124 " threads= number of threads on one CPU core\n"
ad96090a
BS
125 " sockets= number of discrete sockets in the system\n",
126 QEMU_ARCH_ALL)
5824d651 127STEXI
12b7f57e 128@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
6616b2ad 129@findex -smp
5824d651
BS
130Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
131CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
132to 4.
58a04db1
AP
133For the PC target, the number of @var{cores} per socket, the number
134of @var{threads} per cores and the total number of @var{sockets} can be
135specified. Missing values will be computed. If any on the three values is
136given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
137specifies the maximum number of hotpluggable CPUs.
5824d651
BS
138ETEXI
139
268a362c 140DEF("numa", HAS_ARG, QEMU_OPTION_numa,
e0ee9fd0
EH
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)
268a362c 143STEXI
e0ee9fd0
EH
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}]
6616b2ad 146@findex -numa
4b9a5dd7
EH
147Define a NUMA node and assign RAM and VCPUs to it.
148
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
152set of VCPUs can be represented by providing multiple @samp{cpus}
153options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
154split between them.
155
156For example, the following option assigns VCPUs 0, 1, 2 and 5 to
157a NUMA node:
158@example
159-numa node,cpus=0-2,cpus=5
160@end example
161
162@samp{mem} assigns a given RAM amount to a node. @samp{memdev}
163assigns RAM from a given memory backend device to a node. If
164@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
165split equally between them.
166
167@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
168if one node uses @samp{memdev}, all of them have to use it.
169
170Note that the -@option{numa} option doesn't allocate any of the
171specified resources, it just assigns existing resources to NUMA
172nodes. This means that one still has to use the @option{-m},
173@option{-smp} options to allocate RAM and VCPUs respectively.
174
268a362c
AL
175ETEXI
176
587ed6be
CB
177DEF("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)
180STEXI
181@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
182@findex -add-fd
183
184Add a file descriptor to an fd set. Valid options are:
185
186@table @option
187@item fd=@var{fd}
188This option defines the file descriptor of which a duplicate is added to fd set.
189The file descriptor cannot be stdin, stdout, or stderr.
190@item set=@var{set}
191This option defines the ID of the fd set to add the file descriptor to.
192@item opaque=@var{opaque}
193This option defines a free-form string that can be used to describe @var{fd}.
194@end table
195
196You can open an image using pre-opened file descriptors from an fd set:
197@example
198qemu-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
203ETEXI
204
6616b2ad
SW
205DEF("set", HAS_ARG, QEMU_OPTION_set,
206 "-set group.id.arg=value\n"
207 " set <arg> parameter for item <id> of type <group>\n"
ad96090a 208 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
6616b2ad 209STEXI
6265c43b 210@item -set @var{group}.@var{id}.@var{arg}=@var{value}
6616b2ad 211@findex -set
e1f3b974 212Set parameter @var{arg} for item @var{id} of type @var{group}
6616b2ad
SW
213ETEXI
214
215DEF("global", HAS_ARG, QEMU_OPTION_global,
3751d7c4
PB
216 "-global driver.property=value\n"
217 "-global driver=driver,property=property,value=value\n"
ad96090a
BS
218 " set a global default for a driver property\n",
219 QEMU_ARCH_ALL)
6616b2ad 220STEXI
3017b72c 221@item -global @var{driver}.@var{prop}=@var{value}
3751d7c4 222@itemx -global driver=@var{driver},property=@var{property},value=@var{value}
6616b2ad 223@findex -global
3017b72c
MR
224Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
225
226@example
3804da9d 227qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
3017b72c
MR
228@end example
229
230In particular, you can use this to set driver properties for devices which are
231created automatically by the machine model. To create a device which is not
232created automatically and set properties on it, use -@option{device}.
3751d7c4 233
ae08fd5a
MA
234-global @var{driver}.@var{prop}=@var{value} is shorthand for -global
235driver=@var{driver},property=@var{prop},value=@var{value}. The
236longhand syntax works even when @var{driver} contains a dot.
6616b2ad
SW
237ETEXI
238
5824d651 239DEF("boot", HAS_ARG, QEMU_OPTION_boot,
2221dde5 240 "-boot [order=drives][,once=drives][,menu=on|off]\n"
c8a6ae8b 241 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
3d3b8303
WX
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"
ac05f349
AK
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",
ad96090a 246 QEMU_ARCH_ALL)
5824d651 247STEXI
c8a6ae8b 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]
6616b2ad 249@findex -boot
2221dde5 250Specify boot order @var{drives} as a string of drive letters. Valid
d274e07c 251drive letters depend on the target architecture. The x86 PC uses: a, b
2221dde5
JK
252(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
253from network adapter 1-4), hard disk boot is the default. To apply a
254particular boot order only on the first startup, specify it via
255@option{once}.
256
257Interactive boot menus/prompts can be enabled via @option{menu=on} as far
258as firmware/BIOS supports them. The default is non-interactive boot.
259
3d3b8303
WX
260A splash picture could be passed to bios, enabling user to show it as logo,
261when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
262supports them. Currently Seabios for X86 system support it.
263limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
264format(true color). The resolution should be supported by the SVGA mode, so
265the recommended is 320x240, 640x480, 800x640.
266
ac05f349
AK
267A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
268when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
269reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
270system support it.
271
c8a6ae8b
AK
272Do strict boot via @option{strict=on} as far as firmware/BIOS
273supports it. This only effects when boot priority is changed by
274bootindex options. The default is non-strict boot.
275
2221dde5
JK
276@example
277# try to boot from network first, then from hard disk
3804da9d 278qemu-system-i386 -boot order=nc
2221dde5 279# boot from CD-ROM first, switch back to default order after reboot
3804da9d 280qemu-system-i386 -boot once=d
3d3b8303 281# boot with a splash picture for 5 seconds.
3804da9d 282qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
2221dde5
JK
283@end example
284
285Note: The legacy format '-boot @var{drives}' is still supported but its
286use is discouraged as it may be removed from future versions.
5824d651
BS
287ETEXI
288
5824d651 289DEF("m", HAS_ARG, QEMU_OPTION_m,
89f3ea2b 290 "-m [size=]megs[,slots=n,maxmem=size]\n"
6e1d3c1c 291 " configure guest RAM\n"
0daba1f0 292 " size: initial amount of guest memory\n"
c270fb9e 293 " slots: number of hotplug slots (default: none)\n"
b6fe0124
MR
294 " maxmem: maximum amount of guest memory (default: none)\n"
295 "NOTE: Some architectures might enforce a specific granularity\n",
6e1d3c1c 296 QEMU_ARCH_ALL)
5824d651 297STEXI
9fcc0794 298@item -m [size=]@var{megs}[,slots=n,maxmem=size]
6616b2ad 299@findex -m
9fcc0794
LC
300Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
301Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
302megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
303could be used to set amount of hotpluggable memory slots and maximum amount of
304memory. Note that @var{maxmem} must be aligned to the page size.
305
306For example, the following command-line sets the guest startup RAM size to
3071GB, creates 3 slots to hotplug additional memory and sets the maximum
308memory the guest can reach to 4GB:
309
310@example
311qemu-system-x86_64 -m 1G,slots=3,maxmem=4G
312@end example
313
314If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
315be enabled and the guest startup RAM will never increase.
5824d651
BS
316ETEXI
317
c902760f 318DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
ad96090a 319 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
c902760f
MT
320STEXI
321@item -mem-path @var{path}
b8f490eb 322@findex -mem-path
c902760f
MT
323Allocate guest RAM from a temporarily created file in @var{path}.
324ETEXI
325
c902760f 326DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
ad96090a
BS
327 "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
328 QEMU_ARCH_ALL)
c902760f
MT
329STEXI
330@item -mem-prealloc
b8f490eb 331@findex -mem-prealloc
c902760f
MT
332Preallocate memory when using -mem-path.
333ETEXI
c902760f 334
5824d651 335DEF("k", HAS_ARG, QEMU_OPTION_k,
ad96090a
BS
336 "-k language use keyboard layout (for example 'fr' for French)\n",
337 QEMU_ARCH_ALL)
5824d651
BS
338STEXI
339@item -k @var{language}
6616b2ad 340@findex -k
5824d651
BS
341Use keyboard layout @var{language} (for example @code{fr} for
342French). This option is only needed where it is not easy to get raw PC
32945472 343keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
5824d651
BS
344display). You don't normally need to use it on PC/Linux or PC/Windows
345hosts.
346
347The available layouts are:
348@example
349ar de-ch es fo fr-ca hu ja mk no pt-br sv
350da en-gb et fr fr-ch is lt nl pl ru th
351de en-us fi fr-be hr it lv nl-be pt sl tr
352@end example
353
354The default is @code{en-us}.
355ETEXI
356
357
5824d651 358DEF("audio-help", 0, QEMU_OPTION_audio_help,
ad96090a
BS
359 "-audio-help print list of audio drivers and their options\n",
360 QEMU_ARCH_ALL)
5824d651
BS
361STEXI
362@item -audio-help
6616b2ad 363@findex -audio-help
5824d651
BS
364Will show the audio subsystem help: list of drivers, tunable
365parameters.
366ETEXI
367
5824d651
BS
368DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
369 "-soundhw c1,... enable audio support\n"
370 " and only specified sound cards (comma separated list)\n"
585f6036
PM
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)
5824d651
BS
373STEXI
374@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
6616b2ad 375@findex -soundhw
585f6036 376Enable audio and selected sound hardware. Use 'help' to print all
5824d651
BS
377available sound hardware.
378
379@example
10adb8be
MA
380qemu-system-i386 -soundhw sb16,adlib disk.img
381qemu-system-i386 -soundhw es1370 disk.img
382qemu-system-i386 -soundhw ac97 disk.img
383qemu-system-i386 -soundhw hda disk.img
384qemu-system-i386 -soundhw all disk.img
385qemu-system-i386 -soundhw help
386@end example
387
388Note that Linux's i810_audio OSS kernel (for AC97) module might
389require manually specifying clocking.
390
391@example
392modprobe i810_audio clocking=48000
393@end example
394ETEXI
395
396DEF("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)
400STEXI
401@item -balloon none
402@findex -balloon
403Disable balloon device.
404@item -balloon virtio[,addr=@var{addr}]
405Enable virtio balloon device (default), optionally with PCI address
406@var{addr}.
407ETEXI
408
409DEF("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)
416STEXI
417@item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
418@findex -device
419Add device @var{driver}. @var{prop}=@var{value} sets driver
420properties. Valid properties depend on the driver. To get help on
421possible drivers and properties, use @code{-device help} and
422@code{-device @var{driver},help}.
f8490451
CM
423
424Some drivers are:
425@item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}]
426
427Add an IPMI BMC. This is a simulation of a hardware management
428interface processor that normally sits on a system. It provides
429a watchdog and the ability to reset and power control the system.
430You need to connect this to an IPMI interface to make it useful
431
432The IPMI slave address to use for the BMC. The default is 0x20.
433This address is the BMC's address on the I2C network of management
434controllers. If you don't know what this means, it is safe to ignore
435it.
436
437@item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
438
439Add a connection to an external IPMI BMC simulator. Instead of
440locally emulating the BMC like the above item, instead connect
441to an external entity that provides the IPMI services.
442
443A connection is made to an external BMC simulator. If you do this, it
444is strongly recommended that you use the "reconnect=" chardev option
445to reconnect to the simulator if the connection is lost. Note that if
446this is not used carefully, it can be a security issue, as the
447interface has the ability to send resets, NMIs, and power off the VM.
448It's best if QEMU makes a connection to an external simulator running
449on a secure port on localhost, so neither the simulator nor QEMU is
450exposed to any outside network.
451
452See the "lanserv/README.vm" file in the OpenIPMI library for more
453details on the external interface.
454
455@item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
456
457Add a KCS IPMI interafce on the ISA bus. This also adds a
458corresponding ACPI and SMBIOS entries, if appropriate.
459
460@table @option
461@item bmc=@var{id}
462The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
463@item ioport=@var{val}
464Define the I/O address of the interface. The default is 0xca0 for KCS.
465@item irq=@var{val}
466Define the interrupt to use. The default is 5. To disable interrupts,
467set this to 0.
468@end table
469
470@item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
471
472Like the KCS interface, but defines a BT interface. The default port is
4730xe4 and the default interrupt is 5.
474
10adb8be
MA
475ETEXI
476
477DEF("name", HAS_ARG, QEMU_OPTION_name,
8f480de0 478 "-name string1[,process=string2][,debug-threads=on|off]\n"
10adb8be 479 " set the name of the guest\n"
8f480de0
DDAG
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",
10adb8be
MA
483 QEMU_ARCH_ALL)
484STEXI
485@item -name @var{name}
486@findex -name
487Sets the @var{name} of the guest.
488This name will be displayed in the SDL window caption.
489The @var{name} will also be used for the VNC server.
490Also optionally set the top visible process name in Linux.
8f480de0 491Naming of individual threads can also be enabled on Linux to aid debugging.
10adb8be
MA
492ETEXI
493
494DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
495 "-uuid %08x-%04x-%04x-%04x-%012x\n"
496 " specify machine UUID\n", QEMU_ARCH_ALL)
497STEXI
498@item -uuid @var{uuid}
499@findex -uuid
500Set system UUID.
501ETEXI
502
503STEXI
504@end table
505ETEXI
506DEFHEADING()
507
43f187a5 508DEFHEADING(Block device options)
10adb8be
MA
509STEXI
510@table @option
511ETEXI
512
513DEF("fda", HAS_ARG, QEMU_OPTION_fda,
514 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
515DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
516STEXI
517@item -fda @var{file}
f9cfd655 518@itemx -fdb @var{file}
10adb8be
MA
519@findex -fda
520@findex -fdb
92a539d2 521Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
10adb8be
MA
522ETEXI
523
524DEF("hda", HAS_ARG, QEMU_OPTION_hda,
525 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
526DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
527DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
528 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
529DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
530STEXI
531@item -hda @var{file}
f9cfd655
MA
532@itemx -hdb @var{file}
533@itemx -hdc @var{file}
534@itemx -hdd @var{file}
10adb8be
MA
535@findex -hda
536@findex -hdb
537@findex -hdc
538@findex -hdd
539Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
540ETEXI
541
542DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
543 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
544 QEMU_ARCH_ALL)
545STEXI
546@item -cdrom @var{file}
547@findex -cdrom
548Use @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
550using @file{/dev/cdrom} as filename (@pxref{host_drives}).
551ETEXI
552
42e5f393
MA
553DEF("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)
559
10adb8be
MA
560DEF("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"
d1db760d
SH
564 " [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
565 " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
10adb8be 566 " [,readonly=on|off][,copy-on-read=on|off]\n"
2f7133b2 567 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
3e9fab69
BC
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"
2024c1df 572 " [[,iops_size=is]]\n"
76f4afb4 573 " [[,group=g]]\n"
10adb8be
MA
574 " use 'file' as a drive image\n", QEMU_ARCH_ALL)
575STEXI
576@item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
577@findex -drive
578
579Define a new drive. Valid options are:
580
581@table @option
582@item file=@var{file}
583This option defines which disk image (@pxref{disk_images}) to use with
584this drive. If the filename contains comma, you must double it
585(for instance, "file=my,,file" to use file "my,file").
586
587Special files such as iSCSI devices can be specified using protocol
588specific URLs. See the section for "Device URL Syntax" for more information.
589@item if=@var{interface}
590This option defines on which type on interface the drive is connected.
591Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
592@item bus=@var{bus},unit=@var{unit}
593These options define where is connected the drive by defining the bus number and
594the unit id.
595@item index=@var{index}
596This option defines where is connected the drive by using an index in the list
597of available connectors of a given interface type.
598@item media=@var{media}
599This option defines the type of the media: disk or cdrom.
600@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
601These options have the same definition as they have in @option{-hdachs}.
602@item snapshot=@var{snapshot}
9d85d557
MT
603@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
604(see @option{-snapshot}).
10adb8be
MA
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.
a9384aff
PB
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.
10adb8be
MA
611@item format=@var{format}
612Specify which disk @var{format} will be used rather than detecting
d33c8a7d 613the format. Can be used to specify format=raw to avoid interpreting
10adb8be
MA
614an untrusted format header.
615@item serial=@var{serial}
616This option specifies the serial number to assign to the device.
617@item addr=@var{addr}
618Specify the controller's PCI address (if=virtio only).
619@item werror=@var{action},rerror=@var{action}
620Specify 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
623host disk is full; report the error to the guest otherwise).
624The default setting is @option{werror=enospc} and @option{rerror=report}.
625@item readonly
626Open 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
629file sectors into the image file.
465bee1d
PL
630@item detect-zeroes=@var{detect-zeroes}
631@var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
632conversion of plain zero writes by the OS to driver specific optimized
633zero write commands. You may even choose "unmap" if @var{discard} is set
634to "unmap" to allow a zero write to be converted to an UNMAP operation.
10adb8be
MA
635@end table
636
637By default, the @option{cache=writeback} mode is used. It will report data
638writes as completed as soon as the data is present in the host page cache.
639This is safe as long as your guest OS makes sure to correctly flush disk caches
640where needed. If your guest OS does not handle volatile disk write caches
641correctly and your host crashes or loses power, then the guest may experience
642data corruption.
643
644For such guests, you should consider using @option{cache=writethrough}. This
645means that the host page cache will be used to read and write data, but write
646notification will be sent to the guest only after QEMU has made sure to flush
647each write to the disk. Be aware that this has a major impact on performance.
648
649The host page cache can be avoided entirely with @option{cache=none}. This will
650attempt to do disk IO directly to the guest's memory. QEMU may still perform
651an internal copy of the data. Note that this is considered a writeback mode and
652the guest OS must handle the disk write cache correctly in order to avoid data
653corruption on host crashes.
654
655The host page cache can be avoided while only sending write notifications to
656the guest when the data has been flushed to the disk using
657@option{cache=directsync}.
658
659In 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
661data to the disk but can instead keep things in cache. If anything goes wrong,
662like your host losing power, the disk storage getting disconnected accidentally,
663etc. your image will most probably be rendered unusable. When using
664the @option{-snapshot} option, unsafe caching is always used.
665
666Copy-on-read avoids accessing the same backing file sectors repeatedly and is
667useful when the backing file is over a slow network. By default copy-on-read
668is off.
669
670Instead of @option{-cdrom} you can use:
671@example
672qemu-system-i386 -drive file=file,index=2,media=cdrom
673@end example
674
675Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
676use:
677@example
678qemu-system-i386 -drive file=file,index=0,media=disk
679qemu-system-i386 -drive file=file,index=1,media=disk
680qemu-system-i386 -drive file=file,index=2,media=disk
681qemu-system-i386 -drive file=file,index=3,media=disk
682@end example
683
684You can open an image using pre-opened file descriptors from an fd set:
685@example
686qemu-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
691
692You can connect a CDROM to the slave of ide0:
693@example
694qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
5824d651
BS
695@end example
696
10adb8be
MA
697If you don't specify the "file=" argument, you define an empty drive:
698@example
699qemu-system-i386 -drive if=ide,index=1,media=cdrom
700@end example
5824d651 701
10adb8be
MA
702Instead of @option{-fda}, @option{-fdb}, you can use:
703@example
704qemu-system-i386 -drive file=file,index=0,if=floppy
705qemu-system-i386 -drive file=file,index=1,if=floppy
706@end example
b1746ddd 707
10adb8be
MA
708By default, @var{interface} is "ide" and @var{index} is automatically
709incremented:
710@example
711qemu-system-i386 -drive file=a -drive file=b"
712@end example
713is interpreted like:
714@example
715qemu-system-i386 -hda a -hdb b
716@end example
84644c45
MA
717ETEXI
718
10adb8be
MA
719DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
720 "-mtdblock file use 'file' as on-board Flash memory image\n",
84644c45
MA
721 QEMU_ARCH_ALL)
722STEXI
10adb8be
MA
723@item -mtdblock @var{file}
724@findex -mtdblock
725Use @var{file} as on-board Flash memory image.
84644c45
MA
726ETEXI
727
10adb8be
MA
728DEF("sd", HAS_ARG, QEMU_OPTION_sd,
729 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
5824d651 730STEXI
10adb8be
MA
731@item -sd @var{file}
732@findex -sd
733Use @var{file} as SecureDigital card image.
5824d651
BS
734ETEXI
735
10adb8be
MA
736DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
737 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
5824d651 738STEXI
10adb8be
MA
739@item -pflash @var{file}
740@findex -pflash
741Use @var{file} as a parallel flash image.
c70a01e4 742ETEXI
5824d651 743
10adb8be
MA
744DEF("snapshot", 0, QEMU_OPTION_snapshot,
745 "-snapshot write to temporary files instead of disk image files\n",
c70a01e4
MA
746 QEMU_ARCH_ALL)
747STEXI
10adb8be
MA
748@item -snapshot
749@findex -snapshot
750Write to temporary files instead of disk image files. In this case,
751the raw disk image you use is not written back. You can however force
752the write back by pressing @key{C-a s} (@pxref{disk_images}).
5824d651
BS
753ETEXI
754
10adb8be
MA
755DEF("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",
ad96090a 759 QEMU_ARCH_ALL)
5824d651 760STEXI
10adb8be
MA
761@item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
762@findex -hdachs
763Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=
764@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS
765translation mode (@var{t}=none, lba or auto). Usually QEMU can guess
766all those parameters. This option is useful for old MS-DOS disk
767images.
c70a01e4 768ETEXI
74db920c
GS
769
770DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
2c30dd74 771 "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
b8bbdb88
PJ
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",
74db920c
GS
778 QEMU_ARCH_ALL)
779
780STEXI
781
84a87cc4 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}]
74db920c 783@findex -fsdev
7c92a3d2
AK
784Define a new file system device. Valid options are:
785@table @option
786@item @var{fsdriver}
787This option specifies the fs driver backend to use.
f67e3ffd 788Currently "local", "handle" and "proxy" file system drivers are supported.
7c92a3d2
AK
789@item id=@var{id}
790Specifies identifier for this device
791@item path=@var{path}
792Specifies the export path for the file system device. Files under
793this path will be available to the 9p client on the guest.
794@item security_model=@var{security_model}
795Specifies the security model to be used for this export path.
2c30dd74 796Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
7c92a3d2 797In "passthrough" security model, files are stored using the same
b65ee4fa 798credentials as they are created on the guest. This requires QEMU
2c30dd74 799to run as root. In "mapped-xattr" security model, some of the file
7c92a3d2 800attributes like uid, gid, mode bits and link target are stored as
2c30dd74
AK
801file attributes. For "mapped-file" these attributes are stored in the
802hidden .virtfs_metadata directory. Directories exported by this security model cannot
7c92a3d2
AK
803interact with other unix tools. "none" security model is same as
804passthrough except the sever won't report failures if it fails to
d9b36a6e 805set file attributes like ownership. Security model is mandatory
f67e3ffd 806only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
d9b36a6e 807security model as a parameter.
7c92a3d2
AK
808@item writeout=@var{writeout}
809This is an optional argument. The only supported value is "immediate".
810This means that host page cache will be used to read and write data but
811write notification will be sent to the guest only when the data has been
812reported as written by the storage subsystem.
2c74c2cb
MK
813@item readonly
814Enables exporting 9p share as a readonly mount for guests. By default
815read-write access is given.
84a87cc4
MK
816@item socket=@var{socket}
817Enables proxy filesystem driver to use passed socket file for communicating
818with virtfs-proxy-helper
f67e3ffd
MK
819@item sock_fd=@var{sock_fd}
820Enables proxy filesystem driver to use passed socket descriptor for
821communicating with virtfs-proxy-helper. Usually a helper like libvirt
822will create socketpair and pass one of the fds as sock_fd
7c92a3d2 823@end table
9ce56db6 824
7c92a3d2
AK
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}
827Options for virtio-9p-pci driver are:
828@table @option
829@item fsdev=@var{id}
830Specifies the id value specified along with -fsdev option
831@item mount_tag=@var{mount_tag}
832Specifies the tag name to be used by the guest to mount this export point
74db920c 833@end table
7c92a3d2 834
74db920c 835ETEXI
74db920c 836
3d54abc7 837DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
2c30dd74 838 "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
84a87cc4 839 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
3d54abc7
GS
840 QEMU_ARCH_ALL)
841
842STEXI
843
84a87cc4 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}]
3d54abc7 845@findex -virtfs
3d54abc7 846
7c92a3d2
AK
847The general form of a Virtual File system pass-through options are:
848@table @option
849@item @var{fsdriver}
850This option specifies the fs driver backend to use.
f67e3ffd 851Currently "local", "handle" and "proxy" file system drivers are supported.
7c92a3d2
AK
852@item id=@var{id}
853Specifies identifier for this device
854@item path=@var{path}
855Specifies the export path for the file system device. Files under
856this path will be available to the 9p client on the guest.
857@item security_model=@var{security_model}
858Specifies the security model to be used for this export path.
2c30dd74 859Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
7c92a3d2 860In "passthrough" security model, files are stored using the same
b65ee4fa 861credentials as they are created on the guest. This requires QEMU
2c30dd74 862to run as root. In "mapped-xattr" security model, some of the file
7c92a3d2 863attributes like uid, gid, mode bits and link target are stored as
2c30dd74
AK
864file attributes. For "mapped-file" these attributes are stored in the
865hidden .virtfs_metadata directory. Directories exported by this security model cannot
7c92a3d2
AK
866interact with other unix tools. "none" security model is same as
867passthrough except the sever won't report failures if it fails to
d9b36a6e 868set file attributes like ownership. Security model is mandatory only
f67e3ffd 869for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
d9b36a6e 870model as a parameter.
7c92a3d2
AK
871@item writeout=@var{writeout}
872This is an optional argument. The only supported value is "immediate".
873This means that host page cache will be used to read and write data but
874write notification will be sent to the guest only when the data has been
875reported as written by the storage subsystem.
2c74c2cb
MK
876@item readonly
877Enables exporting 9p share as a readonly mount for guests. By default
878read-write access is given.
84a87cc4
MK
879@item socket=@var{socket}
880Enables proxy filesystem driver to use passed socket file for
881communicating with virtfs-proxy-helper. Usually a helper like libvirt
882will create socketpair and pass one of the fds as sock_fd
f67e3ffd
MK
883@item sock_fd
884Enables proxy filesystem driver to use passed 'sock_fd' as the socket
885descriptor for interfacing with virtfs-proxy-helper
3d54abc7
GS
886@end table
887ETEXI
3d54abc7 888
9db221ae
AK
889DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
890 "-virtfs_synth Create synthetic file system image\n",
891 QEMU_ARCH_ALL)
892STEXI
893@item -virtfs_synth
894@findex -virtfs_synth
895Create synthetic file system image
896ETEXI
897
5824d651
BS
898STEXI
899@end table
900ETEXI
5824d651
BS
901DEFHEADING()
902
43f187a5 903DEFHEADING(USB options)
10adb8be
MA
904STEXI
905@table @option
906ETEXI
907
908DEF("usb", 0, QEMU_OPTION_usb,
909 "-usb enable the USB driver (will be the default soon)\n",
910 QEMU_ARCH_ALL)
911STEXI
912@item -usb
913@findex -usb
914Enable the USB driver (will be the default soon)
915ETEXI
916
917DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
918 "-usbdevice name add the host or guest USB device 'name'\n",
919 QEMU_ARCH_ALL)
920STEXI
921
922@item -usbdevice @var{devname}
923@findex -usbdevice
924Add the USB device @var{devname}. @xref{usb_devices}.
925
926@table @option
927
928@item mouse
929Virtual Mouse. This will override the PS/2 mouse emulation when activated.
930
931@item tablet
932Pointer device that uses absolute coordinates (like a touchscreen). This
933means QEMU is able to report the mouse position without having to grab the
934mouse. Also overrides the PS/2 mouse emulation when activated.
935
936@item disk:[format=@var{format}]:@var{file}
937Mass storage device based on file. The optional @var{format} argument
d33c8a7d 938will be used rather than detecting the format. Can be used to specify
10adb8be
MA
939@code{format=raw} to avoid interpreting an untrusted format header.
940
941@item host:@var{bus}.@var{addr}
942Pass through the host device identified by @var{bus}.@var{addr} (Linux only).
943
944@item host:@var{vendor_id}:@var{product_id}
945Pass through the host device identified by @var{vendor_id}:@var{product_id}
946(Linux only).
947
948@item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
949Serial converter to host character device @var{dev}, see @code{-serial} for the
950available devices.
951
952@item braille
953Braille device. This will use BrlAPI to display the braille output on a real
954or fake device.
955
956@item net:@var{options}
957Network adapter that supports CDC ethernet and RNDIS protocols.
958
959@end table
960ETEXI
961
962STEXI
963@end table
964ETEXI
965DEFHEADING()
966
43f187a5 967DEFHEADING(Display options)
5824d651
BS
968STEXI
969@table @option
970ETEXI
971
1472a95b
JS
972DEF("display", HAS_ARG, QEMU_OPTION_display,
973 "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
87eb2bac 974 " [,window_close=on|off][,gl=on|off]\n"
f04ec5af
RH
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)
1472a95b
JS
993STEXI
994@item -display @var{type}
995@findex -display
996Select type of display to use. This option is a replacement for the
997old style -sdl/-curses/... options. Valid values for @var{type} are
998@table @option
999@item sdl
1000Display video output via SDL (usually in a separate graphics
1001window; see the SDL documentation for other possibilities).
1002@item curses
1003Display video output via curses. For graphics device models which
1004support a text mode, QEMU can display this output using a
1005curses/ncurses interface. Nothing is displayed when the graphics
1006device is in graphical mode or if the graphics device does not support
1007a text mode. Generally only the VGA device models support text mode.
4171d32e
JS
1008@item none
1009Do not display video output. The guest will still see an emulated
1010graphics card, but its output will not be displayed to the QEMU
1011user. This option differs from the -nographic option in that it
1012only affects what is done with video output; -nographic also changes
1013the destination of the serial and parallel port data.
881249c7
JK
1014@item gtk
1015Display video output in a GTK window. This interface provides drop-down
1016menus and other UI elements to configure and control the VM during
1017runtime.
3264ff12
JS
1018@item vnc
1019Start a VNC server on display <arg>
1472a95b
JS
1020@end table
1021ETEXI
1022
5824d651 1023DEF("nographic", 0, QEMU_OPTION_nographic,
ad96090a
BS
1024 "-nographic disable graphical output and redirect serial I/Os to console\n",
1025 QEMU_ARCH_ALL)
5824d651
BS
1026STEXI
1027@item -nographic
6616b2ad 1028@findex -nographic
dc0a3e44
CL
1029Normally, if QEMU is compiled with graphical window support, it displays
1030output such as guest graphics, guest console, and the QEMU monitor in a
1031window. With this option, you can totally disable graphical output so
1032that QEMU is a simple command line application. The emulated serial port
1033is redirected on the console and muxed with the monitor (unless
1034redirected elsewhere explicitly). Therefore, you can still use QEMU to
1035debug a Linux kernel with a serial console. Use @key{C-a h} for help on
1036switching between the console and monitor.
5824d651
BS
1037ETEXI
1038
5824d651 1039DEF("curses", 0, QEMU_OPTION_curses,
f04ec5af 1040 "-curses shorthand for -display curses\n",
ad96090a 1041 QEMU_ARCH_ALL)
5824d651
BS
1042STEXI
1043@item -curses
b8f490eb 1044@findex -curses
dc0a3e44
CL
1045Normally, if QEMU is compiled with graphical window support, it displays
1046output such as guest graphics, guest console, and the QEMU monitor in a
1047window. With this option, QEMU can display the VGA output when in text
1048mode using a curses/ncurses interface. Nothing is displayed in graphical
1049mode.
5824d651
BS
1050ETEXI
1051
5824d651 1052DEF("no-frame", 0, QEMU_OPTION_no_frame,
ad96090a
BS
1053 "-no-frame open SDL window without a frame and window decorations\n",
1054 QEMU_ARCH_ALL)
5824d651
BS
1055STEXI
1056@item -no-frame
6616b2ad 1057@findex -no-frame
5824d651
BS
1058Do not use decorations for SDL windows and start them using the whole
1059available screen space. This makes the using QEMU in a dedicated desktop
1060workspace more convenient.
1061ETEXI
1062
5824d651 1063DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
ad96090a
BS
1064 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
1065 QEMU_ARCH_ALL)
5824d651
BS
1066STEXI
1067@item -alt-grab
6616b2ad 1068@findex -alt-grab
de1db2a1
BH
1069Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
1070affects the special keys (for fullscreen, monitor-mode switching, etc).
5824d651
BS
1071ETEXI
1072
0ca9f8a4 1073DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
ad96090a
BS
1074 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
1075 QEMU_ARCH_ALL)
0ca9f8a4
DK
1076STEXI
1077@item -ctrl-grab
6616b2ad 1078@findex -ctrl-grab
de1db2a1
BH
1079Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
1080affects the special keys (for fullscreen, monitor-mode switching, etc).
0ca9f8a4
DK
1081ETEXI
1082
5824d651 1083DEF("no-quit", 0, QEMU_OPTION_no_quit,
ad96090a 1084 "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
5824d651
BS
1085STEXI
1086@item -no-quit
6616b2ad 1087@findex -no-quit
5824d651
BS
1088Disable SDL window close capability.
1089ETEXI
1090
5824d651 1091DEF("sdl", 0, QEMU_OPTION_sdl,
f04ec5af 1092 "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
5824d651
BS
1093STEXI
1094@item -sdl
6616b2ad 1095@findex -sdl
5824d651
BS
1096Enable SDL.
1097ETEXI
1098
29b0040b 1099DEF("spice", HAS_ARG, QEMU_OPTION_spice,
27af7788
YH
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"
fe4831b1 1103 " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
27af7788
YH
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"
5ad24e5f
HG
1112 " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
1113 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
7b525508 1114 " [,gl=[on|off]][,rendernode=<file>]\n"
27af7788
YH
1115 " enable spice\n"
1116 " at least one of {port, tls-port} is mandatory\n",
1117 QEMU_ARCH_ALL)
29b0040b
GH
1118STEXI
1119@item -spice @var{option}[,@var{option}[,...]]
1120@findex -spice
1121Enable the spice remote desktop protocol. Valid options are
1122
1123@table @option
1124
1125@item port=<nr>
c448e855 1126Set the TCP port spice is listening on for plaintext channels.
29b0040b 1127
333b0eeb
GH
1128@item addr=<addr>
1129Set the IP address spice is listening on. Default is any address.
1130
1131@item ipv4
f9cfd655
MA
1132@itemx ipv6
1133@itemx unix
333b0eeb
GH
1134Force using the specified IP version.
1135
29b0040b
GH
1136@item password=<secret>
1137Set the password you need to authenticate.
1138
48b3ed0a
MAL
1139@item sasl
1140Require that the client use SASL to authenticate with the spice.
1141The exact choice of authentication method used is controlled from the
1142system / user's SASL configuration file for the 'qemu' service. This
1143is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1144unprivileged user, an environment variable SASL_CONF_PATH can be used
1145to make it search alternate locations for the service config.
1146While some SASL auth methods can also provide data encryption (eg GSSAPI),
1147it is recommended that SASL always be combined with the 'tls' and
1148'x509' settings to enable use of SSL and server certificates. This
1149ensures a data encryption preventing compromise of authentication
1150credentials.
1151
29b0040b
GH
1152@item disable-ticketing
1153Allow client connects without authentication.
1154
d4970b07
HG
1155@item disable-copy-paste
1156Disable copy paste between the client and the guest.
1157
5ad24e5f
HG
1158@item disable-agent-file-xfer
1159Disable spice-vdagent based file-xfer between the client and the guest.
1160
c448e855
GH
1161@item tls-port=<nr>
1162Set the TCP port spice is listening on for encrypted channels.
1163
1164@item x509-dir=<dir>
1165Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
1166
1167@item x509-key-file=<file>
f9cfd655
MA
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>
c448e855
GH
1172The x509 file names can also be configured individually.
1173
1174@item tls-ciphers=<list>
1175Specify which ciphers to use.
1176
d70d6b31 1177@item tls-channel=[main|display|cursor|inputs|record|playback]
f9cfd655 1178@itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
17b6dea0
GH
1179Force specific channel to be used with or without TLS encryption. The
1180options can be specified multiple times to configure multiple
1181channels. The special name "default" can be used to set the default
1182mode. For channels which are not explicitly forced into one mode the
1183spice client is allowed to pick tls/plaintext as he pleases.
1184
9f04e09e
YH
1185@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
1186Configure image compression (lossless).
1187Default is auto_glz.
1188
1189@item jpeg-wan-compression=[auto|never|always]
f9cfd655 1190@itemx zlib-glz-wan-compression=[auto|never|always]
9f04e09e
YH
1191Configure wan image compression (lossy for slow links).
1192Default is auto.
1193
84a23f25 1194@item streaming-video=[off|all|filter]
93ca519e 1195Configure video stream detection. Default is off.
84a23f25
GH
1196
1197@item agent-mouse=[on|off]
1198Enable/disable passing mouse events via vdagent. Default is on.
1199
1200@item playback-compression=[on|off]
1201Enable/disable audio stream compression (using celt 0.5.1). Default is on.
1202
8c957053
YH
1203@item seamless-migration=[on|off]
1204Enable/disable spice seamless migration. Default is off.
1205
474114b7
GH
1206@item gl=[on|off]
1207Enable/disable OpenGL context. Default is off.
1208
7b525508
MAL
1209@item rendernode=<file>
1210DRM render node for OpenGL rendering. If not specified, it will pick
1211the first available. (Since 2.9)
1212
29b0040b
GH
1213@end table
1214ETEXI
1215
5824d651 1216DEF("portrait", 0, QEMU_OPTION_portrait,
ad96090a
BS
1217 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
1218 QEMU_ARCH_ALL)
5824d651
BS
1219STEXI
1220@item -portrait
6616b2ad 1221@findex -portrait
5824d651
BS
1222Rotate graphical output 90 deg left (only PXA LCD).
1223ETEXI
1224
9312805d
VK
1225DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
1226 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
1227 QEMU_ARCH_ALL)
1228STEXI
6265c43b 1229@item -rotate @var{deg}
9312805d
VK
1230@findex -rotate
1231Rotate graphical output some deg left (only PXA LCD).
1232ETEXI
1233
5824d651 1234DEF("vga", HAS_ARG, QEMU_OPTION_vga,
a94f0c5c 1235 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
ad96090a 1236 " select video card type\n", QEMU_ARCH_ALL)
5824d651 1237STEXI
e4558dca 1238@item -vga @var{type}
6616b2ad 1239@findex -vga
5824d651 1240Select type of VGA card to emulate. Valid values for @var{type} are
b3f046c2 1241@table @option
5824d651
BS
1242@item cirrus
1243Cirrus Logic GD5446 Video card. All Windows versions starting from
1244Windows 95 should recognize and use this graphic card. For optimal
1245performances, use 16 bit color depth in the guest and the host OS.
41eeb0e6 1246(This card was the default before QEMU 2.2)
5824d651
BS
1247@item std
1248Standard VGA card with Bochs VBE extensions. If your guest OS
1249supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
1250to use high resolution modes (>= 1280x1024x16) then you should use
41eeb0e6 1251this option. (This card is the default since QEMU 2.2)
5824d651
BS
1252@item vmware
1253VMWare SVGA-II compatible adapter. Use it if you have sufficiently
1254recent XFree86/XOrg server or Windows guest with a driver for this
1255card.
a19cbfb3
GH
1256@item qxl
1257QXL paravirtual graphic card. It is VGA compatible (including VESA
12582.0 VBE support). Works best with qxl guest drivers installed though.
1259Recommended choice when using the spice protocol.
33632788
MCA
1260@item tcx
1261(sun4m only) Sun TCX framebuffer. This is the default framebuffer for
1262sun4m machines and offers both 8-bit and 24-bit colour depths at a
1263fixed resolution of 1024x768.
1264@item cg3
1265(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
1266for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
1267resolutions aimed at people wishing to run older Solaris versions.
a94f0c5c
GH
1268@item virtio
1269Virtio VGA card.
5824d651
BS
1270@item none
1271Disable VGA card.
1272@end table
1273ETEXI
1274
1275DEF("full-screen", 0, QEMU_OPTION_full_screen,
ad96090a 1276 "-full-screen start in full screen\n", QEMU_ARCH_ALL)
5824d651
BS
1277STEXI
1278@item -full-screen
6616b2ad 1279@findex -full-screen
5824d651
BS
1280Start in full screen.
1281ETEXI
1282
5824d651 1283DEF("g", 1, QEMU_OPTION_g ,
ad96090a
BS
1284 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
1285 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
5824d651 1286STEXI
95d5f08b 1287@item -g @var{width}x@var{height}[x@var{depth}]
6616b2ad 1288@findex -g
95d5f08b 1289Set the initial graphical resolution and depth (PPC, SPARC only).
5824d651
BS
1290ETEXI
1291
1292DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
f04ec5af 1293 "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
5824d651
BS
1294STEXI
1295@item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
6616b2ad 1296@findex -vnc
dc0a3e44
CL
1297Normally, if QEMU is compiled with graphical window support, it displays
1298output such as guest graphics, guest console, and the QEMU monitor in a
1299window. 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
1301very useful to enable the usb tablet device when using this option
1302(option @option{-usbdevice tablet}). When using the VNC display, you
1303must use the @option{-k} parameter to set the keyboard layout if you are
1304not using en-us. Valid syntax for the @var{display} is
5824d651 1305
b3f046c2 1306@table @option
5824d651 1307
99a9a52a
RH
1308@item to=@var{L}
1309
1310With this option, QEMU will try next available VNC @var{display}s, until the
1311number @var{L}, if the origianlly defined "-vnc @var{display}" is not
1312available, e.g. port 5900+@var{display} is already used by another
1313application. By default, to=0.
1314
5824d651
BS
1315@item @var{host}:@var{d}
1316
1317TCP connections will only be allowed from @var{host} on display @var{d}.
1318By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
1319be omitted in which case the server will accept connections from any host.
1320
4e257e5e 1321@item unix:@var{path}
5824d651
BS
1322
1323Connections will be allowed over UNIX domain sockets where @var{path} is the
1324location of a unix socket to listen for connections on.
1325
1326@item none
1327
1328VNC is initialized but not started. The monitor @code{change} command
1329can be used to later start the VNC server.
1330
1331@end table
1332
1333Following the @var{display} value there may be one or more @var{option} flags
1334separated by commas. Valid options are
1335
b3f046c2 1336@table @option
5824d651
BS
1337
1338@item reverse
1339
1340Connect to a listening VNC client via a ``reverse'' connection. The
1341client is specified by the @var{display}. For reverse network
1342connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
1343is a TCP port number, not a display number.
1344
7536ee4b
TH
1345@item websocket
1346
1347Opens an additional TCP listening port dedicated to VNC Websocket connections.
275e0d61
DB
1348If a bare @var{websocket} option is given, the Websocket port is
13495700+@var{display}. An alternative port can be specified with the
1350syntax @code{websocket}=@var{port}.
1351
1352If @var{host} is specified connections will only be allowed from this host.
1353It is possible to control the websocket listen address independently, using
1354the syntax @code{websocket}=@var{host}:@var{port}.
1355
3e305e4a
DB
1356If no TLS credentials are provided, the websocket connection runs in
1357unencrypted mode. If TLS credentials are provided, the websocket connection
1358requires encrypted client connections.
7536ee4b 1359
5824d651
BS
1360@item password
1361
1362Require that password based authentication is used for client connections.
86ee5bc3
MN
1363
1364The password must be set separately using the @code{set_password} command in
1365the @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".
1368
1369If you would like to change <protocol> password expiration, you should use
1370@code{expire_password <protocol> <expiration-time>} where expiration time could
1371be one of the following options: now, never, +seconds or UNIX time of
1372expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
1373to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
1374date and time).
1375
1376You can also use keywords "now" or "never" for the expiration time to
1377allow <protocol> password to expire immediately or never expire.
5824d651 1378
3e305e4a
DB
1379@item tls-creds=@var{ID}
1380
1381Provides the ID of a set of TLS credentials to use to secure the
1382VNC server. They will apply to both the normal VNC server socket
1383and the websocket socket (if enabled). Setting TLS credentials
1384will cause the VNC server socket to enable the VeNCrypt auth
1385mechanism. The credentials should have been previously created
1386using the @option{-object tls-creds} argument.
1387
1388The @option{tls-creds} parameter obsoletes the @option{tls},
1389@option{x509}, and @option{x509verify} options, and as such
1390it is not permitted to set both new and old type options at
1391the same time.
1392
5824d651
BS
1393@item tls
1394
1395Require that client use TLS when communicating with the VNC server. This
1396uses anonymous TLS credentials so is susceptible to a man-in-the-middle
1397attack. It is recommended that this option be combined with either the
4e257e5e 1398@option{x509} or @option{x509verify} options.
5824d651 1399
3e305e4a
DB
1400This option is now deprecated in favor of using the @option{tls-creds}
1401argument.
1402
5824d651
BS
1403@item x509=@var{/path/to/certificate/dir}
1404
1405Valid if @option{tls} is specified. Require that x509 credentials are used
1406for negotiating the TLS session. The server will send its x509 certificate
1407to the client. It is recommended that a password be set on the VNC server
1408to provide authentication of the client when this is used. The path following
1409this option specifies where the x509 certificates are to be loaded from.
1410See the @ref{vnc_security} section for details on generating certificates.
1411
3e305e4a
DB
1412This option is now deprecated in favour of using the @option{tls-creds}
1413argument.
1414
5824d651
BS
1415@item x509verify=@var{/path/to/certificate/dir}
1416
1417Valid if @option{tls} is specified. Require that x509 credentials are used
1418for negotiating the TLS session. The server will send its x509 certificate
1419to the client, and request that the client send its own x509 certificate.
1420The server will validate the client's certificate against the CA certificate,
1421and reject clients when validation fails. If the certificate authority is
1422trusted, this is a sufficient authentication mechanism. You may still wish
1423to set a password on the VNC server as a second authentication layer. The
1424path following this option specifies where the x509 certificates are to
1425be loaded from. See the @ref{vnc_security} section for details on generating
1426certificates.
1427
3e305e4a
DB
1428This option is now deprecated in favour of using the @option{tls-creds}
1429argument.
1430
5824d651
BS
1431@item sasl
1432
1433Require that the client use SASL to authenticate with the VNC server.
1434The exact choice of authentication method used is controlled from the
1435system / user's SASL configuration file for the 'qemu' service. This
1436is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1437unprivileged user, an environment variable SASL_CONF_PATH can be used
1438to make it search alternate locations for the service config.
1439While some SASL auth methods can also provide data encryption (eg GSSAPI),
1440it is recommended that SASL always be combined with the 'tls' and
1441'x509' settings to enable use of SSL and server certificates. This
1442ensures a data encryption preventing compromise of authentication
1443credentials. See the @ref{vnc_security} section for details on using
1444SASL authentication.
1445
1446@item acl
1447
1448Turn on access control lists for checking of the x509 client certificate
1449and SASL party. For x509 certs, the ACL check is made against the
1450certificate'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
1452made against the username, which depending on the SASL plugin, may
1453include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}.
1454When the @option{acl} flag is set, the initial access list will be
1455empty, with a @code{deny} policy. Thus no one will be allowed to
1456use the VNC server until the ACLs have been loaded. This can be
1457achieved using the @code{acl} monitor command.
1458
6f9c78c1
CC
1459@item lossy
1460
1461Enable lossy compression methods (gradient, JPEG, ...). If this
1462option is set, VNC client may receive lossy framebuffer updates
1463depending on its encoding settings. Enabling this option can save
1464a lot of bandwidth at the expense of quality.
1465
80e0c8c3
CC
1466@item non-adaptive
1467
1468Disable adaptive encodings. Adaptive encodings are enabled by default.
1469An adaptive encoding will try to detect frequently updated screen regions,
1470and send updates in these regions using a lossy encoding (like JPEG).
61cc8701 1471This can be really helpful to save bandwidth when playing videos. Disabling
9d85d557 1472adaptive encodings restores the original static behavior of encodings
80e0c8c3
CC
1473like Tight.
1474
8cf36489
GH
1475@item share=[allow-exclusive|force-shared|ignore]
1476
1477Set display sharing policy. 'allow-exclusive' allows clients to ask
1478for exclusive access. As suggested by the rfb spec this is
1479implemented by dropping other connections. Connecting multiple
1480clients in parallel requires all clients asking for a shared session
1481(vncviewer: -shared switch). This is the default. 'force-shared'
1482disables exclusive client access. Useful for shared desktop sessions,
1483where you don't want someone forgetting specify -shared disconnect
1484everybody else. 'ignore' completely ignores the shared flag and
1485allows everybody connect unconditionally. Doesn't conform to the rfb
b65ee4fa 1486spec but is traditional QEMU behavior.
8cf36489 1487
c5ce8333
GH
1488@item key-delay-ms
1489
1490Set keyboard delay, for key down and key up events, in milliseconds.
1491Default is 1. Keyboards are low-bandwidth devices, so this slowdown
1492can help the device and guest to keep up and not lose events in case
1493events are arriving in bulk. Possible causes for the latter are flaky
1494network connections, or scripts for automated testing.
1495
5824d651
BS
1496@end table
1497ETEXI
1498
1499STEXI
1500@end table
1501ETEXI
a3adb7ad 1502ARCHHEADING(, QEMU_ARCH_I386)
5824d651 1503
43f187a5 1504ARCHHEADING(i386 target only, QEMU_ARCH_I386)
5824d651
BS
1505STEXI
1506@table @option
1507ETEXI
1508
5824d651 1509DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
ad96090a
BS
1510 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
1511 QEMU_ARCH_I386)
5824d651
BS
1512STEXI
1513@item -win2k-hack
6616b2ad 1514@findex -win2k-hack
5824d651
BS
1515Use it when installing Windows 2000 to avoid a disk full bug. After
1516Windows 2000 is installed, you no longer need this option (this option
1517slows down the IDE transfers).
1518ETEXI
1519
1ed2fc1f 1520HXCOMM Deprecated by -rtc
ad96090a 1521DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
5824d651 1522
5824d651 1523DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
ad96090a
BS
1524 "-no-fd-bootchk disable boot signature checking for floppy disks\n",
1525 QEMU_ARCH_I386)
5824d651
BS
1526STEXI
1527@item -no-fd-bootchk
6616b2ad 1528@findex -no-fd-bootchk
4eda32f5 1529Disable boot signature checking for floppy disks in BIOS. May
5824d651
BS
1530be needed to boot from old floppy disks.
1531ETEXI
1532
5824d651 1533DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
f5d8c8cd 1534 "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
5824d651
BS
1535STEXI
1536@item -no-acpi
6616b2ad 1537@findex -no-acpi
5824d651
BS
1538Disable ACPI (Advanced Configuration and Power Interface) support. Use
1539it if your guest OS complains about ACPI problems (PC target machine
1540only).
1541ETEXI
1542
5824d651 1543DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
ad96090a 1544 "-no-hpet disable HPET\n", QEMU_ARCH_I386)
5824d651
BS
1545STEXI
1546@item -no-hpet
6616b2ad 1547@findex -no-hpet
5824d651
BS
1548Disable HPET support.
1549ETEXI
1550
5824d651 1551DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
104bf02e 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"
ad96090a 1553 " ACPI table description\n", QEMU_ARCH_I386)
5824d651
BS
1554STEXI
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}]...]
6616b2ad 1556@findex -acpitable
5824d651 1557Add ACPI table with specified header fields and context from specified files.
104bf02e
MT
1558For file=, take whole ACPI table from the specified files, including all
1559ACPI headers (possible overridden by other options).
1560For data=, only data
1561portion of the table is used, all header information is specified in the
1562command line.
ae123749
LE
1563If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
1564fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
1565to ensure the field matches required by the Microsoft SLIC spec and the ACPI
1566spec.
5824d651
BS
1567ETEXI
1568
b6f6e3d3
AL
1569DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
1570 "-smbios file=binary\n"
ca1a8a06 1571 " load SMBIOS entry from binary file\n"
b155eb1d
GS
1572 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
1573 " [,uefi=on|off]\n"
ca1a8a06 1574 " specify SMBIOS type 0 fields\n"
b6f6e3d3
AL
1575 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1576 " [,uuid=uuid][,sku=str][,family=str]\n"
b155eb1d
GS
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"
3ebd6cc8 1588 " [,asset=str][,part=str][,speed=%d]\n"
b155eb1d 1589 " specify SMBIOS type 17 fields\n",
c30e1565 1590 QEMU_ARCH_I386 | QEMU_ARCH_ARM)
b6f6e3d3
AL
1591STEXI
1592@item -smbios file=@var{binary}
6616b2ad 1593@findex -smbios
b6f6e3d3
AL
1594Load SMBIOS entry from binary file.
1595
84351843 1596@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
b6f6e3d3
AL
1597Specify SMBIOS type 0 fields
1598
b155eb1d 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}]
b6f6e3d3 1600Specify SMBIOS type 1 fields
b155eb1d
GS
1601
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}]
1603Specify SMBIOS type 2 fields
1604
1605@item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
1606Specify SMBIOS type 3 fields
1607
1608@item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
1609Specify SMBIOS type 4 fields
1610
3ebd6cc8 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}]
b155eb1d 1612Specify SMBIOS type 17 fields
b6f6e3d3
AL
1613ETEXI
1614
5824d651
BS
1615STEXI
1616@end table
1617ETEXI
c70a01e4 1618DEFHEADING()
5824d651 1619
43f187a5 1620DEFHEADING(Network options)
5824d651
BS
1621STEXI
1622@table @option
1623ETEXI
1624
ad196a9d
JK
1625HXCOMM Legacy slirp options (now moved to -net user):
1626#ifdef CONFIG_SLIRP
ad96090a
BS
1627DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL)
1628DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL)
1629DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL)
ad196a9d 1630#ifndef _WIN32
ad96090a 1631DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
ad196a9d
JK
1632#endif
1633#endif
1634
6a8b4a5b 1635DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
5824d651 1636#ifdef CONFIG_SLIRP
0b11c036
ST
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"
d8eb3864 1640 " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
63d2960b 1641 " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
ad196a9d 1642#ifndef _WIN32
c92ef6a2 1643 "[,smb=dir[,smbserver=addr]]\n"
ad196a9d 1644#endif
6a8b4a5b
TH
1645 " configure a user mode network backend with ID 'str',\n"
1646 " its DHCP server and optional services\n"
5824d651
BS
1647#endif
1648#ifdef _WIN32
6a8b4a5b
TH
1649 "-netdev tap,id=str,ifname=name\n"
1650 " configure a host TAP network backend with ID 'str'\n"
5824d651 1651#else
6a8b4a5b 1652 "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
584613ea 1653 " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
6a8b4a5b 1654 " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
69e87b32 1655 " [,poll-us=n]\n"
6a8b4a5b 1656 " configure a host TAP network backend with ID 'str'\n"
584613ea 1657 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
a7c36ee4
CB
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"
ca1a8a06 1661 " use '[down]script=no' to disable script execution\n"
a7c36ee4
CB
1662 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
1663 " configure it\n"
5824d651 1664 " use 'fd=h' to connect to an already opened TAP interface\n"
2ca81baa 1665 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
ca1a8a06 1666 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
f157ed20 1667 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
ca1a8a06
BR
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"
82b0d80e 1670 " use vhost=on to enable experimental in kernel accelerator\n"
5430a28f
MT
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"
82b0d80e 1673 " use 'vhostfd=h' to connect to an already opened vhost net device\n"
2ca81baa 1674 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
ec396014 1675 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
69e87b32
JW
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"
6a8b4a5b
TH
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"
3fb69aa1
AI
1682#endif
1683#ifdef __linux__
6a8b4a5b
TH
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"
3fb69aa1 1690 " Linux kernel 3.3+ as well as most routers can talk\n"
2f47b403 1691 " L2TPv3. This transport allows connecting a VM to a VM,\n"
3fb69aa1
AI
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"
3952651a 1698 " use 'srcport=' to specify source udp port\n"
3fb69aa1
AI
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"
5824d651 1709#endif
6a8b4a5b
TH
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"
3a75e74c 1715 " use 'localaddr=addr' to specify the host address to send packets from\n"
6a8b4a5b
TH
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"
5824d651 1719#ifdef CONFIG_VDE
6a8b4a5b
TH
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"
5824d651
BS
1723 " Use group 'groupname' and mode 'octalmode' to change default\n"
1724 " ownership and permissions for communication port.\n"
58952137
VM
1725#endif
1726#ifdef CONFIG_NETMAP
6a8b4a5b 1727 "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
58952137
VM
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"
5824d651 1731#endif
6a8b4a5b
TH
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)
1736DEF("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"
bb9ea79e
AL
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"
ca1a8a06 1742 "-net none use it alone to have zero network devices. If no -net option\n"
6a8b4a5b
TH
1743 " is provided, the default is '-net nic -net user'\n"
1744 "-net ["
a1ea458f
MM
1745#ifdef CONFIG_SLIRP
1746 "user|"
1747#endif
1748 "tap|"
a7c36ee4 1749 "bridge|"
a1ea458f
MM
1750#ifdef CONFIG_VDE
1751 "vde|"
58952137
VM
1752#endif
1753#ifdef CONFIG_NETMAP
1754 "netmap|"
a1ea458f 1755#endif
6a8b4a5b
TH
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)
5824d651 1759STEXI
609c1dac 1760@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
6616b2ad 1761@findex -net
5824d651 1762Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
0d6b0b1d 1763= 0 is the default). The NIC is an e1000 by default on the PC
5607c388
MA
1764target. Optionally, the MAC address can be changed to @var{mac}, the
1765device address set to @var{addr} (PCI cards only),
ffe6370c
MT
1766and a @var{name} can be assigned for use in monitor commands.
1767Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
1768that 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
071c9394 1770NIC is created. QEMU can emulate several different models of network card.
5824d651 1771Valid values for @var{type} are
ffe6370c 1772@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er},
5824d651
BS
1773@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
1774@code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}.
585f6036 1775Not all devices are supported on all targets. Use @code{-net nic,model=help}
5824d651
BS
1776for a list of available devices for your target.
1777
08d12022 1778@item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
b8f490eb 1779@findex -netdev
ad196a9d 1780@item -net user[,@var{option}][,@var{option}][,...]
5824d651 1781Use the user mode network stack which requires no administrator
ad196a9d
JK
1782privilege to run. Valid options are:
1783
b3f046c2 1784@table @option
ad196a9d
JK
1785@item vlan=@var{n}
1786Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
1787
08d12022 1788@item id=@var{id}
f9cfd655 1789@itemx name=@var{name}
ad196a9d
JK
1790Assign symbolic name for use in monitor commands.
1791
0b11c036
ST
1792@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must
1793be enabled. If neither is specified both protocols are enabled.
1794
c92ef6a2
JK
1795@item net=@var{addr}[/@var{mask}]
1796Set IP network address the guest will see. Optionally specify the netmask,
1797either in the form a.b.c.d or as number of valid top-most bits. Default is
b0b36e5d 179810.0.2.0/24.
c92ef6a2
JK
1799
1800@item host=@var{addr}
1801Specify the guest-visible address of the host. Default is the 2nd IP in the
1802guest network, i.e. x.x.x.2.
ad196a9d 1803
d8eb3864
ST
1804@item ipv6-net=@var{addr}[/@var{int}]
1805Set IPv6 network address the guest will see (default is fec0::/64). The
1806network prefix is given in the usual hexadecimal IPv6 address
1807notation. The prefix size is optional, and is given as the number of
1808valid top-most bits (default is 64).
7aac531e 1809
d8eb3864 1810@item ipv6-host=@var{addr}
7aac531e
YB
1811Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
1812the guest network, i.e. xxxx::2.
1813
c54ed5bc 1814@item restrict=on|off
caef55ed 1815If this option is enabled, the guest will be isolated, i.e. it will not be
ad196a9d 1816able to contact the host and no guest IP packets will be routed over the host
caef55ed 1817to the outside. This option does not affect any explicitly set forwarding rules.
ad196a9d
JK
1818
1819@item hostname=@var{name}
63d2960b 1820Specifies the client hostname reported by the built-in DHCP server.
ad196a9d 1821
c92ef6a2
JK
1822@item dhcpstart=@var{addr}
1823Specify the first of the 16 IPs the built-in DHCP server can assign. Default
b0b36e5d 1824is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
c92ef6a2
JK
1825
1826@item dns=@var{addr}
1827Specify the guest-visible address of the virtual nameserver. The address must
1828be different from the host address. Default is the 3rd IP in the guest network,
1829i.e. x.x.x.3.
7aac531e 1830
d8eb3864 1831@item ipv6-dns=@var{addr}
7aac531e
YB
1832Specify the guest-visible address of the IPv6 virtual nameserver. The address
1833must be different from the host address. Default is the 3rd IP in the guest
1834network, i.e. xxxx::3.
c92ef6a2 1835
63d2960b
KS
1836@item dnssearch=@var{domain}
1837Provides an entry for the domain-search list sent by the built-in
1838DHCP server. More than one domain suffix can be transmitted by specifying
1839this option multiple times. If supported, this will cause the guest to
1840automatically try to append the given domain suffix(es) in case a domain name
1841can not be resolved.
1842
1843Example:
1844@example
1845qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...]
1846@end example
1847
ad196a9d
JK
1848@item tftp=@var{dir}
1849When using the user mode network stack, activate a built-in TFTP
1850server. The files in @var{dir} will be exposed as the root of a TFTP server.
1851The TFTP client on the guest must be configured in binary mode (use the command
c92ef6a2 1852@code{bin} of the Unix TFTP client).
ad196a9d
JK
1853
1854@item bootfile=@var{file}
1855When using the user mode network stack, broadcast @var{file} as the BOOTP
1856filename. In conjunction with @option{tftp}, this can be used to network boot
1857a guest from a local directory.
1858
1859Example (using pxelinux):
1860@example
3804da9d 1861qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
ad196a9d
JK
1862@end example
1863
c92ef6a2 1864@item smb=@var{dir}[,smbserver=@var{addr}]
ad196a9d
JK
1865When using the user mode network stack, activate a built-in SMB
1866server so that Windows OSes can access to the host files in @file{@var{dir}}
c92ef6a2
JK
1867transparently. The IP address of the SMB server can be set to @var{addr}. By
1868default the 4th IP in the guest network is used, i.e. x.x.x.4.
ad196a9d
JK
1869
1870In the guest Windows OS, the line:
1871@example
187210.0.2.4 smbserver
1873@end example
1874must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
1875or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
1876
1877Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
1878
e2d8830e
BS
1879Note that a SAMBA server must be installed on the host OS.
1880QEMU was tested successfully with smbd versions from Red Hat 9,
1881Fedora Core 3 and OpenSUSE 11.x.
ad196a9d 1882
3c6a0580 1883@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
c92ef6a2
JK
1884Redirect incoming TCP or UDP connections to the host port @var{hostport} to
1885the 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
3c6a0580
JK
1887given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
1888be bound to a specific host interface. If no connection type is set, TCP is
c92ef6a2 1889used. This option can be given multiple times.
ad196a9d
JK
1890
1891For example, to redirect host X11 connection from screen 1 to guest
1892screen 0, use the following:
1893
1894@example
1895# on the host
3804da9d 1896qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
ad196a9d
JK
1897# this host xterm should open in the guest X11 server
1898xterm -display :1
1899@end example
1900
1901To redirect telnet connections from host port 5555 to telnet port on
1902the guest, use the following:
1903
1904@example
1905# on the host
3804da9d 1906qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...]
ad196a9d
JK
1907telnet localhost 5555
1908@end example
1909
1910Then when you use on the host @code{telnet localhost 5555}, you
1911connect to the guest telnet server.
5824d651 1912
c92ef6a2 1913@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
f9cfd655 1914@itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
3c6a0580 1915Forward guest TCP connections to the IP address @var{server} on port @var{port}
b412eb61
AG
1916to the character device @var{dev} or to a program executed by @var{cmd:command}
1917which gets spawned for each connection. This option can be given multiple times.
1918
43ffe61f 1919You can either use a chardev directly and have that one used throughout QEMU's
b412eb61
AG
1920lifetime, like in the following example:
1921
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
1925qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...]
1926@end example
1927
1928Or you can execute a command on every TCP connection established by the guest,
43ffe61f 1929so that QEMU behaves similar to an inetd process for that virtual server:
b412eb61
AG
1930
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
1934qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
1935@end example
ad196a9d
JK
1936
1937@end table
1938
1939Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still
1940processed and applied to -net user. Mixing them with the new configuration
1941syntax gives undefined results. Their use for new applications is discouraged
1942as they will be removed from future versions.
5824d651 1943
584613ea
AK
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}]
a7c36ee4
CB
1946Connect the host TAP network interface @var{name} to VLAN @var{n}.
1947
1948Use the network script @var{file} to configure it and the network script
5824d651 1949@var{dfile} to deconfigure it. If @var{name} is not provided, the OS
a7c36ee4
CB
1950automatically 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}
1953to disable script execution.
1954
1955If running QEMU as an unprivileged user, use the network helper
584613ea
AK
1956@var{helper} to configure the TAP interface and attach it to the bridge.
1957The default network helper executable is @file{/path/to/qemu-bridge-helper}
1958and the default bridge device is @file{br0}.
a7c36ee4
CB
1959
1960@option{fd}=@var{h} can be used to specify the handle of an already
1961opened host TAP interface.
1962
1963Examples:
5824d651
BS
1964
1965@example
a7c36ee4 1966#launch a QEMU instance with the default network script
3804da9d 1967qemu-system-i386 linux.img -net nic -net tap
5824d651
BS
1968@end example
1969
5824d651 1970@example
a7c36ee4
CB
1971#launch a QEMU instance with two NICs, each one connected
1972#to a TAP device
3804da9d
SW
1973qemu-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
5824d651
BS
1976@end example
1977
a7c36ee4
CB
1978@example
1979#launch a QEMU instance with the default network helper to
1980#connect a TAP device to bridge br0
3804da9d 1981qemu-system-i386 linux.img \
420508fb 1982 -net nic -net tap,"helper=/path/to/qemu-bridge-helper"
a7c36ee4
CB
1983@end example
1984
08d12022 1985@item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
f9cfd655 1986@itemx -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}]
a7c36ee4
CB
1987Connect a host TAP network interface to a host bridge device.
1988
1989Use the network helper @var{helper} to configure the TAP interface and
1990attach it to the bridge. The default network helper executable is
420508fb 1991@file{/path/to/qemu-bridge-helper} and the default bridge
a7c36ee4
CB
1992device is @file{br0}.
1993
1994Examples:
1995
1996@example
1997#launch a QEMU instance with the default network helper to
1998#connect a TAP device to bridge br0
3804da9d 1999qemu-system-i386 linux.img -net bridge -net nic,model=virtio
a7c36ee4
CB
2000@end example
2001
2002@example
2003#launch a QEMU instance with the default network helper to
2004#connect a TAP device to bridge qemubr0
3804da9d 2005qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio
a7c36ee4
CB
2006@end example
2007
08d12022 2008@item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
f9cfd655 2009@itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
5824d651
BS
2010
2011Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual
2012machine using a TCP socket connection. If @option{listen} is
2013specified, QEMU waits for incoming connections on @var{port}
2014(@var{host} is optional). @option{connect} is used to connect to
2015another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
2016specifies an already opened TCP socket.
2017
2018Example:
2019@example
2020# launch a first QEMU instance
3804da9d
SW
2021qemu-system-i386 linux.img \
2022 -net nic,macaddr=52:54:00:12:34:56 \
2023 -net socket,listen=:1234
5824d651
BS
2024# connect the VLAN 0 of this instance to the VLAN 0
2025# of the first instance
3804da9d
SW
2026qemu-system-i386 linux.img \
2027 -net nic,macaddr=52:54:00:12:34:57 \
2028 -net socket,connect=127.0.0.1:1234
5824d651
BS
2029@end example
2030
08d12022 2031@item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
f9cfd655 2032@itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
5824d651
BS
2033
2034Create a VLAN @var{n} shared with another QEMU virtual
2035machines using a UDP multicast socket, effectively making a bus for
2036every QEMU with same multicast address @var{maddr} and @var{port}.
2037NOTES:
2038@enumerate
2039@item
2040Several QEMU can be running on different hosts and share same bus (assuming
2041correct multicast setup for these hosts).
2042@item
2043mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
2044@url{http://user-mode-linux.sf.net}.
2045@item
2046Use @option{fd=h} to specify an already opened UDP multicast socket.
2047@end enumerate
2048
2049Example:
2050@example
2051# launch one QEMU instance
3804da9d
SW
2052qemu-system-i386 linux.img \
2053 -net nic,macaddr=52:54:00:12:34:56 \
2054 -net socket,mcast=230.0.0.1:1234
5824d651 2055# launch another QEMU instance on same "bus"
3804da9d
SW
2056qemu-system-i386 linux.img \
2057 -net nic,macaddr=52:54:00:12:34:57 \
2058 -net socket,mcast=230.0.0.1:1234
5824d651 2059# launch yet another QEMU instance on same "bus"
3804da9d
SW
2060qemu-system-i386 linux.img \
2061 -net nic,macaddr=52:54:00:12:34:58 \
2062 -net socket,mcast=230.0.0.1:1234
5824d651
BS
2063@end example
2064
2065Example (User Mode Linux compat.):
2066@example
2067# launch QEMU instance (note mcast address selected
2068# is UML's default)
3804da9d
SW
2069qemu-system-i386 linux.img \
2070 -net nic,macaddr=52:54:00:12:34:56 \
2071 -net socket,mcast=239.192.168.1:1102
5824d651
BS
2072# launch UML
2073/path/to/linux ubd0=/path/to/root_fs eth0=mcast
2074@end example
2075
3a75e74c
MR
2076Example (send packets from host's 1.2.3.4):
2077@example
3804da9d
SW
2078qemu-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
3a75e74c
MR
2081@end example
2082
3fb69aa1 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}]
f9cfd655 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}]
3fb69aa1
AI
2085Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular
2086protocol to transport Ethernet (and other Layer 2) data frames between
2087two systems. It is present in routers, firewalls and the Linux kernel
2088(from version 3.3 onwards).
2089
2090This transport allows a VM to communicate to another VM, router or firewall directly.
2091
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}
f9cfd655 2105@itemx txcookie=@var{txcookie}
3fb69aa1
AI
2106 Cookies are a weak form of security in the l2tpv3 specification.
2107Their function is mostly to prevent misconfiguration. By default they are 32
2108bit.
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
2113draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
2114@item pincounter=on
2115 Work around broken counter handling in peer. This may also help on
2116networks which have packet reorder.
2117@item offset=@var{offset}
2118 Add an extra offset between header and data
2119
2120For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
2121on 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
2125ip 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
2127ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
2128 0xFFFFFFFF peer_session_id 0xFFFFFFFF
2129ifconfig vmtunnel0 mtu 1500
2130ifconfig vmtunnel0 up
2131brctl addif br-lan vmtunnel0
2132
2133
2134# on 4.3.2.1
2135# launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
2136
2137qemu-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
2138
2139
2140@end example
2141
08d12022 2142@item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
f9cfd655 2143@itemx -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
5824d651
BS
2144Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and
2145listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
2146and MODE @var{octalmode} to change default ownership and permissions for
c1ba4e0b 2147communication port. This option is only available if QEMU has been compiled
5824d651
BS
2148with vde support enabled.
2149
2150Example:
2151@example
2152# launch vde switch
2153vde_switch -F -sock /tmp/myswitch
2154# launch QEMU instance
3804da9d 2155qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch
5824d651
BS
2156@end example
2157
40e8c26d
SH
2158@item -netdev hubport,id=@var{id},hubid=@var{hubid}
2159
2160Create a hub port on QEMU "vlan" @var{hubid}.
2161
2162The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single
2163netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the
2164required hub automatically.
2165
b931bfbf 2166@item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
03ce5744
NN
2167
2168Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
2169be a unix domain socket backed one. The vhost-user uses a specifically defined
2170protocol to pass vhost ioctl replacement messages to an application on the other
2171end of the socket. On non-MSIX guests, the feature can be forced with
b931bfbf
CO
2172@var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
2173be created for multiqueue vhost-user.
03ce5744
NN
2174
2175Example:
2176@example
2177qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
2178 -numa node,memdev=mem \
79cad2fa 2179 -chardev socket,id=chr0,path=/path/to/socket \
03ce5744
NN
2180 -netdev type=vhost-user,id=net0,chardev=chr0 \
2181 -device virtio-net-pci,netdev=net0
2182@end example
2183
bb9ea79e
AL
2184@item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}]
2185Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default).
2186At most @var{len} bytes (64k by default) per packet are stored. The file format is
2187libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
d3e0c032 2188Note: For devices created with '-netdev', use '-object filter-dump,...' instead.
bb9ea79e 2189
5824d651
BS
2190@item -net none
2191Indicate that no network devices should be configured. It is used to
2192override the default configuration (@option{-net nic -net user}) which
2193is activated if no @option{-net} options are provided.
c70a01e4 2194ETEXI
5824d651 2195
c70a01e4 2196STEXI
5824d651
BS
2197@end table
2198ETEXI
7273a2db
MB
2199DEFHEADING()
2200
43f187a5 2201DEFHEADING(Character device options)
c70a01e4
MA
2202STEXI
2203
2204The general form of a character device option is:
2205@table @option
2206ETEXI
7273a2db
MB
2207
2208DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
517b3d40 2209 "-chardev help\n"
d0d7708b 2210 "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
5dd1f02b 2211 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
d0d7708b 2212 " [,server][,nowait][,telnet][,reconnect=seconds][,mux=on|off]\n"
a8fb5427 2213 " [,logfile=PATH][,logappend=on|off][,tls-creds=ID] (tcp)\n"
d0d7708b
DB
2214 "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,reconnect=seconds]\n"
2215 " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
7273a2db 2216 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
97331287 2217 " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
d0d7708b
DB
2218 " [,logfile=PATH][,logappend=on|off]\n"
2219 "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
7273a2db 2220 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
d0d7708b
DB
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"
7273a2db 2225#ifdef _WIN32
d0d7708b
DB
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"
7273a2db 2228#else
d0d7708b
DB
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"
7273a2db
MB
2231#endif
2232#ifdef CONFIG_BRLAPI
d0d7708b 2233 "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
7273a2db
MB
2234#endif
2235#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
2236 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
d0d7708b
DB
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"
7273a2db
MB
2239#endif
2240#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
d0d7708b
DB
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"
cbcc6336
AL
2243#endif
2244#if defined(CONFIG_SPICE)
d0d7708b
DB
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"
7273a2db 2247#endif
ad96090a 2248 , QEMU_ARCH_ALL
7273a2db
MB
2249)
2250
2251STEXI
97331287 2252@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}]
6616b2ad 2253@findex -chardev
7273a2db
MB
2254Backend is one of:
2255@option{null},
2256@option{socket},
2257@option{udp},
2258@option{msmouse},
2259@option{vc},
4f57378f 2260@option{ringbuf},
7273a2db
MB
2261@option{file},
2262@option{pipe},
2263@option{console},
2264@option{serial},
2265@option{pty},
2266@option{stdio},
2267@option{braille},
2268@option{tty},
88a946d3 2269@option{parallel},
cbcc6336
AL
2270@option{parport},
2271@option{spicevmc}.
5a49d3e9 2272@option{spiceport}.
7273a2db
MB
2273The specific backend will determine the applicable options.
2274
517b3d40
LM
2275Use "-chardev help" to print all available chardev backend types.
2276
7273a2db
MB
2277All devices must have an id, which can be any string up to 127 characters long.
2278It is used to uniquely identify this device in other command line directives.
2279
97331287 2280A character device may be used in multiplexing mode by multiple front-ends.
a40db1b3
PM
2281Specify @option{mux=on} to enable this mode.
2282A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
2283backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
2284If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
2285create a multiplexer with your specified ID, and you can then configure multiple
2286front ends to use that chardev ID for their input/output. Up to four different
2287front ends can be connected to a single multiplexed chardev. (Without
2288multiplexing enabled, a chardev can only be used by a single front end.)
2289For instance you could use this to allow a single stdio chardev to be used by
2290two serial ports and the QEMU monitor:
2291
2292@example
2293-chardev stdio,mux=on,id=char0 \
bdbcb547 2294-mon chardev=char0,mode=readline \
a40db1b3
PM
2295-serial chardev:char0 \
2296-serial chardev:char0
2297@end example
2298
2299You can have more than one multiplexer in a system configuration; for instance
2300you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
2301multiplexed between the QEMU monitor and a parallel port:
2302
2303@example
2304-chardev stdio,mux=on,id=char0 \
bdbcb547 2305-mon chardev=char0,mode=readline \
a40db1b3
PM
2306-parallel chardev:char0 \
2307-chardev tcp,...,mux=on,id=char1 \
2308-serial chardev:char1 \
2309-serial chardev:char1
2310@end example
2311
2312When you're using a multiplexed character device, some escape sequences are
2313interpreted in the input. @xref{mux_keys, Keys in the character backend
2314multiplexer}.
2315
2316Note that some other command line options may implicitly create multiplexed
2317character backends; for instance @option{-serial mon:stdio} creates a
2318multiplexed stdio backend connected to the serial port and the QEMU monitor,
2319and @option{-nographic} also multiplexes the console and the monitor to
2320stdio.
2321
2322There is currently no support for multiplexing in the other direction
2323(where a single QEMU front end takes input and output from multiple chardevs).
97331287 2324
d0d7708b
DB
2325Every backend supports the @option{logfile} option, which supplies the path
2326to a file to record all data transmitted via the backend. The @option{logappend}
2327option controls whether the log file will be truncated or appended to when
2328opened.
2329
2330Further options to each backend are described below.
7273a2db
MB
2331
2332@item -chardev null ,id=@var{id}
2333A void device. This device will not emit any data, and will drop any data it
2334receives. The null backend does not take any options.
2335
a8fb5427 2336@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] [,reconnect=@var{seconds}] [,tls-creds=@var{id}]
7273a2db
MB
2337
2338Create a two-way stream socket, which can be either a TCP or a unix socket. A
2339unix socket will be created if @option{path} is specified. Behaviour is
2340undefined if TCP options are specified for a unix socket.
2341
2342@option{server} specifies that the socket shall be a listening socket.
2343
2344@option{nowait} specifies that QEMU should not block waiting for a client to
2345connect to a listening socket.
2346
2347@option{telnet} specifies that traffic on the socket should interpret telnet
2348escape sequences.
2349
5dd1f02b
CM
2350@option{reconnect} sets the timeout for reconnecting on non-server sockets when
2351the remote end goes away. qemu will delay this many seconds and then attempt
2352to reconnect. Zero disables reconnecting, and is the default.
2353
a8fb5427
DB
2354@option{tls-creds} requests enablement of the TLS protocol for encryption,
2355and specifies the id of the TLS credentials to use for the handshake. The
2356credentials must be previously created with the @option{-object tls-creds}
2357argument.
2358
7273a2db
MB
2359TCP and unix socket options are given below:
2360
2361@table @option
2362
8d533561 2363@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay]
7273a2db
MB
2364
2365@option{host} for a listening socket specifies the local address to be bound.
2366For a connecting socket species the remote host to connect to. @option{host} is
2367optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
2368
2369@option{port} for a listening socket specifies the local port to be bound. For a
2370connecting 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.
2373
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
2376to and including @option{to} until it succeeds. @option{to} must be specified
2377as a port number.
2378
2379@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2380If neither is specified the socket may use either protocol.
2381
2382@option{nodelay} disables the Nagle algorithm.
2383
2384@item unix options: path=@var{path}
2385
2386@option{path} specifies the local path of the unix socket. @option{path} is
2387required.
2388
2389@end table
2390
2391@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6]
2392
2393Sends all traffic from the guest to a remote host over UDP.
2394
2395@option{host} specifies the remote host to connect to. If not specified it
2396defaults to @code{localhost}.
2397
2398@option{port} specifies the port on the remote host to connect to. @option{port}
2399is required.
2400
2401@option{localaddr} specifies the local address to bind to. If not specified it
2402defaults to @code{0.0.0.0}.
2403
2404@option{localport} specifies the local port to bind to. If not specified any
2405available local port will be used.
2406
2407@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2408If neither is specified the device may use either protocol.
2409
2410@item -chardev msmouse ,id=@var{id}
2411
2412Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
2413take any options.
2414
2415@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]]
2416
2417Connect to a QEMU text console. @option{vc} may optionally be given a specific
2418size.
2419
2420@option{width} and @option{height} specify the width and height respectively of
2421the console, in pixels.
2422
2423@option{cols} and @option{rows} specify that the console be sized to fit a text
2424console with the given dimensions.
2425
4f57378f 2426@item -chardev ringbuf ,id=@var{id} [,size=@var{size}]
51767e7c 2427
3949e594 2428Create a ring buffer with fixed size @option{size}.
e69f7d25 2429@var{size} must be a power of two and defaults to @code{64K}.
51767e7c 2430
7273a2db
MB
2431@item -chardev file ,id=@var{id} ,path=@var{path}
2432
2433Log all traffic received from the guest to a file.
2434
2435@option{path} specifies the path of the file to be opened. This file will be
2436created if it does not already exist, and overwritten if it does. @option{path}
2437is required.
2438
2439@item -chardev pipe ,id=@var{id} ,path=@var{path}
2440
2441Create a two-way connection to the guest. The behaviour differs slightly between
2442Windows hosts and other hosts:
2443
2444On Windows, a single duplex pipe will be created at
2445@file{\\.pipe\@option{path}}.
2446
2447On 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
2449received 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
2451be present.
2452
2453@option{path} forms part of the pipe path as described above. @option{path} is
2454required.
2455
2456@item -chardev console ,id=@var{id}
2457
2458Send traffic from the guest to QEMU's standard output. @option{console} does not
2459take any options.
2460
2461@option{console} is only available on Windows hosts.
2462
2463@item -chardev serial ,id=@var{id} ,path=@option{path}
2464
2465Send traffic from the guest to a serial device on the host.
2466
d59044ef
GH
2467On Unix hosts serial will actually accept any tty device,
2468not only serial lines.
7273a2db
MB
2469
2470@option{path} specifies the name of the serial device to open.
2471
2472@item -chardev pty ,id=@var{id}
2473
2474Create a new pseudo-terminal on the host and connect to it. @option{pty} does
2475not take any options.
2476
2477@option{pty} is not available on Windows hosts.
2478
b7fdb3ab 2479@item -chardev stdio ,id=@var{id} [,signal=on|off]
b65ee4fa 2480Connect to standard input and standard output of the QEMU process.
b7fdb3ab
AJ
2481
2482@option{signal} controls if signals are enabled on the terminal, that includes
2483exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
2484default, use @option{signal=off} to disable it.
2485
7273a2db
MB
2486@item -chardev braille ,id=@var{id}
2487
2488Connect to a local BrlAPI server. @option{braille} does not take any options.
2489
2490@item -chardev tty ,id=@var{id} ,path=@var{path}
2491
7273a2db 2492@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
d037d6bb 2493DragonFlyBSD hosts. It is an alias for @option{serial}.
7273a2db
MB
2494
2495@option{path} specifies the path to the tty. @option{path} is required.
2496
88a946d3 2497@item -chardev parallel ,id=@var{id} ,path=@var{path}
f9cfd655 2498@itemx -chardev parport ,id=@var{id} ,path=@var{path}
7273a2db 2499
88a946d3 2500@option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
7273a2db
MB
2501
2502Connect to a local parallel port.
2503
2504@option{path} specifies the path to the parallel port device. @option{path} is
2505required.
2506
cbcc6336
AL
2507@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2508
3a846906
SH
2509@option{spicevmc} is only available when spice support is built in.
2510
cbcc6336
AL
2511@option{debug} debug level for spicevmc
2512
2513@option{name} name of spice channel to connect to
2514
2515Connect to a spice virtual machine channel, such as vdiport.
cbcc6336 2516
5a49d3e9
MAL
2517@item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2518
2519@option{spiceport} is only available when spice support is built in.
2520
2521@option{debug} debug level for spicevmc
2522
2523@option{name} name of spice port to connect to
2524
2525Connect to a spice port, allowing a Spice client to handle the traffic
2526identified by a name (preferably a fqdn).
c70a01e4 2527ETEXI
5a49d3e9 2528
c70a01e4 2529STEXI
7273a2db
MB
2530@end table
2531ETEXI
7273a2db
MB
2532DEFHEADING()
2533
43f187a5 2534DEFHEADING(Device URL Syntax)
c70a01e4 2535STEXI
0f5314a2
RS
2536
2537In addition to using normal file images for the emulated storage devices,
2538QEMU can also use networked resources such as iSCSI devices. These are
2539specified using a special URL syntax.
2540
2541@table @option
2542@item iSCSI
2543iSCSI support allows QEMU to access iSCSI resources directly and use as
2544images for the guest storage. Both disk and cdrom images are supported.
2545
2546Syntax for specifying iSCSI LUNs is
2547``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
2548
31459f46
RS
2549By 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
2551line or a configuration file.
2552
5dd7a535
PL
2553Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect
2554stalled requests and force a reestablishment of the session. The timeout
9049736e
PL
2555is specified in seconds. The default is 0 which means no timeout. Libiscsi
25561.15.0 or greater is required for this feature.
31459f46 2557
0f5314a2
RS
2558Example (without authentication):
2559@example
3804da9d
SW
2560qemu-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
0f5314a2
RS
2563@end example
2564
2565Example (CHAP username/password via URL):
2566@example
3804da9d 2567qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
0f5314a2
RS
2568@end example
2569
2570Example (CHAP username/password via environment variables):
2571@example
2572LIBISCSI_CHAP_USERNAME="user" \
2573LIBISCSI_CHAP_PASSWORD="password" \
3804da9d 2574qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
0f5314a2
RS
2575@end example
2576
2577iSCSI support is an optional feature of QEMU and only available when
2578compiled and linked against libiscsi.
f9dadc98
RS
2579ETEXI
2580DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2581 "-iscsi [user=user][,password=password]\n"
2582 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
2fe3798c 2583 " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
5dd7a535 2584 " [,timeout=timeout]\n"
f9dadc98
RS
2585 " iSCSI session parameters\n", QEMU_ARCH_ALL)
2586STEXI
0f5314a2 2587
31459f46
RS
2588iSCSI parameters such as username and password can also be specified via
2589a configuration file. See qemu-doc for more information and examples.
2590
08ae330e
RS
2591@item NBD
2592QEMU supports NBD (Network Block Devices) both using TCP protocol as well
2593as Unix Domain Sockets.
2594
2595Syntax for specifying a NBD device using TCP
2596``nbd:<server-ip>:<port>[:exportname=<export>]''
2597
2598Syntax for specifying a NBD device using Unix Domain Sockets
2599``nbd:unix:<domain-socket>[:exportname=<export>]''
2600
2601
2602Example for TCP
2603@example
3804da9d 2604qemu-system-i386 --drive file=nbd:192.0.2.1:30000
08ae330e
RS
2605@end example
2606
2607Example for Unix Domain Sockets
2608@example
3804da9d 2609qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket
08ae330e
RS
2610@end example
2611
0a12ec87
RJ
2612@item SSH
2613QEMU supports SSH (Secure Shell) access to remote disks.
2614
2615Examples:
2616@example
2617qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img
2618qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
2619@end example
2620
2621Currently authentication must be done using ssh-agent. Other
2622authentication methods may be supported in future.
2623
d9990228
RS
2624@item Sheepdog
2625Sheepdog is a distributed storage system for QEMU.
2626QEMU supports using either local sheepdog devices or remote networked
2627devices.
2628
2629Syntax for specifying a sheepdog device
5d6768e3 2630@example
1b8bbb46 2631sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
5d6768e3 2632@end example
d9990228
RS
2633
2634Example
2635@example
5d6768e3 2636qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
d9990228
RS
2637@end example
2638
6135c5e1 2639See also @url{https://sheepdog.github.io/sheepdog/}.
d9990228 2640
8809e289 2641@item GlusterFS
736a83fa 2642GlusterFS is a user space distributed file system.
8809e289
BR
2643QEMU supports the use of GlusterFS volumes for hosting VM disk images using
2644TCP, Unix Domain Sockets and RDMA transport protocols.
2645
2646Syntax for specifying a VM disk image on GlusterFS volume is
2647@example
76b5550f
PKK
2648
2649URI:
2650gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
2651
2652JSON:
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":"..."@}]@}@}'
8809e289
BR
2656@end example
2657
2658
2659Example
2660@example
76b5550f
PKK
2661URI:
2662qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,
2663@ file.debug=9,file.logfile=/var/log/qemu-gluster.log
2664
2665JSON:
2666qemu-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"@}]@}@}'
2672qemu-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
8809e289
BR
2676@end example
2677
2678See also @url{http://www.gluster.org}.
0a86cb73 2679
23dce387
HR
2680@item HTTP/HTTPS/FTP/FTPS
2681QEMU supports read-only access to files accessed over http(s) and ftp(s).
0a86cb73
MB
2682
2683Syntax using a single filename:
2684@example
2685<protocol>://[<username>[:<password>]@@]<host>/<path>
2686@end example
2687
2688where:
2689@table @option
2690@item protocol
23dce387 2691'http', 'https', 'ftp', or 'ftps'.
0a86cb73
MB
2692
2693@item username
2694Optional username for authentication to the remote server.
2695
2696@item password
2697Optional password for authentication to the remote server.
2698
2699@item host
2700Address of the remote server.
2701
2702@item path
2703Path on the remote server, including any query string.
2704@end table
2705
2706The following options are also supported:
2707@table @option
2708@item url
2709The full URL when passing options to the driver explicitly.
2710
2711@item readahead
2712The amount of data to read ahead with each range request to the remote server.
2713This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
2714does not have a suffix, it will be assumed to be in bytes. The value must be a
2715multiple of 512 bytes. It defaults to 256k.
2716
2717@item sslverify
2718Whether to verify the remote server's certificate when connecting over SSL. It
2719can have the value 'on' or 'off'. It defaults to 'on'.
212aefaa 2720
a94f83d9
RJ
2721@item cookie
2722Send this cookie (it can also be a list of cookies separated by ';') with
2723each outgoing request. Only supported when using protocols such as HTTP
2724which support cookies, otherwise ignored.
2725
212aefaa
DHB
2726@item timeout
2727Set the timeout in seconds of the CURL connection. This timeout is the time
2728that CURL waits for a response from the remote server to get the size of the
2729image to be downloaded. If not set, the default timeout of 5 seconds is used.
0a86cb73
MB
2730@end table
2731
2732Note that when passing options to qemu explicitly, @option{driver} is the value
2733of <protocol>.
2734
2735Example: boot from a remote Fedora 20 live ISO image
2736@example
2737qemu-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
2738
2739qemu-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
2741
2742Example: boot from a remote Fedora 20 cloud image using a local overlay for
2743writes, copy-on-read, and a readahead of 64k
2744@example
2745qemu-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
2746
2747qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
2748@end example
2749
2750Example: boot from an image stored on a VMware vSphere server with a self-signed
212aefaa
DHB
2751certificate using a local overlay for writes, a readahead of 64k and a timeout
2752of 10 seconds.
0a86cb73 2753@example
212aefaa 2754qemu-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
0a86cb73
MB
2755
2756qemu-system-x86_64 -drive file=/tmp/test.qcow2
2757@end example
c70a01e4
MA
2758ETEXI
2759
2760STEXI
0f5314a2
RS
2761@end table
2762ETEXI
2763
43f187a5 2764DEFHEADING(Bluetooth(R) options)
c70a01e4
MA
2765STEXI
2766@table @option
2767ETEXI
7273a2db 2768
5824d651 2769DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
5824d651
BS
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" \
ad96090a
BS
2778 " emulate a bluetooth device 'dev' in scatternet 'n'\n",
2779 QEMU_ARCH_ALL)
5824d651 2780STEXI
5824d651 2781@item -bt hci[...]
6616b2ad 2782@findex -bt
5824d651
BS
2783Defines the function of the corresponding Bluetooth HCI. -bt options
2784are matched with the HCIs present in the chosen machine type. For
2785example when emulating a machine with only one HCI built into it, only
2786the first @code{-bt hci[...]} option is valid and defines the HCI's
2787logic. The Transport Layer is decided by the machine type. Currently
2788the machines @code{n800} and @code{n810} have one HCI and all other
2789machines have none.
2790
2791@anchor{bt-hcis}
2792The following three types are recognized:
2793
b3f046c2 2794@table @option
5824d651
BS
2795@item -bt hci,null
2796(default) The corresponding Bluetooth HCI assumes no internal logic
2797and will not respond to any HCI commands or emit events.
2798
2799@item -bt hci,host[:@var{id}]
2800(@code{bluez} only) The corresponding HCI passes commands / events
2801to / from the physical HCI identified by the name @var{id} (default:
2802@code{hci0}) on the computer running QEMU. Only available on @code{bluez}
2803capable systems like Linux.
2804
2805@item -bt hci[,vlan=@var{n}]
2806Add a virtual, standard HCI that will participate in the Bluetooth
2807scatternet @var{n} (default @code{0}). Similarly to @option{-net}
2808VLANs, devices inside a bluetooth network @var{n} can only communicate
2809with other devices in the same network (scatternet).
2810@end table
2811
2812@item -bt vhci[,vlan=@var{n}]
2813(Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
2814to the host bluetooth stack instead of to the emulated target. This
2815allows the host and target machines to participate in a common scatternet
2816and communicate. Requires the Linux @code{vhci} driver installed. Can
2817be used as following:
2818
2819@example
3804da9d 2820qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
5824d651
BS
2821@end example
2822
2823@item -bt device:@var{dev}[,vlan=@var{n}]
2824Emulate 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
2826currently:
2827
b3f046c2 2828@table @option
5824d651
BS
2829@item keyboard
2830Virtual wireless keyboard implementing the HIDP bluetooth profile.
2831@end table
5824d651
BS
2832ETEXI
2833
c70a01e4
MA
2834STEXI
2835@end table
2836ETEXI
5824d651
BS
2837DEFHEADING()
2838
d1a0cf73 2839#ifdef CONFIG_TPM
43f187a5 2840DEFHEADING(TPM device options)
d1a0cf73
SB
2841
2842DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
92dcc234
SB
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",
d1a0cf73
SB
2847 QEMU_ARCH_ALL)
2848STEXI
2849
2850The general form of a TPM device option is:
2851@table @option
2852
2853@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
2854@findex -tpmdev
2855Backend type must be:
4549a8b7 2856@option{passthrough}.
d1a0cf73
SB
2857
2858The specific backend type will determine the applicable options.
28c4fa32
CB
2859The @code{-tpmdev} option creates the TPM backend and requires a
2860@code{-device} option that specifies the TPM frontend interface model.
d1a0cf73
SB
2861
2862Options to each backend are described below.
2863
2864Use 'help' to print all available TPM backend types.
2865@example
2866qemu -tpmdev help
2867@end example
2868
92dcc234 2869@item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path}
4549a8b7
SB
2870
2871(Linux-host only) Enable access to the host's TPM using the passthrough
2872driver.
2873
2874@option{path} specifies the path to the host's TPM device, i.e., on
2875a Linux host this would be @code{/dev/tpm0}.
2876@option{path} is optional and by default @code{/dev/tpm0} is used.
2877
92dcc234
SB
2878@option{cancel-path} specifies the path to the host TPM device's sysfs
2879entry allowing for cancellation of an ongoing TPM command.
2880@option{cancel-path} is optional and by default QEMU will search for the
2881sysfs entry to use.
2882
4549a8b7
SB
2883Some notes about using the host's TPM with the passthrough driver:
2884
2885The TPM device accessed by the passthrough driver must not be
2886used by any other application on the host.
2887
2888Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
2889the VM's firmware (BIOS/UEFI) will not be able to initialize the
2890TPM again and may therefore not show a TPM-specific menu that would
2891otherwise allow the user to configure the TPM, e.g., allow the user to
2892enable/disable or activate/deactivate the TPM.
2893Further, if TPM ownership is released from within a VM then the host's TPM
2894will get disabled and deactivated. To enable and activate the
2895TPM again afterwards, the host has to be rebooted and the user is
2896required to enter the firmware's menu to enable and activate the TPM.
2897If the TPM is left disabled and/or deactivated most TPM commands will fail.
2898
2899To create a passthrough TPM use the following two options:
2900@example
2901-tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
2902@end example
2903Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
2904@code{tpmdev=tpm0} in the device option.
2905
d1a0cf73
SB
2906@end table
2907
2908ETEXI
2909
2910DEFHEADING()
2911
2912#endif
2913
43f187a5 2914DEFHEADING(Linux/Multiboot boot specific)
5824d651 2915STEXI
7677f05d
AG
2916
2917When using these options, you can use a given Linux or Multiboot
2918kernel without installing it in the disk image. It can be useful
5824d651
BS
2919for easier testing of various kernels.
2920
2921@table @option
2922ETEXI
2923
2924DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
ad96090a 2925 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
5824d651
BS
2926STEXI
2927@item -kernel @var{bzImage}
6616b2ad 2928@findex -kernel
7677f05d
AG
2929Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
2930or in multiboot format.
5824d651
BS
2931ETEXI
2932
2933DEF("append", HAS_ARG, QEMU_OPTION_append, \
ad96090a 2934 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
5824d651
BS
2935STEXI
2936@item -append @var{cmdline}
6616b2ad 2937@findex -append
5824d651
BS
2938Use @var{cmdline} as kernel command line
2939ETEXI
2940
2941DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
ad96090a 2942 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
5824d651
BS
2943STEXI
2944@item -initrd @var{file}
6616b2ad 2945@findex -initrd
5824d651 2946Use @var{file} as initial ram disk.
7677f05d
AG
2947
2948@item -initrd "@var{file1} arg=foo,@var{file2}"
2949
2950This syntax is only available with multiboot.
2951
2952Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
2953first module.
5824d651
BS
2954ETEXI
2955
412beee6 2956DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
379b5c7c 2957 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
412beee6
GL
2958STEXI
2959@item -dtb @var{file}
2960@findex -dtb
2961Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
2962on boot.
2963ETEXI
2964
5824d651
BS
2965STEXI
2966@end table
2967ETEXI
5824d651
BS
2968DEFHEADING()
2969
43f187a5 2970DEFHEADING(Debug/Expert options)
5824d651
BS
2971STEXI
2972@table @option
2973ETEXI
2974
81b2b810
GS
2975DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
2976 "-fw_cfg [name=]<name>,file=<file>\n"
63d3145a 2977 " add named fw_cfg entry with contents from file\n"
6407d76e 2978 "-fw_cfg [name=]<name>,string=<str>\n"
63d3145a 2979 " add named fw_cfg entry with contents from string\n",
81b2b810
GS
2980 QEMU_ARCH_ALL)
2981STEXI
63d3145a 2982
81b2b810
GS
2983@item -fw_cfg [name=]@var{name},file=@var{file}
2984@findex -fw_cfg
63d3145a 2985Add named fw_cfg entry with contents from file @var{file}.
6407d76e
GS
2986
2987@item -fw_cfg [name=]@var{name},string=@var{str}
63d3145a
MA
2988Add named fw_cfg entry with contents from string @var{str}.
2989
2990The terminating NUL character of the contents of @var{str} will not be
2991included as part of the fw_cfg item data. To insert contents with
2992embedded NUL characters, you have to use the @var{file} parameter.
2993
2994The fw_cfg entries are passed by QEMU through to the guest.
2995
2996Example:
2997@example
2998 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
2999@end example
3000creates an fw_cfg entry named opt/com.mycompany/blob with contents
3001from ./my_blob.bin.
3002
81b2b810
GS
3003ETEXI
3004
5824d651 3005DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
ad96090a
BS
3006 "-serial dev redirect the serial port to char device 'dev'\n",
3007 QEMU_ARCH_ALL)
5824d651
BS
3008STEXI
3009@item -serial @var{dev}
6616b2ad 3010@findex -serial
5824d651
BS
3011Redirect 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.
3014
3015This option can be used several times to simulate up to 4 serial
3016ports.
3017
3018Use @code{-serial none} to disable all serial ports.
3019
3020Available character devices are:
b3f046c2 3021@table @option
4e257e5e 3022@item vc[:@var{W}x@var{H}]
5824d651
BS
3023Virtual console. Optionally, a width and height can be given in pixel with
3024@example
3025vc:800x600
3026@end example
3027It is also possible to specify width or height in characters:
3028@example
3029vc:80Cx24C
3030@end example
3031@item pty
3032[Linux only] Pseudo TTY (a new PTY is automatically allocated)
3033@item none
3034No device is allocated.
3035@item null
3036void device
88e020e5
IL
3037@item chardev:@var{id}
3038Use a named character device defined with the @code{-chardev} option.
5824d651
BS
3039@item /dev/XXX
3040[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
3041parameters 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}
3046Write output to @var{filename}. No character can be read.
3047@item stdio
3048[Unix only] standard input/output
3049@item pipe:@var{filename}
3050name 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}]
3054This implements UDP Net Console.
3055When @var{remote_host} or @var{src_ip} are not specified
3056they default to @code{0.0.0.0}.
3057When not using a specified @var{src_port} a random port is automatically chosen.
5824d651
BS
3058
3059If you just want a simple readonly console you can use @code{netcat} or
b65ee4fa
SW
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
5824d651
BS
3062will appear in the netconsole session.
3063
3064If you plan to send characters back via netconsole or you want to stop
b65ee4fa 3065and start QEMU a lot of times, you should have QEMU use the same
5824d651 3066source port each time by using something like @code{-serial
b65ee4fa 3067udp::4555@@:4556} to QEMU. Another approach is to use a patched
5824d651
BS
3068version of netcat which can listen to a TCP port and send and receive
3069characters via udp. If you have a patched version of netcat which
3070activates telnet remote echo and single char transfer, then you can
bd1caa3f 3071use the following options to set up a netcat redirector to allow
b65ee4fa 3072telnet on port 5555 to access the QEMU port.
5824d651 3073@table @code
071c9394 3074@item QEMU Options:
5824d651
BS
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:
3079localhost 5555
3080@end table
3081
5dd1f02b 3082@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
5824d651
BS
3083The TCP Net Console has two modes of operation. It can send the serial
3084I/O to a location or wait for a connection from a location. By default
3085the TCP Net Console is sent to @var{host} at the @var{port}. If you use
3086the @var{server} option QEMU will wait for a client socket application
3087to connect to the port before continuing, unless the @code{nowait}
3088option was specified. The @code{nodelay} option disables the Nagle buffering
5dd1f02b
CM
3089algorithm. The @code{reconnect} option only applies if @var{noserver} is
3090set, if the connection goes down it will attempt to reconnect at the
3091given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only
5824d651
BS
3092one TCP connection at a time is accepted. You can use @code{telnet} to
3093connect 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
3102
3103@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
3104The telnet protocol is used instead of raw tcp sockets. The options
3105work the same as if you had specified @code{-serial tcp}. The
3106difference is that the port acts like a telnet server or client using
3107telnet option negotiation. This will also allow you to send the
3108MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
3109sequence. Typically in unix telnet you do it with Control-] and then
3110type "send break" followed by pressing the enter key.
3111
5dd1f02b 3112@item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
5824d651
BS
3113A unix domain socket is used instead of a tcp socket. The option works the
3114same as if you had specified @code{-serial tcp} except the unix domain socket
3115@var{path} is used for connections.
3116
3117@item mon:@var{dev_string}
3118This is a special option to allow the monitor to be multiplexed onto
3119another serial port. The monitor is accessed with key sequence of
02c4bdf1 3120@key{Control-a} and then pressing @key{c}.
5824d651
BS
3121@var{dev_string} should be any one of the serial devices specified
3122above. An example to multiplex the monitor onto a telnet server
3123listening on port 4444 would be:
3124@table @code
3125@item -serial mon:telnet::4444,server,nowait
3126@end table
be022d61
MT
3127When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
3128QEMU any more but will be passed to the guest instead.
5824d651
BS
3129
3130@item braille
3131Braille device. This will use BrlAPI to display the braille output on a real
3132or fake device.
3133
be8b28a9
KW
3134@item msmouse
3135Three button serial mouse. Configure the guest to use Microsoft protocol.
5824d651
BS
3136@end table
3137ETEXI
3138
3139DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
ad96090a
BS
3140 "-parallel dev redirect the parallel port to char device 'dev'\n",
3141 QEMU_ARCH_ALL)
5824d651
BS
3142STEXI
3143@item -parallel @var{dev}
6616b2ad 3144@findex -parallel
5824d651
BS
3145Redirect the virtual parallel port to host device @var{dev} (same
3146devices as the serial port). On Linux hosts, @file{/dev/parportN} can
3147be used to use hardware devices connected on the corresponding host
3148parallel port.
3149
3150This option can be used several times to simulate up to 3 parallel
3151ports.
3152
3153Use @code{-parallel none} to disable all parallel ports.
3154ETEXI
3155
3156DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
ad96090a
BS
3157 "-monitor dev redirect the monitor to char device 'dev'\n",
3158 QEMU_ARCH_ALL)
5824d651 3159STEXI
4e307fc8 3160@item -monitor @var{dev}
6616b2ad 3161@findex -monitor
5824d651
BS
3162Redirect the monitor to host device @var{dev} (same devices as the
3163serial port).
3164The default device is @code{vc} in graphical mode and @code{stdio} in
3165non graphical mode.
70e098af 3166Use @code{-monitor none} to disable the default monitor.
5824d651 3167ETEXI
6ca5582d 3168DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
ad96090a
BS
3169 "-qmp dev like -monitor but opens in 'control' mode\n",
3170 QEMU_ARCH_ALL)
95d5f08b
SW
3171STEXI
3172@item -qmp @var{dev}
6616b2ad 3173@findex -qmp
95d5f08b
SW
3174Like -monitor but opens in 'control' mode.
3175ETEXI
4821cd4c
HR
3176DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
3177 "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
3178 QEMU_ARCH_ALL)
3179STEXI
3180@item -qmp-pretty @var{dev}
3181@findex -qmp-pretty
3182Like -qmp but uses pretty JSON formatting.
3183ETEXI
5824d651 3184
22a0e04b 3185DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
bdbcb547 3186 "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
22a0e04b 3187STEXI
bdbcb547 3188@item -mon [chardev=]name[,mode=readline|control]
6616b2ad 3189@findex -mon
22a0e04b
GH
3190Setup monitor on chardev @var{name}.
3191ETEXI
3192
c9f398e5 3193DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
ad96090a
BS
3194 "-debugcon dev redirect the debug console to char device 'dev'\n",
3195 QEMU_ARCH_ALL)
c9f398e5
PA
3196STEXI
3197@item -debugcon @var{dev}
6616b2ad 3198@findex -debugcon
c9f398e5
PA
3199Redirect the debug console to host device @var{dev} (same devices as the
3200serial port). The debug console is an I/O port which is typically port
32010xe9; writing to that I/O port sends output to this device.
3202The default device is @code{vc} in graphical mode and @code{stdio} in
3203non graphical mode.
3204ETEXI
3205
5824d651 3206DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
ad96090a 3207 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
5824d651
BS
3208STEXI
3209@item -pidfile @var{file}
6616b2ad 3210@findex -pidfile
5824d651
BS
3211Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
3212from a script.
3213ETEXI
3214
1b530a6d 3215DEF("singlestep", 0, QEMU_OPTION_singlestep, \
ad96090a 3216 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
1b530a6d
AJ
3217STEXI
3218@item -singlestep
6616b2ad 3219@findex -singlestep
1b530a6d
AJ
3220Run the emulation in single step mode.
3221ETEXI
3222
5824d651 3223DEF("S", 0, QEMU_OPTION_S, \
ad96090a
BS
3224 "-S freeze CPU at startup (use 'c' to start execution)\n",
3225 QEMU_ARCH_ALL)
5824d651
BS
3226STEXI
3227@item -S
6616b2ad 3228@findex -S
5824d651
BS
3229Do not start CPU at startup (you must type 'c' in the monitor).
3230ETEXI
3231
888a6bc6
SM
3232DEF("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)
3237STEXI
3238@item -realtime mlock=on|off
3239@findex -realtime
3240Run qemu with realtime features.
3241mlocking qemu and guest memory can be enabled via @option{mlock=on}
3242(enabled by default).
3243ETEXI
3244
59030a8c 3245DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
ad96090a 3246 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
59030a8c
AL
3247STEXI
3248@item -gdb @var{dev}
6616b2ad 3249@findex -gdb
59030a8c
AL
3250Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
3251connections will likely be TCP-based, but also UDP, pseudo TTY, or even
b65ee4fa 3252stdio are reasonable use case. The latter is allowing to start QEMU from
59030a8c
AL
3253within gdb and establish the connection via a pipe:
3254@example
3804da9d 3255(gdb) target remote | exec qemu-system-i386 -gdb stdio ...
59030a8c 3256@end example
5824d651
BS
3257ETEXI
3258
59030a8c 3259DEF("s", 0, QEMU_OPTION_s, \
ad96090a
BS
3260 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
3261 QEMU_ARCH_ALL)
5824d651 3262STEXI
59030a8c 3263@item -s
6616b2ad 3264@findex -s
59030a8c
AL
3265Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
3266(@pxref{gdb_usage}).
5824d651
BS
3267ETEXI
3268
3269DEF("d", HAS_ARG, QEMU_OPTION_d, \
989b697d 3270 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
ad96090a 3271 QEMU_ARCH_ALL)
5824d651 3272STEXI
989b697d 3273@item -d @var{item1}[,...]
6616b2ad 3274@findex -d
989b697d 3275Enable logging of specified items. Use '-d help' for a list of log items.
5824d651
BS
3276ETEXI
3277
c235d738 3278DEF("D", HAS_ARG, QEMU_OPTION_D, \
989b697d 3279 "-D logfile output log to logfile (default stderr)\n",
c235d738
MF
3280 QEMU_ARCH_ALL)
3281STEXI
8bd383b4 3282@item -D @var{logfile}
c235d738 3283@findex -D
989b697d 3284Output log in @var{logfile} instead of to stderr
c235d738
MF
3285ETEXI
3286
3514552e
AB
3287DEF("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)
3290STEXI
3291@item -dfilter @var{range1}[,...]
3292@findex -dfilter
3293Filter debug output to that relevant to a range of target addresses. The filter
3294spec 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
3296addresses and sizes required. For example:
3297@example
3298 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
3299@end example
3300Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
3301the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
3302block starting at 0xffffffc00005f000.
3303ETEXI
3304
5824d651 3305DEF("L", HAS_ARG, QEMU_OPTION_L, \
ad96090a
BS
3306 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
3307 QEMU_ARCH_ALL)
5824d651
BS
3308STEXI
3309@item -L @var{path}
6616b2ad 3310@findex -L
5824d651 3311Set the directory for the BIOS, VGA BIOS and keymaps.
37146e7e
RJ
3312
3313To list all the data directories, use @code{-L help}.
5824d651
BS
3314ETEXI
3315
3316DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
ad96090a 3317 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
5824d651
BS
3318STEXI
3319@item -bios @var{file}
6616b2ad 3320@findex -bios
5824d651
BS
3321Set the filename for the BIOS.
3322ETEXI
3323
5824d651 3324DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
ad96090a 3325 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
5824d651
BS
3326STEXI
3327@item -enable-kvm
6616b2ad 3328@findex -enable-kvm
5824d651
BS
3329Enable KVM full virtualization support. This option is only available
3330if KVM support is enabled when compiling.
3331ETEXI
3332
b0cb0a66
VP
3333DEF("enable-hax", 0, QEMU_OPTION_enable_hax, \
3334 "-enable-hax enable HAX virtualization support\n", QEMU_ARCH_I386)
3335STEXI
3336@item -enable-hax
3337@findex -enable-hax
3338Enable HAX (Hardware-based Acceleration eXecution) support. This option
3339is only available if HAX support is enabled when compiling. HAX is only
3340applicable to MAC and Windows platform, and thus does not conflict with
3341KVM.
3342ETEXI
3343
e37630ca 3344DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
ad96090a 3345 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
e37630ca
AL
3346DEF("xen-create", 0, QEMU_OPTION_xen_create,
3347 "-xen-create create domain using xen hypercalls, bypassing xend\n"
ad96090a
BS
3348 " warning: should not be used when xend is in use\n",
3349 QEMU_ARCH_ALL)
e37630ca
AL
3350DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
3351 "-xen-attach attach to existing xen domain\n"
b65ee4fa 3352 " xend will use this when starting QEMU\n",
ad96090a 3353 QEMU_ARCH_ALL)
95d5f08b
SW
3354STEXI
3355@item -xen-domid @var{id}
6616b2ad 3356@findex -xen-domid
95d5f08b
SW
3357Specify xen guest domain @var{id} (XEN only).
3358@item -xen-create
6616b2ad 3359@findex -xen-create
95d5f08b
SW
3360Create domain using xen hypercalls, bypassing xend.
3361Warning: should not be used when xend is in use (XEN only).
3362@item -xen-attach
6616b2ad 3363@findex -xen-attach
95d5f08b 3364Attach to existing xen domain.
b65ee4fa 3365xend will use this when starting QEMU (XEN only).
95d5f08b 3366ETEXI
e37630ca 3367
5824d651 3368DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
ad96090a 3369 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
5824d651
BS
3370STEXI
3371@item -no-reboot
6616b2ad 3372@findex -no-reboot
5824d651
BS
3373Exit instead of rebooting.
3374ETEXI
3375
3376DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
ad96090a 3377 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
5824d651
BS
3378STEXI
3379@item -no-shutdown
6616b2ad 3380@findex -no-shutdown
5824d651
BS
3381Don't exit QEMU on guest shutdown, but instead only stop the emulation.
3382This allows for instance switching to monitor to commit changes to the
3383disk image.
3384ETEXI
3385
3386DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
3387 "-loadvm [tag|id]\n" \
ad96090a
BS
3388 " start right away with a saved state (loadvm in monitor)\n",
3389 QEMU_ARCH_ALL)
5824d651
BS
3390STEXI
3391@item -loadvm @var{file}
6616b2ad 3392@findex -loadvm
5824d651
BS
3393Start right away with a saved state (@code{loadvm} in monitor)
3394ETEXI
3395
3396#ifndef _WIN32
3397DEF("daemonize", 0, QEMU_OPTION_daemonize, \
ad96090a 3398 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
5824d651
BS
3399#endif
3400STEXI
3401@item -daemonize
6616b2ad 3402@findex -daemonize
5824d651
BS
3403Daemonize the QEMU process after initialization. QEMU will not detach from
3404standard IO until it is ready to receive connections on any of its devices.
3405This option is a useful way for external programs to launch QEMU without having
3406to cope with initialization race conditions.
3407ETEXI
3408
3409DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
ad96090a
BS
3410 "-option-rom rom load a file, rom, into the option ROM space\n",
3411 QEMU_ARCH_ALL)
5824d651
BS
3412STEXI
3413@item -option-rom @var{file}
6616b2ad 3414@findex -option-rom
5824d651
BS
3415Load the contents of @var{file} as an option ROM.
3416This option is useful to load things like EtherBoot.
3417ETEXI
3418
e218052f
MA
3419HXCOMM Silently ignored for compatibility
3420DEF("clock", HAS_ARG, QEMU_OPTION_clock, "", QEMU_ARCH_ALL)
5824d651 3421
1ed2fc1f 3422HXCOMM Options deprecated by -rtc
ad96090a
BS
3423DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL)
3424DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL)
1ed2fc1f 3425
1ed2fc1f 3426DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
78808141 3427 "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \
ad96090a
BS
3428 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
3429 QEMU_ARCH_ALL)
5824d651 3430
5824d651
BS
3431STEXI
3432
6875204c 3433@item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew]
6616b2ad 3434@findex -rtc
1ed2fc1f
JK
3435Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
3436UTC or local time, respectively. @code{localtime} is required for correct date in
3437MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the
3438format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
3439
9d85d557 3440By default the RTC is driven by the host system time. This allows using of the
6875204c
JK
3441RTC as accurate reference clock inside the guest, specifically if the host
3442time is smoothly following an accurate external reference clock, e.g. via NTP.
78808141
PB
3443If you want to isolate the guest time from the host, you can set @option{clock}
3444to @code{rt} instead. To even prevent it from progressing during suspension,
3445you can set it to @code{vm}.
6875204c 3446
1ed2fc1f
JK
3447Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
3448specifically with Windows' ACPI HAL. This option will try to figure out how
3449many timer interrupts were not processed by the Windows guest and will
3450re-inject them.
5824d651
BS
3451ETEXI
3452
3453DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
9c2037d0 3454 "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
bc14ca24 3455 " enable virtual instruction counter with 2^N clock ticks per\n" \
f1f4b57e
VC
3456 " instruction, enable aligning the host and virtual clocks\n" \
3457 " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
5824d651 3458STEXI
9c2037d0 3459@item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
6616b2ad 3460@findex -icount
5824d651 3461Enable virtual instruction counter. The virtual cpu will execute one
4e257e5e 3462instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
5824d651
BS
3463then the virtual cpu speed will be automatically adjusted to keep virtual
3464time within a few seconds of real time.
3465
f1f4b57e 3466When the virtual cpu is sleeping, the virtual time will advance at default
778d9f9b
PK
3467speed unless @option{sleep=on|off} is specified.
3468With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
f1f4b57e
VC
3469instantly whenever the virtual cpu goes to sleep mode and will not advance
3470if no timer is enabled. This behavior give deterministic execution times from
3471the guest point of view.
3472
5824d651
BS
3473Note that while this option can give deterministic behavior, it does not
3474provide cycle accurate emulation. Modern CPUs contain superscalar out of
3475order cores with complex cache hierarchies. The number of instructions
3476executed often has little or no correlation with actual performance.
a8bfac37 3477
b6af0975 3478@option{align=on} will activate the delay algorithm which will try
a8bfac37
ST
3479to synchronise the host clock and the virtual clock. The goal is to
3480have a guest running at the real frequency imposed by the shift option.
3481Whenever the guest clock is behind the host clock and if
82597615 3482@option{align=on} is specified then we print a message to the user
a8bfac37
ST
3483to inform about the delay.
3484Currently this option does not work when @option{shift} is @code{auto}.
3485Note: The sync algorithm will work for those shift values for which
3486the guest clock runs ahead of the host clock. Typically this happens
3487when the shift value is high (how high depends on the host machine).
4c27b859
PD
3488
3489When @option{rr} option is specified deterministic record/replay is enabled.
3490Replay log is written into @var{filename} file in record mode and
3491read from this file in replay mode.
9c2037d0
PD
3492
3493Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
3494at the start of execution recording. In replay mode this option is used
3495to load the initial VM state.
5824d651
BS
3496ETEXI
3497
9dd986cc 3498DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
d7933ef3 3499 "-watchdog model\n" \
ad96090a
BS
3500 " enable virtual hardware watchdog [default=none]\n",
3501 QEMU_ARCH_ALL)
9dd986cc
RJ
3502STEXI
3503@item -watchdog @var{model}
6616b2ad 3504@findex -watchdog
9dd986cc
RJ
3505Create a virtual hardware watchdog device. Once enabled (by a guest
3506action), the watchdog must be periodically polled by an agent inside
d7933ef3
XW
3507the guest or else the guest will be restarted. Choose a model for
3508which your guest has drivers.
9dd986cc 3509
d7933ef3
XW
3510The @var{model} is the model of hardware watchdog to emulate. Use
3511@code{-watchdog help} to list available hardware models. Only one
9dd986cc 3512watchdog can be enabled for a guest.
d7933ef3
XW
3513
3514The following models may be available:
3515@table @option
3516@item ib700
3517iBASE 700 is a very simple ISA watchdog with a single timer.
3518@item i6300esb
3519Intel 6300ESB I/O controller hub is a much more featureful PCI-based
3520dual-timer watchdog.
188f24c2
XW
3521@item diag288
3522A virtual watchdog for s390x backed by the diagnose 288 hypercall
3523(currently KVM only).
d7933ef3 3524@end table
9dd986cc
RJ
3525ETEXI
3526
3527DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
3528 "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \
ad96090a
BS
3529 " action when watchdog fires [default=reset]\n",
3530 QEMU_ARCH_ALL)
9dd986cc
RJ
3531STEXI
3532@item -watchdog-action @var{action}
b8f490eb 3533@findex -watchdog-action
9dd986cc
RJ
3534
3535The @var{action} controls what QEMU will do when the watchdog timer
3536expires.
3537The default is
3538@code{reset} (forcefully reset the guest).
3539Other 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).
3545
3546Note that the @code{shutdown} action requires that the guest responds
3547to ACPI signals, which it may not be able to do in the sort of
3548situations where the watchdog would have expired, and thus
3549@code{-watchdog-action shutdown} is not recommended for production use.
3550
3551Examples:
3552
3553@table @code
3554@item -watchdog i6300esb -watchdog-action pause
f9cfd655 3555@itemx -watchdog ib700
9dd986cc
RJ
3556@end table
3557ETEXI
3558
5824d651 3559DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
ad96090a
BS
3560 "-echr chr set terminal escape character instead of ctrl-a\n",
3561 QEMU_ARCH_ALL)
5824d651
BS
3562STEXI
3563
4e257e5e 3564@item -echr @var{numeric_ascii_value}
6616b2ad 3565@findex -echr
5824d651
BS
3566Change the escape character used for switching to the monitor when using
3567monitor 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
3570control keys where 1 through 26 map to Control-a through Control-z. For
3571instance you could use the either of the following to change the escape
3572character to Control-t.
3573@table @code
3574@item -echr 0x14
f9cfd655 3575@itemx -echr 20
5824d651
BS
3576@end table
3577ETEXI
3578
3579DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \
3580 "-virtioconsole c\n" \
ad96090a 3581 " set virtio console\n", QEMU_ARCH_ALL)
5824d651
BS
3582STEXI
3583@item -virtioconsole @var{c}
6616b2ad 3584@findex -virtioconsole
5824d651 3585Set virtio console.
98b19252
AS
3586
3587This option is maintained for backward compatibility.
3588
3589Please use @code{-device virtconsole} for the new way of invocation.
5824d651
BS
3590ETEXI
3591
3592DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
ad96090a 3593 "-show-cursor show cursor\n", QEMU_ARCH_ALL)
5824d651 3594STEXI
95d5f08b 3595@item -show-cursor
6616b2ad 3596@findex -show-cursor
95d5f08b 3597Show cursor.
5824d651
BS
3598ETEXI
3599
3600DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
ad96090a 3601 "-tb-size n set TB size\n", QEMU_ARCH_ALL)
5824d651 3602STEXI
95d5f08b 3603@item -tb-size @var{n}
6616b2ad 3604@findex -tb-size
95d5f08b 3605Set TB size.
5824d651
BS
3606ETEXI
3607
3608DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
7c601803
MT
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" \
1597051b
DDAG
3617 " or from given external command\n" \
3618 "-incoming defer\n" \
3619 " wait for the URI to be specified via migrate_incoming\n",
ad96090a 3620 QEMU_ARCH_ALL)
5824d651 3621STEXI
7c601803 3622@item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
f9cfd655 3623@itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
6616b2ad 3624@findex -incoming
7c601803
MT
3625Prepare for incoming migration, listen on a given tcp port.
3626
3627@item -incoming unix:@var{socketpath}
3628Prepare for incoming migration, listen on a given unix socket.
3629
3630@item -incoming fd:@var{fd}
3631Accept incoming migration from a given filedescriptor.
3632
3633@item -incoming exec:@var{cmdline}
3634Accept incoming migration as an output from specified external command.
1597051b
DDAG
3635
3636@item -incoming defer
3637Wait for the URI to be specified via migrate_incoming. The monitor can
3638be used to change settings (such as migration parameters) prior to issuing
3639the migrate_incoming to allow the migration to begin.
5824d651
BS
3640ETEXI
3641
d15c05fc
AA
3642DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
3643 "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
3644STEXI
3645@item -only-migratable
3646@findex -only-migratable
3647Only allow migratable devices. Devices will not be allowed to enter an
3648unmigratable state.
3649ETEXI
3650
d8c208dd 3651DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
ad96090a 3652 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
d8c208dd 3653STEXI
3dbf2c7f 3654@item -nodefaults
6616b2ad 3655@findex -nodefaults
66c19bf1
MN
3656Don't create default devices. Normally, QEMU sets the default devices like serial
3657port, parallel port, virtual console, monitor device, VGA adapter, floppy and
3658CD-ROM drive and others. The @code{-nodefaults} option will disable all those
3659default devices.
d8c208dd
GH
3660ETEXI
3661
5824d651
BS
3662#ifndef _WIN32
3663DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
ad96090a
BS
3664 "-chroot dir chroot to dir just before starting the VM\n",
3665 QEMU_ARCH_ALL)
5824d651
BS
3666#endif
3667STEXI
4e257e5e 3668@item -chroot @var{dir}
6616b2ad 3669@findex -chroot
5824d651
BS
3670Immediately before starting guest execution, chroot to the specified
3671directory. Especially useful in combination with -runas.
3672ETEXI
3673
3674#ifndef _WIN32
3675DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
ad96090a
BS
3676 "-runas user change to user id user just before starting the VM\n",
3677 QEMU_ARCH_ALL)
5824d651
BS
3678#endif
3679STEXI
4e257e5e 3680@item -runas @var{user}
6616b2ad 3681@findex -runas
5824d651
BS
3682Immediately before starting guest execution, drop root privileges, switching
3683to the specified user.
3684ETEXI
3685
5824d651
BS
3686DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
3687 "-prom-env variable=value\n"
ad96090a
BS
3688 " set OpenBIOS nvram variables\n",
3689 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
95d5f08b
SW
3690STEXI
3691@item -prom-env @var{variable}=@var{value}
6616b2ad 3692@findex -prom-env
95d5f08b
SW
3693Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
3694ETEXI
5824d651 3695DEF("semihosting", 0, QEMU_OPTION_semihosting,
f7bbcfb5 3696 "-semihosting semihosting mode\n",
3b3c1694
LA
3697 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3698 QEMU_ARCH_MIPS)
95d5f08b
SW
3699STEXI
3700@item -semihosting
6616b2ad 3701@findex -semihosting
3b3c1694 3702Enable semihosting mode (ARM, M68K, Xtensa, MIPS only).
a38bb079
LI
3703ETEXI
3704DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
a59d31a1
LA
3705 "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\n" \
3706 " semihosting configuration\n",
3b3c1694
LA
3707QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3708QEMU_ARCH_MIPS)
a38bb079 3709STEXI
a59d31a1 3710@item -semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]
a38bb079 3711@findex -semihosting-config
3b3c1694 3712Enable and configure semihosting (ARM, M68K, Xtensa, MIPS only).
a59d31a1
LA
3713@table @option
3714@item target=@code{native|gdb|auto}
3715Defines where the semihosting calls will be addressed, to QEMU (@code{native})
3716or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
3717during debug sessions and @code{native} otherwise.
3718@item arg=@var{str1},arg=@var{str2},...
3719Allows the user to pass input arguments, and can be used multiple times to build
3720up a list. The old-style @code{-kernel}/@code{-append} method of passing a
3721command line is still supported for backward compatibility. If both the
3722@code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
3723specified, the former is passed to semihosting as it always takes precedence.
3724@end table
95d5f08b 3725ETEXI
5824d651 3726DEF("old-param", 0, QEMU_OPTION_old_param,
ad96090a 3727 "-old-param old param mode\n", QEMU_ARCH_ARM)
95d5f08b
SW
3728STEXI
3729@item -old-param
6616b2ad 3730@findex -old-param (ARM)
95d5f08b
SW
3731Old param mode (ARM only).
3732ETEXI
3733
7d76ad4f
EO
3734DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
3735 "-sandbox <arg> Enable seccomp mode 2 system call filter (default 'off').\n",
3736 QEMU_ARCH_ALL)
3737STEXI
6265c43b 3738@item -sandbox @var{arg}
7d76ad4f
EO
3739@findex -sandbox
3740Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
3741disable it. The default is 'off'.
3742ETEXI
3743
715a664a 3744DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
ad96090a 3745 "-readconfig <file>\n", QEMU_ARCH_ALL)
3dbf2c7f
SW
3746STEXI
3747@item -readconfig @var{file}
6616b2ad 3748@findex -readconfig
ed24cfac
MN
3749Read device configuration from @var{file}. This approach is useful when you want to spawn
3750QEMU process with many command line options but you don't want to exceed the command line
3751character limit.
3dbf2c7f 3752ETEXI
715a664a
GH
3753DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
3754 "-writeconfig <file>\n"
ad96090a 3755 " read/write config file\n", QEMU_ARCH_ALL)
3dbf2c7f
SW
3756STEXI
3757@item -writeconfig @var{file}
6616b2ad 3758@findex -writeconfig
ed24cfac
MN
3759Write device configuration to @var{file}. The @var{file} can be either filename to save
3760command line and device configuration into file or dash @code{-}) character to print the
3761output to stdout. This can be later used as input file for @code{-readconfig} option.
3dbf2c7f 3762ETEXI
292444cb
AL
3763DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
3764 "-nodefconfig\n"
ad96090a
BS
3765 " do not load default config files at startup\n",
3766 QEMU_ARCH_ALL)
292444cb
AL
3767STEXI
3768@item -nodefconfig
6616b2ad 3769@findex -nodefconfig
f29a5614
EH
3770Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
3771The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
3772ETEXI
3773DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
3774 "-no-user-config\n"
3775 " do not load user-provided config files at startup\n",
3776 QEMU_ARCH_ALL)
3777STEXI
3778@item -no-user-config
3779@findex -no-user-config
3780The @code{-no-user-config} option makes QEMU not load any of the user-provided
3781config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
3782files from @var{datadir}.
292444cb 3783ETEXI
ab6540d5 3784DEF("trace", HAS_ARG, QEMU_OPTION_trace,
10578a25 3785 "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
23d15e86 3786 " specify tracing options\n",
ab6540d5
PS
3787 QEMU_ARCH_ALL)
3788STEXI
23d15e86
LV
3789HXCOMM This line is not accurate, as some sub-options are backend-specific but
3790HXCOMM HX does not support conditional compilation of text.
e370ad99 3791@item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
ab6540d5 3792@findex -trace
eeb2b8f7 3793@include qemu-option-trace.texi
ab6540d5 3794ETEXI
3dbf2c7f 3795
31e70d6c
MA
3796HXCOMM Internal use
3797DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
3798DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
c7f0f3b1 3799
0f66998f
PM
3800#ifdef __linux__
3801DEF("enable-fips", 0, QEMU_OPTION_enablefips,
3802 "-enable-fips enable FIPS 140-2 compliance\n",
3803 QEMU_ARCH_ALL)
3804#endif
3805STEXI
3806@item -enable-fips
3807@findex -enable-fips
3808Enable FIPS 140-2 compliance mode.
3809ETEXI
3810
a0dac021 3811HXCOMM Deprecated by -machine accel=tcg property
c6e88b3b 3812DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
a0dac021 3813
c21fb4f8 3814HXCOMM Deprecated by kvm-pit driver properties
c6e88b3b 3815DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
c21fb4f8
JK
3816 "", QEMU_ARCH_I386)
3817
4086bde8 3818HXCOMM Deprecated (ignored)
c6e88b3b 3819DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
4086bde8 3820
e43d594e 3821HXCOMM Deprecated by -machine kernel_irqchip=on|off property
c6e88b3b 3822DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
e43d594e 3823
88eed34a
JK
3824HXCOMM Deprecated (ignored)
3825DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
3826
5e2ac519
SA
3827DEF("msg", HAS_ARG, QEMU_OPTION_msg,
3828 "-msg timestamp[=on|off]\n"
3829 " change the format of messages\n"
3830 " on|off controls leading timestamps (default:on)\n",
3831 QEMU_ARCH_ALL)
3832STEXI
3833@item -msg timestamp[=on|off]
3834@findex -msg
3835prepend a timestamp to each log message.(default:on)
3836ETEXI
3837
abfd9ce3
AS
3838DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
3839 "-dump-vmstate <file>\n"
3840 " Output vmstate information in JSON format to file.\n"
3841 " Use the scripts/vmstate-static-checker.py file to\n"
3842 " check for possible regressions in migration code\n"
2382053f 3843 " by comparing two such vmstate dumps.\n",
abfd9ce3
AS
3844 QEMU_ARCH_ALL)
3845STEXI
3846@item -dump-vmstate @var{file}
3847@findex -dump-vmstate
3848Dump json-encoded vmstate information for current machine type to file
3849in @var{file}
3850ETEXI
3851
43f187a5
PB
3852STEXI
3853@end table
3854ETEXI
3855DEFHEADING()
b9174d4f 3856DEFHEADING(Generic object creation)
43f187a5
PB
3857STEXI
3858@table @option
3859ETEXI
b9174d4f
DB
3860
3861DEF("object", HAS_ARG, QEMU_OPTION_object,
3862 "-object TYPENAME[,PROP1=VALUE1,...]\n"
3863 " create a new object of type TYPENAME setting properties\n"
3864 " in the order they are specified. Note that the 'id'\n"
3865 " property must be set. These objects are placed in the\n"
3866 " '/objects' path.\n",
3867 QEMU_ARCH_ALL)
3868STEXI
3869@item -object @var{typename}[,@var{prop1}=@var{value1},...]
3870@findex -object
3871Create a new object of type @var{typename} setting properties
3872in the order they are specified. Note that the 'id'
3873property must be set. These objects are placed in the
3874'/objects' path.
3875
3876@table @option
3877
3878@item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off}
3879
3880Creates a memory file backend object, which can be used to back
3881the guest RAM with huge pages. The @option{id} parameter is a
3882unique ID that will be used to reference this memory region
3883when configuring the @option{-numa} argument. The @option{size}
3884option provides the size of the memory region, and accepts
3885common suffixes, eg @option{500M}. The @option{mem-path} provides
3886the path to either a shared memory or huge page filesystem mount.
3887The @option{share} boolean option determines whether the memory
3888region is marked as private to QEMU, or shared. The latter allows
3889a co-operating external process to access the QEMU memory region.
3890
3891@item -object rng-random,id=@var{id},filename=@var{/dev/random}
3892
3893Creates a random number generator backend which obtains entropy from
3894a device on the host. The @option{id} parameter is a unique ID that
3895will be used to reference this entropy backend from the @option{virtio-rng}
3896device. The @option{filename} parameter specifies which file to obtain
3897entropy from and if omitted defaults to @option{/dev/random}.
3898
3899@item -object rng-egd,id=@var{id},chardev=@var{chardevid}
3900
3901Creates a random number generator backend which obtains entropy from
3902an external daemon running on the host. The @option{id} parameter is
3903a unique ID that will be used to reference this entropy backend from
3904the @option{virtio-rng} device. The @option{chardev} parameter is
3905the unique ID of a character device backend that provides the connection
3906to the RNG daemon.
3907
e00adf6c
DB
3908@item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
3909
3910Creates a TLS anonymous credentials object, which can be used to provide
3911TLS support on network backends. The @option{id} parameter is a unique
3912ID which network backends will use to access the credentials. The
3913@option{endpoint} is either @option{server} or @option{client} depending
3914on whether the QEMU network backend that uses the credentials will be
3915acting as a client or as a server. If @option{verify-peer} is enabled
3916(the default) then once the handshake is completed, the peer credentials
3917will be verified, though this is a no-op for anonymous credentials.
3918
3919The @var{dir} parameter tells QEMU where to find the credential
3920files. For server endpoints, this directory may contain a file
3921@var{dh-params.pem} providing diffie-hellman parameters to use
3922for the TLS server. If the file is missing, QEMU will generate
3923a set of DH parameters at startup. This is a computationally
3924expensive operation that consumes random pool entropy, so it is
3925recommended that a persistent set of parameters be generated
3926upfront and saved.
3927
1d7b5b4a 3928@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}
85bcbc78
DB
3929
3930Creates a TLS anonymous credentials object, which can be used to provide
3931TLS support on network backends. The @option{id} parameter is a unique
3932ID which network backends will use to access the credentials. The
3933@option{endpoint} is either @option{server} or @option{client} depending
3934on whether the QEMU network backend that uses the credentials will be
3935acting as a client or as a server. If @option{verify-peer} is enabled
3936(the default) then once the handshake is completed, the peer credentials
3937will be verified. With x509 certificates, this implies that the clients
3938must be provided with valid client certificates too.
3939
3940The @var{dir} parameter tells QEMU where to find the credential
3941files. For server endpoints, this directory may contain a file
3942@var{dh-params.pem} providing diffie-hellman parameters to use
3943for the TLS server. If the file is missing, QEMU will generate
3944a set of DH parameters at startup. This is a computationally
3945expensive operation that consumes random pool entropy, so it is
3946recommended that a persistent set of parameters be generated
3947upfront and saved.
3948
3949For x509 certificate credentials the directory will contain further files
3950providing the x509 certificates. The certificates must be stored
3951in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
3952@var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
3953@var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
3954
1d7b5b4a
DB
3955For the @var{server-key.pem} and @var{client-key.pem} files which
3956contain sensitive private keys, it is possible to use an encrypted
3957version by providing the @var{passwordid} parameter. This provides
3958the ID of a previously created @code{secret} object containing the
3959password for decryption.
3960
338d3f41 3961@item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}]
7dbb11c8
YH
3962
3963Interval @var{t} can't be 0, this filter batches the packet delivery: all
3964packets arriving in a given interval on netdev @var{netdevid} are delayed
3965until the end of the interval. Interval is in microseconds.
338d3f41
HZ
3966@option{status} is optional that indicate whether the netfilter is
3967on (enabled) or off (disabled), the default status for netfilter will be 'on'.
7dbb11c8
YH
3968
3969queue @var{all|rx|tx} is an option that can be applied to any netfilter.
3970
3971@option{all}: the filter is attached both to the receive and the transmit
3972 queue of the netdev (default).
3973
3974@option{rx}: the filter is attached to the receive queue of the netdev,
3975 where it will receive packets sent to the netdev.
3976
3977@option{tx}: the filter is attached to the transmit queue of the netdev,
3978 where it will receive packets sent by the netdev.
3979
f6d3afb5
ZC
3980@item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
3981
3982filter-mirror on netdev @var{netdevid},mirror net packet to chardev
3983@var{chardevid}
3984
d46f75b2
ZC
3985@item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},
3986outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
3987
3988filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
3989@var{chardevid},and redirect indev's packet to filter.
3990Create a filter-redirector we need to differ outdev id from indev id, id can not
3991be the same. we can just use indev or outdev, but at least one of indev or outdev
3992need to be specified.
3993
e6eee8ab
ZC
3994@item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},rewriter-mode=@var{mode}[,queue=@var{all|rx|tx}]
3995
3996Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
3997secondary from primary to keep secondary tcp connection,and rewrite
3998tcp packet to primary from secondary make tcp packet can be handled by
3999client.
4000
4001usage:
4002colo secondary:
4003-object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4004-object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4005-object filter-rewriter,id=rew0,netdev=hn0,queue=all
4006
c551cd52 4007@item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
d3e0c032
TH
4008
4009Dump the network traffic on netdev @var{dev} to the file specified by
4010@var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
4011The file format is libpcap, so it can be analyzed with tools such as tcpdump
4012or Wireshark.
4013
7dce4e6f
ZC
4014@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},
4015outdev=@var{chardevid}
4016
4017Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
4018secondary packet. If the packets are same, we will output primary
4019packet to outdev@var{chardevid}, else we will notify colo-frame
4020do checkpoint and send primary packet to outdev@var{chardevid}.
4021
4022we must use it with the help of filter-mirror and filter-redirector.
4023
4024@example
4025
4026primary:
4027-netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
4028-device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
4029-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
4030-chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
4031-chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
4032-chardev socket,id=compare0-0,host=3.3.3.3,port=9001
4033-chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
4034-chardev socket,id=compare_out0,host=3.3.3.3,port=9005
4035-object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
4036-object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
4037-object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
4038-object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
4039
4040secondary:
4041-netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
4042-device e1000,netdev=hn0,mac=52:a4:00:12:78:66
4043-chardev socket,id=red0,host=3.3.3.3,port=9003
4044-chardev socket,id=red1,host=3.3.3.3,port=9004
4045-object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4046-object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4047
4048@end example
4049
4050If you want to know the detail of above command line, you can read
4051the colo-compare git log.
4052
1653a5f3
GA
4053@item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
4054
4055Creates a cryptodev backend which executes crypto opreation from
4056the QEMU cipher APIS. The @var{id} parameter is
4057a unique ID that will be used to reference this cryptodev backend from
4058the @option{virtio-crypto} device. The @var{queues} parameter is optional,
4059which specify the queue number of cryptodev backend, the default of
4060@var{queues} is 1.
4061
4062@example
4063
4064 # qemu-system-x86_64 \
4065 [...] \
4066 -object cryptodev-backend-builtin,id=cryptodev0 \
4067 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
4068 [...]
4069@end example
4070
ac1d8878
DB
4071@item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4072@item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4073
4074Defines a secret to store a password, encryption key, or some other sensitive
4075data. The sensitive data can either be passed directly via the @var{data}
4076parameter, or indirectly via the @var{file} parameter. Using the @var{data}
4077parameter is insecure unless the sensitive data is encrypted.
4078
4079The sensitive data can be provided in raw format (the default), or base64.
4080When encoded as JSON, the raw format only supports valid UTF-8 characters,
4081so base64 is recommended for sending binary data. QEMU will convert from
4082which ever format is provided to the format it needs internally. eg, an
4083RBD password can be provided in raw format, even though it will be base64
4084encoded when passed onto the RBD sever.
4085
4086For added protection, it is possible to encrypt the data associated with
4087a secret using the AES-256-CBC cipher. Use of encryption is indicated
4088by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
4089parameter provides the ID of a previously defined secret that contains
4090the AES-256 decryption key. This key should be 32-bytes long and be
4091base64 encoded. The @var{iv} parameter provides the random initialization
4092vector used for encryption of this particular secret and should be a
69c0b278 4093base64 encrypted string of the 16-byte IV.
ac1d8878
DB
4094
4095The simplest (insecure) usage is to provide the secret inline
4096
4097@example
4098
4099 # $QEMU -object secret,id=sec0,data=letmein,format=raw
4100
4101@end example
4102
4103The simplest secure usage is to provide the secret via a file
4104
4105 # echo -n "letmein" > mypasswd.txt
4106 # $QEMU -object secret,id=sec0,file=mypasswd.txt,format=raw
4107
4108For greater security, AES-256-CBC should be used. To illustrate usage,
4109consider the openssl command line tool which can encrypt the data. Note
4110that when encrypting, the plaintext must be padded to the cipher block
4111size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
4112
4113First a master key needs to be created in base64 encoding:
4114
4115@example
4116 # openssl rand -base64 32 > key.b64
4117 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
4118@end example
4119
4120Each secret to be encrypted needs to have a random initialization vector
4121generated. These do not need to be kept secret
4122
4123@example
4124 # openssl rand -base64 16 > iv.b64
4125 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
4126@end example
4127
4128The secret to be defined can now be encrypted, in this case we're
4129telling openssl to base64 encode the result, but it could be left
4130as raw bytes if desired.
4131
4132@example
4133 # SECRET=$(echo -n "letmein" |
4134 openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
4135@end example
4136
4137When launching QEMU, create a master secret pointing to @code{key.b64}
4138and specify that to be used to decrypt the user password. Pass the
4139contents of @code{iv.b64} to the second secret
4140
4141@example
4142 # $QEMU \
4143 -object secret,id=secmaster0,format=base64,file=key.b64 \
4144 -object secret,id=sec0,keyid=secmaster0,format=base64,\
4145 data=$SECRET,iv=$(<iv.b64)
4146@end example
4147
b9174d4f
DB
4148@end table
4149
4150ETEXI
4151
4152
3dbf2c7f
SW
4153HXCOMM This is the last statement. Insert new options before this line!
4154STEXI
4155@end table
4156ETEXI