blob: 92b4da6427b001e6f6b9d38cfde70817dbc0bf40 [file] [log] [blame]
blueswir15824d652009-03-28 06:44:27 +00001HXCOMM 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
Blue Swirlad960902010-03-29 19:23:52 +00004HXCOMM 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.
blueswir15824d652009-03-28 06:44:27 +00007HXCOMM HXCOMM can be used for comments, discarded from both texi and C
8
9DEFHEADING(Standard options:)
10STEXI
11@table @option
12ETEXI
13
14DEF("help", 0, QEMU_OPTION_h,
Blue Swirlad960902010-03-29 19:23:52 +000015 "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +000016STEXI
17@item -h
Stefan Weil6616b2a2010-02-05 23:52:05 +010018@findex -h
blueswir15824d652009-03-28 06:44:27 +000019Display help and exit
20ETEXI
21
pbrook9bd7e6d2009-04-07 22:58:45 +000022DEF("version", 0, QEMU_OPTION_version,
Blue Swirlad960902010-03-29 19:23:52 +000023 "-version display version information and exit\n", QEMU_ARCH_ALL)
pbrook9bd7e6d2009-04-07 22:58:45 +000024STEXI
25@item -version
Stefan Weil6616b2a2010-02-05 23:52:05 +010026@findex -version
pbrook9bd7e6d2009-04-07 22:58:45 +000027Display version information and exit
28ETEXI
29
Jan Kiszka80f52a62011-07-23 12:39:46 +020030DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
31 "-machine [type=]name[,prop[=value][,...]]\n"
Peter Maydell585f6032012-10-04 16:22:01 +010032 " selects emulated machine ('-machine help' for list)\n"
Jan Kiszka80f52a62011-07-23 12:39:46 +020033 " property accel=accel1[:accel2[:...]] selects accelerator\n"
Jan Kiszka6a48ffa2011-10-15 13:43:48 +020034 " supported accelerators are kvm, xen, tcg (default: tcg)\n"
Jan Kiszka39d69602012-01-25 18:14:15 +010035 " kernel_irqchip=on|off controls accelerated irqchip support\n"
Jason Baronddb97f12012-08-02 15:44:16 -040036 " kvm_shadow_mem=size of KVM shadow MMU\n"
Luiz Capitulino8490fc72012-09-05 16:50:16 -030037 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
Le Tana52a7fd2014-08-16 13:55:40 +080038 " mem-merge=on|off controls memory merge support (default: on)\n"
39 " iommu=on|off controls emulated Intel IOMMU (VT-d) support (default=off)\n",
Jan Kiszka80f52a62011-07-23 12:39:46 +020040 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +000041STEXI
Jan Kiszka80f52a62011-07-23 12:39:46 +020042@item -machine [type=]@var{name}[,prop=@var{value}[,...]]
43@findex -machine
Peter Maydell585f6032012-10-04 16:22:01 +010044Select the emulated machine by @var{name}. Use @code{-machine help} to list
Jan Kiszka80f52a62011-07-23 12:39:46 +020045available machines. Supported machine properties are:
46@table @option
47@item accel=@var{accels1}[:@var{accels2}[:...]]
48This is used to enable an accelerator. Depending on the target architecture,
49kvm, xen, or tcg can be available. By default, tcg is used. If there is more
50than one accelerator specified, the next one is used if the previous one fails
51to initialize.
Jan Kiszka6a48ffa2011-10-15 13:43:48 +020052@item kernel_irqchip=on|off
53Enables in-kernel irqchip support for the chosen accelerator when available.
Jan Kiszka39d69602012-01-25 18:14:15 +010054@item kvm_shadow_mem=size
55Defines the size of the KVM shadow MMU.
Jason Baronddb97f12012-08-02 15:44:16 -040056@item dump-guest-core=on|off
57Include guest memory in a core dump. The default is on.
Luiz Capitulino8490fc72012-09-05 16:50:16 -030058@item mem-merge=on|off
59Enables or disables memory merge support. This feature, when supported by
60the host, de-duplicates identical memory pages among VMs instances
61(enabled by default).
Le Tana52a7fd2014-08-16 13:55:40 +080062@item iommu=on|off
63Enables or disables emulated Intel IOMMU (VT-d) support. The default is off.
Jan Kiszka80f52a62011-07-23 12:39:46 +020064@end table
blueswir15824d652009-03-28 06:44:27 +000065ETEXI
66
Jan Kiszka80f52a62011-07-23 12:39:46 +020067HXCOMM Deprecated by -machine
68DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
69
blueswir15824d652009-03-28 06:44:27 +000070DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
Peter Maydell585f6032012-10-04 16:22:01 +010071 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +000072STEXI
73@item -cpu @var{model}
Stefan Weil6616b2a2010-02-05 23:52:05 +010074@findex -cpu
Peter Maydell585f6032012-10-04 16:22:01 +010075Select CPU model (@code{-cpu help} for list and additional feature selection)
blueswir15824d652009-03-28 06:44:27 +000076ETEXI
77
78DEF("smp", HAS_ARG, QEMU_OPTION_smp,
Michael Tokarev12b7f572013-06-24 15:06:52 +040079 "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
Jes Sorensen6be68d72009-07-23 17:03:42 +020080 " set the number of CPUs to 'n' [default=1]\n"
81 " maxcpus= maximum number of total cpus, including\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -070082 " offline CPUs for hotplug, etc\n"
Andre Przywara58a04db2009-08-28 10:49:57 +020083 " cores= number of CPU cores on one socket\n"
84 " threads= number of threads on one CPU core\n"
Blue Swirlad960902010-03-29 19:23:52 +000085 " sockets= number of discrete sockets in the system\n",
86 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +000087STEXI
Michael Tokarev12b7f572013-06-24 15:06:52 +040088@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
Stefan Weil6616b2a2010-02-05 23:52:05 +010089@findex -smp
blueswir15824d652009-03-28 06:44:27 +000090Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
91CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
92to 4.
Andre Przywara58a04db2009-08-28 10:49:57 +020093For the PC target, the number of @var{cores} per socket, the number
94of @var{threads} per cores and the total number of @var{sockets} can be
95specified. Missing values will be computed. If any on the three values is
96given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
97specifies the maximum number of hotpluggable CPUs.
blueswir15824d652009-03-28 06:44:27 +000098ETEXI
99
aliguori268a3622009-04-21 22:30:27 +0000100DEF("numa", HAS_ARG, QEMU_OPTION_numa,
Paolo Bonzini7febe362014-05-14 17:43:17 +0800101 "-numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node]\n"
102 "-numa node[,memdev=id][,cpus=cpu[-cpu]][,nodeid=node]\n", QEMU_ARCH_ALL)
aliguori268a3622009-04-21 22:30:27 +0000103STEXI
Luiz Capitulino4932b892014-05-14 17:43:10 +0800104@item -numa node[,mem=@var{size}][,cpus=@var{cpu[-cpu]}][,nodeid=@var{node}]
Paolo Bonzini7febe362014-05-14 17:43:17 +0800105@item -numa node[,memdev=@var{id}][,cpus=@var{cpu[-cpu]}][,nodeid=@var{node}]
Stefan Weil6616b2a2010-02-05 23:52:05 +0100106@findex -numa
Paolo Bonzini7febe362014-05-14 17:43:17 +0800107Simulate a multi node NUMA system. If @samp{mem}, @samp{memdev}
Luiz Capitulino4932b892014-05-14 17:43:10 +0800108and @samp{cpus} are omitted, resources are split equally. Also, note
109that the -@option{numa} option doesn't allocate any of the specified
110resources. That is, it just assigns existing resources to NUMA nodes. This
111means that one still has to use the @option{-m}, @option{-smp} options
Paolo Bonzini7febe362014-05-14 17:43:17 +0800112to allocate RAM and VCPUs respectively, and possibly @option{-object}
113to specify the memory backend for the @samp{memdev} suboption.
114
115@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one
116node uses @samp{memdev}, all of them have to use it.
aliguori268a3622009-04-21 22:30:27 +0000117ETEXI
118
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100119DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
120 "-add-fd fd=fd,set=set[,opaque=opaque]\n"
121 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
122STEXI
123@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
124@findex -add-fd
125
126Add a file descriptor to an fd set. Valid options are:
127
128@table @option
129@item fd=@var{fd}
130This option defines the file descriptor of which a duplicate is added to fd set.
131The file descriptor cannot be stdin, stdout, or stderr.
132@item set=@var{set}
133This option defines the ID of the fd set to add the file descriptor to.
134@item opaque=@var{opaque}
135This option defines a free-form string that can be used to describe @var{fd}.
136@end table
137
138You can open an image using pre-opened file descriptors from an fd set:
139@example
140qemu-system-i386
141-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
142-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
143-drive file=/dev/fdset/2,index=0,media=disk
144@end example
145ETEXI
146
147DEF("set", HAS_ARG, QEMU_OPTION_set,
148 "-set group.id.arg=value\n"
149 " set <arg> parameter for item <id> of type <group>\n"
150 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
151STEXI
152@item -set @var{group}.@var{id}.@var{arg}=@var{value}
153@findex -set
154Set parameter @var{arg} for item @var{id} of type @var{group}\n"
155ETEXI
156
157DEF("global", HAS_ARG, QEMU_OPTION_global,
158 "-global driver.prop=value\n"
159 " set a global default for a driver property\n",
160 QEMU_ARCH_ALL)
161STEXI
162@item -global @var{driver}.@var{prop}=@var{value}
163@findex -global
164Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
165
166@example
167qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
168@end example
169
170In particular, you can use this to set driver properties for devices which are
171created automatically by the machine model. To create a device which is not
172created automatically and set properties on it, use -@option{device}.
173ETEXI
174
175DEF("boot", HAS_ARG, QEMU_OPTION_boot,
176 "-boot [order=drives][,once=drives][,menu=on|off]\n"
Amos Kongc8a6ae82013-03-19 14:23:27 +0800177 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100178 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
179 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
180 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
181 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
182 QEMU_ARCH_ALL)
183STEXI
Amos Kongc8a6ae82013-03-19 14:23:27 +0800184@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]
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100185@findex -boot
186Specify boot order @var{drives} as a string of drive letters. Valid
187drive letters depend on the target achitecture. The x86 PC uses: a, b
188(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
189from network adapter 1-4), hard disk boot is the default. To apply a
190particular boot order only on the first startup, specify it via
191@option{once}.
192
193Interactive boot menus/prompts can be enabled via @option{menu=on} as far
194as firmware/BIOS supports them. The default is non-interactive boot.
195
196A splash picture could be passed to bios, enabling user to show it as logo,
197when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
198supports them. Currently Seabios for X86 system support it.
199limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
200format(true color). The resolution should be supported by the SVGA mode, so
201the recommended is 320x240, 640x480, 800x640.
202
203A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
204when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
205reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
206system support it.
207
Amos Kongc8a6ae82013-03-19 14:23:27 +0800208Do strict boot via @option{strict=on} as far as firmware/BIOS
209supports it. This only effects when boot priority is changed by
210bootindex options. The default is non-strict boot.
211
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100212@example
213# try to boot from network first, then from hard disk
214qemu-system-i386 -boot order=nc
215# boot from CD-ROM first, switch back to default order after reboot
216qemu-system-i386 -boot once=d
217# boot with a splash picture for 5 seconds.
218qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
219@end example
220
221Note: The legacy format '-boot @var{drives}' is still supported but its
222use is discouraged as it may be removed from future versions.
223ETEXI
224
225DEF("m", HAS_ARG, QEMU_OPTION_m,
Igor Mammedovc270fb92014-06-02 15:25:02 +0200226 "-m[emory] [size=]megs[,slots=n,maxmem=size]\n"
Igor Mammedov6e1d3c12013-11-27 01:27:35 +0100227 " configure guest RAM\n"
228 " size: initial amount of guest memory (default: "
Igor Mammedovc270fb92014-06-02 15:25:02 +0200229 stringify(DEFAULT_RAM_SIZE) "MiB)\n"
230 " slots: number of hotplug slots (default: none)\n"
231 " maxmem: maximum amount of guest memory (default: none)\n",
Igor Mammedov6e1d3c12013-11-27 01:27:35 +0100232 QEMU_ARCH_ALL)
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100233STEXI
Igor Mammedov6e1d3c12013-11-27 01:27:35 +0100234@item -m [size=]@var{megs}
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100235@findex -m
236Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB. Optionally,
237a suffix of ``M'' or ``G'' can be used to signify a value in megabytes or
Igor Mammedovc270fb92014-06-02 15:25:02 +0200238gigabytes respectively. Optional pair @var{slots}, @var{maxmem} could be used
239to set amount of hotluggable memory slots and possible maximum amount of memory.
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100240ETEXI
241
242DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
243 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
244STEXI
245@item -mem-path @var{path}
246@findex -mem-path
247Allocate guest RAM from a temporarily created file in @var{path}.
248ETEXI
249
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100250DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
251 "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
252 QEMU_ARCH_ALL)
253STEXI
254@item -mem-prealloc
255@findex -mem-prealloc
256Preallocate memory when using -mem-path.
257ETEXI
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100258
259DEF("k", HAS_ARG, QEMU_OPTION_k,
260 "-k language use keyboard layout (for example 'fr' for French)\n",
261 QEMU_ARCH_ALL)
262STEXI
263@item -k @var{language}
264@findex -k
265Use keyboard layout @var{language} (for example @code{fr} for
266French). This option is only needed where it is not easy to get raw PC
267keycodes (e.g. on Macs, with some X11 servers or with a VNC
268display). You don't normally need to use it on PC/Linux or PC/Windows
269hosts.
270
271The available layouts are:
272@example
273ar de-ch es fo fr-ca hu ja mk no pt-br sv
274da en-gb et fr fr-ch is lt nl pl ru th
275de en-us fi fr-be hr it lv nl-be pt sl tr
276@end example
277
278The default is @code{en-us}.
279ETEXI
280
281
282DEF("audio-help", 0, QEMU_OPTION_audio_help,
283 "-audio-help print list of audio drivers and their options\n",
284 QEMU_ARCH_ALL)
285STEXI
286@item -audio-help
287@findex -audio-help
288Will show the audio subsystem help: list of drivers, tunable
289parameters.
290ETEXI
291
292DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
293 "-soundhw c1,... enable audio support\n"
294 " and only specified sound cards (comma separated list)\n"
295 " use '-soundhw help' to get the list of supported cards\n"
296 " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
297STEXI
298@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
299@findex -soundhw
300Enable audio and selected sound hardware. Use 'help' to print all
301available sound hardware.
302
303@example
304qemu-system-i386 -soundhw sb16,adlib disk.img
305qemu-system-i386 -soundhw es1370 disk.img
306qemu-system-i386 -soundhw ac97 disk.img
307qemu-system-i386 -soundhw hda disk.img
308qemu-system-i386 -soundhw all disk.img
309qemu-system-i386 -soundhw help
310@end example
311
312Note that Linux's i810_audio OSS kernel (for AC97) module might
313require manually specifying clocking.
314
315@example
316modprobe i810_audio clocking=48000
317@end example
318ETEXI
319
320DEF("balloon", HAS_ARG, QEMU_OPTION_balloon,
321 "-balloon none disable balloon device\n"
322 "-balloon virtio[,addr=str]\n"
323 " enable virtio balloon device (default)\n", QEMU_ARCH_ALL)
324STEXI
325@item -balloon none
326@findex -balloon
327Disable balloon device.
328@item -balloon virtio[,addr=@var{addr}]
329Enable virtio balloon device (default), optionally with PCI address
330@var{addr}.
331ETEXI
332
333DEF("device", HAS_ARG, QEMU_OPTION_device,
334 "-device driver[,prop[=value][,...]]\n"
335 " add device (based on driver)\n"
336 " prop=value,... sets driver properties\n"
337 " use '-device help' to print all possible drivers\n"
338 " use '-device driver,help' to print all possible properties\n",
339 QEMU_ARCH_ALL)
340STEXI
341@item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
342@findex -device
343Add device @var{driver}. @var{prop}=@var{value} sets driver
344properties. Valid properties depend on the driver. To get help on
345possible drivers and properties, use @code{-device help} and
346@code{-device @var{driver},help}.
347ETEXI
348
349DEF("name", HAS_ARG, QEMU_OPTION_name,
Dr. David Alan Gilbert8f480de2014-01-30 10:20:31 +0000350 "-name string1[,process=string2][,debug-threads=on|off]\n"
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100351 " set the name of the guest\n"
Dr. David Alan Gilbert8f480de2014-01-30 10:20:31 +0000352 " string1 sets the window title and string2 the process name (on Linux)\n"
353 " When debug-threads is enabled, individual threads are given a separate name (on Linux)\n"
354 " NOTE: The thread names are for debugging and not a stable API.\n",
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100355 QEMU_ARCH_ALL)
356STEXI
357@item -name @var{name}
358@findex -name
359Sets the @var{name} of the guest.
360This name will be displayed in the SDL window caption.
361The @var{name} will also be used for the VNC server.
362Also optionally set the top visible process name in Linux.
Dr. David Alan Gilbert8f480de2014-01-30 10:20:31 +0000363Naming of individual threads can also be enabled on Linux to aid debugging.
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100364ETEXI
365
366DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
367 "-uuid %08x-%04x-%04x-%04x-%012x\n"
368 " specify machine UUID\n", QEMU_ARCH_ALL)
369STEXI
370@item -uuid @var{uuid}
371@findex -uuid
372Set system UUID.
373ETEXI
374
375STEXI
376@end table
377ETEXI
378DEFHEADING()
379
380DEFHEADING(Block device options:)
381STEXI
382@table @option
383ETEXI
384
blueswir15824d652009-03-28 06:44:27 +0000385DEF("fda", HAS_ARG, QEMU_OPTION_fda,
Blue Swirlad960902010-03-29 19:23:52 +0000386 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
387DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000388STEXI
389@item -fda @var{file}
390@item -fdb @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100391@findex -fda
392@findex -fdb
blueswir15824d652009-03-28 06:44:27 +0000393Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can
394use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}).
395ETEXI
396
397DEF("hda", HAS_ARG, QEMU_OPTION_hda,
Blue Swirlad960902010-03-29 19:23:52 +0000398 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
399DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000400DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
Blue Swirlad960902010-03-29 19:23:52 +0000401 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
402DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000403STEXI
404@item -hda @var{file}
405@item -hdb @var{file}
406@item -hdc @var{file}
407@item -hdd @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100408@findex -hda
409@findex -hdb
410@findex -hdc
411@findex -hdd
blueswir15824d652009-03-28 06:44:27 +0000412Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
413ETEXI
414
415DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
Blue Swirlad960902010-03-29 19:23:52 +0000416 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
417 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000418STEXI
419@item -cdrom @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100420@findex -cdrom
blueswir15824d652009-03-28 06:44:27 +0000421Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
422@option{-cdrom} at the same time). You can use the host CD-ROM by
423using @file{/dev/cdrom} as filename (@pxref{host_drives}).
424ETEXI
425
426DEF("drive", HAS_ARG, QEMU_OPTION_drive,
427 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
428 " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
Stefan Hajnoczi92196b22011-08-04 12:26:52 +0100429 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
Stefan Hajnoczid1db7602014-04-23 13:55:37 +0200430 " [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
431 " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
Stefan Hajnoczifb0490f2011-11-17 13:40:32 +0000432 " [,readonly=on|off][,copy-on-read=on|off]\n"
Peter Lieven2f7133b2014-07-28 21:53:02 +0200433 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
Benoît Canet3e9fab62013-09-02 14:14:40 +0200434 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
435 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
436 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
437 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
Benoît Canet2024c1d2013-09-02 14:14:41 +0200438 " [[,iops_size=is]]\n"
Blue Swirlad960902010-03-29 19:23:52 +0000439 " use 'file' as a drive image\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000440STEXI
441@item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
Stefan Weil6616b2a2010-02-05 23:52:05 +0100442@findex -drive
blueswir15824d652009-03-28 06:44:27 +0000443
444Define a new drive. Valid options are:
445
Kevin Wolfb3f046c2009-10-09 10:58:35 +0200446@table @option
blueswir15824d652009-03-28 06:44:27 +0000447@item file=@var{file}
448This option defines which disk image (@pxref{disk_images}) to use with
449this drive. If the filename contains comma, you must double it
450(for instance, "file=my,,file" to use file "my,file").
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +1100451
452Special files such as iSCSI devices can be specified using protocol
453specific URLs. See the section for "Device URL Syntax" for more information.
blueswir15824d652009-03-28 06:44:27 +0000454@item if=@var{interface}
455This option defines on which type on interface the drive is connected.
456Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
457@item bus=@var{bus},unit=@var{unit}
458These options define where is connected the drive by defining the bus number and
459the unit id.
460@item index=@var{index}
461This option defines where is connected the drive by using an index in the list
462of available connectors of a given interface type.
463@item media=@var{media}
464This option defines the type of the media: disk or cdrom.
465@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
466These options have the same definition as they have in @option{-hdachs}.
467@item snapshot=@var{snapshot}
Michael Tokarev9d85d552014-04-07 13:34:58 +0400468@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
469(see @option{-snapshot}).
blueswir15824d652009-03-28 06:44:27 +0000470@item cache=@var{cache}
Stefan Hajnoczi92196b22011-08-04 12:26:52 +0100471@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
Christoph Hellwig5c6c3a62009-08-20 16:58:35 +0200472@item aio=@var{aio}
473@var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
Paolo Bonzinia9384af2013-02-08 14:06:12 +0100474@item discard=@var{discard}
475@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.
blueswir15824d652009-03-28 06:44:27 +0000476@item format=@var{format}
477Specify which disk @var{format} will be used rather than detecting
478the format. Can be used to specifiy format=raw to avoid interpreting
479an untrusted format header.
480@item serial=@var{serial}
481This option specifies the serial number to assign to the device.
Markus Armbrusterc2cc47a2009-06-18 15:14:10 +0200482@item addr=@var{addr}
483Specify the controller's PCI address (if=virtio only).
Luiz Capitulinoae73e592011-07-12 17:35:08 -0300484@item werror=@var{action},rerror=@var{action}
485Specify which @var{action} to take on write and read errors. Valid actions are:
486"ignore" (ignore the error and try to continue), "stop" (pause QEMU),
487"report" (report the error to the guest), "enospc" (pause QEMU only if the
488host disk is full; report the error to the guest otherwise).
489The default setting is @option{werror=enospc} and @option{rerror=report}.
490@item readonly
491Open drive @option{file} as read-only. Guest write attempts will fail.
Stefan Hajnoczifb0490f2011-11-17 13:40:32 +0000492@item copy-on-read=@var{copy-on-read}
493@var{copy-on-read} is "on" or "off" and enables whether to copy read backing
494file sectors into the image file.
Peter Lieven465bee12014-05-18 00:58:19 +0200495@item detect-zeroes=@var{detect-zeroes}
496@var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
497conversion of plain zero writes by the OS to driver specific optimized
498zero write commands. You may even choose "unmap" if @var{discard} is set
499to "unmap" to allow a zero write to be converted to an UNMAP operation.
blueswir15824d652009-03-28 06:44:27 +0000500@end table
501
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100502By default, the @option{cache=writeback} mode is used. It will report data
503writes as completed as soon as the data is present in the host page cache.
504This is safe as long as your guest OS makes sure to correctly flush disk caches
505where needed. If your guest OS does not handle volatile disk write caches
506correctly and your host crashes or loses power, then the guest may experience
507data corruption.
blueswir15824d652009-03-28 06:44:27 +0000508
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100509For such guests, you should consider using @option{cache=writethrough}. This
510means that the host page cache will be used to read and write data, but write
511notification will be sent to the guest only after QEMU has made sure to flush
512each write to the disk. Be aware that this has a major impact on performance.
blueswir15824d652009-03-28 06:44:27 +0000513
Aurelien Jarnoc304d312009-05-03 23:29:14 +0200514The host page cache can be avoided entirely with @option{cache=none}. This will
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100515attempt to do disk IO directly to the guest's memory. QEMU may still perform
516an internal copy of the data. Note that this is considered a writeback mode and
517the guest OS must handle the disk write cache correctly in order to avoid data
518corruption on host crashes.
blueswir15824d652009-03-28 06:44:27 +0000519
Stefan Hajnoczi92196b22011-08-04 12:26:52 +0100520The host page cache can be avoided while only sending write notifications to
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100521the guest when the data has been flushed to the disk using
522@option{cache=directsync}.
blueswir15824d652009-03-28 06:44:27 +0000523
Alexander Graf016f5cf2010-05-26 17:51:49 +0200524In case you don't care about data integrity over host failures, use
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100525@option{cache=unsafe}. This option tells QEMU that it never needs to write any
526data to the disk but can instead keep things in cache. If anything goes wrong,
Stefan Weile7d81002011-12-10 00:19:46 +0100527like your host losing power, the disk storage getting disconnected accidentally,
Kevin Wolfa13e5e02012-11-21 12:26:56 +0100528etc. your image will most probably be rendered unusable. When using
Alexander Grafc3177282010-05-26 21:04:32 +0200529the @option{-snapshot} option, unsafe caching is always used.
Alexander Graf016f5cf2010-05-26 17:51:49 +0200530
Stefan Hajnoczifb0490f2011-11-17 13:40:32 +0000531Copy-on-read avoids accessing the same backing file sectors repeatedly and is
532useful when the backing file is over a slow network. By default copy-on-read
533is off.
534
blueswir15824d652009-03-28 06:44:27 +0000535Instead of @option{-cdrom} you can use:
536@example
Stefan Weil3804da92012-05-11 22:21:50 +0200537qemu-system-i386 -drive file=file,index=2,media=cdrom
blueswir15824d652009-03-28 06:44:27 +0000538@end example
539
540Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
541use:
542@example
Stefan Weil3804da92012-05-11 22:21:50 +0200543qemu-system-i386 -drive file=file,index=0,media=disk
544qemu-system-i386 -drive file=file,index=1,media=disk
545qemu-system-i386 -drive file=file,index=2,media=disk
546qemu-system-i386 -drive file=file,index=3,media=disk
blueswir15824d652009-03-28 06:44:27 +0000547@end example
548
Corey Bryant587ed6b2012-10-18 15:19:34 -0400549You can open an image using pre-opened file descriptors from an fd set:
550@example
551qemu-system-i386
552-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
553-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
554-drive file=/dev/fdset/2,index=0,media=disk
555@end example
556
blueswir15824d652009-03-28 06:44:27 +0000557You can connect a CDROM to the slave of ide0:
558@example
Stefan Weil3804da92012-05-11 22:21:50 +0200559qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
blueswir15824d652009-03-28 06:44:27 +0000560@end example
561
562If you don't specify the "file=" argument, you define an empty drive:
563@example
Stefan Weil3804da92012-05-11 22:21:50 +0200564qemu-system-i386 -drive if=ide,index=1,media=cdrom
blueswir15824d652009-03-28 06:44:27 +0000565@end example
566
567You can connect a SCSI disk with unit ID 6 on the bus #0:
568@example
Stefan Weil3804da92012-05-11 22:21:50 +0200569qemu-system-i386 -drive file=file,if=scsi,bus=0,unit=6
blueswir15824d652009-03-28 06:44:27 +0000570@end example
571
572Instead of @option{-fda}, @option{-fdb}, you can use:
573@example
Stefan Weil3804da92012-05-11 22:21:50 +0200574qemu-system-i386 -drive file=file,index=0,if=floppy
575qemu-system-i386 -drive file=file,index=1,if=floppy
blueswir15824d652009-03-28 06:44:27 +0000576@end example
577
578By default, @var{interface} is "ide" and @var{index} is automatically
579incremented:
580@example
Stefan Weil3804da92012-05-11 22:21:50 +0200581qemu-system-i386 -drive file=a -drive file=b"
blueswir15824d652009-03-28 06:44:27 +0000582@end example
583is interpreted like:
584@example
Stefan Weil3804da92012-05-11 22:21:50 +0200585qemu-system-i386 -hda a -hdb b
blueswir15824d652009-03-28 06:44:27 +0000586@end example
587ETEXI
588
589DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
Blue Swirlad960902010-03-29 19:23:52 +0000590 "-mtdblock file use 'file' as on-board Flash memory image\n",
591 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000592STEXI
Kevin Wolf4e257e52009-10-09 10:58:36 +0200593@item -mtdblock @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100594@findex -mtdblock
Kevin Wolf4e257e52009-10-09 10:58:36 +0200595Use @var{file} as on-board Flash memory image.
blueswir15824d652009-03-28 06:44:27 +0000596ETEXI
597
598DEF("sd", HAS_ARG, QEMU_OPTION_sd,
Blue Swirlad960902010-03-29 19:23:52 +0000599 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000600STEXI
Kevin Wolf4e257e52009-10-09 10:58:36 +0200601@item -sd @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100602@findex -sd
Kevin Wolf4e257e52009-10-09 10:58:36 +0200603Use @var{file} as SecureDigital card image.
blueswir15824d652009-03-28 06:44:27 +0000604ETEXI
605
606DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
Blue Swirlad960902010-03-29 19:23:52 +0000607 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000608STEXI
Kevin Wolf4e257e52009-10-09 10:58:36 +0200609@item -pflash @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +0100610@findex -pflash
Kevin Wolf4e257e52009-10-09 10:58:36 +0200611Use @var{file} as a parallel flash image.
blueswir15824d652009-03-28 06:44:27 +0000612ETEXI
613
blueswir15824d652009-03-28 06:44:27 +0000614DEF("snapshot", 0, QEMU_OPTION_snapshot,
Blue Swirlad960902010-03-29 19:23:52 +0000615 "-snapshot write to temporary files instead of disk image files\n",
616 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000617STEXI
618@item -snapshot
Stefan Weil6616b2a2010-02-05 23:52:05 +0100619@findex -snapshot
blueswir15824d652009-03-28 06:44:27 +0000620Write to temporary files instead of disk image files. In this case,
621the raw disk image you use is not written back. You can however force
622the write back by pressing @key{C-a s} (@pxref{disk_images}).
623ETEXI
624
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100625DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \
626 "-hdachs c,h,s[,t]\n" \
627 " force hard disk 0 physical geometry and the optional BIOS\n" \
628 " translation (t=none or lba) (usually QEMU can guess them)\n",
Blue Swirlad960902010-03-29 19:23:52 +0000629 QEMU_ARCH_ALL)
Marcelo Tosattic9027602010-03-01 20:25:08 -0300630STEXI
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100631@item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
632@findex -hdachs
633Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=
634@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS
635translation mode (@var{t}=none, lba or auto). Usually QEMU can guess
636all those parameters. This option is useful for old MS-DOS disk
637images.
Markus Armbrusterc70a01e2013-02-13 19:49:40 +0100638ETEXI
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530639
640DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530641 "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530642 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530643 QEMU_ARCH_ALL)
644
645STEXI
646
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530647@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}]
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530648@findex -fsdev
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530649Define a new file system device. Valid options are:
650@table @option
651@item @var{fsdriver}
652This option specifies the fs driver backend to use.
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530653Currently "local", "handle" and "proxy" file system drivers are supported.
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530654@item id=@var{id}
655Specifies identifier for this device
656@item path=@var{path}
657Specifies the export path for the file system device. Files under
658this path will be available to the 9p client on the guest.
659@item security_model=@var{security_model}
660Specifies the security model to be used for this export path.
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530661Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530662In "passthrough" security model, files are stored using the same
Stefan Weilb65ee4f2012-05-11 22:25:50 +0200663credentials as they are created on the guest. This requires QEMU
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530664to run as root. In "mapped-xattr" security model, some of the file
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530665attributes like uid, gid, mode bits and link target are stored as
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530666file attributes. For "mapped-file" these attributes are stored in the
667hidden .virtfs_metadata directory. Directories exported by this security model cannot
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530668interact with other unix tools. "none" security model is same as
669passthrough except the sever won't report failures if it fails to
M. Mohan Kumard9b36a62011-10-14 12:59:37 +0530670set file attributes like ownership. Security model is mandatory
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530671only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
M. Mohan Kumard9b36a62011-10-14 12:59:37 +0530672security model as a parameter.
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530673@item writeout=@var{writeout}
674This is an optional argument. The only supported value is "immediate".
675This means that host page cache will be used to read and write data but
676write notification will be sent to the guest only when the data has been
677reported as written by the storage subsystem.
M. Mohan Kumar2c74c2c2011-10-25 12:10:39 +0530678@item readonly
679Enables exporting 9p share as a readonly mount for guests. By default
680read-write access is given.
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530681@item socket=@var{socket}
682Enables proxy filesystem driver to use passed socket file for communicating
683with virtfs-proxy-helper
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530684@item sock_fd=@var{sock_fd}
685Enables proxy filesystem driver to use passed socket descriptor for
686communicating with virtfs-proxy-helper. Usually a helper like libvirt
687will create socketpair and pass one of the fds as sock_fd
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530688@end table
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530689
690-fsdev option is used along with -device driver "virtio-9p-pci".
691@item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag}
692Options for virtio-9p-pci driver are:
693@table @option
694@item fsdev=@var{id}
695Specifies the id value specified along with -fsdev option
696@item mount_tag=@var{mount_tag}
697Specifies the tag name to be used by the guest to mount this export point
698@end table
699
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530700ETEXI
Gautham R Shenoy74db9202010-04-29 17:44:43 +0530701
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530702DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530703 "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530704 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530705 QEMU_ARCH_ALL)
706
707STEXI
708
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530709@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}]
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530710@findex -virtfs
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530711
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530712The general form of a Virtual File system pass-through options are:
713@table @option
714@item @var{fsdriver}
715This option specifies the fs driver backend to use.
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530716Currently "local", "handle" and "proxy" file system drivers are supported.
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530717@item id=@var{id}
718Specifies identifier for this device
719@item path=@var{path}
720Specifies the export path for the file system device. Files under
721this path will be available to the 9p client on the guest.
722@item security_model=@var{security_model}
723Specifies the security model to be used for this export path.
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530724Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530725In "passthrough" security model, files are stored using the same
Stefan Weilb65ee4f2012-05-11 22:25:50 +0200726credentials as they are created on the guest. This requires QEMU
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530727to run as root. In "mapped-xattr" security model, some of the file
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530728attributes like uid, gid, mode bits and link target are stored as
Aneesh Kumar K.V2c30dd72012-01-19 12:21:11 +0530729file attributes. For "mapped-file" these attributes are stored in the
730hidden .virtfs_metadata directory. Directories exported by this security model cannot
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530731interact with other unix tools. "none" security model is same as
732passthrough except the sever won't report failures if it fails to
M. Mohan Kumard9b36a62011-10-14 12:59:37 +0530733set file attributes like ownership. Security model is mandatory only
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530734for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
M. Mohan Kumard9b36a62011-10-14 12:59:37 +0530735model as a parameter.
Aneesh Kumar K.V7c92a3d2011-10-12 19:11:24 +0530736@item writeout=@var{writeout}
737This is an optional argument. The only supported value is "immediate".
738This means that host page cache will be used to read and write data but
739write notification will be sent to the guest only when the data has been
740reported as written by the storage subsystem.
M. Mohan Kumar2c74c2c2011-10-25 12:10:39 +0530741@item readonly
742Enables exporting 9p share as a readonly mount for guests. By default
743read-write access is given.
M. Mohan Kumar84a87cc2011-12-14 13:58:47 +0530744@item socket=@var{socket}
745Enables proxy filesystem driver to use passed socket file for
746communicating with virtfs-proxy-helper. Usually a helper like libvirt
747will create socketpair and pass one of the fds as sock_fd
M. Mohan Kumarf67e3ff2011-12-14 13:58:46 +0530748@item sock_fd
749Enables proxy filesystem driver to use passed 'sock_fd' as the socket
750descriptor for interfacing with virtfs-proxy-helper
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530751@end table
752ETEXI
Gautham R Shenoy3d54abc2010-04-29 17:45:03 +0530753
Aneesh Kumar K.V9db221a2011-10-25 12:10:40 +0530754DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
755 "-virtfs_synth Create synthetic file system image\n",
756 QEMU_ARCH_ALL)
757STEXI
758@item -virtfs_synth
759@findex -virtfs_synth
760Create synthetic file system image
761ETEXI
762
blueswir15824d652009-03-28 06:44:27 +0000763STEXI
764@end table
765ETEXI
blueswir15824d652009-03-28 06:44:27 +0000766DEFHEADING()
767
Markus Armbruster10adb8b2013-02-13 19:49:43 +0100768DEFHEADING(USB options:)
769STEXI
770@table @option
771ETEXI
772
773DEF("usb", 0, QEMU_OPTION_usb,
774 "-usb enable the USB driver (will be the default soon)\n",
775 QEMU_ARCH_ALL)
776STEXI
777@item -usb
778@findex -usb
779Enable the USB driver (will be the default soon)
780ETEXI
781
782DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
783 "-usbdevice name add the host or guest USB device 'name'\n",
784 QEMU_ARCH_ALL)
785STEXI
786
787@item -usbdevice @var{devname}
788@findex -usbdevice
789Add the USB device @var{devname}. @xref{usb_devices}.
790
791@table @option
792
793@item mouse
794Virtual Mouse. This will override the PS/2 mouse emulation when activated.
795
796@item tablet
797Pointer device that uses absolute coordinates (like a touchscreen). This
798means QEMU is able to report the mouse position without having to grab the
799mouse. Also overrides the PS/2 mouse emulation when activated.
800
801@item disk:[format=@var{format}]:@var{file}
802Mass storage device based on file. The optional @var{format} argument
803will be used rather than detecting the format. Can be used to specifiy
804@code{format=raw} to avoid interpreting an untrusted format header.
805
806@item host:@var{bus}.@var{addr}
807Pass through the host device identified by @var{bus}.@var{addr} (Linux only).
808
809@item host:@var{vendor_id}:@var{product_id}
810Pass through the host device identified by @var{vendor_id}:@var{product_id}
811(Linux only).
812
813@item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
814Serial converter to host character device @var{dev}, see @code{-serial} for the
815available devices.
816
817@item braille
818Braille device. This will use BrlAPI to display the braille output on a real
819or fake device.
820
821@item net:@var{options}
822Network adapter that supports CDC ethernet and RNDIS protocols.
823
824@end table
825ETEXI
826
827STEXI
828@end table
829ETEXI
830DEFHEADING()
831
blueswir15824d652009-03-28 06:44:27 +0000832DEFHEADING(Display options:)
blueswir15824d652009-03-28 06:44:27 +0000833STEXI
834@table @option
835ETEXI
836
Jes Sorensen1472a952011-03-16 13:33:31 +0100837DEF("display", HAS_ARG, QEMU_OPTION_display,
838 "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
Jes Sorensen3264ff12011-03-16 13:33:33 +0100839 " [,window_close=on|off]|curses|none|\n"
Jan Kiszka881249c2014-03-12 08:33:50 +0100840 " gtk[,grab_on_hover=on|off]|\n"
Jes Sorensen3264ff12011-03-16 13:33:33 +0100841 " vnc=<display>[,<optargs>]\n"
Jes Sorensen1472a952011-03-16 13:33:31 +0100842 " select display type\n", QEMU_ARCH_ALL)
843STEXI
844@item -display @var{type}
845@findex -display
846Select type of display to use. This option is a replacement for the
847old style -sdl/-curses/... options. Valid values for @var{type} are
848@table @option
849@item sdl
850Display video output via SDL (usually in a separate graphics
851window; see the SDL documentation for other possibilities).
852@item curses
853Display video output via curses. For graphics device models which
854support a text mode, QEMU can display this output using a
855curses/ncurses interface. Nothing is displayed when the graphics
856device is in graphical mode or if the graphics device does not support
857a text mode. Generally only the VGA device models support text mode.
Jes Sorensen4171d322011-03-16 13:33:32 +0100858@item none
859Do not display video output. The guest will still see an emulated
860graphics card, but its output will not be displayed to the QEMU
861user. This option differs from the -nographic option in that it
862only affects what is done with video output; -nographic also changes
863the destination of the serial and parallel port data.
Jan Kiszka881249c2014-03-12 08:33:50 +0100864@item gtk
865Display video output in a GTK window. This interface provides drop-down
866menus and other UI elements to configure and control the VM during
867runtime.
Jes Sorensen3264ff12011-03-16 13:33:33 +0100868@item vnc
869Start a VNC server on display <arg>
Jes Sorensen1472a952011-03-16 13:33:31 +0100870@end table
871ETEXI
872
blueswir15824d652009-03-28 06:44:27 +0000873DEF("nographic", 0, QEMU_OPTION_nographic,
Blue Swirlad960902010-03-29 19:23:52 +0000874 "-nographic disable graphical output and redirect serial I/Os to console\n",
875 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000876STEXI
877@item -nographic
Stefan Weil6616b2a2010-02-05 23:52:05 +0100878@findex -nographic
blueswir15824d652009-03-28 06:44:27 +0000879Normally, QEMU uses SDL to display the VGA output. With this option,
880you can totally disable graphical output so that QEMU is a simple
881command line application. The emulated serial port is redirected on
Paolo Bonzini02c4bdf2013-07-03 20:29:45 +0400882the console and muxed with the monitor (unless redirected elsewhere
883explicitly). Therefore, you can still use QEMU to debug a Linux kernel
Ramkumar Ramachandrab031f412013-07-20 16:53:09 +0530884with a serial console. Use @key{C-a h} for help on switching between
885the console and monitor.
blueswir15824d652009-03-28 06:44:27 +0000886ETEXI
887
blueswir15824d652009-03-28 06:44:27 +0000888DEF("curses", 0, QEMU_OPTION_curses,
Blue Swirlad960902010-03-29 19:23:52 +0000889 "-curses use a curses/ncurses interface instead of SDL\n",
890 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000891STEXI
892@item -curses
Markus Armbrusterb8f490e2013-02-13 19:49:38 +0100893@findex -curses
blueswir15824d652009-03-28 06:44:27 +0000894Normally, QEMU uses SDL to display the VGA output. With this option,
895QEMU can display the VGA output when in text mode using a
896curses/ncurses interface. Nothing is displayed in graphical mode.
897ETEXI
898
blueswir15824d652009-03-28 06:44:27 +0000899DEF("no-frame", 0, QEMU_OPTION_no_frame,
Blue Swirlad960902010-03-29 19:23:52 +0000900 "-no-frame open SDL window without a frame and window decorations\n",
901 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000902STEXI
903@item -no-frame
Stefan Weil6616b2a2010-02-05 23:52:05 +0100904@findex -no-frame
blueswir15824d652009-03-28 06:44:27 +0000905Do not use decorations for SDL windows and start them using the whole
906available screen space. This makes the using QEMU in a dedicated desktop
907workspace more convenient.
908ETEXI
909
blueswir15824d652009-03-28 06:44:27 +0000910DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
Blue Swirlad960902010-03-29 19:23:52 +0000911 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
912 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000913STEXI
914@item -alt-grab
Stefan Weil6616b2a2010-02-05 23:52:05 +0100915@findex -alt-grab
Brad Hardsde1db2a2011-04-29 21:46:12 +1000916Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
917affects the special keys (for fullscreen, monitor-mode switching, etc).
blueswir15824d652009-03-28 06:44:27 +0000918ETEXI
919
Dustin Kirkland0ca9f8a2009-09-17 15:48:04 -0500920DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
Blue Swirlad960902010-03-29 19:23:52 +0000921 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
922 QEMU_ARCH_ALL)
Dustin Kirkland0ca9f8a2009-09-17 15:48:04 -0500923STEXI
924@item -ctrl-grab
Stefan Weil6616b2a2010-02-05 23:52:05 +0100925@findex -ctrl-grab
Brad Hardsde1db2a2011-04-29 21:46:12 +1000926Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
927affects the special keys (for fullscreen, monitor-mode switching, etc).
Dustin Kirkland0ca9f8a2009-09-17 15:48:04 -0500928ETEXI
929
blueswir15824d652009-03-28 06:44:27 +0000930DEF("no-quit", 0, QEMU_OPTION_no_quit,
Blue Swirlad960902010-03-29 19:23:52 +0000931 "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000932STEXI
933@item -no-quit
Stefan Weil6616b2a2010-02-05 23:52:05 +0100934@findex -no-quit
blueswir15824d652009-03-28 06:44:27 +0000935Disable SDL window close capability.
936ETEXI
937
blueswir15824d652009-03-28 06:44:27 +0000938DEF("sdl", 0, QEMU_OPTION_sdl,
Blue Swirlad960902010-03-29 19:23:52 +0000939 "-sdl enable SDL\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +0000940STEXI
941@item -sdl
Stefan Weil6616b2a2010-02-05 23:52:05 +0100942@findex -sdl
blueswir15824d652009-03-28 06:44:27 +0000943Enable SDL.
944ETEXI
945
Gerd Hoffmann29b00402010-03-11 11:13:27 -0300946DEF("spice", HAS_ARG, QEMU_OPTION_spice,
Yonit Halperin27af7782012-08-21 13:54:20 +0300947 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
948 " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
949 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
950 " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6]\n"
951 " [,tls-ciphers=<list>]\n"
952 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
953 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
954 " [,sasl][,password=<secret>][,disable-ticketing]\n"
955 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
956 " [,jpeg-wan-compression=[auto|never|always]]\n"
957 " [,zlib-glz-wan-compression=[auto|never|always]]\n"
958 " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
Hans de Goede5ad24e52013-06-08 15:37:27 +0200959 " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
960 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
Yonit Halperin27af7782012-08-21 13:54:20 +0300961 " enable spice\n"
962 " at least one of {port, tls-port} is mandatory\n",
963 QEMU_ARCH_ALL)
Gerd Hoffmann29b00402010-03-11 11:13:27 -0300964STEXI
965@item -spice @var{option}[,@var{option}[,...]]
966@findex -spice
967Enable the spice remote desktop protocol. Valid options are
968
969@table @option
970
971@item port=<nr>
Gerd Hoffmannc448e852010-03-11 11:13:32 -0300972Set the TCP port spice is listening on for plaintext channels.
Gerd Hoffmann29b00402010-03-11 11:13:27 -0300973
Gerd Hoffmann333b0ee2010-08-27 14:29:16 +0200974@item addr=<addr>
975Set the IP address spice is listening on. Default is any address.
976
977@item ipv4
978@item ipv6
979Force using the specified IP version.
980
Gerd Hoffmann29b00402010-03-11 11:13:27 -0300981@item password=<secret>
982Set the password you need to authenticate.
983
Marc-André Lureau48b3ed02011-05-17 10:40:33 +0200984@item sasl
985Require that the client use SASL to authenticate with the spice.
986The exact choice of authentication method used is controlled from the
987system / user's SASL configuration file for the 'qemu' service. This
988is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
989unprivileged user, an environment variable SASL_CONF_PATH can be used
990to make it search alternate locations for the service config.
991While some SASL auth methods can also provide data encryption (eg GSSAPI),
992it is recommended that SASL always be combined with the 'tls' and
993'x509' settings to enable use of SSL and server certificates. This
994ensures a data encryption preventing compromise of authentication
995credentials.
996
Gerd Hoffmann29b00402010-03-11 11:13:27 -0300997@item disable-ticketing
998Allow client connects without authentication.
999
Hans de Goeded4970b02011-03-27 16:43:54 +02001000@item disable-copy-paste
1001Disable copy paste between the client and the guest.
1002
Hans de Goede5ad24e52013-06-08 15:37:27 +02001003@item disable-agent-file-xfer
1004Disable spice-vdagent based file-xfer between the client and the guest.
1005
Gerd Hoffmannc448e852010-03-11 11:13:32 -03001006@item tls-port=<nr>
1007Set the TCP port spice is listening on for encrypted channels.
1008
1009@item x509-dir=<dir>
1010Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
1011
1012@item x509-key-file=<file>
1013@item x509-key-password=<file>
1014@item x509-cert-file=<file>
1015@item x509-cacert-file=<file>
1016@item x509-dh-key-file=<file>
1017The x509 file names can also be configured individually.
1018
1019@item tls-ciphers=<list>
1020Specify which ciphers to use.
1021
Alon Levyd70d6b32011-12-20 13:05:18 +02001022@item tls-channel=[main|display|cursor|inputs|record|playback]
1023@item plaintext-channel=[main|display|cursor|inputs|record|playback]
Gerd Hoffmann17b6dea2010-08-27 14:09:56 +02001024Force specific channel to be used with or without TLS encryption. The
1025options can be specified multiple times to configure multiple
1026channels. The special name "default" can be used to set the default
1027mode. For channels which are not explicitly forced into one mode the
1028spice client is allowed to pick tls/plaintext as he pleases.
1029
Yonit Halperin9f04e092010-07-14 13:26:34 +03001030@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
1031Configure image compression (lossless).
1032Default is auto_glz.
1033
1034@item jpeg-wan-compression=[auto|never|always]
1035@item zlib-glz-wan-compression=[auto|never|always]
1036Configure wan image compression (lossy for slow links).
1037Default is auto.
1038
Gerd Hoffmann84a23f22010-08-30 16:36:53 +02001039@item streaming-video=[off|all|filter]
1040Configure video stream detection. Default is filter.
1041
1042@item agent-mouse=[on|off]
1043Enable/disable passing mouse events via vdagent. Default is on.
1044
1045@item playback-compression=[on|off]
1046Enable/disable audio stream compression (using celt 0.5.1). Default is on.
1047
Yonit Halperin8c957052012-08-21 11:51:59 +03001048@item seamless-migration=[on|off]
1049Enable/disable spice seamless migration. Default is off.
1050
Gerd Hoffmann29b00402010-03-11 11:13:27 -03001051@end table
1052ETEXI
1053
blueswir15824d652009-03-28 06:44:27 +00001054DEF("portrait", 0, QEMU_OPTION_portrait,
Blue Swirlad960902010-03-29 19:23:52 +00001055 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
1056 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00001057STEXI
1058@item -portrait
Stefan Weil6616b2a2010-02-05 23:52:05 +01001059@findex -portrait
blueswir15824d652009-03-28 06:44:27 +00001060Rotate graphical output 90 deg left (only PXA LCD).
1061ETEXI
1062
Vasily Khoruzhick93128052011-06-17 13:04:36 +03001063DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
1064 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
1065 QEMU_ARCH_ALL)
1066STEXI
Markus Armbruster6265c432013-02-13 19:49:39 +01001067@item -rotate @var{deg}
Vasily Khoruzhick93128052011-06-17 13:04:36 +03001068@findex -rotate
1069Rotate graphical output some deg left (only PXA LCD).
1070ETEXI
1071
blueswir15824d652009-03-28 06:44:27 +00001072DEF("vga", HAS_ARG, QEMU_OPTION_vga,
Mark Cave-Ayland33632782014-03-17 21:46:25 +00001073 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|none]\n"
Blue Swirlad960902010-03-29 19:23:52 +00001074 " select video card type\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00001075STEXI
malce4558dc2012-08-27 18:33:21 +04001076@item -vga @var{type}
Stefan Weil6616b2a2010-02-05 23:52:05 +01001077@findex -vga
blueswir15824d652009-03-28 06:44:27 +00001078Select type of VGA card to emulate. Valid values for @var{type} are
Kevin Wolfb3f046c2009-10-09 10:58:35 +02001079@table @option
blueswir15824d652009-03-28 06:44:27 +00001080@item cirrus
1081Cirrus Logic GD5446 Video card. All Windows versions starting from
1082Windows 95 should recognize and use this graphic card. For optimal
1083performances, use 16 bit color depth in the guest and the host OS.
1084(This one is the default)
1085@item std
1086Standard VGA card with Bochs VBE extensions. If your guest OS
1087supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
1088to use high resolution modes (>= 1280x1024x16) then you should use
1089this option.
1090@item vmware
1091VMWare SVGA-II compatible adapter. Use it if you have sufficiently
1092recent XFree86/XOrg server or Windows guest with a driver for this
1093card.
Gerd Hoffmanna19cbfb2010-04-27 11:50:11 +02001094@item qxl
1095QXL paravirtual graphic card. It is VGA compatible (including VESA
10962.0 VBE support). Works best with qxl guest drivers installed though.
1097Recommended choice when using the spice protocol.
Mark Cave-Ayland33632782014-03-17 21:46:25 +00001098@item tcx
1099(sun4m only) Sun TCX framebuffer. This is the default framebuffer for
1100sun4m machines and offers both 8-bit and 24-bit colour depths at a
1101fixed resolution of 1024x768.
1102@item cg3
1103(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
1104for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
1105resolutions aimed at people wishing to run older Solaris versions.
blueswir15824d652009-03-28 06:44:27 +00001106@item none
1107Disable VGA card.
1108@end table
1109ETEXI
1110
1111DEF("full-screen", 0, QEMU_OPTION_full_screen,
Blue Swirlad960902010-03-29 19:23:52 +00001112 "-full-screen start in full screen\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00001113STEXI
1114@item -full-screen
Stefan Weil6616b2a2010-02-05 23:52:05 +01001115@findex -full-screen
blueswir15824d652009-03-28 06:44:27 +00001116Start in full screen.
1117ETEXI
1118
blueswir15824d652009-03-28 06:44:27 +00001119DEF("g", 1, QEMU_OPTION_g ,
Blue Swirlad960902010-03-29 19:23:52 +00001120 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
1121 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
blueswir15824d652009-03-28 06:44:27 +00001122STEXI
Stefan Weil95d5f082010-01-20 22:25:27 +01001123@item -g @var{width}x@var{height}[x@var{depth}]
Stefan Weil6616b2a2010-02-05 23:52:05 +01001124@findex -g
Stefan Weil95d5f082010-01-20 22:25:27 +01001125Set the initial graphical resolution and depth (PPC, SPARC only).
blueswir15824d652009-03-28 06:44:27 +00001126ETEXI
1127
1128DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
Blue Swirlad960902010-03-29 19:23:52 +00001129 "-vnc display start a VNC server on display\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00001130STEXI
1131@item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
Stefan Weil6616b2a2010-02-05 23:52:05 +01001132@findex -vnc
blueswir15824d652009-03-28 06:44:27 +00001133Normally, QEMU uses SDL to display the VGA output. With this option,
1134you can have QEMU listen on VNC display @var{display} and redirect the VGA
1135display over the VNC session. It is very useful to enable the usb
1136tablet device when using this option (option @option{-usbdevice
1137tablet}). When using the VNC display, you must use the @option{-k}
1138parameter to set the keyboard layout if you are not using en-us. Valid
1139syntax for the @var{display} is
1140
Kevin Wolfb3f046c2009-10-09 10:58:35 +02001141@table @option
blueswir15824d652009-03-28 06:44:27 +00001142
1143@item @var{host}:@var{d}
1144
1145TCP connections will only be allowed from @var{host} on display @var{d}.
1146By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
1147be omitted in which case the server will accept connections from any host.
1148
Kevin Wolf4e257e52009-10-09 10:58:36 +02001149@item unix:@var{path}
blueswir15824d652009-03-28 06:44:27 +00001150
1151Connections will be allowed over UNIX domain sockets where @var{path} is the
1152location of a unix socket to listen for connections on.
1153
1154@item none
1155
1156VNC is initialized but not started. The monitor @code{change} command
1157can be used to later start the VNC server.
1158
1159@end table
1160
1161Following the @var{display} value there may be one or more @var{option} flags
1162separated by commas. Valid options are
1163
Kevin Wolfb3f046c2009-10-09 10:58:35 +02001164@table @option
blueswir15824d652009-03-28 06:44:27 +00001165
1166@item reverse
1167
1168Connect to a listening VNC client via a ``reverse'' connection. The
1169client is specified by the @var{display}. For reverse network
1170connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
1171is a TCP port number, not a display number.
1172
Tim Hardeck7536ee42013-01-21 11:04:44 +01001173@item websocket
1174
1175Opens an additional TCP listening port dedicated to VNC Websocket connections.
Peter Maydell085d8132013-03-18 17:20:07 +00001176By definition the Websocket port is 5700+@var{display}. If @var{host} is
Tim Hardeck7536ee42013-01-21 11:04:44 +01001177specified connections will only be allowed from this host.
1178As an alternative the Websocket port could be specified by using
1179@code{websocket}=@var{port}.
Tim Hardeck0057a0d2013-04-23 16:33:01 +02001180TLS encryption for the Websocket connection is supported if the required
1181certificates are specified with the VNC option @option{x509}.
Tim Hardeck7536ee42013-01-21 11:04:44 +01001182
blueswir15824d652009-03-28 06:44:27 +00001183@item password
1184
1185Require that password based authentication is used for client connections.
Michal Novotny86ee5bc2012-07-16 15:54:38 +02001186
1187The password must be set separately using the @code{set_password} command in
1188the @ref{pcsys_monitor}. The syntax to change your password is:
1189@code{set_password <protocol> <password>} where <protocol> could be either
1190"vnc" or "spice".
1191
1192If you would like to change <protocol> password expiration, you should use
1193@code{expire_password <protocol> <expiration-time>} where expiration time could
1194be one of the following options: now, never, +seconds or UNIX time of
1195expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
1196to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
1197date and time).
1198
1199You can also use keywords "now" or "never" for the expiration time to
1200allow <protocol> password to expire immediately or never expire.
blueswir15824d652009-03-28 06:44:27 +00001201
1202@item tls
1203
1204Require that client use TLS when communicating with the VNC server. This
1205uses anonymous TLS credentials so is susceptible to a man-in-the-middle
1206attack. It is recommended that this option be combined with either the
Kevin Wolf4e257e52009-10-09 10:58:36 +02001207@option{x509} or @option{x509verify} options.
blueswir15824d652009-03-28 06:44:27 +00001208
1209@item x509=@var{/path/to/certificate/dir}
1210
1211Valid if @option{tls} is specified. Require that x509 credentials are used
1212for negotiating the TLS session. The server will send its x509 certificate
1213to the client. It is recommended that a password be set on the VNC server
1214to provide authentication of the client when this is used. The path following
1215this option specifies where the x509 certificates are to be loaded from.
1216See the @ref{vnc_security} section for details on generating certificates.
1217
1218@item x509verify=@var{/path/to/certificate/dir}
1219
1220Valid if @option{tls} is specified. Require that x509 credentials are used
1221for negotiating the TLS session. The server will send its x509 certificate
1222to the client, and request that the client send its own x509 certificate.
1223The server will validate the client's certificate against the CA certificate,
1224and reject clients when validation fails. If the certificate authority is
1225trusted, this is a sufficient authentication mechanism. You may still wish
1226to set a password on the VNC server as a second authentication layer. The
1227path following this option specifies where the x509 certificates are to
1228be loaded from. See the @ref{vnc_security} section for details on generating
1229certificates.
1230
1231@item sasl
1232
1233Require that the client use SASL to authenticate with the VNC server.
1234The exact choice of authentication method used is controlled from the
1235system / user's SASL configuration file for the 'qemu' service. This
1236is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1237unprivileged user, an environment variable SASL_CONF_PATH can be used
1238to make it search alternate locations for the service config.
1239While some SASL auth methods can also provide data encryption (eg GSSAPI),
1240it is recommended that SASL always be combined with the 'tls' and
1241'x509' settings to enable use of SSL and server certificates. This
1242ensures a data encryption preventing compromise of authentication
1243credentials. See the @ref{vnc_security} section for details on using
1244SASL authentication.
1245
1246@item acl
1247
1248Turn on access control lists for checking of the x509 client certificate
1249and SASL party. For x509 certs, the ACL check is made against the
1250certificate's distinguished name. This is something that looks like
1251@code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is
1252made against the username, which depending on the SASL plugin, may
1253include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}.
1254When the @option{acl} flag is set, the initial access list will be
1255empty, with a @code{deny} policy. Thus no one will be allowed to
1256use the VNC server until the ACLs have been loaded. This can be
1257achieved using the @code{acl} monitor command.
1258
Corentin Chary6f9c78c2010-07-07 20:57:51 +02001259@item lossy
1260
1261Enable lossy compression methods (gradient, JPEG, ...). If this
1262option is set, VNC client may receive lossy framebuffer updates
1263depending on its encoding settings. Enabling this option can save
1264a lot of bandwidth at the expense of quality.
1265
Corentin Chary80e0c8c2011-02-04 09:06:08 +01001266@item non-adaptive
1267
1268Disable adaptive encodings. Adaptive encodings are enabled by default.
1269An adaptive encoding will try to detect frequently updated screen regions,
1270and send updates in these regions using a lossy encoding (like JPEG).
Stefan Weil61cc8702011-04-13 22:45:22 +02001271This can be really helpful to save bandwidth when playing videos. Disabling
Michael Tokarev9d85d552014-04-07 13:34:58 +04001272adaptive encodings restores the original static behavior of encodings
Corentin Chary80e0c8c2011-02-04 09:06:08 +01001273like Tight.
1274
Gerd Hoffmann8cf36482011-11-24 18:10:49 +01001275@item share=[allow-exclusive|force-shared|ignore]
1276
1277Set display sharing policy. 'allow-exclusive' allows clients to ask
1278for exclusive access. As suggested by the rfb spec this is
1279implemented by dropping other connections. Connecting multiple
1280clients in parallel requires all clients asking for a shared session
1281(vncviewer: -shared switch). This is the default. 'force-shared'
1282disables exclusive client access. Useful for shared desktop sessions,
1283where you don't want someone forgetting specify -shared disconnect
1284everybody else. 'ignore' completely ignores the shared flag and
1285allows everybody connect unconditionally. Doesn't conform to the rfb
Stefan Weilb65ee4f2012-05-11 22:25:50 +02001286spec but is traditional QEMU behavior.
Gerd Hoffmann8cf36482011-11-24 18:10:49 +01001287
blueswir15824d652009-03-28 06:44:27 +00001288@end table
1289ETEXI
1290
1291STEXI
1292@end table
1293ETEXI
Michael Ellermana3adb7a2011-12-19 17:19:31 +11001294ARCHHEADING(, QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001295
Michael Ellermana3adb7a2011-12-19 17:19:31 +11001296ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001297STEXI
1298@table @option
1299ETEXI
1300
blueswir15824d652009-03-28 06:44:27 +00001301DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
Blue Swirlad960902010-03-29 19:23:52 +00001302 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
1303 QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001304STEXI
1305@item -win2k-hack
Stefan Weil6616b2a2010-02-05 23:52:05 +01001306@findex -win2k-hack
blueswir15824d652009-03-28 06:44:27 +00001307Use it when installing Windows 2000 to avoid a disk full bug. After
1308Windows 2000 is installed, you no longer need this option (this option
1309slows down the IDE transfers).
1310ETEXI
1311
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02001312HXCOMM Deprecated by -rtc
Blue Swirlad960902010-03-29 19:23:52 +00001313DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001314
blueswir15824d652009-03-28 06:44:27 +00001315DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
Blue Swirlad960902010-03-29 19:23:52 +00001316 "-no-fd-bootchk disable boot signature checking for floppy disks\n",
1317 QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001318STEXI
1319@item -no-fd-bootchk
Stefan Weil6616b2a2010-02-05 23:52:05 +01001320@findex -no-fd-bootchk
Markus Armbruster4eda32f2013-06-14 13:15:06 +02001321Disable boot signature checking for floppy disks in BIOS. May
blueswir15824d652009-03-28 06:44:27 +00001322be needed to boot from old floppy disks.
1323ETEXI
1324
blueswir15824d652009-03-28 06:44:27 +00001325DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
Blue Swirlad960902010-03-29 19:23:52 +00001326 "-no-acpi disable ACPI\n", QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001327STEXI
1328@item -no-acpi
Stefan Weil6616b2a2010-02-05 23:52:05 +01001329@findex -no-acpi
blueswir15824d652009-03-28 06:44:27 +00001330Disable ACPI (Advanced Configuration and Power Interface) support. Use
1331it if your guest OS complains about ACPI problems (PC target machine
1332only).
1333ETEXI
1334
blueswir15824d652009-03-28 06:44:27 +00001335DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
Blue Swirlad960902010-03-29 19:23:52 +00001336 "-no-hpet disable HPET\n", QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001337STEXI
1338@item -no-hpet
Stefan Weil6616b2a2010-02-05 23:52:05 +01001339@findex -no-hpet
blueswir15824d652009-03-28 06:44:27 +00001340Disable HPET support.
1341ETEXI
1342
blueswir15824d652009-03-28 06:44:27 +00001343DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
Michael Tokarev104bf022011-05-12 18:44:17 +04001344 "-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"
Blue Swirlad960902010-03-29 19:23:52 +00001345 " ACPI table description\n", QEMU_ARCH_I386)
blueswir15824d652009-03-28 06:44:27 +00001346STEXI
1347@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}]...]
Stefan Weil6616b2a2010-02-05 23:52:05 +01001348@findex -acpitable
blueswir15824d652009-03-28 06:44:27 +00001349Add ACPI table with specified header fields and context from specified files.
Michael Tokarev104bf022011-05-12 18:44:17 +04001350For file=, take whole ACPI table from the specified files, including all
1351ACPI headers (possible overridden by other options).
1352For data=, only data
1353portion of the table is used, all header information is specified in the
1354command line.
blueswir15824d652009-03-28 06:44:27 +00001355ETEXI
1356
aliguorib6f6e3d2009-04-17 18:59:56 +00001357DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
1358 "-smbios file=binary\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001359 " load SMBIOS entry from binary file\n"
Gabriel L. Somlo84351842014-05-19 10:09:54 -04001360 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001361 " specify SMBIOS type 0 fields\n"
aliguorib6f6e3d2009-04-17 18:59:56 +00001362 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1363 " [,uuid=uuid][,sku=str][,family=str]\n"
Blue Swirlad960902010-03-29 19:23:52 +00001364 " specify SMBIOS type 1 fields\n", QEMU_ARCH_I386)
aliguorib6f6e3d2009-04-17 18:59:56 +00001365STEXI
1366@item -smbios file=@var{binary}
Stefan Weil6616b2a2010-02-05 23:52:05 +01001367@findex -smbios
aliguorib6f6e3d2009-04-17 18:59:56 +00001368Load SMBIOS entry from binary file.
1369
Gabriel L. Somlo84351842014-05-19 10:09:54 -04001370@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
aliguorib6f6e3d2009-04-17 18:59:56 +00001371Specify SMBIOS type 0 fields
1372
Blue Swirl609c1da2010-03-18 18:41:49 +00001373@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}]
aliguorib6f6e3d2009-04-17 18:59:56 +00001374Specify SMBIOS type 1 fields
1375ETEXI
1376
blueswir15824d652009-03-28 06:44:27 +00001377STEXI
1378@end table
1379ETEXI
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01001380DEFHEADING()
blueswir15824d652009-03-28 06:44:27 +00001381
1382DEFHEADING(Network options:)
1383STEXI
1384@table @option
1385ETEXI
1386
Jan Kiszkaad196a92009-06-24 14:42:28 +02001387HXCOMM Legacy slirp options (now moved to -net user):
1388#ifdef CONFIG_SLIRP
Blue Swirlad960902010-03-29 19:23:52 +00001389DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL)
1390DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL)
1391DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL)
Jan Kiszkaad196a92009-06-24 14:42:28 +02001392#ifndef _WIN32
Blue Swirlad960902010-03-29 19:23:52 +00001393DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
Jan Kiszkaad196a92009-06-24 14:42:28 +02001394#endif
1395#endif
1396
Blue Swirlbab79442009-06-09 21:50:02 +03001397DEF("net", HAS_ARG, QEMU_OPTION_net,
Michael S. Tsirkinffe63702009-06-21 19:51:18 +03001398 "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
blueswir15824d652009-03-28 06:44:27 +00001399 " create a new Network Interface Card and connect it to VLAN 'n'\n"
1400#ifdef CONFIG_SLIRP
Jan Kiszkac54ed5b2011-07-20 12:20:14 +02001401 "-net user[,vlan=n][,name=str][,net=addr[/mask]][,host=addr][,restrict=on|off]\n"
Klaus Stengel63d29602012-10-27 19:53:39 +02001402 " [,hostname=host][,dhcpstart=addr][,dns=addr][,dnssearch=domain][,tftp=dir]\n"
1403 " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
Jan Kiszkaad196a92009-06-24 14:42:28 +02001404#ifndef _WIN32
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001405 "[,smb=dir[,smbserver=addr]]\n"
Jan Kiszkaad196a92009-06-24 14:42:28 +02001406#endif
1407 " connect the user mode network stack to VLAN 'n', configure its\n"
1408 " DHCP server and enabled optional services\n"
blueswir15824d652009-03-28 06:44:27 +00001409#endif
1410#ifdef _WIN32
1411 "-net tap[,vlan=n][,name=str],ifname=name\n"
1412 " connect the host TAP network interface to VLAN 'n'\n"
1413#else
Jason Wangec396012013-02-22 22:57:52 +08001414 "-net tap[,vlan=n][,name=str][,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off][,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
Michal Privoznik3528a3c2012-11-23 09:52:39 +01001415 " connect the host TAP network interface to VLAN 'n'\n"
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001416 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
1417 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
1418 " to deconfigure it\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001419 " use '[down]script=no' to disable script execution\n"
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001420 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
1421 " configure it\n"
blueswir15824d652009-03-28 06:44:27 +00001422 " use 'fd=h' to connect to an already opened TAP interface\n"
Jason Wang2ca81ba2013-02-20 18:04:01 +08001423 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001424 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
Michael S. Tsirkinf157ed22011-02-01 14:25:40 +02001425 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001426 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
1427 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
Michael S. Tsirkin82b0d802010-03-17 13:08:24 +02001428 " use vhost=on to enable experimental in kernel accelerator\n"
mst@redhat.com5430a282011-02-01 22:13:42 +02001429 " (only has effect for virtio guests which use MSIX)\n"
1430 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
Michael S. Tsirkin82b0d802010-03-17 13:08:24 +02001431 " use 'vhostfd=h' to connect to an already opened vhost net device\n"
Jason Wang2ca81ba2013-02-20 18:04:01 +08001432 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
Jason Wangec396012013-02-22 22:57:52 +08001433 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001434 "-net bridge[,vlan=n][,name=str][,br=bridge][,helper=helper]\n"
1435 " connects a host TAP network interface to a host bridge device 'br'\n"
1436 " (default=" DEFAULT_BRIDGE_INTERFACE ") using the program 'helper'\n"
1437 " (default=" DEFAULT_BRIDGE_HELPER ")\n"
Mark McLoughlin0df0ff62009-06-18 18:21:34 +01001438#endif
Anton Ivanov3fb69aa2014-06-20 10:34:41 +01001439#ifdef __linux__
1440 "-net l2tpv3[,vlan=n][,name=str],src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on/off][,udp=on/off][,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]\n"
1441 " connect the VLAN to an Ethernet over L2TPv3 pseudowire\n"
1442 " Linux kernel 3.3+ as well as most routers can talk\n"
Michael Tokarev2f47b402014-07-24 20:10:17 +04001443 " L2TPv3. This transport allows connecting a VM to a VM,\n"
Anton Ivanov3fb69aa2014-06-20 10:34:41 +01001444 " VM to a router and even VM to Host. It is a nearly-universal\n"
1445 " standard (RFC3391). Note - this implementation uses static\n"
1446 " pre-configured tunnels (same as the Linux kernel).\n"
1447 " use 'src=' to specify source address\n"
1448 " use 'dst=' to specify destination address\n"
1449 " use 'udp=on' to specify udp encapsulation\n"
Gonglei39526512014-08-14 14:35:48 +08001450 " use 'srcport=' to specify source udp port\n"
Anton Ivanov3fb69aa2014-06-20 10:34:41 +01001451 " use 'dstport=' to specify destination udp port\n"
1452 " use 'ipv6=on' to force v6\n"
1453 " L2TPv3 uses cookies to prevent misconfiguration as\n"
1454 " well as a weak security measure\n"
1455 " use 'rxcookie=0x012345678' to specify a rxcookie\n"
1456 " use 'txcookie=0x012345678' to specify a txcookie\n"
1457 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
1458 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
1459 " use 'pincounter=on' to work around broken counter handling in peer\n"
1460 " use 'offset=X' to add an extra offset between header and data\n"
1461#endif
blueswir15824d652009-03-28 06:44:27 +00001462 "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n"
1463 " connect the vlan 'n' to another VLAN using a socket connection\n"
Mike Ryan3a75e742010-12-01 11:16:47 -08001464 "-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
blueswir15824d652009-03-28 06:44:27 +00001465 " connect the vlan 'n' to multicast maddr and port\n"
Mike Ryan3a75e742010-12-01 11:16:47 -08001466 " use 'localaddr=addr' to specify the host address to send packets from\n"
Benjamin0e0e7fa2012-01-11 09:20:54 +09001467 "-net socket[,vlan=n][,name=str][,fd=h][,udp=host:port][,localaddr=host:port]\n"
1468 " connect the vlan 'n' to another VLAN using an UDP tunnel\n"
blueswir15824d652009-03-28 06:44:27 +00001469#ifdef CONFIG_VDE
1470 "-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
1471 " connect the vlan 'n' to port 'n' of a vde switch running\n"
1472 " on host and listening for incoming connections on 'socketpath'.\n"
1473 " Use group 'groupname' and mode 'octalmode' to change default\n"
1474 " ownership and permissions for communication port.\n"
1475#endif
Vincenzo Maffione58952132013-11-06 11:44:06 +01001476#ifdef CONFIG_NETMAP
1477 "-net netmap,ifname=name[,devname=nmname]\n"
1478 " attach to the existing netmap-enabled network interface 'name', or to a\n"
1479 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
1480 " netmap device, defaults to '/dev/netmap')\n"
1481#endif
aliguoribb9ea792009-04-21 19:56:28 +00001482 "-net dump[,vlan=n][,file=f][,len=n]\n"
1483 " dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
Bruce Rogersca1a8a02010-01-06 12:33:57 -07001484 "-net none use it alone to have zero network devices. If no -net option\n"
Blue Swirlad960902010-03-29 19:23:52 +00001485 " is provided, the default is '-net nic -net user'\n", QEMU_ARCH_ALL)
Mark McLoughlina1ea4582009-10-08 19:58:26 +01001486DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
1487 "-netdev ["
1488#ifdef CONFIG_SLIRP
1489 "user|"
1490#endif
1491 "tap|"
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001492 "bridge|"
Mark McLoughlina1ea4582009-10-08 19:58:26 +01001493#ifdef CONFIG_VDE
1494 "vde|"
1495#endif
Vincenzo Maffione58952132013-11-06 11:44:06 +01001496#ifdef CONFIG_NETMAP
1497 "netmap|"
1498#endif
Nikolay Nikolaev03ce5742014-06-10 13:02:16 +03001499 "vhost-user|"
Stefan Hajnoczi40e8c262013-02-26 11:07:16 +01001500 "socket|"
1501 "hubport],id=str[,option][,option][,...]\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00001502STEXI
Blue Swirl609c1da2010-03-18 18:41:49 +00001503@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
Stefan Weil6616b2a2010-02-05 23:52:05 +01001504@findex -net
blueswir15824d652009-03-28 06:44:27 +00001505Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
Anthony Liguori0d6b0b12009-08-14 11:20:47 -05001506= 0 is the default). The NIC is an e1000 by default on the PC
Markus Armbruster5607c382009-06-18 15:14:08 +02001507target. Optionally, the MAC address can be changed to @var{mac}, the
1508device address set to @var{addr} (PCI cards only),
Michael S. Tsirkinffe63702009-06-21 19:51:18 +03001509and a @var{name} can be assigned for use in monitor commands.
1510Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
1511that the card should have; this option currently only affects virtio cards; set
1512@var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
Stefan Weil071c9392012-04-07 09:23:36 +02001513NIC is created. QEMU can emulate several different models of network card.
blueswir15824d652009-03-28 06:44:27 +00001514Valid values for @var{type} are
Michael S. Tsirkinffe63702009-06-21 19:51:18 +03001515@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er},
blueswir15824d652009-03-28 06:44:27 +00001516@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
1517@code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}.
Peter Maydell585f6032012-10-04 16:22:01 +01001518Not all devices are supported on all targets. Use @code{-net nic,model=help}
blueswir15824d652009-03-28 06:44:27 +00001519for a list of available devices for your target.
1520
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001521@item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
Markus Armbrusterb8f490e2013-02-13 19:49:38 +01001522@findex -netdev
Jan Kiszkaad196a92009-06-24 14:42:28 +02001523@item -net user[,@var{option}][,@var{option}][,...]
blueswir15824d652009-03-28 06:44:27 +00001524Use the user mode network stack which requires no administrator
Jan Kiszkaad196a92009-06-24 14:42:28 +02001525privilege to run. Valid options are:
blueswir15824d652009-03-28 06:44:27 +00001526
Kevin Wolfb3f046c2009-10-09 10:58:35 +02001527@table @option
Jan Kiszkaad196a92009-06-24 14:42:28 +02001528@item vlan=@var{n}
1529Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
1530
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001531@item id=@var{id}
Jan Kiszkaad196a92009-06-24 14:42:28 +02001532@item name=@var{name}
1533Assign symbolic name for use in monitor commands.
1534
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001535@item net=@var{addr}[/@var{mask}]
1536Set IP network address the guest will see. Optionally specify the netmask,
1537either in the form a.b.c.d or as number of valid top-most bits. Default is
Brad Hardsb0b36e52011-04-24 17:19:56 +1000153810.0.2.0/24.
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001539
1540@item host=@var{addr}
1541Specify the guest-visible address of the host. Default is the 2nd IP in the
1542guest network, i.e. x.x.x.2.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001543
Jan Kiszkac54ed5b2011-07-20 12:20:14 +02001544@item restrict=on|off
Brad Hardscaef55e2011-06-09 07:50:43 +10001545If this option is enabled, the guest will be isolated, i.e. it will not be
Jan Kiszkaad196a92009-06-24 14:42:28 +02001546able to contact the host and no guest IP packets will be routed over the host
Brad Hardscaef55e2011-06-09 07:50:43 +10001547to the outside. This option does not affect any explicitly set forwarding rules.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001548
1549@item hostname=@var{name}
Klaus Stengel63d29602012-10-27 19:53:39 +02001550Specifies the client hostname reported by the built-in DHCP server.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001551
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001552@item dhcpstart=@var{addr}
1553Specify the first of the 16 IPs the built-in DHCP server can assign. Default
Brad Hardsb0b36e52011-04-24 17:19:56 +10001554is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001555
1556@item dns=@var{addr}
1557Specify the guest-visible address of the virtual nameserver. The address must
1558be different from the host address. Default is the 3rd IP in the guest network,
1559i.e. x.x.x.3.
1560
Klaus Stengel63d29602012-10-27 19:53:39 +02001561@item dnssearch=@var{domain}
1562Provides an entry for the domain-search list sent by the built-in
1563DHCP server. More than one domain suffix can be transmitted by specifying
1564this option multiple times. If supported, this will cause the guest to
1565automatically try to append the given domain suffix(es) in case a domain name
1566can not be resolved.
1567
1568Example:
1569@example
1570qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...]
1571@end example
1572
Jan Kiszkaad196a92009-06-24 14:42:28 +02001573@item tftp=@var{dir}
1574When using the user mode network stack, activate a built-in TFTP
1575server. The files in @var{dir} will be exposed as the root of a TFTP server.
1576The TFTP client on the guest must be configured in binary mode (use the command
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001577@code{bin} of the Unix TFTP client).
Jan Kiszkaad196a92009-06-24 14:42:28 +02001578
1579@item bootfile=@var{file}
1580When using the user mode network stack, broadcast @var{file} as the BOOTP
1581filename. In conjunction with @option{tftp}, this can be used to network boot
1582a guest from a local directory.
1583
1584Example (using pxelinux):
1585@example
Stefan Weil3804da92012-05-11 22:21:50 +02001586qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
Jan Kiszkaad196a92009-06-24 14:42:28 +02001587@end example
1588
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001589@item smb=@var{dir}[,smbserver=@var{addr}]
Jan Kiszkaad196a92009-06-24 14:42:28 +02001590When using the user mode network stack, activate a built-in SMB
1591server so that Windows OSes can access to the host files in @file{@var{dir}}
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001592transparently. The IP address of the SMB server can be set to @var{addr}. By
1593default the 4th IP in the guest network is used, i.e. x.x.x.4.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001594
1595In the guest Windows OS, the line:
1596@example
159710.0.2.4 smbserver
1598@end example
1599must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
1600or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
1601
1602Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
1603
Brade2d88302011-09-02 16:53:28 -04001604Note that a SAMBA server must be installed on the host OS.
1605QEMU was tested successfully with smbd versions from Red Hat 9,
1606Fedora Core 3 and OpenSUSE 11.x.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001607
Jan Kiszka3c6a0582009-06-24 14:42:28 +02001608@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001609Redirect incoming TCP or UDP connections to the host port @var{hostport} to
1610the guest IP address @var{guestaddr} on guest port @var{guestport}. If
1611@var{guestaddr} is not specified, its value is x.x.x.15 (default first address
Jan Kiszka3c6a0582009-06-24 14:42:28 +02001612given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
1613be bound to a specific host interface. If no connection type is set, TCP is
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001614used. This option can be given multiple times.
Jan Kiszkaad196a92009-06-24 14:42:28 +02001615
1616For example, to redirect host X11 connection from screen 1 to guest
1617screen 0, use the following:
1618
1619@example
1620# on the host
Stefan Weil3804da92012-05-11 22:21:50 +02001621qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
Jan Kiszkaad196a92009-06-24 14:42:28 +02001622# this host xterm should open in the guest X11 server
1623xterm -display :1
1624@end example
1625
1626To redirect telnet connections from host port 5555 to telnet port on
1627the guest, use the following:
1628
1629@example
1630# on the host
Stefan Weil3804da92012-05-11 22:21:50 +02001631qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...]
Jan Kiszkaad196a92009-06-24 14:42:28 +02001632telnet localhost 5555
1633@end example
1634
1635Then when you use on the host @code{telnet localhost 5555}, you
1636connect to the guest telnet server.
1637
Jan Kiszkac92ef6a2009-06-24 14:42:28 +02001638@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
Alexander Grafb412eb62012-06-03 09:45:01 +02001639@item guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
Jan Kiszka3c6a0582009-06-24 14:42:28 +02001640Forward guest TCP connections to the IP address @var{server} on port @var{port}
Alexander Grafb412eb62012-06-03 09:45:01 +02001641to the character device @var{dev} or to a program executed by @var{cmd:command}
1642which gets spawned for each connection. This option can be given multiple times.
1643
Stefan Weil43ffe612012-07-20 23:26:02 +02001644You can either use a chardev directly and have that one used throughout QEMU's
Alexander Grafb412eb62012-06-03 09:45:01 +02001645lifetime, like in the following example:
1646
1647@example
1648# open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
1649# the guest accesses it
1650qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...]
1651@end example
1652
1653Or you can execute a command on every TCP connection established by the guest,
Stefan Weil43ffe612012-07-20 23:26:02 +02001654so that QEMU behaves similar to an inetd process for that virtual server:
Alexander Grafb412eb62012-06-03 09:45:01 +02001655
1656@example
1657# call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
1658# and connect the TCP stream to its stdin/stdout
1659qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
1660@end example
Jan Kiszkaad196a92009-06-24 14:42:28 +02001661
1662@end table
1663
1664Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still
1665processed and applied to -net user. Mixing them with the new configuration
1666syntax gives undefined results. Their use for new applications is discouraged
1667as they will be removed from future versions.
blueswir15824d652009-03-28 06:44:27 +00001668
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001669@item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,helper=@var{helper}]
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001670@item -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,helper=@var{helper}]
1671Connect the host TAP network interface @var{name} to VLAN @var{n}.
1672
1673Use the network script @var{file} to configure it and the network script
blueswir15824d652009-03-28 06:44:27 +00001674@var{dfile} to deconfigure it. If @var{name} is not provided, the OS
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001675automatically provides one. The default network configure script is
1676@file{/etc/qemu-ifup} and the default network deconfigure script is
1677@file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
1678to disable script execution.
1679
1680If running QEMU as an unprivileged user, use the network helper
1681@var{helper} to configure the TAP interface. The default network
Amos Kong420508f2013-10-23 04:49:28 +08001682helper executable is @file{/path/to/qemu-bridge-helper}.
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001683
1684@option{fd}=@var{h} can be used to specify the handle of an already
1685opened host TAP interface.
1686
1687Examples:
blueswir15824d652009-03-28 06:44:27 +00001688
1689@example
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001690#launch a QEMU instance with the default network script
Stefan Weil3804da92012-05-11 22:21:50 +02001691qemu-system-i386 linux.img -net nic -net tap
blueswir15824d652009-03-28 06:44:27 +00001692@end example
1693
blueswir15824d652009-03-28 06:44:27 +00001694@example
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001695#launch a QEMU instance with two NICs, each one connected
1696#to a TAP device
Stefan Weil3804da92012-05-11 22:21:50 +02001697qemu-system-i386 linux.img \
1698 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
1699 -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
blueswir15824d652009-03-28 06:44:27 +00001700@end example
1701
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001702@example
1703#launch a QEMU instance with the default network helper to
1704#connect a TAP device to bridge br0
Stefan Weil3804da92012-05-11 22:21:50 +02001705qemu-system-i386 linux.img \
Amos Kong420508f2013-10-23 04:49:28 +08001706 -net nic -net tap,"helper=/path/to/qemu-bridge-helper"
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001707@end example
1708
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001709@item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001710@item -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}]
1711Connect a host TAP network interface to a host bridge device.
1712
1713Use the network helper @var{helper} to configure the TAP interface and
1714attach it to the bridge. The default network helper executable is
Amos Kong420508f2013-10-23 04:49:28 +08001715@file{/path/to/qemu-bridge-helper} and the default bridge
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001716device is @file{br0}.
1717
1718Examples:
1719
1720@example
1721#launch a QEMU instance with the default network helper to
1722#connect a TAP device to bridge br0
Stefan Weil3804da92012-05-11 22:21:50 +02001723qemu-system-i386 linux.img -net bridge -net nic,model=virtio
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001724@end example
1725
1726@example
1727#launch a QEMU instance with the default network helper to
1728#connect a TAP device to bridge qemubr0
Stefan Weil3804da92012-05-11 22:21:50 +02001729qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio
Corey Bryanta7c36ee2012-01-26 09:42:27 -05001730@end example
1731
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001732@item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
Blue Swirl609c1da2010-03-18 18:41:49 +00001733@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
blueswir15824d652009-03-28 06:44:27 +00001734
1735Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual
1736machine using a TCP socket connection. If @option{listen} is
1737specified, QEMU waits for incoming connections on @var{port}
1738(@var{host} is optional). @option{connect} is used to connect to
1739another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
1740specifies an already opened TCP socket.
1741
1742Example:
1743@example
1744# launch a first QEMU instance
Stefan Weil3804da92012-05-11 22:21:50 +02001745qemu-system-i386 linux.img \
1746 -net nic,macaddr=52:54:00:12:34:56 \
1747 -net socket,listen=:1234
blueswir15824d652009-03-28 06:44:27 +00001748# connect the VLAN 0 of this instance to the VLAN 0
1749# of the first instance
Stefan Weil3804da92012-05-11 22:21:50 +02001750qemu-system-i386 linux.img \
1751 -net nic,macaddr=52:54:00:12:34:57 \
1752 -net socket,connect=127.0.0.1:1234
blueswir15824d652009-03-28 06:44:27 +00001753@end example
1754
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001755@item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
Mike Ryan3a75e742010-12-01 11:16:47 -08001756@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
blueswir15824d652009-03-28 06:44:27 +00001757
1758Create a VLAN @var{n} shared with another QEMU virtual
1759machines using a UDP multicast socket, effectively making a bus for
1760every QEMU with same multicast address @var{maddr} and @var{port}.
1761NOTES:
1762@enumerate
1763@item
1764Several QEMU can be running on different hosts and share same bus (assuming
1765correct multicast setup for these hosts).
1766@item
1767mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
1768@url{http://user-mode-linux.sf.net}.
1769@item
1770Use @option{fd=h} to specify an already opened UDP multicast socket.
1771@end enumerate
1772
1773Example:
1774@example
1775# launch one QEMU instance
Stefan Weil3804da92012-05-11 22:21:50 +02001776qemu-system-i386 linux.img \
1777 -net nic,macaddr=52:54:00:12:34:56 \
1778 -net socket,mcast=230.0.0.1:1234
blueswir15824d652009-03-28 06:44:27 +00001779# launch another QEMU instance on same "bus"
Stefan Weil3804da92012-05-11 22:21:50 +02001780qemu-system-i386 linux.img \
1781 -net nic,macaddr=52:54:00:12:34:57 \
1782 -net socket,mcast=230.0.0.1:1234
blueswir15824d652009-03-28 06:44:27 +00001783# launch yet another QEMU instance on same "bus"
Stefan Weil3804da92012-05-11 22:21:50 +02001784qemu-system-i386 linux.img \
1785 -net nic,macaddr=52:54:00:12:34:58 \
1786 -net socket,mcast=230.0.0.1:1234
blueswir15824d652009-03-28 06:44:27 +00001787@end example
1788
1789Example (User Mode Linux compat.):
1790@example
1791# launch QEMU instance (note mcast address selected
1792# is UML's default)
Stefan Weil3804da92012-05-11 22:21:50 +02001793qemu-system-i386 linux.img \
1794 -net nic,macaddr=52:54:00:12:34:56 \
1795 -net socket,mcast=239.192.168.1:1102
blueswir15824d652009-03-28 06:44:27 +00001796# launch UML
1797/path/to/linux ubd0=/path/to/root_fs eth0=mcast
1798@end example
1799
Mike Ryan3a75e742010-12-01 11:16:47 -08001800Example (send packets from host's 1.2.3.4):
1801@example
Stefan Weil3804da92012-05-11 22:21:50 +02001802qemu-system-i386 linux.img \
1803 -net nic,macaddr=52:54:00:12:34:56 \
1804 -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4
Mike Ryan3a75e742010-12-01 11:16:47 -08001805@end example
1806
Anton Ivanov3fb69aa2014-06-20 10:34:41 +01001807@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}]
1808@item -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}]
1809Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular
1810protocol to transport Ethernet (and other Layer 2) data frames between
1811two systems. It is present in routers, firewalls and the Linux kernel
1812(from version 3.3 onwards).
1813
1814This transport allows a VM to communicate to another VM, router or firewall directly.
1815
1816@item src=@var{srcaddr}
1817 source address (mandatory)
1818@item dst=@var{dstaddr}
1819 destination address (mandatory)
1820@item udp
1821 select udp encapsulation (default is ip).
1822@item srcport=@var{srcport}
1823 source udp port.
1824@item dstport=@var{dstport}
1825 destination udp port.
1826@item ipv6
1827 force v6, otherwise defaults to v4.
1828@item rxcookie=@var{rxcookie}
1829@item txcookie=@var{txcookie}
1830 Cookies are a weak form of security in the l2tpv3 specification.
1831Their function is mostly to prevent misconfiguration. By default they are 32
1832bit.
1833@item cookie64
1834 Set cookie size to 64 bit instead of the default 32
1835@item counter=off
1836 Force a 'cut-down' L2TPv3 with no counter as in
1837draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
1838@item pincounter=on
1839 Work around broken counter handling in peer. This may also help on
1840networks which have packet reorder.
1841@item offset=@var{offset}
1842 Add an extra offset between header and data
1843
1844For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
1845on the remote Linux host 1.2.3.4:
1846@example
1847# Setup tunnel on linux host using raw ip as encapsulation
1848# on 1.2.3.4
1849ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
1850 encap udp udp_sport 16384 udp_dport 16384
1851ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
1852 0xFFFFFFFF peer_session_id 0xFFFFFFFF
1853ifconfig vmtunnel0 mtu 1500
1854ifconfig vmtunnel0 up
1855brctl addif br-lan vmtunnel0
1856
1857
1858# on 4.3.2.1
1859# launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
1860
1861qemu-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
1862
1863
1864@end example
1865
Stefan Hajnoczi08d12022012-08-14 14:14:27 +01001866@item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
Blue Swirl609c1da2010-03-18 18:41:49 +00001867@item -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
blueswir15824d652009-03-28 06:44:27 +00001868Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and
1869listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
1870and MODE @var{octalmode} to change default ownership and permissions for
Stefan Weilc1ba4e02011-09-05 18:13:03 +02001871communication port. This option is only available if QEMU has been compiled
blueswir15824d652009-03-28 06:44:27 +00001872with vde support enabled.
1873
1874Example:
1875@example
1876# launch vde switch
1877vde_switch -F -sock /tmp/myswitch
1878# launch QEMU instance
Stefan Weil3804da92012-05-11 22:21:50 +02001879qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch
blueswir15824d652009-03-28 06:44:27 +00001880@end example
1881
Stefan Hajnoczi40e8c262013-02-26 11:07:16 +01001882@item -netdev hubport,id=@var{id},hubid=@var{hubid}
1883
1884Create a hub port on QEMU "vlan" @var{hubid}.
1885
1886The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single
1887netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the
1888required hub automatically.
1889
Nikolay Nikolaev03ce5742014-06-10 13:02:16 +03001890@item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off]
1891
1892Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
1893be a unix domain socket backed one. The vhost-user uses a specifically defined
1894protocol to pass vhost ioctl replacement messages to an application on the other
1895end of the socket. On non-MSIX guests, the feature can be forced with
1896@var{vhostforce}.
1897
1898Example:
1899@example
1900qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
1901 -numa node,memdev=mem \
1902 -chardev socket,path=/path/to/socket \
1903 -netdev type=vhost-user,id=net0,chardev=chr0 \
1904 -device virtio-net-pci,netdev=net0
1905@end example
1906
aliguoribb9ea792009-04-21 19:56:28 +00001907@item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}]
1908Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default).
1909At most @var{len} bytes (64k by default) per packet are stored. The file format is
1910libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
1911
blueswir15824d652009-03-28 06:44:27 +00001912@item -net none
1913Indicate that no network devices should be configured. It is used to
1914override the default configuration (@option{-net nic -net user}) which
1915is activated if no @option{-net} options are provided.
blueswir15824d652009-03-28 06:44:27 +00001916ETEXI
1917
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01001918STEXI
1919@end table
1920ETEXI
Matthew Booth7273a2d2009-10-30 13:41:12 +00001921DEFHEADING()
1922
1923DEFHEADING(Character device options:)
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01001924STEXI
1925
1926The general form of a character device option is:
1927@table @option
1928ETEXI
Matthew Booth7273a2d2009-10-30 13:41:12 +00001929
1930DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
Jan Kiszka97331282010-04-06 16:55:54 +02001931 "-chardev null,id=id[,mux=on|off]\n"
Liming Wang38a24c82014-08-13 11:20:04 +08001932 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001933 " [,server][,nowait][,telnet][,mux=on|off] (tcp)\n"
1934 "-chardev socket,id=id,path=path[,server][,nowait][,telnet],[mux=on|off] (unix)\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001935 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001936 " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
1937 "-chardev msmouse,id=id[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001938 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001939 " [,mux=on|off]\n"
Markus Armbruster4f573782013-07-26 16:44:32 +02001940 "-chardev ringbuf,id=id[,size=size]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001941 "-chardev file,id=id,path=path[,mux=on|off]\n"
1942 "-chardev pipe,id=id,path=path[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001943#ifdef _WIN32
Jan Kiszka97331282010-04-06 16:55:54 +02001944 "-chardev console,id=id[,mux=on|off]\n"
1945 "-chardev serial,id=id,path=path[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001946#else
Jan Kiszka97331282010-04-06 16:55:54 +02001947 "-chardev pty,id=id[,mux=on|off]\n"
Aurelien Jarnob7fdb3a2010-07-13 21:13:12 +02001948 "-chardev stdio,id=id[,mux=on|off][,signal=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001949#endif
1950#ifdef CONFIG_BRLAPI
Jan Kiszka97331282010-04-06 16:55:54 +02001951 "-chardev braille,id=id[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001952#endif
1953#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
1954 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
Gerd Hoffmannd59044e2012-12-19 13:50:29 +01001955 "-chardev serial,id=id,path=path[,mux=on|off]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001956 "-chardev tty,id=id,path=path[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001957#endif
1958#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
Gerd Hoffmann88a946d2013-01-10 14:20:58 +01001959 "-chardev parallel,id=id,path=path[,mux=on|off]\n"
Jan Kiszka97331282010-04-06 16:55:54 +02001960 "-chardev parport,id=id,path=path[,mux=on|off]\n"
Matthew Booth7273a2d2009-10-30 13:41:12 +00001961#endif
Alon Levycbcc6332011-01-19 10:49:50 +02001962#if defined(CONFIG_SPICE)
1963 "-chardev spicevmc,id=id,name=name[,debug=debug]\n"
Marc-André Lureau5a49d3e2012-12-05 16:15:34 +01001964 "-chardev spiceport,id=id,name=name[,debug=debug]\n"
Alon Levycbcc6332011-01-19 10:49:50 +02001965#endif
Blue Swirlad960902010-03-29 19:23:52 +00001966 , QEMU_ARCH_ALL
Matthew Booth7273a2d2009-10-30 13:41:12 +00001967)
1968
1969STEXI
Jan Kiszka97331282010-04-06 16:55:54 +02001970@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}]
Stefan Weil6616b2a2010-02-05 23:52:05 +01001971@findex -chardev
Matthew Booth7273a2d2009-10-30 13:41:12 +00001972Backend is one of:
1973@option{null},
1974@option{socket},
1975@option{udp},
1976@option{msmouse},
1977@option{vc},
Markus Armbruster4f573782013-07-26 16:44:32 +02001978@option{ringbuf},
Matthew Booth7273a2d2009-10-30 13:41:12 +00001979@option{file},
1980@option{pipe},
1981@option{console},
1982@option{serial},
1983@option{pty},
1984@option{stdio},
1985@option{braille},
1986@option{tty},
Gerd Hoffmann88a946d2013-01-10 14:20:58 +01001987@option{parallel},
Alon Levycbcc6332011-01-19 10:49:50 +02001988@option{parport},
1989@option{spicevmc}.
Marc-André Lureau5a49d3e2012-12-05 16:15:34 +01001990@option{spiceport}.
Matthew Booth7273a2d2009-10-30 13:41:12 +00001991The specific backend will determine the applicable options.
1992
1993All devices must have an id, which can be any string up to 127 characters long.
1994It is used to uniquely identify this device in other command line directives.
1995
Jan Kiszka97331282010-04-06 16:55:54 +02001996A character device may be used in multiplexing mode by multiple front-ends.
1997The key sequence of @key{Control-a} and @key{c} will rotate the input focus
1998between attached front-ends. Specify @option{mux=on} to enable this mode.
1999
Matthew Booth7273a2d2009-10-30 13:41:12 +00002000Options to each backend are described below.
2001
2002@item -chardev null ,id=@var{id}
2003A void device. This device will not emit any data, and will drop any data it
2004receives. The null backend does not take any options.
2005
2006@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet]
2007
2008Create a two-way stream socket, which can be either a TCP or a unix socket. A
2009unix socket will be created if @option{path} is specified. Behaviour is
2010undefined if TCP options are specified for a unix socket.
2011
2012@option{server} specifies that the socket shall be a listening socket.
2013
2014@option{nowait} specifies that QEMU should not block waiting for a client to
2015connect to a listening socket.
2016
2017@option{telnet} specifies that traffic on the socket should interpret telnet
2018escape sequences.
2019
2020TCP and unix socket options are given below:
2021
2022@table @option
2023
Aurelien Jarno8d533562010-03-27 11:52:05 +01002024@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay]
Matthew Booth7273a2d2009-10-30 13:41:12 +00002025
2026@option{host} for a listening socket specifies the local address to be bound.
2027For a connecting socket species the remote host to connect to. @option{host} is
2028optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
2029
2030@option{port} for a listening socket specifies the local port to be bound. For a
2031connecting socket specifies the port on the remote host to connect to.
2032@option{port} can be given as either a port number or a service name.
2033@option{port} is required.
2034
2035@option{to} is only relevant to listening sockets. If it is specified, and
2036@option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
2037to and including @option{to} until it succeeds. @option{to} must be specified
2038as a port number.
2039
2040@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2041If neither is specified the socket may use either protocol.
2042
2043@option{nodelay} disables the Nagle algorithm.
2044
2045@item unix options: path=@var{path}
2046
2047@option{path} specifies the local path of the unix socket. @option{path} is
2048required.
2049
2050@end table
2051
2052@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6]
2053
2054Sends all traffic from the guest to a remote host over UDP.
2055
2056@option{host} specifies the remote host to connect to. If not specified it
2057defaults to @code{localhost}.
2058
2059@option{port} specifies the port on the remote host to connect to. @option{port}
2060is required.
2061
2062@option{localaddr} specifies the local address to bind to. If not specified it
2063defaults to @code{0.0.0.0}.
2064
2065@option{localport} specifies the local port to bind to. If not specified any
2066available local port will be used.
2067
2068@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2069If neither is specified the device may use either protocol.
2070
2071@item -chardev msmouse ,id=@var{id}
2072
2073Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
2074take any options.
2075
2076@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]]
2077
2078Connect to a QEMU text console. @option{vc} may optionally be given a specific
2079size.
2080
2081@option{width} and @option{height} specify the width and height respectively of
2082the console, in pixels.
2083
2084@option{cols} and @option{rows} specify that the console be sized to fit a text
2085console with the given dimensions.
2086
Markus Armbruster4f573782013-07-26 16:44:32 +02002087@item -chardev ringbuf ,id=@var{id} [,size=@var{size}]
Lei Li51767e72013-01-25 00:03:19 +08002088
Markus Armbruster3949e592013-02-06 21:27:24 +01002089Create a ring buffer with fixed size @option{size}.
2090@var{size} must be a power of two, and defaults to @code{64K}).
Lei Li51767e72013-01-25 00:03:19 +08002091
Matthew Booth7273a2d2009-10-30 13:41:12 +00002092@item -chardev file ,id=@var{id} ,path=@var{path}
2093
2094Log all traffic received from the guest to a file.
2095
2096@option{path} specifies the path of the file to be opened. This file will be
2097created if it does not already exist, and overwritten if it does. @option{path}
2098is required.
2099
2100@item -chardev pipe ,id=@var{id} ,path=@var{path}
2101
2102Create a two-way connection to the guest. The behaviour differs slightly between
2103Windows hosts and other hosts:
2104
2105On Windows, a single duplex pipe will be created at
2106@file{\\.pipe\@option{path}}.
2107
2108On other hosts, 2 pipes will be created called @file{@option{path}.in} and
2109@file{@option{path}.out}. Data written to @file{@option{path}.in} will be
2110received by the guest. Data written by the guest can be read from
2111@file{@option{path}.out}. QEMU will not create these fifos, and requires them to
2112be present.
2113
2114@option{path} forms part of the pipe path as described above. @option{path} is
2115required.
2116
2117@item -chardev console ,id=@var{id}
2118
2119Send traffic from the guest to QEMU's standard output. @option{console} does not
2120take any options.
2121
2122@option{console} is only available on Windows hosts.
2123
2124@item -chardev serial ,id=@var{id} ,path=@option{path}
2125
2126Send traffic from the guest to a serial device on the host.
2127
Gerd Hoffmannd59044e2012-12-19 13:50:29 +01002128On Unix hosts serial will actually accept any tty device,
2129not only serial lines.
Matthew Booth7273a2d2009-10-30 13:41:12 +00002130
2131@option{path} specifies the name of the serial device to open.
2132
2133@item -chardev pty ,id=@var{id}
2134
2135Create a new pseudo-terminal on the host and connect to it. @option{pty} does
2136not take any options.
2137
2138@option{pty} is not available on Windows hosts.
2139
Aurelien Jarnob7fdb3a2010-07-13 21:13:12 +02002140@item -chardev stdio ,id=@var{id} [,signal=on|off]
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002141Connect to standard input and standard output of the QEMU process.
Aurelien Jarnob7fdb3a2010-07-13 21:13:12 +02002142
2143@option{signal} controls if signals are enabled on the terminal, that includes
2144exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
2145default, use @option{signal=off} to disable it.
2146
2147@option{stdio} is not available on Windows hosts.
Matthew Booth7273a2d2009-10-30 13:41:12 +00002148
2149@item -chardev braille ,id=@var{id}
2150
2151Connect to a local BrlAPI server. @option{braille} does not take any options.
2152
2153@item -chardev tty ,id=@var{id} ,path=@var{path}
2154
Matthew Booth7273a2d2009-10-30 13:41:12 +00002155@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
Markus Armbrusterd037d6b2013-02-13 15:54:15 +01002156DragonFlyBSD hosts. It is an alias for @option{serial}.
Matthew Booth7273a2d2009-10-30 13:41:12 +00002157
2158@option{path} specifies the path to the tty. @option{path} is required.
2159
Gerd Hoffmann88a946d2013-01-10 14:20:58 +01002160@item -chardev parallel ,id=@var{id} ,path=@var{path}
Matthew Booth7273a2d2009-10-30 13:41:12 +00002161@item -chardev parport ,id=@var{id} ,path=@var{path}
2162
Gerd Hoffmann88a946d2013-01-10 14:20:58 +01002163@option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
Matthew Booth7273a2d2009-10-30 13:41:12 +00002164
2165Connect to a local parallel port.
2166
2167@option{path} specifies the path to the parallel port device. @option{path} is
2168required.
2169
Alon Levycbcc6332011-01-19 10:49:50 +02002170@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2171
Stefan Hajnoczi3a846902011-10-06 11:24:12 +01002172@option{spicevmc} is only available when spice support is built in.
2173
Alon Levycbcc6332011-01-19 10:49:50 +02002174@option{debug} debug level for spicevmc
2175
2176@option{name} name of spice channel to connect to
2177
2178Connect to a spice virtual machine channel, such as vdiport.
Alon Levycbcc6332011-01-19 10:49:50 +02002179
Marc-André Lureau5a49d3e2012-12-05 16:15:34 +01002180@item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2181
2182@option{spiceport} is only available when spice support is built in.
2183
2184@option{debug} debug level for spicevmc
2185
2186@option{name} name of spice port to connect to
2187
2188Connect to a spice port, allowing a Spice client to handle the traffic
2189identified by a name (preferably a fqdn).
Matthew Booth7273a2d2009-10-30 13:41:12 +00002190ETEXI
2191
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01002192STEXI
2193@end table
2194ETEXI
Matthew Booth7273a2d2009-10-30 13:41:12 +00002195DEFHEADING()
2196
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002197DEFHEADING(Device URL Syntax:)
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01002198STEXI
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002199
2200In addition to using normal file images for the emulated storage devices,
2201QEMU can also use networked resources such as iSCSI devices. These are
2202specified using a special URL syntax.
2203
2204@table @option
2205@item iSCSI
2206iSCSI support allows QEMU to access iSCSI resources directly and use as
2207images for the guest storage. Both disk and cdrom images are supported.
2208
2209Syntax for specifying iSCSI LUNs is
2210``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
2211
Ronnie Sahlberg31459f42012-08-06 18:24:55 +10002212By default qemu will use the iSCSI initiator-name
2213'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command
2214line or a configuration file.
2215
2216
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002217Example (without authentication):
2218@example
Stefan Weil3804da92012-05-11 22:21:50 +02002219qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
2220 -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
2221 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002222@end example
2223
2224Example (CHAP username/password via URL):
2225@example
Stefan Weil3804da92012-05-11 22:21:50 +02002226qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002227@end example
2228
2229Example (CHAP username/password via environment variables):
2230@example
2231LIBISCSI_CHAP_USERNAME="user" \
2232LIBISCSI_CHAP_PASSWORD="password" \
Stefan Weil3804da92012-05-11 22:21:50 +02002233qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002234@end example
2235
2236iSCSI support is an optional feature of QEMU and only available when
2237compiled and linked against libiscsi.
Ronnie Sahlbergf9dadc92012-01-26 09:39:02 +11002238ETEXI
2239DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2240 "-iscsi [user=user][,password=password]\n"
2241 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
Paolo Bonzini2fe37982013-12-06 16:08:05 +01002242 " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
Ronnie Sahlbergf9dadc92012-01-26 09:39:02 +11002243 " iSCSI session parameters\n", QEMU_ARCH_ALL)
2244STEXI
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002245
Ronnie Sahlberg31459f42012-08-06 18:24:55 +10002246iSCSI parameters such as username and password can also be specified via
2247a configuration file. See qemu-doc for more information and examples.
2248
Ronnie Sahlberg08ae3302011-10-27 20:33:21 +11002249@item NBD
2250QEMU supports NBD (Network Block Devices) both using TCP protocol as well
2251as Unix Domain Sockets.
2252
2253Syntax for specifying a NBD device using TCP
2254``nbd:<server-ip>:<port>[:exportname=<export>]''
2255
2256Syntax for specifying a NBD device using Unix Domain Sockets
2257``nbd:unix:<domain-socket>[:exportname=<export>]''
2258
2259
2260Example for TCP
2261@example
Stefan Weil3804da92012-05-11 22:21:50 +02002262qemu-system-i386 --drive file=nbd:192.0.2.1:30000
Ronnie Sahlberg08ae3302011-10-27 20:33:21 +11002263@end example
2264
2265Example for Unix Domain Sockets
2266@example
Stefan Weil3804da92012-05-11 22:21:50 +02002267qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket
Ronnie Sahlberg08ae3302011-10-27 20:33:21 +11002268@end example
2269
Richard W.M. Jones0a12ec82013-04-09 15:30:53 +01002270@item SSH
2271QEMU supports SSH (Secure Shell) access to remote disks.
2272
2273Examples:
2274@example
2275qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img
2276qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
2277@end example
2278
2279Currently authentication must be done using ssh-agent. Other
2280authentication methods may be supported in future.
2281
Ronnie Sahlbergd9990222011-10-28 20:13:39 +11002282@item Sheepdog
2283Sheepdog is a distributed storage system for QEMU.
2284QEMU supports using either local sheepdog devices or remote networked
2285devices.
2286
2287Syntax for specifying a sheepdog device
MORITA Kazutaka5d6768e2013-02-22 12:39:51 +09002288@example
MORITA Kazutaka1b8bbb42013-02-22 12:39:53 +09002289sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
MORITA Kazutaka5d6768e2013-02-22 12:39:51 +09002290@end example
Ronnie Sahlbergd9990222011-10-28 20:13:39 +11002291
2292Example
2293@example
MORITA Kazutaka5d6768e2013-02-22 12:39:51 +09002294qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
Ronnie Sahlbergd9990222011-10-28 20:13:39 +11002295@end example
2296
2297See also @url{http://http://www.osrg.net/sheepdog/}.
2298
Bharata B Rao8809e282012-10-24 17:17:53 +05302299@item GlusterFS
2300GlusterFS is an user space distributed file system.
2301QEMU supports the use of GlusterFS volumes for hosting VM disk images using
2302TCP, Unix Domain Sockets and RDMA transport protocols.
2303
2304Syntax for specifying a VM disk image on GlusterFS volume is
2305@example
2306gluster[+transport]://[server[:port]]/volname/image[?socket=...]
2307@end example
2308
2309
2310Example
2311@example
Lei Lidb2d5eb2013-03-07 15:50:26 +08002312qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img
Bharata B Rao8809e282012-10-24 17:17:53 +05302313@end example
2314
2315See also @url{http://www.gluster.org}.
Matthew Booth0a86cb72014-05-14 19:28:43 -04002316
2317@item HTTP/HTTPS/FTP/FTPS/TFTP
2318QEMU supports read-only access to files accessed over http(s), ftp(s) and tftp.
2319
2320Syntax using a single filename:
2321@example
2322<protocol>://[<username>[:<password>]@@]<host>/<path>
2323@end example
2324
2325where:
2326@table @option
2327@item protocol
2328'http', 'https', 'ftp', 'ftps', or 'tftp'.
2329
2330@item username
2331Optional username for authentication to the remote server.
2332
2333@item password
2334Optional password for authentication to the remote server.
2335
2336@item host
2337Address of the remote server.
2338
2339@item path
2340Path on the remote server, including any query string.
2341@end table
2342
2343The following options are also supported:
2344@table @option
2345@item url
2346The full URL when passing options to the driver explicitly.
2347
2348@item readahead
2349The amount of data to read ahead with each range request to the remote server.
2350This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
2351does not have a suffix, it will be assumed to be in bytes. The value must be a
2352multiple of 512 bytes. It defaults to 256k.
2353
2354@item sslverify
2355Whether to verify the remote server's certificate when connecting over SSL. It
2356can have the value 'on' or 'off'. It defaults to 'on'.
2357@end table
2358
2359Note that when passing options to qemu explicitly, @option{driver} is the value
2360of <protocol>.
2361
2362Example: boot from a remote Fedora 20 live ISO image
2363@example
2364qemu-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
2365
2366qemu-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
2367@end example
2368
2369Example: boot from a remote Fedora 20 cloud image using a local overlay for
2370writes, copy-on-read, and a readahead of 64k
2371@example
2372qemu-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
2373
2374qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
2375@end example
2376
2377Example: boot from an image stored on a VMware vSphere server with a self-signed
2378certificate using a local overlay for writes and a readahead of 64k
2379@example
2380qemu-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"@}' /tmp/test.qcow2
2381
2382qemu-system-x86_64 -drive file=/tmp/test.qcow2
2383@end example
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01002384ETEXI
2385
2386STEXI
Ronnie Sahlberg0f5314a2011-10-26 23:51:37 +11002387@end table
2388ETEXI
2389
Matthew Booth7273a2d2009-10-30 13:41:12 +00002390DEFHEADING(Bluetooth(R) options:)
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01002391STEXI
2392@table @option
2393ETEXI
Matthew Booth7273a2d2009-10-30 13:41:12 +00002394
blueswir15824d652009-03-28 06:44:27 +00002395DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
blueswir15824d652009-03-28 06:44:27 +00002396 "-bt hci,null dumb bluetooth HCI - doesn't respond to commands\n" \
2397 "-bt hci,host[:id]\n" \
2398 " use host's HCI with the given name\n" \
2399 "-bt hci[,vlan=n]\n" \
2400 " emulate a standard HCI in virtual scatternet 'n'\n" \
2401 "-bt vhci[,vlan=n]\n" \
2402 " add host computer to virtual scatternet 'n' using VHCI\n" \
2403 "-bt device:dev[,vlan=n]\n" \
Blue Swirlad960902010-03-29 19:23:52 +00002404 " emulate a bluetooth device 'dev' in scatternet 'n'\n",
2405 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002406STEXI
blueswir15824d652009-03-28 06:44:27 +00002407@item -bt hci[...]
Stefan Weil6616b2a2010-02-05 23:52:05 +01002408@findex -bt
blueswir15824d652009-03-28 06:44:27 +00002409Defines the function of the corresponding Bluetooth HCI. -bt options
2410are matched with the HCIs present in the chosen machine type. For
2411example when emulating a machine with only one HCI built into it, only
2412the first @code{-bt hci[...]} option is valid and defines the HCI's
2413logic. The Transport Layer is decided by the machine type. Currently
2414the machines @code{n800} and @code{n810} have one HCI and all other
2415machines have none.
2416
2417@anchor{bt-hcis}
2418The following three types are recognized:
2419
Kevin Wolfb3f046c2009-10-09 10:58:35 +02002420@table @option
blueswir15824d652009-03-28 06:44:27 +00002421@item -bt hci,null
2422(default) The corresponding Bluetooth HCI assumes no internal logic
2423and will not respond to any HCI commands or emit events.
2424
2425@item -bt hci,host[:@var{id}]
2426(@code{bluez} only) The corresponding HCI passes commands / events
2427to / from the physical HCI identified by the name @var{id} (default:
2428@code{hci0}) on the computer running QEMU. Only available on @code{bluez}
2429capable systems like Linux.
2430
2431@item -bt hci[,vlan=@var{n}]
2432Add a virtual, standard HCI that will participate in the Bluetooth
2433scatternet @var{n} (default @code{0}). Similarly to @option{-net}
2434VLANs, devices inside a bluetooth network @var{n} can only communicate
2435with other devices in the same network (scatternet).
2436@end table
2437
2438@item -bt vhci[,vlan=@var{n}]
2439(Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
2440to the host bluetooth stack instead of to the emulated target. This
2441allows the host and target machines to participate in a common scatternet
2442and communicate. Requires the Linux @code{vhci} driver installed. Can
2443be used as following:
2444
2445@example
Stefan Weil3804da92012-05-11 22:21:50 +02002446qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
blueswir15824d652009-03-28 06:44:27 +00002447@end example
2448
2449@item -bt device:@var{dev}[,vlan=@var{n}]
2450Emulate a bluetooth device @var{dev} and place it in network @var{n}
2451(default @code{0}). QEMU can only emulate one type of bluetooth devices
2452currently:
2453
Kevin Wolfb3f046c2009-10-09 10:58:35 +02002454@table @option
blueswir15824d652009-03-28 06:44:27 +00002455@item keyboard
2456Virtual wireless keyboard implementing the HIDP bluetooth profile.
2457@end table
blueswir15824d652009-03-28 06:44:27 +00002458ETEXI
2459
Markus Armbrusterc70a01e2013-02-13 19:49:40 +01002460STEXI
2461@end table
2462ETEXI
blueswir15824d652009-03-28 06:44:27 +00002463DEFHEADING()
2464
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05002465#ifdef CONFIG_TPM
2466DEFHEADING(TPM device options:)
2467
2468DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
Stefan Berger92dcc232013-02-27 12:47:54 -05002469 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
2470 " use path to provide path to a character device; default is /dev/tpm0\n"
2471 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
2472 " not provided it will be searched for in /sys/class/misc/tpm?/device\n",
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05002473 QEMU_ARCH_ALL)
2474STEXI
2475
2476The general form of a TPM device option is:
2477@table @option
2478
2479@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
2480@findex -tpmdev
2481Backend type must be:
Stefan Berger4549a8b2013-02-27 12:47:53 -05002482@option{passthrough}.
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05002483
2484The specific backend type will determine the applicable options.
Corey Bryant28c4fa32013-03-20 12:34:49 -04002485The @code{-tpmdev} option creates the TPM backend and requires a
2486@code{-device} option that specifies the TPM frontend interface model.
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05002487
2488Options to each backend are described below.
2489
2490Use 'help' to print all available TPM backend types.
2491@example
2492qemu -tpmdev help
2493@end example
2494
Stefan Berger92dcc232013-02-27 12:47:54 -05002495@item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path}
Stefan Berger4549a8b2013-02-27 12:47:53 -05002496
2497(Linux-host only) Enable access to the host's TPM using the passthrough
2498driver.
2499
2500@option{path} specifies the path to the host's TPM device, i.e., on
2501a Linux host this would be @code{/dev/tpm0}.
2502@option{path} is optional and by default @code{/dev/tpm0} is used.
2503
Stefan Berger92dcc232013-02-27 12:47:54 -05002504@option{cancel-path} specifies the path to the host TPM device's sysfs
2505entry allowing for cancellation of an ongoing TPM command.
2506@option{cancel-path} is optional and by default QEMU will search for the
2507sysfs entry to use.
2508
Stefan Berger4549a8b2013-02-27 12:47:53 -05002509Some notes about using the host's TPM with the passthrough driver:
2510
2511The TPM device accessed by the passthrough driver must not be
2512used by any other application on the host.
2513
2514Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
2515the VM's firmware (BIOS/UEFI) will not be able to initialize the
2516TPM again and may therefore not show a TPM-specific menu that would
2517otherwise allow the user to configure the TPM, e.g., allow the user to
2518enable/disable or activate/deactivate the TPM.
2519Further, if TPM ownership is released from within a VM then the host's TPM
2520will get disabled and deactivated. To enable and activate the
2521TPM again afterwards, the host has to be rebooted and the user is
2522required to enter the firmware's menu to enable and activate the TPM.
2523If the TPM is left disabled and/or deactivated most TPM commands will fail.
2524
2525To create a passthrough TPM use the following two options:
2526@example
2527-tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
2528@end example
2529Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
2530@code{tpmdev=tpm0} in the device option.
2531
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05002532@end table
2533
2534ETEXI
2535
2536DEFHEADING()
2537
2538#endif
2539
Alexander Graf7677f052009-06-28 16:55:55 +02002540DEFHEADING(Linux/Multiboot boot specific:)
blueswir15824d652009-03-28 06:44:27 +00002541STEXI
Alexander Graf7677f052009-06-28 16:55:55 +02002542
2543When using these options, you can use a given Linux or Multiboot
2544kernel without installing it in the disk image. It can be useful
blueswir15824d652009-03-28 06:44:27 +00002545for easier testing of various kernels.
2546
2547@table @option
2548ETEXI
2549
2550DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
Blue Swirlad960902010-03-29 19:23:52 +00002551 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002552STEXI
2553@item -kernel @var{bzImage}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002554@findex -kernel
Alexander Graf7677f052009-06-28 16:55:55 +02002555Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
2556or in multiboot format.
blueswir15824d652009-03-28 06:44:27 +00002557ETEXI
2558
2559DEF("append", HAS_ARG, QEMU_OPTION_append, \
Blue Swirlad960902010-03-29 19:23:52 +00002560 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002561STEXI
2562@item -append @var{cmdline}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002563@findex -append
blueswir15824d652009-03-28 06:44:27 +00002564Use @var{cmdline} as kernel command line
2565ETEXI
2566
2567DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
Blue Swirlad960902010-03-29 19:23:52 +00002568 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002569STEXI
2570@item -initrd @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002571@findex -initrd
blueswir15824d652009-03-28 06:44:27 +00002572Use @var{file} as initial ram disk.
Alexander Graf7677f052009-06-28 16:55:55 +02002573
2574@item -initrd "@var{file1} arg=foo,@var{file2}"
2575
2576This syntax is only available with multiboot.
2577
2578Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
2579first module.
blueswir15824d652009-03-28 06:44:27 +00002580ETEXI
2581
Grant Likely412beee2012-03-02 11:56:38 +00002582DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
Peter A. G. Crosthwaite379b5c72012-03-04 21:03:54 +10002583 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
Grant Likely412beee2012-03-02 11:56:38 +00002584STEXI
2585@item -dtb @var{file}
2586@findex -dtb
2587Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
2588on boot.
2589ETEXI
2590
blueswir15824d652009-03-28 06:44:27 +00002591STEXI
2592@end table
2593ETEXI
blueswir15824d652009-03-28 06:44:27 +00002594DEFHEADING()
2595
2596DEFHEADING(Debug/Expert options:)
blueswir15824d652009-03-28 06:44:27 +00002597STEXI
2598@table @option
2599ETEXI
2600
2601DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
Blue Swirlad960902010-03-29 19:23:52 +00002602 "-serial dev redirect the serial port to char device 'dev'\n",
2603 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002604STEXI
2605@item -serial @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002606@findex -serial
blueswir15824d652009-03-28 06:44:27 +00002607Redirect the virtual serial port to host character device
2608@var{dev}. The default device is @code{vc} in graphical mode and
2609@code{stdio} in non graphical mode.
2610
2611This option can be used several times to simulate up to 4 serial
2612ports.
2613
2614Use @code{-serial none} to disable all serial ports.
2615
2616Available character devices are:
Kevin Wolfb3f046c2009-10-09 10:58:35 +02002617@table @option
Kevin Wolf4e257e52009-10-09 10:58:36 +02002618@item vc[:@var{W}x@var{H}]
blueswir15824d652009-03-28 06:44:27 +00002619Virtual console. Optionally, a width and height can be given in pixel with
2620@example
2621vc:800x600
2622@end example
2623It is also possible to specify width or height in characters:
2624@example
2625vc:80Cx24C
2626@end example
2627@item pty
2628[Linux only] Pseudo TTY (a new PTY is automatically allocated)
2629@item none
2630No device is allocated.
2631@item null
2632void device
Ingo van Lil88e020e2013-12-20 14:44:53 +01002633@item chardev:@var{id}
2634Use a named character device defined with the @code{-chardev} option.
blueswir15824d652009-03-28 06:44:27 +00002635@item /dev/XXX
2636[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
2637parameters are set according to the emulated ones.
2638@item /dev/parport@var{N}
2639[Linux only, parallel port only] Use host parallel port
2640@var{N}. Currently SPP and EPP parallel port features can be used.
2641@item file:@var{filename}
2642Write output to @var{filename}. No character can be read.
2643@item stdio
2644[Unix only] standard input/output
2645@item pipe:@var{filename}
2646name pipe @var{filename}
2647@item COM@var{n}
2648[Windows only] Use host serial port @var{n}
2649@item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
2650This implements UDP Net Console.
2651When @var{remote_host} or @var{src_ip} are not specified
2652they default to @code{0.0.0.0}.
2653When not using a specified @var{src_port} a random port is automatically chosen.
blueswir15824d652009-03-28 06:44:27 +00002654
2655If you just want a simple readonly console you can use @code{netcat} or
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002656@code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
2657@code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
blueswir15824d652009-03-28 06:44:27 +00002658will appear in the netconsole session.
2659
2660If you plan to send characters back via netconsole or you want to stop
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002661and start QEMU a lot of times, you should have QEMU use the same
blueswir15824d652009-03-28 06:44:27 +00002662source port each time by using something like @code{-serial
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002663udp::4555@@:4556} to QEMU. Another approach is to use a patched
blueswir15824d652009-03-28 06:44:27 +00002664version of netcat which can listen to a TCP port and send and receive
2665characters via udp. If you have a patched version of netcat which
2666activates telnet remote echo and single char transfer, then you can
2667use the following options to step up a netcat redirector to allow
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002668telnet on port 5555 to access the QEMU port.
blueswir15824d652009-03-28 06:44:27 +00002669@table @code
Stefan Weil071c9392012-04-07 09:23:36 +02002670@item QEMU Options:
blueswir15824d652009-03-28 06:44:27 +00002671-serial udp::4555@@:4556
2672@item netcat options:
2673-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
2674@item telnet options:
2675localhost 5555
2676@end table
2677
2678@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay]
2679The TCP Net Console has two modes of operation. It can send the serial
2680I/O to a location or wait for a connection from a location. By default
2681the TCP Net Console is sent to @var{host} at the @var{port}. If you use
2682the @var{server} option QEMU will wait for a client socket application
2683to connect to the port before continuing, unless the @code{nowait}
2684option was specified. The @code{nodelay} option disables the Nagle buffering
2685algorithm. If @var{host} is omitted, 0.0.0.0 is assumed. Only
2686one TCP connection at a time is accepted. You can use @code{telnet} to
2687connect to the corresponding character device.
2688@table @code
2689@item Example to send tcp console to 192.168.0.2 port 4444
2690-serial tcp:192.168.0.2:4444
2691@item Example to listen and wait on port 4444 for connection
2692-serial tcp::4444,server
2693@item Example to not wait and listen on ip 192.168.0.100 port 4444
2694-serial tcp:192.168.0.100:4444,server,nowait
2695@end table
2696
2697@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
2698The telnet protocol is used instead of raw tcp sockets. The options
2699work the same as if you had specified @code{-serial tcp}. The
2700difference is that the port acts like a telnet server or client using
2701telnet option negotiation. This will also allow you to send the
2702MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
2703sequence. Typically in unix telnet you do it with Control-] and then
2704type "send break" followed by pressing the enter key.
2705
2706@item unix:@var{path}[,server][,nowait]
2707A unix domain socket is used instead of a tcp socket. The option works the
2708same as if you had specified @code{-serial tcp} except the unix domain socket
2709@var{path} is used for connections.
2710
2711@item mon:@var{dev_string}
2712This is a special option to allow the monitor to be multiplexed onto
2713another serial port. The monitor is accessed with key sequence of
Paolo Bonzini02c4bdf2013-07-03 20:29:45 +04002714@key{Control-a} and then pressing @key{c}.
blueswir15824d652009-03-28 06:44:27 +00002715@var{dev_string} should be any one of the serial devices specified
2716above. An example to multiplex the monitor onto a telnet server
2717listening on port 4444 would be:
2718@table @code
2719@item -serial mon:telnet::4444,server,nowait
2720@end table
Michael Tokarevbe022d62013-07-11 12:55:50 +04002721When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
2722QEMU any more but will be passed to the guest instead.
blueswir15824d652009-03-28 06:44:27 +00002723
2724@item braille
2725Braille device. This will use BrlAPI to display the braille output on a real
2726or fake device.
2727
Kevin Wolfbe8b28a2009-10-09 10:58:37 +02002728@item msmouse
2729Three button serial mouse. Configure the guest to use Microsoft protocol.
blueswir15824d652009-03-28 06:44:27 +00002730@end table
2731ETEXI
2732
2733DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
Blue Swirlad960902010-03-29 19:23:52 +00002734 "-parallel dev redirect the parallel port to char device 'dev'\n",
2735 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002736STEXI
2737@item -parallel @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002738@findex -parallel
blueswir15824d652009-03-28 06:44:27 +00002739Redirect the virtual parallel port to host device @var{dev} (same
2740devices as the serial port). On Linux hosts, @file{/dev/parportN} can
2741be used to use hardware devices connected on the corresponding host
2742parallel port.
2743
2744This option can be used several times to simulate up to 3 parallel
2745ports.
2746
2747Use @code{-parallel none} to disable all parallel ports.
2748ETEXI
2749
2750DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
Blue Swirlad960902010-03-29 19:23:52 +00002751 "-monitor dev redirect the monitor to char device 'dev'\n",
2752 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002753STEXI
Gerd Hoffmann4e307fc2009-12-08 13:11:37 +01002754@item -monitor @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002755@findex -monitor
blueswir15824d652009-03-28 06:44:27 +00002756Redirect the monitor to host device @var{dev} (same devices as the
2757serial port).
2758The default device is @code{vc} in graphical mode and @code{stdio} in
2759non graphical mode.
Luiz Capitulino70e098a2013-05-16 12:02:55 -04002760Use @code{-monitor none} to disable the default monitor.
blueswir15824d652009-03-28 06:44:27 +00002761ETEXI
Gerd Hoffmann6ca55822009-12-08 13:11:52 +01002762DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
Blue Swirlad960902010-03-29 19:23:52 +00002763 "-qmp dev like -monitor but opens in 'control' mode\n",
2764 QEMU_ARCH_ALL)
Stefan Weil95d5f082010-01-20 22:25:27 +01002765STEXI
2766@item -qmp @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002767@findex -qmp
Stefan Weil95d5f082010-01-20 22:25:27 +01002768Like -monitor but opens in 'control' mode.
2769ETEXI
blueswir15824d652009-03-28 06:44:27 +00002770
Gerd Hoffmann22a0e042009-12-08 13:11:51 +01002771DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
Michael Tokarevf17e4ea2013-06-15 13:47:32 +04002772 "-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL)
Gerd Hoffmann22a0e042009-12-08 13:11:51 +01002773STEXI
Michael Tokarevf17e4ea2013-06-15 13:47:32 +04002774@item -mon [chardev=]name[,mode=readline|control][,default]
Stefan Weil6616b2a2010-02-05 23:52:05 +01002775@findex -mon
Gerd Hoffmann22a0e042009-12-08 13:11:51 +01002776Setup monitor on chardev @var{name}.
2777ETEXI
2778
H. Peter Anvinc9f398e2009-12-29 13:51:36 -08002779DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
Blue Swirlad960902010-03-29 19:23:52 +00002780 "-debugcon dev redirect the debug console to char device 'dev'\n",
2781 QEMU_ARCH_ALL)
H. Peter Anvinc9f398e2009-12-29 13:51:36 -08002782STEXI
2783@item -debugcon @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002784@findex -debugcon
H. Peter Anvinc9f398e2009-12-29 13:51:36 -08002785Redirect the debug console to host device @var{dev} (same devices as the
2786serial port). The debug console is an I/O port which is typically port
27870xe9; writing to that I/O port sends output to this device.
2788The default device is @code{vc} in graphical mode and @code{stdio} in
2789non graphical mode.
2790ETEXI
2791
blueswir15824d652009-03-28 06:44:27 +00002792DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
Blue Swirlad960902010-03-29 19:23:52 +00002793 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002794STEXI
2795@item -pidfile @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002796@findex -pidfile
blueswir15824d652009-03-28 06:44:27 +00002797Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
2798from a script.
2799ETEXI
2800
aurel321b530a62009-04-05 20:08:59 +00002801DEF("singlestep", 0, QEMU_OPTION_singlestep, \
Blue Swirlad960902010-03-29 19:23:52 +00002802 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
aurel321b530a62009-04-05 20:08:59 +00002803STEXI
2804@item -singlestep
Stefan Weil6616b2a2010-02-05 23:52:05 +01002805@findex -singlestep
aurel321b530a62009-04-05 20:08:59 +00002806Run the emulation in single step mode.
2807ETEXI
2808
blueswir15824d652009-03-28 06:44:27 +00002809DEF("S", 0, QEMU_OPTION_S, \
Blue Swirlad960902010-03-29 19:23:52 +00002810 "-S freeze CPU at startup (use 'c' to start execution)\n",
2811 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002812STEXI
2813@item -S
Stefan Weil6616b2a2010-02-05 23:52:05 +01002814@findex -S
blueswir15824d652009-03-28 06:44:27 +00002815Do not start CPU at startup (you must type 'c' in the monitor).
2816ETEXI
2817
Satoru Moriya888a6bc2013-04-19 16:42:06 +02002818DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
2819 "-realtime [mlock=on|off]\n"
2820 " run qemu with realtime features\n"
2821 " mlock=on|off controls mlock support (default: on)\n",
2822 QEMU_ARCH_ALL)
2823STEXI
2824@item -realtime mlock=on|off
2825@findex -realtime
2826Run qemu with realtime features.
2827mlocking qemu and guest memory can be enabled via @option{mlock=on}
2828(enabled by default).
2829ETEXI
2830
aliguori59030a82009-04-05 18:43:41 +00002831DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
Blue Swirlad960902010-03-29 19:23:52 +00002832 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002833STEXI
aliguori59030a82009-04-05 18:43:41 +00002834@item -gdb @var{dev}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002835@findex -gdb
aliguori59030a82009-04-05 18:43:41 +00002836Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
2837connections will likely be TCP-based, but also UDP, pseudo TTY, or even
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002838stdio are reasonable use case. The latter is allowing to start QEMU from
aliguori59030a82009-04-05 18:43:41 +00002839within gdb and establish the connection via a pipe:
2840@example
Stefan Weil3804da92012-05-11 22:21:50 +02002841(gdb) target remote | exec qemu-system-i386 -gdb stdio ...
aliguori59030a82009-04-05 18:43:41 +00002842@end example
blueswir15824d652009-03-28 06:44:27 +00002843ETEXI
2844
aliguori59030a82009-04-05 18:43:41 +00002845DEF("s", 0, QEMU_OPTION_s, \
Blue Swirlad960902010-03-29 19:23:52 +00002846 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
2847 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002848STEXI
aliguori59030a82009-04-05 18:43:41 +00002849@item -s
Stefan Weil6616b2a2010-02-05 23:52:05 +01002850@findex -s
aliguori59030a82009-04-05 18:43:41 +00002851Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
2852(@pxref{gdb_usage}).
blueswir15824d652009-03-28 06:44:27 +00002853ETEXI
2854
2855DEF("d", HAS_ARG, QEMU_OPTION_d, \
Peter Maydell989b6972013-02-26 17:52:40 +00002856 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
Blue Swirlad960902010-03-29 19:23:52 +00002857 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002858STEXI
Peter Maydell989b6972013-02-26 17:52:40 +00002859@item -d @var{item1}[,...]
Stefan Weil6616b2a2010-02-05 23:52:05 +01002860@findex -d
Peter Maydell989b6972013-02-26 17:52:40 +00002861Enable logging of specified items. Use '-d help' for a list of log items.
blueswir15824d652009-03-28 06:44:27 +00002862ETEXI
2863
Matthew Fernandezc235d732011-06-07 16:32:40 +00002864DEF("D", HAS_ARG, QEMU_OPTION_D, \
Peter Maydell989b6972013-02-26 17:52:40 +00002865 "-D logfile output log to logfile (default stderr)\n",
Matthew Fernandezc235d732011-06-07 16:32:40 +00002866 QEMU_ARCH_ALL)
2867STEXI
Stefan Weil8bd383b2012-05-11 22:40:50 +02002868@item -D @var{logfile}
Matthew Fernandezc235d732011-06-07 16:32:40 +00002869@findex -D
Peter Maydell989b6972013-02-26 17:52:40 +00002870Output log in @var{logfile} instead of to stderr
Matthew Fernandezc235d732011-06-07 16:32:40 +00002871ETEXI
2872
blueswir15824d652009-03-28 06:44:27 +00002873DEF("L", HAS_ARG, QEMU_OPTION_L, \
Blue Swirlad960902010-03-29 19:23:52 +00002874 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
2875 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002876STEXI
2877@item -L @var{path}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002878@findex -L
blueswir15824d652009-03-28 06:44:27 +00002879Set the directory for the BIOS, VGA BIOS and keymaps.
2880ETEXI
2881
2882DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
Blue Swirlad960902010-03-29 19:23:52 +00002883 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002884STEXI
2885@item -bios @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002886@findex -bios
blueswir15824d652009-03-28 06:44:27 +00002887Set the filename for the BIOS.
2888ETEXI
2889
blueswir15824d652009-03-28 06:44:27 +00002890DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
Blue Swirlad960902010-03-29 19:23:52 +00002891 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002892STEXI
2893@item -enable-kvm
Stefan Weil6616b2a2010-02-05 23:52:05 +01002894@findex -enable-kvm
blueswir15824d652009-03-28 06:44:27 +00002895Enable KVM full virtualization support. This option is only available
2896if KVM support is enabled when compiling.
2897ETEXI
2898
aliguorie37630c2009-04-22 15:19:10 +00002899DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
Blue Swirlad960902010-03-29 19:23:52 +00002900 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
aliguorie37630c2009-04-22 15:19:10 +00002901DEF("xen-create", 0, QEMU_OPTION_xen_create,
2902 "-xen-create create domain using xen hypercalls, bypassing xend\n"
Blue Swirlad960902010-03-29 19:23:52 +00002903 " warning: should not be used when xend is in use\n",
2904 QEMU_ARCH_ALL)
aliguorie37630c2009-04-22 15:19:10 +00002905DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
2906 "-xen-attach attach to existing xen domain\n"
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002907 " xend will use this when starting QEMU\n",
Blue Swirlad960902010-03-29 19:23:52 +00002908 QEMU_ARCH_ALL)
Stefan Weil95d5f082010-01-20 22:25:27 +01002909STEXI
2910@item -xen-domid @var{id}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002911@findex -xen-domid
Stefan Weil95d5f082010-01-20 22:25:27 +01002912Specify xen guest domain @var{id} (XEN only).
2913@item -xen-create
Stefan Weil6616b2a2010-02-05 23:52:05 +01002914@findex -xen-create
Stefan Weil95d5f082010-01-20 22:25:27 +01002915Create domain using xen hypercalls, bypassing xend.
2916Warning: should not be used when xend is in use (XEN only).
2917@item -xen-attach
Stefan Weil6616b2a2010-02-05 23:52:05 +01002918@findex -xen-attach
Stefan Weil95d5f082010-01-20 22:25:27 +01002919Attach to existing xen domain.
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002920xend will use this when starting QEMU (XEN only).
Stefan Weil95d5f082010-01-20 22:25:27 +01002921ETEXI
aliguorie37630c2009-04-22 15:19:10 +00002922
blueswir15824d652009-03-28 06:44:27 +00002923DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
Blue Swirlad960902010-03-29 19:23:52 +00002924 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002925STEXI
2926@item -no-reboot
Stefan Weil6616b2a2010-02-05 23:52:05 +01002927@findex -no-reboot
blueswir15824d652009-03-28 06:44:27 +00002928Exit instead of rebooting.
2929ETEXI
2930
2931DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
Blue Swirlad960902010-03-29 19:23:52 +00002932 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002933STEXI
2934@item -no-shutdown
Stefan Weil6616b2a2010-02-05 23:52:05 +01002935@findex -no-shutdown
blueswir15824d652009-03-28 06:44:27 +00002936Don't exit QEMU on guest shutdown, but instead only stop the emulation.
2937This allows for instance switching to monitor to commit changes to the
2938disk image.
2939ETEXI
2940
2941DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
2942 "-loadvm [tag|id]\n" \
Blue Swirlad960902010-03-29 19:23:52 +00002943 " start right away with a saved state (loadvm in monitor)\n",
2944 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002945STEXI
2946@item -loadvm @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002947@findex -loadvm
blueswir15824d652009-03-28 06:44:27 +00002948Start right away with a saved state (@code{loadvm} in monitor)
2949ETEXI
2950
2951#ifndef _WIN32
2952DEF("daemonize", 0, QEMU_OPTION_daemonize, \
Blue Swirlad960902010-03-29 19:23:52 +00002953 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002954#endif
2955STEXI
2956@item -daemonize
Stefan Weil6616b2a2010-02-05 23:52:05 +01002957@findex -daemonize
blueswir15824d652009-03-28 06:44:27 +00002958Daemonize the QEMU process after initialization. QEMU will not detach from
2959standard IO until it is ready to receive connections on any of its devices.
2960This option is a useful way for external programs to launch QEMU without having
2961to cope with initialization race conditions.
2962ETEXI
2963
2964DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
Blue Swirlad960902010-03-29 19:23:52 +00002965 "-option-rom rom load a file, rom, into the option ROM space\n",
2966 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002967STEXI
2968@item -option-rom @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002969@findex -option-rom
blueswir15824d652009-03-28 06:44:27 +00002970Load the contents of @var{file} as an option ROM.
2971This option is useful to load things like EtherBoot.
2972ETEXI
2973
2974DEF("clock", HAS_ARG, QEMU_OPTION_clock, \
2975 "-clock force the use of the given methods for timer alarm.\n" \
Peter Maydell585f6032012-10-04 16:22:01 +01002976 " To see what timers are available use '-clock help'\n",
Blue Swirlad960902010-03-29 19:23:52 +00002977 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002978STEXI
2979@item -clock @var{method}
Stefan Weil6616b2a2010-02-05 23:52:05 +01002980@findex -clock
blueswir15824d652009-03-28 06:44:27 +00002981Force the use of the given methods for timer alarm. To see what timers
Peter Maydell585f6032012-10-04 16:22:01 +01002982are available use @code{-clock help}.
blueswir15824d652009-03-28 06:44:27 +00002983ETEXI
2984
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02002985HXCOMM Options deprecated by -rtc
Blue Swirlad960902010-03-29 19:23:52 +00002986DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL)
2987DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00002988
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02002989DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
Paolo Bonzini78808142012-03-30 10:31:21 +00002990 "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \
Blue Swirlad960902010-03-29 19:23:52 +00002991 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
2992 QEMU_ARCH_ALL)
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02002993
blueswir15824d652009-03-28 06:44:27 +00002994STEXI
2995
Jan Kiszka68752042009-09-15 13:36:04 +02002996@item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew]
Stefan Weil6616b2a2010-02-05 23:52:05 +01002997@findex -rtc
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02002998Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
2999UTC or local time, respectively. @code{localtime} is required for correct date in
3000MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the
3001format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
3002
Michael Tokarev9d85d552014-04-07 13:34:58 +04003003By default the RTC is driven by the host system time. This allows using of the
Jan Kiszka68752042009-09-15 13:36:04 +02003004RTC as accurate reference clock inside the guest, specifically if the host
3005time is smoothly following an accurate external reference clock, e.g. via NTP.
Paolo Bonzini78808142012-03-30 10:31:21 +00003006If you want to isolate the guest time from the host, you can set @option{clock}
3007to @code{rt} instead. To even prevent it from progressing during suspension,
3008you can set it to @code{vm}.
Jan Kiszka68752042009-09-15 13:36:04 +02003009
Jan Kiszka1ed2fc12009-09-15 13:36:04 +02003010Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
3011specifically with Windows' ACPI HAL. This option will try to figure out how
3012many timer interrupts were not processed by the Windows guest and will
3013re-inject them.
blueswir15824d652009-03-28 06:44:27 +00003014ETEXI
3015
3016DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
Sebastian Tanasea8bfac32014-07-25 11:56:29 +02003017 "-icount [shift=N|auto][,align=on|off]\n" \
aliguoribc14ca22009-04-05 18:43:37 +00003018 " enable virtual instruction counter with 2^N clock ticks per\n" \
Sebastian Tanasea8bfac32014-07-25 11:56:29 +02003019 " instruction and enable aligning the host and virtual clocks\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003020STEXI
Sebastian Tanase1ad95802014-07-25 11:56:28 +02003021@item -icount [shift=@var{N}|auto]
Stefan Weil6616b2a2010-02-05 23:52:05 +01003022@findex -icount
blueswir15824d652009-03-28 06:44:27 +00003023Enable virtual instruction counter. The virtual cpu will execute one
Kevin Wolf4e257e52009-10-09 10:58:36 +02003024instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
blueswir15824d652009-03-28 06:44:27 +00003025then the virtual cpu speed will be automatically adjusted to keep virtual
3026time within a few seconds of real time.
3027
3028Note that while this option can give deterministic behavior, it does not
3029provide cycle accurate emulation. Modern CPUs contain superscalar out of
3030order cores with complex cache hierarchies. The number of instructions
3031executed often has little or no correlation with actual performance.
Sebastian Tanasea8bfac32014-07-25 11:56:29 +02003032
3033@option{align=on} will activate the delay algorithm which will try to
3034to synchronise the host clock and the virtual clock. The goal is to
3035have a guest running at the real frequency imposed by the shift option.
3036Whenever the guest clock is behind the host clock and if
3037@option{align=on} is specified then we print a messsage to the user
3038to inform about the delay.
3039Currently this option does not work when @option{shift} is @code{auto}.
3040Note: The sync algorithm will work for those shift values for which
3041the guest clock runs ahead of the host clock. Typically this happens
3042when the shift value is high (how high depends on the host machine).
blueswir15824d652009-03-28 06:44:27 +00003043ETEXI
3044
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003045DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
3046 "-watchdog i6300esb|ib700\n" \
Blue Swirlad960902010-03-29 19:23:52 +00003047 " enable virtual hardware watchdog [default=none]\n",
3048 QEMU_ARCH_ALL)
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003049STEXI
3050@item -watchdog @var{model}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003051@findex -watchdog
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003052Create a virtual hardware watchdog device. Once enabled (by a guest
3053action), the watchdog must be periodically polled by an agent inside
3054the guest or else the guest will be restarted.
3055
3056The @var{model} is the model of hardware watchdog to emulate. Choices
3057for model are: @code{ib700} (iBASE 700) which is a very simple ISA
3058watchdog with a single timer, or @code{i6300esb} (Intel 6300ESB I/O
3059controller hub) which is a much more featureful PCI-based dual-timer
3060watchdog. Choose a model for which your guest has drivers.
3061
Peter Maydell585f6032012-10-04 16:22:01 +01003062Use @code{-watchdog help} to list available hardware models. Only one
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003063watchdog can be enabled for a guest.
3064ETEXI
3065
3066DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
3067 "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \
Blue Swirlad960902010-03-29 19:23:52 +00003068 " action when watchdog fires [default=reset]\n",
3069 QEMU_ARCH_ALL)
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003070STEXI
3071@item -watchdog-action @var{action}
Markus Armbrusterb8f490e2013-02-13 19:49:38 +01003072@findex -watchdog-action
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +01003073
3074The @var{action} controls what QEMU will do when the watchdog timer
3075expires.
3076The default is
3077@code{reset} (forcefully reset the guest).
3078Other possible actions are:
3079@code{shutdown} (attempt to gracefully shutdown the guest),
3080@code{poweroff} (forcefully poweroff the guest),
3081@code{pause} (pause the guest),
3082@code{debug} (print a debug message and continue), or
3083@code{none} (do nothing).
3084
3085Note that the @code{shutdown} action requires that the guest responds
3086to ACPI signals, which it may not be able to do in the sort of
3087situations where the watchdog would have expired, and thus
3088@code{-watchdog-action shutdown} is not recommended for production use.
3089
3090Examples:
3091
3092@table @code
3093@item -watchdog i6300esb -watchdog-action pause
3094@item -watchdog ib700
3095@end table
3096ETEXI
3097
blueswir15824d652009-03-28 06:44:27 +00003098DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
Blue Swirlad960902010-03-29 19:23:52 +00003099 "-echr chr set terminal escape character instead of ctrl-a\n",
3100 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003101STEXI
3102
Kevin Wolf4e257e52009-10-09 10:58:36 +02003103@item -echr @var{numeric_ascii_value}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003104@findex -echr
blueswir15824d652009-03-28 06:44:27 +00003105Change the escape character used for switching to the monitor when using
3106monitor and serial sharing. The default is @code{0x01} when using the
3107@code{-nographic} option. @code{0x01} is equal to pressing
3108@code{Control-a}. You can select a different character from the ascii
3109control keys where 1 through 26 map to Control-a through Control-z. For
3110instance you could use the either of the following to change the escape
3111character to Control-t.
3112@table @code
3113@item -echr 0x14
3114@item -echr 20
3115@end table
3116ETEXI
3117
3118DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \
3119 "-virtioconsole c\n" \
Blue Swirlad960902010-03-29 19:23:52 +00003120 " set virtio console\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003121STEXI
3122@item -virtioconsole @var{c}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003123@findex -virtioconsole
blueswir15824d652009-03-28 06:44:27 +00003124Set virtio console.
Amit Shah98b19252010-01-20 00:36:52 +05303125
3126This option is maintained for backward compatibility.
3127
3128Please use @code{-device virtconsole} for the new way of invocation.
blueswir15824d652009-03-28 06:44:27 +00003129ETEXI
3130
3131DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
Blue Swirlad960902010-03-29 19:23:52 +00003132 "-show-cursor show cursor\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003133STEXI
Stefan Weil95d5f082010-01-20 22:25:27 +01003134@item -show-cursor
Stefan Weil6616b2a2010-02-05 23:52:05 +01003135@findex -show-cursor
Stefan Weil95d5f082010-01-20 22:25:27 +01003136Show cursor.
blueswir15824d652009-03-28 06:44:27 +00003137ETEXI
3138
3139DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
Blue Swirlad960902010-03-29 19:23:52 +00003140 "-tb-size n set TB size\n", QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003141STEXI
Stefan Weil95d5f082010-01-20 22:25:27 +01003142@item -tb-size @var{n}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003143@findex -tb-size
Stefan Weil95d5f082010-01-20 22:25:27 +01003144Set TB size.
blueswir15824d652009-03-28 06:44:27 +00003145ETEXI
3146
3147DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
Blue Swirlad960902010-03-29 19:23:52 +00003148 "-incoming p prepare for incoming migration, listen on port p\n",
3149 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003150STEXI
Stefan Weil95d5f082010-01-20 22:25:27 +01003151@item -incoming @var{port}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003152@findex -incoming
Stefan Weil95d5f082010-01-20 22:25:27 +01003153Prepare for incoming migration, listen on @var{port}.
blueswir15824d652009-03-28 06:44:27 +00003154ETEXI
3155
Gerd Hoffmannd8c208d2009-12-08 13:11:46 +01003156DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
Blue Swirlad960902010-03-29 19:23:52 +00003157 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
Gerd Hoffmannd8c208d2009-12-08 13:11:46 +01003158STEXI
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003159@item -nodefaults
Stefan Weil6616b2a2010-02-05 23:52:05 +01003160@findex -nodefaults
Michal Novotny66c19bf2012-07-16 14:35:10 +02003161Don't create default devices. Normally, QEMU sets the default devices like serial
3162port, parallel port, virtual console, monitor device, VGA adapter, floppy and
3163CD-ROM drive and others. The @code{-nodefaults} option will disable all those
3164default devices.
Gerd Hoffmannd8c208d2009-12-08 13:11:46 +01003165ETEXI
3166
blueswir15824d652009-03-28 06:44:27 +00003167#ifndef _WIN32
3168DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
Blue Swirlad960902010-03-29 19:23:52 +00003169 "-chroot dir chroot to dir just before starting the VM\n",
3170 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003171#endif
3172STEXI
Kevin Wolf4e257e52009-10-09 10:58:36 +02003173@item -chroot @var{dir}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003174@findex -chroot
blueswir15824d652009-03-28 06:44:27 +00003175Immediately before starting guest execution, chroot to the specified
3176directory. Especially useful in combination with -runas.
3177ETEXI
3178
3179#ifndef _WIN32
3180DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
Blue Swirlad960902010-03-29 19:23:52 +00003181 "-runas user change to user id user just before starting the VM\n",
3182 QEMU_ARCH_ALL)
blueswir15824d652009-03-28 06:44:27 +00003183#endif
3184STEXI
Kevin Wolf4e257e52009-10-09 10:58:36 +02003185@item -runas @var{user}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003186@findex -runas
blueswir15824d652009-03-28 06:44:27 +00003187Immediately before starting guest execution, drop root privileges, switching
3188to the specified user.
3189ETEXI
3190
blueswir15824d652009-03-28 06:44:27 +00003191DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
3192 "-prom-env variable=value\n"
Blue Swirlad960902010-03-29 19:23:52 +00003193 " set OpenBIOS nvram variables\n",
3194 QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
Stefan Weil95d5f082010-01-20 22:25:27 +01003195STEXI
3196@item -prom-env @var{variable}=@var{value}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003197@findex -prom-env
Stefan Weil95d5f082010-01-20 22:25:27 +01003198Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
3199ETEXI
blueswir15824d652009-03-28 06:44:27 +00003200DEF("semihosting", 0, QEMU_OPTION_semihosting,
Michael Wallef7bbcfb2014-04-22 20:18:42 +02003201 "-semihosting semihosting mode\n",
3202 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32)
Stefan Weil95d5f082010-01-20 22:25:27 +01003203STEXI
3204@item -semihosting
Stefan Weil6616b2a2010-02-05 23:52:05 +01003205@findex -semihosting
Max Filippov1ddeaa52011-09-06 03:55:47 +04003206Semihosting mode (ARM, M68K, Xtensa only).
Stefan Weil95d5f082010-01-20 22:25:27 +01003207ETEXI
blueswir15824d652009-03-28 06:44:27 +00003208DEF("old-param", 0, QEMU_OPTION_old_param,
Blue Swirlad960902010-03-29 19:23:52 +00003209 "-old-param old param mode\n", QEMU_ARCH_ARM)
Stefan Weil95d5f082010-01-20 22:25:27 +01003210STEXI
3211@item -old-param
Stefan Weil6616b2a2010-02-05 23:52:05 +01003212@findex -old-param (ARM)
Stefan Weil95d5f082010-01-20 22:25:27 +01003213Old param mode (ARM only).
3214ETEXI
3215
Eduardo Otubo7d76ad42012-08-14 18:44:08 -03003216DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
3217 "-sandbox <arg> Enable seccomp mode 2 system call filter (default 'off').\n",
3218 QEMU_ARCH_ALL)
3219STEXI
Markus Armbruster6265c432013-02-13 19:49:39 +01003220@item -sandbox @var{arg}
Eduardo Otubo7d76ad42012-08-14 18:44:08 -03003221@findex -sandbox
3222Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
3223disable it. The default is 'off'.
3224ETEXI
3225
Gerd Hoffmann715a6642009-10-14 10:39:28 +02003226DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
Blue Swirlad960902010-03-29 19:23:52 +00003227 "-readconfig <file>\n", QEMU_ARCH_ALL)
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003228STEXI
3229@item -readconfig @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003230@findex -readconfig
Michal Novotnyed24cfa2012-07-16 14:28:32 +02003231Read device configuration from @var{file}. This approach is useful when you want to spawn
3232QEMU process with many command line options but you don't want to exceed the command line
3233character limit.
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003234ETEXI
Gerd Hoffmann715a6642009-10-14 10:39:28 +02003235DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
3236 "-writeconfig <file>\n"
Blue Swirlad960902010-03-29 19:23:52 +00003237 " read/write config file\n", QEMU_ARCH_ALL)
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003238STEXI
3239@item -writeconfig @var{file}
Stefan Weil6616b2a2010-02-05 23:52:05 +01003240@findex -writeconfig
Michal Novotnyed24cfa2012-07-16 14:28:32 +02003241Write device configuration to @var{file}. The @var{file} can be either filename to save
3242command line and device configuration into file or dash @code{-}) character to print the
3243output to stdout. This can be later used as input file for @code{-readconfig} option.
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003244ETEXI
Anthony Liguori292444c2010-01-21 10:57:58 -06003245DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
3246 "-nodefconfig\n"
Blue Swirlad960902010-03-29 19:23:52 +00003247 " do not load default config files at startup\n",
3248 QEMU_ARCH_ALL)
Anthony Liguori292444c2010-01-21 10:57:58 -06003249STEXI
3250@item -nodefconfig
Stefan Weil6616b2a2010-02-05 23:52:05 +01003251@findex -nodefconfig
Eduardo Habkostf29a5612012-05-02 13:07:29 -03003252Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
3253The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
3254ETEXI
3255DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
3256 "-no-user-config\n"
3257 " do not load user-provided config files at startup\n",
3258 QEMU_ARCH_ALL)
3259STEXI
3260@item -no-user-config
3261@findex -no-user-config
3262The @code{-no-user-config} option makes QEMU not load any of the user-provided
3263config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
3264files from @var{datadir}.
Anthony Liguori292444c2010-01-21 10:57:58 -06003265ETEXI
Prerna Saxenaab6540d2010-08-09 11:48:32 +01003266DEF("trace", HAS_ARG, QEMU_OPTION_trace,
Lluís23d15e82011-08-31 20:31:31 +02003267 "-trace [events=<file>][,file=<file>]\n"
3268 " specify tracing options\n",
Prerna Saxenaab6540d2010-08-09 11:48:32 +01003269 QEMU_ARCH_ALL)
3270STEXI
Lluís23d15e82011-08-31 20:31:31 +02003271HXCOMM This line is not accurate, as some sub-options are backend-specific but
3272HXCOMM HX does not support conditional compilation of text.
3273@item -trace [events=@var{file}][,file=@var{file}]
Prerna Saxenaab6540d2010-08-09 11:48:32 +01003274@findex -trace
Lluíse4858972011-08-31 20:31:03 +02003275
Lluís23d15e82011-08-31 20:31:31 +02003276Specify tracing options.
3277
3278@table @option
3279@item events=@var{file}
3280Immediately enable events listed in @var{file}.
3281The file must contain one event name (as listed in the @var{trace-events} file)
3282per line.
Stefan Weilc1ba4e02011-09-05 18:13:03 +02003283This option is only available if QEMU has been compiled with
3284either @var{simple} or @var{stderr} tracing backend.
Lluís23d15e82011-08-31 20:31:31 +02003285@item file=@var{file}
3286Log output traces to @var{file}.
3287
Stefan Weilc1ba4e02011-09-05 18:13:03 +02003288This option is only available if QEMU has been compiled with
3289the @var{simple} tracing backend.
Lluís23d15e82011-08-31 20:31:31 +02003290@end table
Prerna Saxenaab6540d2010-08-09 11:48:32 +01003291ETEXI
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003292
Markus Armbruster31e70d62013-02-13 19:49:37 +01003293HXCOMM Internal use
3294DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
3295DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
Anthony Liguoric7f0f3b2012-03-28 15:42:02 +02003296
Paul Moore0f669982012-08-03 14:39:21 -04003297#ifdef __linux__
3298DEF("enable-fips", 0, QEMU_OPTION_enablefips,
3299 "-enable-fips enable FIPS 140-2 compliance\n",
3300 QEMU_ARCH_ALL)
3301#endif
3302STEXI
3303@item -enable-fips
3304@findex -enable-fips
3305Enable FIPS 140-2 compliance mode.
3306ETEXI
3307
Jan Kiszkaa0dac022012-10-05 14:51:45 -03003308HXCOMM Deprecated by -machine accel=tcg property
Bruce Rogersc6e88b32012-11-20 07:11:21 -07003309DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
Jan Kiszkaa0dac022012-10-05 14:51:45 -03003310
Jan Kiszkac21fb4f2012-10-05 14:51:42 -03003311HXCOMM Deprecated by kvm-pit driver properties
Bruce Rogersc6e88b32012-11-20 07:11:21 -07003312DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
Jan Kiszkac21fb4f2012-10-05 14:51:42 -03003313 "", QEMU_ARCH_I386)
3314
Jan Kiszka4086bde2012-10-05 14:51:41 -03003315HXCOMM Deprecated (ignored)
Bruce Rogersc6e88b32012-11-20 07:11:21 -07003316DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
Jan Kiszka4086bde2012-10-05 14:51:41 -03003317
Jan Kiszkae43d5942012-10-05 14:51:40 -03003318HXCOMM Deprecated by -machine kernel_irqchip=on|off property
Bruce Rogersc6e88b32012-11-20 07:11:21 -07003319DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
Jan Kiszkae43d5942012-10-05 14:51:40 -03003320
Jan Kiszka88eed342012-10-05 14:51:44 -03003321HXCOMM Deprecated (ignored)
3322DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
3323
Anthony Liguori68d98d32012-06-25 14:36:33 -05003324DEF("object", HAS_ARG, QEMU_OPTION_object,
3325 "-object TYPENAME[,PROP1=VALUE1,...]\n"
3326 " create an new object of type TYPENAME setting properties\n"
3327 " in the order they are specified. Note that the 'id'\n"
3328 " property must be set. These objects are placed in the\n"
3329 " '/objects' path.\n",
3330 QEMU_ARCH_ALL)
Markus Armbruster6265c432013-02-13 19:49:39 +01003331STEXI
3332@item -object @var{typename}[,@var{prop1}=@var{value1},...]
3333@findex -object
3334Create an new object of type @var{typename} setting properties
3335in the order they are specified. Note that the 'id'
3336property must be set. These objects are placed in the
3337'/objects' path.
3338ETEXI
Anthony Liguori68d98d32012-06-25 14:36:33 -05003339
Seiji Aguchi5e2ac512013-07-03 23:02:46 -04003340DEF("msg", HAS_ARG, QEMU_OPTION_msg,
3341 "-msg timestamp[=on|off]\n"
3342 " change the format of messages\n"
3343 " on|off controls leading timestamps (default:on)\n",
3344 QEMU_ARCH_ALL)
3345STEXI
3346@item -msg timestamp[=on|off]
3347@findex -msg
3348prepend a timestamp to each log message.(default:on)
3349ETEXI
3350
Amit Shahabfd9ce2014-06-20 18:56:08 +05303351DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
3352 "-dump-vmstate <file>\n"
3353 " Output vmstate information in JSON format to file.\n"
3354 " Use the scripts/vmstate-static-checker.py file to\n"
3355 " check for possible regressions in migration code\n"
3356 " by comparing two such vmstate dumps.",
3357 QEMU_ARCH_ALL)
3358STEXI
3359@item -dump-vmstate @var{file}
3360@findex -dump-vmstate
3361Dump json-encoded vmstate information for current machine type to file
3362in @var{file}
3363ETEXI
3364
Stefan Weil3dbf2c72010-01-16 18:19:44 +01003365HXCOMM This is the last statement. Insert new options before this line!
3366STEXI
3367@end table
3368ETEXI