1HXCOMM Use DEFHEADING() to define headings in both help text and texi 2HXCOMM Text between STEXI and ETEXI are copied to texi version and 3HXCOMM discarded from C version 4HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to 5HXCOMM construct option structures, enums and help message for specified 6HXCOMM architectures. 7HXCOMM 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, 15 "-h or -help display this help and exit\n", QEMU_ARCH_ALL) 16STEXI 17@item -h 18@findex -h 19Display help and exit 20ETEXI 21 22DEF("version", 0, QEMU_OPTION_version, 23 "-version display version information and exit\n", QEMU_ARCH_ALL) 24STEXI 25@item -version 26@findex -version 27Display version information and exit 28ETEXI 29 30DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ 31 "-machine [type=]name[,prop[=value][,...]]\n" 32 " selects emulated machine ('-machine help' for list)\n" 33 " property accel=accel1[:accel2[:...]] selects accelerator\n" 34 " supported accelerators are kvm, xen, tcg (default: tcg)\n" 35 " kernel_irqchip=on|off controls accelerated irqchip support\n" 36 " kvm_shadow_mem=size of KVM shadow MMU\n" 37 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" 38 " mem-merge=on|off controls memory merge support (default: on)\n", 39 QEMU_ARCH_ALL) 40STEXI 41@item -machine [type=]@var{name}[,prop=@var{value}[,...]] 42@findex -machine 43Select the emulated machine by @var{name}. Use @code{-machine help} to list 44available machines. Supported machine properties are: 45@table @option 46@item accel=@var{accels1}[:@var{accels2}[:...]] 47This is used to enable an accelerator. Depending on the target architecture, 48kvm, xen, or tcg can be available. By default, tcg is used. If there is more 49than one accelerator specified, the next one is used if the previous one fails 50to initialize. 51@item kernel_irqchip=on|off 52Enables in-kernel irqchip support for the chosen accelerator when available. 53@item kvm_shadow_mem=size 54Defines the size of the KVM shadow MMU. 55@item dump-guest-core=on|off 56Include guest memory in a core dump. The default is on. 57@item mem-merge=on|off 58Enables or disables memory merge support. This feature, when supported by 59the host, de-duplicates identical memory pages among VMs instances 60(enabled by default). 61@end table 62ETEXI 63 64HXCOMM Deprecated by -machine 65DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL) 66 67DEF("cpu", HAS_ARG, QEMU_OPTION_cpu, 68 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL) 69STEXI 70@item -cpu @var{model} 71@findex -cpu 72Select CPU model (@code{-cpu help} for list and additional feature selection) 73ETEXI 74 75DEF("smp", HAS_ARG, QEMU_OPTION_smp, 76 "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n" 77 " set the number of CPUs to 'n' [default=1]\n" 78 " maxcpus= maximum number of total cpus, including\n" 79 " offline CPUs for hotplug, etc\n" 80 " cores= number of CPU cores on one socket\n" 81 " threads= number of threads on one CPU core\n" 82 " sockets= number of discrete sockets in the system\n", 83 QEMU_ARCH_ALL) 84STEXI 85@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}] 86@findex -smp 87Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255 88CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs 89to 4. 90For the PC target, the number of @var{cores} per socket, the number 91of @var{threads} per cores and the total number of @var{sockets} can be 92specified. Missing values will be computed. If any on the three values is 93given, the total number of CPUs @var{n} can be omitted. @var{maxcpus} 94specifies the maximum number of hotpluggable CPUs. 95ETEXI 96 97DEF("numa", HAS_ARG, QEMU_OPTION_numa, 98 "-numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node]\n" 99 "-numa node[,memdev=id][,cpus=cpu[-cpu]][,nodeid=node]\n", QEMU_ARCH_ALL) 100STEXI 101@item -numa node[,mem=@var{size}][,cpus=@var{cpu[-cpu]}][,nodeid=@var{node}] 102@item -numa node[,memdev=@var{id}][,cpus=@var{cpu[-cpu]}][,nodeid=@var{node}] 103@findex -numa 104Simulate a multi node NUMA system. If @samp{mem}, @samp{memdev} 105and @samp{cpus} are omitted, resources are split equally. Also, note 106that the -@option{numa} option doesn't allocate any of the specified 107resources. That is, it just assigns existing resources to NUMA nodes. This 108means that one still has to use the @option{-m}, @option{-smp} options 109to allocate RAM and VCPUs respectively, and possibly @option{-object} 110to specify the memory backend for the @samp{memdev} suboption. 111 112@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one 113node uses @samp{memdev}, all of them have to use it. 114ETEXI 115 116DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, 117 "-add-fd fd=fd,set=set[,opaque=opaque]\n" 118 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) 119STEXI 120@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}] 121@findex -add-fd 122 123Add a file descriptor to an fd set. Valid options are: 124 125@table @option 126@item fd=@var{fd} 127This option defines the file descriptor of which a duplicate is added to fd set. 128The file descriptor cannot be stdin, stdout, or stderr. 129@item set=@var{set} 130This option defines the ID of the fd set to add the file descriptor to. 131@item opaque=@var{opaque} 132This option defines a free-form string that can be used to describe @var{fd}. 133@end table 134 135You can open an image using pre-opened file descriptors from an fd set: 136@example 137qemu-system-i386 138-add-fd fd=3,set=2,opaque="rdwr:/path/to/file" 139-add-fd fd=4,set=2,opaque="rdonly:/path/to/file" 140-drive file=/dev/fdset/2,index=0,media=disk 141@end example 142ETEXI 143 144DEF("set", HAS_ARG, QEMU_OPTION_set, 145 "-set group.id.arg=value\n" 146 " set <arg> parameter for item <id> of type <group>\n" 147 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL) 148STEXI 149@item -set @var{group}.@var{id}.@var{arg}=@var{value} 150@findex -set 151Set parameter @var{arg} for item @var{id} of type @var{group}\n" 152ETEXI 153 154DEF("global", HAS_ARG, QEMU_OPTION_global, 155 "-global driver.prop=value\n" 156 " set a global default for a driver property\n", 157 QEMU_ARCH_ALL) 158STEXI 159@item -global @var{driver}.@var{prop}=@var{value} 160@findex -global 161Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.: 162 163@example 164qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk 165@end example 166 167In particular, you can use this to set driver properties for devices which are 168created automatically by the machine model. To create a device which is not 169created automatically and set properties on it, use -@option{device}. 170ETEXI 171 172DEF("boot", HAS_ARG, QEMU_OPTION_boot, 173 "-boot [order=drives][,once=drives][,menu=on|off]\n" 174 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n" 175 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n" 176 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n" 177 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n" 178 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n", 179 QEMU_ARCH_ALL) 180STEXI 181@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] 182@findex -boot 183Specify boot order @var{drives} as a string of drive letters. Valid 184drive letters depend on the target achitecture. The x86 PC uses: a, b 185(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot 186from network adapter 1-4), hard disk boot is the default. To apply a 187particular boot order only on the first startup, specify it via 188@option{once}. 189 190Interactive boot menus/prompts can be enabled via @option{menu=on} as far 191as firmware/BIOS supports them. The default is non-interactive boot. 192 193A splash picture could be passed to bios, enabling user to show it as logo, 194when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS 195supports them. Currently Seabios for X86 system support it. 196limitation: The splash file could be a jpeg file or a BMP file in 24 BPP 197format(true color). The resolution should be supported by the SVGA mode, so 198the recommended is 320x240, 640x480, 800x640. 199 200A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms 201when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not 202reboot, qemu passes '-1' to bios by default. Currently Seabios for X86 203system support it. 204 205Do strict boot via @option{strict=on} as far as firmware/BIOS 206supports it. This only effects when boot priority is changed by 207bootindex options. The default is non-strict boot. 208 209@example 210# try to boot from network first, then from hard disk 211qemu-system-i386 -boot order=nc 212# boot from CD-ROM first, switch back to default order after reboot 213qemu-system-i386 -boot once=d 214# boot with a splash picture for 5 seconds. 215qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000 216@end example 217 218Note: The legacy format '-boot @var{drives}' is still supported but its 219use is discouraged as it may be removed from future versions. 220ETEXI 221 222DEF("m", HAS_ARG, QEMU_OPTION_m, 223 "-m[emory] [size=]megs[,slots=n,maxmem=size]\n" 224 " configure guest RAM\n" 225 " size: initial amount of guest memory (default: " 226 stringify(DEFAULT_RAM_SIZE) "MiB)\n" 227 " slots: number of hotplug slots (default: none)\n" 228 " maxmem: maximum amount of guest memory (default: none)\n" 229 "NOTE: Some architectures might enforce a specific granularity\n", 230 QEMU_ARCH_ALL) 231STEXI 232@item -m [size=]@var{megs} 233@findex -m 234Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB. Optionally, 235a suffix of ``M'' or ``G'' can be used to signify a value in megabytes or 236gigabytes respectively. Optional pair @var{slots}, @var{maxmem} could be used 237to set amount of hotluggable memory slots and possible maximum amount of memory. 238ETEXI 239 240DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, 241 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL) 242STEXI 243@item -mem-path @var{path} 244@findex -mem-path 245Allocate guest RAM from a temporarily created file in @var{path}. 246ETEXI 247 248DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc, 249 "-mem-prealloc preallocate guest memory (use with -mem-path)\n", 250 QEMU_ARCH_ALL) 251STEXI 252@item -mem-prealloc 253@findex -mem-prealloc 254Preallocate memory when using -mem-path. 255ETEXI 256 257DEF("k", HAS_ARG, QEMU_OPTION_k, 258 "-k language use keyboard layout (for example 'fr' for French)\n", 259 QEMU_ARCH_ALL) 260STEXI 261@item -k @var{language} 262@findex -k 263Use keyboard layout @var{language} (for example @code{fr} for 264French). This option is only needed where it is not easy to get raw PC 265keycodes (e.g. on Macs, with some X11 servers or with a VNC 266display). You don't normally need to use it on PC/Linux or PC/Windows 267hosts. 268 269The available layouts are: 270@example 271ar de-ch es fo fr-ca hu ja mk no pt-br sv 272da en-gb et fr fr-ch is lt nl pl ru th 273de en-us fi fr-be hr it lv nl-be pt sl tr 274@end example 275 276The default is @code{en-us}. 277ETEXI 278 279 280DEF("audio-help", 0, QEMU_OPTION_audio_help, 281 "-audio-help print list of audio drivers and their options\n", 282 QEMU_ARCH_ALL) 283STEXI 284@item -audio-help 285@findex -audio-help 286Will show the audio subsystem help: list of drivers, tunable 287parameters. 288ETEXI 289 290DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw, 291 "-soundhw c1,... enable audio support\n" 292 " and only specified sound cards (comma separated list)\n" 293 " use '-soundhw help' to get the list of supported cards\n" 294 " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL) 295STEXI 296@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all 297@findex -soundhw 298Enable audio and selected sound hardware. Use 'help' to print all 299available sound hardware. 300 301@example 302qemu-system-i386 -soundhw sb16,adlib disk.img 303qemu-system-i386 -soundhw es1370 disk.img 304qemu-system-i386 -soundhw ac97 disk.img 305qemu-system-i386 -soundhw hda disk.img 306qemu-system-i386 -soundhw all disk.img 307qemu-system-i386 -soundhw help 308@end example 309 310Note that Linux's i810_audio OSS kernel (for AC97) module might 311require manually specifying clocking. 312 313@example 314modprobe i810_audio clocking=48000 315@end example 316ETEXI 317 318DEF("balloon", HAS_ARG, QEMU_OPTION_balloon, 319 "-balloon none disable balloon device\n" 320 "-balloon virtio[,addr=str]\n" 321 " enable virtio balloon device (default)\n", QEMU_ARCH_ALL) 322STEXI 323@item -balloon none 324@findex -balloon 325Disable balloon device. 326@item -balloon virtio[,addr=@var{addr}] 327Enable virtio balloon device (default), optionally with PCI address 328@var{addr}. 329ETEXI 330 331DEF("device", HAS_ARG, QEMU_OPTION_device, 332 "-device driver[,prop[=value][,...]]\n" 333 " add device (based on driver)\n" 334 " prop=value,... sets driver properties\n" 335 " use '-device help' to print all possible drivers\n" 336 " use '-device driver,help' to print all possible properties\n", 337 QEMU_ARCH_ALL) 338STEXI 339@item -device @var{driver}[,@var{prop}[=@var{value}][,...]] 340@findex -device 341Add device @var{driver}. @var{prop}=@var{value} sets driver 342properties. Valid properties depend on the driver. To get help on 343possible drivers and properties, use @code{-device help} and 344@code{-device @var{driver},help}. 345ETEXI 346 347DEF("name", HAS_ARG, QEMU_OPTION_name, 348 "-name string1[,process=string2][,debug-threads=on|off]\n" 349 " set the name of the guest\n" 350 " string1 sets the window title and string2 the process name (on Linux)\n" 351 " When debug-threads is enabled, individual threads are given a separate name (on Linux)\n" 352 " NOTE: The thread names are for debugging and not a stable API.\n", 353 QEMU_ARCH_ALL) 354STEXI 355@item -name @var{name} 356@findex -name 357Sets the @var{name} of the guest. 358This name will be displayed in the SDL window caption. 359The @var{name} will also be used for the VNC server. 360Also optionally set the top visible process name in Linux. 361Naming of individual threads can also be enabled on Linux to aid debugging. 362ETEXI 363 364DEF("uuid", HAS_ARG, QEMU_OPTION_uuid, 365 "-uuid %08x-%04x-%04x-%04x-%012x\n" 366 " specify machine UUID\n", QEMU_ARCH_ALL) 367STEXI 368@item -uuid @var{uuid} 369@findex -uuid 370Set system UUID. 371ETEXI 372 373STEXI 374@end table 375ETEXI 376DEFHEADING() 377 378DEFHEADING(Block device options:) 379STEXI 380@table @option 381ETEXI 382 383DEF("fda", HAS_ARG, QEMU_OPTION_fda, 384 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL) 385DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL) 386STEXI 387@item -fda @var{file} 388@item -fdb @var{file} 389@findex -fda 390@findex -fdb 391Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can 392use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}). 393ETEXI 394 395DEF("hda", HAS_ARG, QEMU_OPTION_hda, 396 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL) 397DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL) 398DEF("hdc", HAS_ARG, QEMU_OPTION_hdc, 399 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL) 400DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL) 401STEXI 402@item -hda @var{file} 403@item -hdb @var{file} 404@item -hdc @var{file} 405@item -hdd @var{file} 406@findex -hda 407@findex -hdb 408@findex -hdc 409@findex -hdd 410Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}). 411ETEXI 412 413DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom, 414 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n", 415 QEMU_ARCH_ALL) 416STEXI 417@item -cdrom @var{file} 418@findex -cdrom 419Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and 420@option{-cdrom} at the same time). You can use the host CD-ROM by 421using @file{/dev/cdrom} as filename (@pxref{host_drives}). 422ETEXI 423 424DEF("drive", HAS_ARG, QEMU_OPTION_drive, 425 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" 426 " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" 427 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" 428 " [,serial=s][,addr=A][,rerror=ignore|stop|report]\n" 429 " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n" 430 " [,readonly=on|off][,copy-on-read=on|off]\n" 431 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" 432 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" 433 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" 434 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" 435 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" 436 " [[,iops_size=is]]\n" 437 " use 'file' as a drive image\n", QEMU_ARCH_ALL) 438STEXI 439@item -drive @var{option}[,@var{option}[,@var{option}[,...]]] 440@findex -drive 441 442Define a new drive. Valid options are: 443 444@table @option 445@item file=@var{file} 446This option defines which disk image (@pxref{disk_images}) to use with 447this drive. If the filename contains comma, you must double it 448(for instance, "file=my,,file" to use file "my,file"). 449 450Special files such as iSCSI devices can be specified using protocol 451specific URLs. See the section for "Device URL Syntax" for more information. 452@item if=@var{interface} 453This option defines on which type on interface the drive is connected. 454Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio. 455@item bus=@var{bus},unit=@var{unit} 456These options define where is connected the drive by defining the bus number and 457the unit id. 458@item index=@var{index} 459This option defines where is connected the drive by using an index in the list 460of available connectors of a given interface type. 461@item media=@var{media} 462This option defines the type of the media: disk or cdrom. 463@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}] 464These options have the same definition as they have in @option{-hdachs}. 465@item snapshot=@var{snapshot} 466@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive 467(see @option{-snapshot}). 468@item cache=@var{cache} 469@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data. 470@item aio=@var{aio} 471@var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO. 472@item discard=@var{discard} 473@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. 474@item format=@var{format} 475Specify which disk @var{format} will be used rather than detecting 476the format. Can be used to specifiy format=raw to avoid interpreting 477an untrusted format header. 478@item serial=@var{serial} 479This option specifies the serial number to assign to the device. 480@item addr=@var{addr} 481Specify the controller's PCI address (if=virtio only). 482@item werror=@var{action},rerror=@var{action} 483Specify which @var{action} to take on write and read errors. Valid actions are: 484"ignore" (ignore the error and try to continue), "stop" (pause QEMU), 485"report" (report the error to the guest), "enospc" (pause QEMU only if the 486host disk is full; report the error to the guest otherwise). 487The default setting is @option{werror=enospc} and @option{rerror=report}. 488@item readonly 489Open drive @option{file} as read-only. Guest write attempts will fail. 490@item copy-on-read=@var{copy-on-read} 491@var{copy-on-read} is "on" or "off" and enables whether to copy read backing 492file sectors into the image file. 493@item detect-zeroes=@var{detect-zeroes} 494@var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic 495conversion of plain zero writes by the OS to driver specific optimized 496zero write commands. You may even choose "unmap" if @var{discard} is set 497to "unmap" to allow a zero write to be converted to an UNMAP operation. 498@end table 499 500By default, the @option{cache=writeback} mode is used. It will report data 501writes as completed as soon as the data is present in the host page cache. 502This is safe as long as your guest OS makes sure to correctly flush disk caches 503where needed. If your guest OS does not handle volatile disk write caches 504correctly and your host crashes or loses power, then the guest may experience 505data corruption. 506 507For such guests, you should consider using @option{cache=writethrough}. This 508means that the host page cache will be used to read and write data, but write 509notification will be sent to the guest only after QEMU has made sure to flush 510each write to the disk. Be aware that this has a major impact on performance. 511 512The host page cache can be avoided entirely with @option{cache=none}. This will 513attempt to do disk IO directly to the guest's memory. QEMU may still perform 514an internal copy of the data. Note that this is considered a writeback mode and 515the guest OS must handle the disk write cache correctly in order to avoid data 516corruption on host crashes. 517 518The host page cache can be avoided while only sending write notifications to 519the guest when the data has been flushed to the disk using 520@option{cache=directsync}. 521 522In case you don't care about data integrity over host failures, use 523@option{cache=unsafe}. This option tells QEMU that it never needs to write any 524data to the disk but can instead keep things in cache. If anything goes wrong, 525like your host losing power, the disk storage getting disconnected accidentally, 526etc. your image will most probably be rendered unusable. When using 527the @option{-snapshot} option, unsafe caching is always used. 528 529Copy-on-read avoids accessing the same backing file sectors repeatedly and is 530useful when the backing file is over a slow network. By default copy-on-read 531is off. 532 533Instead of @option{-cdrom} you can use: 534@example 535qemu-system-i386 -drive file=file,index=2,media=cdrom 536@end example 537 538Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can 539use: 540@example 541qemu-system-i386 -drive file=file,index=0,media=disk 542qemu-system-i386 -drive file=file,index=1,media=disk 543qemu-system-i386 -drive file=file,index=2,media=disk 544qemu-system-i386 -drive file=file,index=3,media=disk 545@end example 546 547You can open an image using pre-opened file descriptors from an fd set: 548@example 549qemu-system-i386 550-add-fd fd=3,set=2,opaque="rdwr:/path/to/file" 551-add-fd fd=4,set=2,opaque="rdonly:/path/to/file" 552-drive file=/dev/fdset/2,index=0,media=disk 553@end example 554 555You can connect a CDROM to the slave of ide0: 556@example 557qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom 558@end example 559 560If you don't specify the "file=" argument, you define an empty drive: 561@example 562qemu-system-i386 -drive if=ide,index=1,media=cdrom 563@end example 564 565You can connect a SCSI disk with unit ID 6 on the bus #0: 566@example 567qemu-system-i386 -drive file=file,if=scsi,bus=0,unit=6 568@end example 569 570Instead of @option{-fda}, @option{-fdb}, you can use: 571@example 572qemu-system-i386 -drive file=file,index=0,if=floppy 573qemu-system-i386 -drive file=file,index=1,if=floppy 574@end example 575 576By default, @var{interface} is "ide" and @var{index} is automatically 577incremented: 578@example 579qemu-system-i386 -drive file=a -drive file=b" 580@end example 581is interpreted like: 582@example 583qemu-system-i386 -hda a -hdb b 584@end example 585ETEXI 586 587DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock, 588 "-mtdblock file use 'file' as on-board Flash memory image\n", 589 QEMU_ARCH_ALL) 590STEXI 591@item -mtdblock @var{file} 592@findex -mtdblock 593Use @var{file} as on-board Flash memory image. 594ETEXI 595 596DEF("sd", HAS_ARG, QEMU_OPTION_sd, 597 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL) 598STEXI 599@item -sd @var{file} 600@findex -sd 601Use @var{file} as SecureDigital card image. 602ETEXI 603 604DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, 605 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) 606STEXI 607@item -pflash @var{file} 608@findex -pflash 609Use @var{file} as a parallel flash image. 610ETEXI 611 612DEF("snapshot", 0, QEMU_OPTION_snapshot, 613 "-snapshot write to temporary files instead of disk image files\n", 614 QEMU_ARCH_ALL) 615STEXI 616@item -snapshot 617@findex -snapshot 618Write to temporary files instead of disk image files. In this case, 619the raw disk image you use is not written back. You can however force 620the write back by pressing @key{C-a s} (@pxref{disk_images}). 621ETEXI 622 623DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \ 624 "-hdachs c,h,s[,t]\n" \ 625 " force hard disk 0 physical geometry and the optional BIOS\n" \ 626 " translation (t=none or lba) (usually QEMU can guess them)\n", 627 QEMU_ARCH_ALL) 628STEXI 629@item -hdachs @var{c},@var{h},@var{s},[,@var{t}] 630@findex -hdachs 631Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <= 632@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS 633translation mode (@var{t}=none, lba or auto). Usually QEMU can guess 634all those parameters. This option is useful for old MS-DOS disk 635images. 636ETEXI 637 638DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, 639 "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n" 640 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n", 641 QEMU_ARCH_ALL) 642 643STEXI 644 645@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}] 646@findex -fsdev 647Define a new file system device. Valid options are: 648@table @option 649@item @var{fsdriver} 650This option specifies the fs driver backend to use. 651Currently "local", "handle" and "proxy" file system drivers are supported. 652@item id=@var{id} 653Specifies identifier for this device 654@item path=@var{path} 655Specifies the export path for the file system device. Files under 656this path will be available to the 9p client on the guest. 657@item security_model=@var{security_model} 658Specifies the security model to be used for this export path. 659Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none". 660In "passthrough" security model, files are stored using the same 661credentials as they are created on the guest. This requires QEMU 662to run as root. In "mapped-xattr" security model, some of the file 663attributes like uid, gid, mode bits and link target are stored as 664file attributes. For "mapped-file" these attributes are stored in the 665hidden .virtfs_metadata directory. Directories exported by this security model cannot 666interact with other unix tools. "none" security model is same as 667passthrough except the sever won't report failures if it fails to 668set file attributes like ownership. Security model is mandatory 669only for local fsdriver. Other fsdrivers (like handle, proxy) don't take 670security model as a parameter. 671@item writeout=@var{writeout} 672This is an optional argument. The only supported value is "immediate". 673This means that host page cache will be used to read and write data but 674write notification will be sent to the guest only when the data has been 675reported as written by the storage subsystem. 676@item readonly 677Enables exporting 9p share as a readonly mount for guests. By default 678read-write access is given. 679@item socket=@var{socket} 680Enables proxy filesystem driver to use passed socket file for communicating 681with virtfs-proxy-helper 682@item sock_fd=@var{sock_fd} 683Enables proxy filesystem driver to use passed socket descriptor for 684communicating with virtfs-proxy-helper. Usually a helper like libvirt 685will create socketpair and pass one of the fds as sock_fd 686@end table 687 688-fsdev option is used along with -device driver "virtio-9p-pci". 689@item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag} 690Options for virtio-9p-pci driver are: 691@table @option 692@item fsdev=@var{id} 693Specifies the id value specified along with -fsdev option 694@item mount_tag=@var{mount_tag} 695Specifies the tag name to be used by the guest to mount this export point 696@end table 697 698ETEXI 699 700DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, 701 "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n" 702 " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n", 703 QEMU_ARCH_ALL) 704 705STEXI 706 707@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}] 708@findex -virtfs 709 710The general form of a Virtual File system pass-through options are: 711@table @option 712@item @var{fsdriver} 713This option specifies the fs driver backend to use. 714Currently "local", "handle" and "proxy" file system drivers are supported. 715@item id=@var{id} 716Specifies identifier for this device 717@item path=@var{path} 718Specifies the export path for the file system device. Files under 719this path will be available to the 9p client on the guest. 720@item security_model=@var{security_model} 721Specifies the security model to be used for this export path. 722Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none". 723In "passthrough" security model, files are stored using the same 724credentials as they are created on the guest. This requires QEMU 725to run as root. In "mapped-xattr" security model, some of the file 726attributes like uid, gid, mode bits and link target are stored as 727file attributes. For "mapped-file" these attributes are stored in the 728hidden .virtfs_metadata directory. Directories exported by this security model cannot 729interact with other unix tools. "none" security model is same as 730passthrough except the sever won't report failures if it fails to 731set file attributes like ownership. Security model is mandatory only 732for local fsdriver. Other fsdrivers (like handle, proxy) don't take security 733model as a parameter. 734@item writeout=@var{writeout} 735This is an optional argument. The only supported value is "immediate". 736This means that host page cache will be used to read and write data but 737write notification will be sent to the guest only when the data has been 738reported as written by the storage subsystem. 739@item readonly 740Enables exporting 9p share as a readonly mount for guests. By default 741read-write access is given. 742@item socket=@var{socket} 743Enables proxy filesystem driver to use passed socket file for 744communicating with virtfs-proxy-helper. Usually a helper like libvirt 745will create socketpair and pass one of the fds as sock_fd 746@item sock_fd 747Enables proxy filesystem driver to use passed 'sock_fd' as the socket 748descriptor for interfacing with virtfs-proxy-helper 749@end table 750ETEXI 751 752DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth, 753 "-virtfs_synth Create synthetic file system image\n", 754 QEMU_ARCH_ALL) 755STEXI 756@item -virtfs_synth 757@findex -virtfs_synth 758Create synthetic file system image 759ETEXI 760 761STEXI 762@end table 763ETEXI 764DEFHEADING() 765 766DEFHEADING(USB options:) 767STEXI 768@table @option 769ETEXI 770 771DEF("usb", 0, QEMU_OPTION_usb, 772 "-usb enable the USB driver (will be the default soon)\n", 773 QEMU_ARCH_ALL) 774STEXI 775@item -usb 776@findex -usb 777Enable the USB driver (will be the default soon) 778ETEXI 779 780DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice, 781 "-usbdevice name add the host or guest USB device 'name'\n", 782 QEMU_ARCH_ALL) 783STEXI 784 785@item -usbdevice @var{devname} 786@findex -usbdevice 787Add the USB device @var{devname}. @xref{usb_devices}. 788 789@table @option 790 791@item mouse 792Virtual Mouse. This will override the PS/2 mouse emulation when activated. 793 794@item tablet 795Pointer device that uses absolute coordinates (like a touchscreen). This 796means QEMU is able to report the mouse position without having to grab the 797mouse. Also overrides the PS/2 mouse emulation when activated. 798 799@item disk:[format=@var{format}]:@var{file} 800Mass storage device based on file. The optional @var{format} argument 801will be used rather than detecting the format. Can be used to specifiy 802@code{format=raw} to avoid interpreting an untrusted format header. 803 804@item host:@var{bus}.@var{addr} 805Pass through the host device identified by @var{bus}.@var{addr} (Linux only). 806 807@item host:@var{vendor_id}:@var{product_id} 808Pass through the host device identified by @var{vendor_id}:@var{product_id} 809(Linux only). 810 811@item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev} 812Serial converter to host character device @var{dev}, see @code{-serial} for the 813available devices. 814 815@item braille 816Braille device. This will use BrlAPI to display the braille output on a real 817or fake device. 818 819@item net:@var{options} 820Network adapter that supports CDC ethernet and RNDIS protocols. 821 822@end table 823ETEXI 824 825STEXI 826@end table 827ETEXI 828DEFHEADING() 829 830DEFHEADING(Display options:) 831STEXI 832@table @option 833ETEXI 834 835DEF("display", HAS_ARG, QEMU_OPTION_display, 836 "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n" 837 " [,window_close=on|off]|curses|none|\n" 838 " gtk[,grab_on_hover=on|off]|\n" 839 " vnc=<display>[,<optargs>]\n" 840 " select display type\n", QEMU_ARCH_ALL) 841STEXI 842@item -display @var{type} 843@findex -display 844Select type of display to use. This option is a replacement for the 845old style -sdl/-curses/... options. Valid values for @var{type} are 846@table @option 847@item sdl 848Display video output via SDL (usually in a separate graphics 849window; see the SDL documentation for other possibilities). 850@item curses 851Display video output via curses. For graphics device models which 852support a text mode, QEMU can display this output using a 853curses/ncurses interface. Nothing is displayed when the graphics 854device is in graphical mode or if the graphics device does not support 855a text mode. Generally only the VGA device models support text mode. 856@item none 857Do not display video output. The guest will still see an emulated 858graphics card, but its output will not be displayed to the QEMU 859user. This option differs from the -nographic option in that it 860only affects what is done with video output; -nographic also changes 861the destination of the serial and parallel port data. 862@item gtk 863Display video output in a GTK window. This interface provides drop-down 864menus and other UI elements to configure and control the VM during 865runtime. 866@item vnc 867Start a VNC server on display <arg> 868@end table 869ETEXI 870 871DEF("nographic", 0, QEMU_OPTION_nographic, 872 "-nographic disable graphical output and redirect serial I/Os to console\n", 873 QEMU_ARCH_ALL) 874STEXI 875@item -nographic 876@findex -nographic 877Normally, QEMU uses SDL to display the VGA output. With this option, 878you can totally disable graphical output so that QEMU is a simple 879command line application. The emulated serial port is redirected on 880the console and muxed with the monitor (unless redirected elsewhere 881explicitly). Therefore, you can still use QEMU to debug a Linux kernel 882with a serial console. Use @key{C-a h} for help on switching between 883the console and monitor. 884ETEXI 885 886DEF("curses", 0, QEMU_OPTION_curses, 887 "-curses use a curses/ncurses interface instead of SDL\n", 888 QEMU_ARCH_ALL) 889STEXI 890@item -curses 891@findex -curses 892Normally, QEMU uses SDL to display the VGA output. With this option, 893QEMU can display the VGA output when in text mode using a 894curses/ncurses interface. Nothing is displayed in graphical mode. 895ETEXI 896 897DEF("no-frame", 0, QEMU_OPTION_no_frame, 898 "-no-frame open SDL window without a frame and window decorations\n", 899 QEMU_ARCH_ALL) 900STEXI 901@item -no-frame 902@findex -no-frame 903Do not use decorations for SDL windows and start them using the whole 904available screen space. This makes the using QEMU in a dedicated desktop 905workspace more convenient. 906ETEXI 907 908DEF("alt-grab", 0, QEMU_OPTION_alt_grab, 909 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n", 910 QEMU_ARCH_ALL) 911STEXI 912@item -alt-grab 913@findex -alt-grab 914Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also 915affects the special keys (for fullscreen, monitor-mode switching, etc). 916ETEXI 917 918DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, 919 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n", 920 QEMU_ARCH_ALL) 921STEXI 922@item -ctrl-grab 923@findex -ctrl-grab 924Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also 925affects the special keys (for fullscreen, monitor-mode switching, etc). 926ETEXI 927 928DEF("no-quit", 0, QEMU_OPTION_no_quit, 929 "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL) 930STEXI 931@item -no-quit 932@findex -no-quit 933Disable SDL window close capability. 934ETEXI 935 936DEF("sdl", 0, QEMU_OPTION_sdl, 937 "-sdl enable SDL\n", QEMU_ARCH_ALL) 938STEXI 939@item -sdl 940@findex -sdl 941Enable SDL. 942ETEXI 943 944DEF("spice", HAS_ARG, QEMU_OPTION_spice, 945 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n" 946 " [,x509-key-file=<file>][,x509-key-password=<file>]\n" 947 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n" 948 " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6]\n" 949 " [,tls-ciphers=<list>]\n" 950 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" 951 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" 952 " [,sasl][,password=<secret>][,disable-ticketing]\n" 953 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" 954 " [,jpeg-wan-compression=[auto|never|always]]\n" 955 " [,zlib-glz-wan-compression=[auto|never|always]]\n" 956 " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n" 957 " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n" 958 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" 959 " enable spice\n" 960 " at least one of {port, tls-port} is mandatory\n", 961 QEMU_ARCH_ALL) 962STEXI 963@item -spice @var{option}[,@var{option}[,...]] 964@findex -spice 965Enable the spice remote desktop protocol. Valid options are 966 967@table @option 968 969@item port=<nr> 970Set the TCP port spice is listening on for plaintext channels. 971 972@item addr=<addr> 973Set the IP address spice is listening on. Default is any address. 974 975@item ipv4 976@item ipv6 977Force using the specified IP version. 978 979@item password=<secret> 980Set the password you need to authenticate. 981 982@item sasl 983Require that the client use SASL to authenticate with the spice. 984The exact choice of authentication method used is controlled from the 985system / user's SASL configuration file for the 'qemu' service. This 986is typically found in /etc/sasl2/qemu.conf. If running QEMU as an 987unprivileged user, an environment variable SASL_CONF_PATH can be used 988to make it search alternate locations for the service config. 989While some SASL auth methods can also provide data encryption (eg GSSAPI), 990it is recommended that SASL always be combined with the 'tls' and 991'x509' settings to enable use of SSL and server certificates. This 992ensures a data encryption preventing compromise of authentication 993credentials. 994 995@item disable-ticketing 996Allow client connects without authentication. 997 998@item disable-copy-paste 999Disable copy paste between the client and the guest. 1000 1001@item disable-agent-file-xfer 1002Disable spice-vdagent based file-xfer between the client and the guest. 1003 1004@item tls-port=<nr> 1005Set the TCP port spice is listening on for encrypted channels. 1006 1007@item x509-dir=<dir> 1008Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir 1009 1010@item x509-key-file=<file> 1011@item x509-key-password=<file> 1012@item x509-cert-file=<file> 1013@item x509-cacert-file=<file> 1014@item x509-dh-key-file=<file> 1015The x509 file names can also be configured individually. 1016 1017@item tls-ciphers=<list> 1018Specify which ciphers to use. 1019 1020@item tls-channel=[main|display|cursor|inputs|record|playback] 1021@item plaintext-channel=[main|display|cursor|inputs|record|playback] 1022Force specific channel to be used with or without TLS encryption. The 1023options can be specified multiple times to configure multiple 1024channels. The special name "default" can be used to set the default 1025mode. For channels which are not explicitly forced into one mode the 1026spice client is allowed to pick tls/plaintext as he pleases. 1027 1028@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off] 1029Configure image compression (lossless). 1030Default is auto_glz. 1031 1032@item jpeg-wan-compression=[auto|never|always] 1033@item zlib-glz-wan-compression=[auto|never|always] 1034Configure wan image compression (lossy for slow links). 1035Default is auto. 1036 1037@item streaming-video=[off|all|filter] 1038Configure video stream detection. Default is filter. 1039 1040@item agent-mouse=[on|off] 1041Enable/disable passing mouse events via vdagent. Default is on. 1042 1043@item playback-compression=[on|off] 1044Enable/disable audio stream compression (using celt 0.5.1). Default is on. 1045 1046@item seamless-migration=[on|off] 1047Enable/disable spice seamless migration. Default is off. 1048 1049@end table 1050ETEXI 1051 1052DEF("portrait", 0, QEMU_OPTION_portrait, 1053 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", 1054 QEMU_ARCH_ALL) 1055STEXI 1056@item -portrait 1057@findex -portrait 1058Rotate graphical output 90 deg left (only PXA LCD). 1059ETEXI 1060 1061DEF("rotate", HAS_ARG, QEMU_OPTION_rotate, 1062 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n", 1063 QEMU_ARCH_ALL) 1064STEXI 1065@item -rotate @var{deg} 1066@findex -rotate 1067Rotate graphical output some deg left (only PXA LCD). 1068ETEXI 1069 1070DEF("vga", HAS_ARG, QEMU_OPTION_vga, 1071 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|none]\n" 1072 " select video card type\n", QEMU_ARCH_ALL) 1073STEXI 1074@item -vga @var{type} 1075@findex -vga 1076Select type of VGA card to emulate. Valid values for @var{type} are 1077@table @option 1078@item cirrus 1079Cirrus Logic GD5446 Video card. All Windows versions starting from 1080Windows 95 should recognize and use this graphic card. For optimal 1081performances, use 16 bit color depth in the guest and the host OS. 1082(This one is the default) 1083@item std 1084Standard VGA card with Bochs VBE extensions. If your guest OS 1085supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want 1086to use high resolution modes (>= 1280x1024x16) then you should use 1087this option. 1088@item vmware 1089VMWare SVGA-II compatible adapter. Use it if you have sufficiently 1090recent XFree86/XOrg server or Windows guest with a driver for this 1091card. 1092@item qxl 1093QXL paravirtual graphic card. It is VGA compatible (including VESA 10942.0 VBE support). Works best with qxl guest drivers installed though. 1095Recommended choice when using the spice protocol. 1096@item tcx 1097(sun4m only) Sun TCX framebuffer. This is the default framebuffer for 1098sun4m machines and offers both 8-bit and 24-bit colour depths at a 1099fixed resolution of 1024x768. 1100@item cg3 1101(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer 1102for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP) 1103resolutions aimed at people wishing to run older Solaris versions. 1104@item none 1105Disable VGA card. 1106@end table 1107ETEXI 1108 1109DEF("full-screen", 0, QEMU_OPTION_full_screen, 1110 "-full-screen start in full screen\n", QEMU_ARCH_ALL) 1111STEXI 1112@item -full-screen 1113@findex -full-screen 1114Start in full screen. 1115ETEXI 1116 1117DEF("g", 1, QEMU_OPTION_g , 1118 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", 1119 QEMU_ARCH_PPC | QEMU_ARCH_SPARC) 1120STEXI 1121@item -g @var{width}x@var{height}[x@var{depth}] 1122@findex -g 1123Set the initial graphical resolution and depth (PPC, SPARC only). 1124ETEXI 1125 1126DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , 1127 "-vnc display start a VNC server on display\n", QEMU_ARCH_ALL) 1128STEXI 1129@item -vnc @var{display}[,@var{option}[,@var{option}[,...]]] 1130@findex -vnc 1131Normally, QEMU uses SDL to display the VGA output. With this option, 1132you can have QEMU listen on VNC display @var{display} and redirect the VGA 1133display over the VNC session. It is very useful to enable the usb 1134tablet device when using this option (option @option{-usbdevice 1135tablet}). When using the VNC display, you must use the @option{-k} 1136parameter to set the keyboard layout if you are not using en-us. Valid 1137syntax for the @var{display} is 1138 1139@table @option 1140 1141@item @var{host}:@var{d} 1142 1143TCP connections will only be allowed from @var{host} on display @var{d}. 1144By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can 1145be omitted in which case the server will accept connections from any host. 1146 1147@item unix:@var{path} 1148 1149Connections will be allowed over UNIX domain sockets where @var{path} is the 1150location of a unix socket to listen for connections on. 1151 1152@item none 1153 1154VNC is initialized but not started. The monitor @code{change} command 1155can be used to later start the VNC server. 1156 1157@end table 1158 1159Following the @var{display} value there may be one or more @var{option} flags 1160separated by commas. Valid options are 1161 1162@table @option 1163 1164@item reverse 1165 1166Connect to a listening VNC client via a ``reverse'' connection. The 1167client is specified by the @var{display}. For reverse network 1168connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument 1169is a TCP port number, not a display number. 1170 1171@item websocket 1172 1173Opens an additional TCP listening port dedicated to VNC Websocket connections. 1174By definition the Websocket port is 5700+@var{display}. If @var{host} is 1175specified connections will only be allowed from this host. 1176As an alternative the Websocket port could be specified by using 1177@code{websocket}=@var{port}. 1178TLS encryption for the Websocket connection is supported if the required 1179certificates are specified with the VNC option @option{x509}. 1180 1181@item password 1182 1183Require that password based authentication is used for client connections. 1184 1185The password must be set separately using the @code{set_password} command in 1186the @ref{pcsys_monitor}. The syntax to change your password is: 1187@code{set_password <protocol> <password>} where <protocol> could be either 1188"vnc" or "spice". 1189 1190If you would like to change <protocol> password expiration, you should use 1191@code{expire_password <protocol> <expiration-time>} where expiration time could 1192be one of the following options: now, never, +seconds or UNIX time of 1193expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800 1194to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this 1195date and time). 1196 1197You can also use keywords "now" or "never" for the expiration time to 1198allow <protocol> password to expire immediately or never expire. 1199 1200@item tls 1201 1202Require that client use TLS when communicating with the VNC server. This 1203uses anonymous TLS credentials so is susceptible to a man-in-the-middle 1204attack. It is recommended that this option be combined with either the 1205@option{x509} or @option{x509verify} options. 1206 1207@item x509=@var{/path/to/certificate/dir} 1208 1209Valid if @option{tls} is specified. Require that x509 credentials are used 1210for negotiating the TLS session. The server will send its x509 certificate 1211to the client. It is recommended that a password be set on the VNC server 1212to provide authentication of the client when this is used. The path following 1213this option specifies where the x509 certificates are to be loaded from. 1214See the @ref{vnc_security} section for details on generating certificates. 1215 1216@item x509verify=@var{/path/to/certificate/dir} 1217 1218Valid if @option{tls} is specified. Require that x509 credentials are used 1219for negotiating the TLS session. The server will send its x509 certificate 1220to the client, and request that the client send its own x509 certificate. 1221The server will validate the client's certificate against the CA certificate, 1222and reject clients when validation fails. If the certificate authority is 1223trusted, this is a sufficient authentication mechanism. You may still wish 1224to set a password on the VNC server as a second authentication layer. The 1225path following this option specifies where the x509 certificates are to 1226be loaded from. See the @ref{vnc_security} section for details on generating 1227certificates. 1228 1229@item sasl 1230 1231Require that the client use SASL to authenticate with the VNC server. 1232The exact choice of authentication method used is controlled from the 1233system / user's SASL configuration file for the 'qemu' service. This 1234is typically found in /etc/sasl2/qemu.conf. If running QEMU as an 1235unprivileged user, an environment variable SASL_CONF_PATH can be used 1236to make it search alternate locations for the service config. 1237While some SASL auth methods can also provide data encryption (eg GSSAPI), 1238it is recommended that SASL always be combined with the 'tls' and 1239'x509' settings to enable use of SSL and server certificates. This 1240ensures a data encryption preventing compromise of authentication 1241credentials. See the @ref{vnc_security} section for details on using 1242SASL authentication. 1243 1244@item acl 1245 1246Turn on access control lists for checking of the x509 client certificate 1247and SASL party. For x509 certs, the ACL check is made against the 1248certificate's distinguished name. This is something that looks like 1249@code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is 1250made against the username, which depending on the SASL plugin, may 1251include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}. 1252When the @option{acl} flag is set, the initial access list will be 1253empty, with a @code{deny} policy. Thus no one will be allowed to 1254use the VNC server until the ACLs have been loaded. This can be 1255achieved using the @code{acl} monitor command. 1256 1257@item lossy 1258 1259Enable lossy compression methods (gradient, JPEG, ...). If this 1260option is set, VNC client may receive lossy framebuffer updates 1261depending on its encoding settings. Enabling this option can save 1262a lot of bandwidth at the expense of quality. 1263 1264@item non-adaptive 1265 1266Disable adaptive encodings. Adaptive encodings are enabled by default. 1267An adaptive encoding will try to detect frequently updated screen regions, 1268and send updates in these regions using a lossy encoding (like JPEG). 1269This can be really helpful to save bandwidth when playing videos. Disabling 1270adaptive encodings restores the original static behavior of encodings 1271like Tight. 1272 1273@item share=[allow-exclusive|force-shared|ignore] 1274 1275Set display sharing policy. 'allow-exclusive' allows clients to ask 1276for exclusive access. As suggested by the rfb spec this is 1277implemented by dropping other connections. Connecting multiple 1278clients in parallel requires all clients asking for a shared session 1279(vncviewer: -shared switch). This is the default. 'force-shared' 1280disables exclusive client access. Useful for shared desktop sessions, 1281where you don't want someone forgetting specify -shared disconnect 1282everybody else. 'ignore' completely ignores the shared flag and 1283allows everybody connect unconditionally. Doesn't conform to the rfb 1284spec but is traditional QEMU behavior. 1285 1286@end table 1287ETEXI 1288 1289STEXI 1290@end table 1291ETEXI 1292ARCHHEADING(, QEMU_ARCH_I386) 1293 1294ARCHHEADING(i386 target only:, QEMU_ARCH_I386) 1295STEXI 1296@table @option 1297ETEXI 1298 1299DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack, 1300 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n", 1301 QEMU_ARCH_I386) 1302STEXI 1303@item -win2k-hack 1304@findex -win2k-hack 1305Use it when installing Windows 2000 to avoid a disk full bug. After 1306Windows 2000 is installed, you no longer need this option (this option 1307slows down the IDE transfers). 1308ETEXI 1309 1310HXCOMM Deprecated by -rtc 1311DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386) 1312 1313DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, 1314 "-no-fd-bootchk disable boot signature checking for floppy disks\n", 1315 QEMU_ARCH_I386) 1316STEXI 1317@item -no-fd-bootchk 1318@findex -no-fd-bootchk 1319Disable boot signature checking for floppy disks in BIOS. May 1320be needed to boot from old floppy disks. 1321ETEXI 1322 1323DEF("no-acpi", 0, QEMU_OPTION_no_acpi, 1324 "-no-acpi disable ACPI\n", QEMU_ARCH_I386) 1325STEXI 1326@item -no-acpi 1327@findex -no-acpi 1328Disable ACPI (Advanced Configuration and Power Interface) support. Use 1329it if your guest OS complains about ACPI problems (PC target machine 1330only). 1331ETEXI 1332 1333DEF("no-hpet", 0, QEMU_OPTION_no_hpet, 1334 "-no-hpet disable HPET\n", QEMU_ARCH_I386) 1335STEXI 1336@item -no-hpet 1337@findex -no-hpet 1338Disable HPET support. 1339ETEXI 1340 1341DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, 1342 "-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" 1343 " ACPI table description\n", QEMU_ARCH_I386) 1344STEXI 1345@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}]...] 1346@findex -acpitable 1347Add ACPI table with specified header fields and context from specified files. 1348For file=, take whole ACPI table from the specified files, including all 1349ACPI headers (possible overridden by other options). 1350For data=, only data 1351portion of the table is used, all header information is specified in the 1352command line. 1353ETEXI 1354 1355DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, 1356 "-smbios file=binary\n" 1357 " load SMBIOS entry from binary file\n" 1358 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]\n" 1359 " specify SMBIOS type 0 fields\n" 1360 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 1361 " [,uuid=uuid][,sku=str][,family=str]\n" 1362 " specify SMBIOS type 1 fields\n", QEMU_ARCH_I386) 1363STEXI 1364@item -smbios file=@var{binary} 1365@findex -smbios 1366Load SMBIOS entry from binary file. 1367 1368@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off] 1369Specify SMBIOS type 0 fields 1370 1371@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}] 1372Specify SMBIOS type 1 fields 1373ETEXI 1374 1375STEXI 1376@end table 1377ETEXI 1378DEFHEADING() 1379 1380DEFHEADING(Network options:) 1381STEXI 1382@table @option 1383ETEXI 1384 1385HXCOMM Legacy slirp options (now moved to -net user): 1386#ifdef CONFIG_SLIRP 1387DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL) 1388DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL) 1389DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL) 1390#ifndef _WIN32 1391DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL) 1392#endif 1393#endif 1394 1395DEF("net", HAS_ARG, QEMU_OPTION_net, 1396 "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" 1397 " create a new Network Interface Card and connect it to VLAN 'n'\n" 1398#ifdef CONFIG_SLIRP 1399 "-net user[,vlan=n][,name=str][,net=addr[/mask]][,host=addr][,restrict=on|off]\n" 1400 " [,hostname=host][,dhcpstart=addr][,dns=addr][,dnssearch=domain][,tftp=dir]\n" 1401 " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]" 1402#ifndef _WIN32 1403 "[,smb=dir[,smbserver=addr]]\n" 1404#endif 1405 " connect the user mode network stack to VLAN 'n', configure its\n" 1406 " DHCP server and enabled optional services\n" 1407#endif 1408#ifdef _WIN32 1409 "-net tap[,vlan=n][,name=str],ifname=name\n" 1410 " connect the host TAP network interface to VLAN 'n'\n" 1411#else 1412 "-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" 1413 " connect the host TAP network interface to VLAN 'n'\n" 1414 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" 1415 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" 1416 " to deconfigure it\n" 1417 " use '[down]script=no' to disable script execution\n" 1418 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" 1419 " configure it\n" 1420 " use 'fd=h' to connect to an already opened TAP interface\n" 1421 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" 1422 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n" 1423 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n" 1424 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" 1425 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" 1426 " use vhost=on to enable experimental in kernel accelerator\n" 1427 " (only has effect for virtio guests which use MSIX)\n" 1428 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n" 1429 " use 'vhostfd=h' to connect to an already opened vhost net device\n" 1430 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" 1431 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" 1432 "-net bridge[,vlan=n][,name=str][,br=bridge][,helper=helper]\n" 1433 " connects a host TAP network interface to a host bridge device 'br'\n" 1434 " (default=" DEFAULT_BRIDGE_INTERFACE ") using the program 'helper'\n" 1435 " (default=" DEFAULT_BRIDGE_HELPER ")\n" 1436#endif 1437#ifdef __linux__ 1438 "-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" 1439 " connect the VLAN to an Ethernet over L2TPv3 pseudowire\n" 1440 " Linux kernel 3.3+ as well as most routers can talk\n" 1441 " L2TPv3. This transport allows connecting a VM to a VM,\n" 1442 " VM to a router and even VM to Host. It is a nearly-universal\n" 1443 " standard (RFC3391). Note - this implementation uses static\n" 1444 " pre-configured tunnels (same as the Linux kernel).\n" 1445 " use 'src=' to specify source address\n" 1446 " use 'dst=' to specify destination address\n" 1447 " use 'udp=on' to specify udp encapsulation\n" 1448 " use 'srcport=' to specify source udp port\n" 1449 " use 'dstport=' to specify destination udp port\n" 1450 " use 'ipv6=on' to force v6\n" 1451 " L2TPv3 uses cookies to prevent misconfiguration as\n" 1452 " well as a weak security measure\n" 1453 " use 'rxcookie=0x012345678' to specify a rxcookie\n" 1454 " use 'txcookie=0x012345678' to specify a txcookie\n" 1455 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n" 1456 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n" 1457 " use 'pincounter=on' to work around broken counter handling in peer\n" 1458 " use 'offset=X' to add an extra offset between header and data\n" 1459#endif 1460 "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" 1461 " connect the vlan 'n' to another VLAN using a socket connection\n" 1462 "-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" 1463 " connect the vlan 'n' to multicast maddr and port\n" 1464 " use 'localaddr=addr' to specify the host address to send packets from\n" 1465 "-net socket[,vlan=n][,name=str][,fd=h][,udp=host:port][,localaddr=host:port]\n" 1466 " connect the vlan 'n' to another VLAN using an UDP tunnel\n" 1467#ifdef CONFIG_VDE 1468 "-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" 1469 " connect the vlan 'n' to port 'n' of a vde switch running\n" 1470 " on host and listening for incoming connections on 'socketpath'.\n" 1471 " Use group 'groupname' and mode 'octalmode' to change default\n" 1472 " ownership and permissions for communication port.\n" 1473#endif 1474#ifdef CONFIG_NETMAP 1475 "-net netmap,ifname=name[,devname=nmname]\n" 1476 " attach to the existing netmap-enabled network interface 'name', or to a\n" 1477 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" 1478 " netmap device, defaults to '/dev/netmap')\n" 1479#endif 1480 "-net dump[,vlan=n][,file=f][,len=n]\n" 1481 " dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n" 1482 "-net none use it alone to have zero network devices. If no -net option\n" 1483 " is provided, the default is '-net nic -net user'\n", QEMU_ARCH_ALL) 1484DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, 1485 "-netdev [" 1486#ifdef CONFIG_SLIRP 1487 "user|" 1488#endif 1489 "tap|" 1490 "bridge|" 1491#ifdef CONFIG_VDE 1492 "vde|" 1493#endif 1494#ifdef CONFIG_NETMAP 1495 "netmap|" 1496#endif 1497 "vhost-user|" 1498 "socket|" 1499 "hubport],id=str[,option][,option][,...]\n", QEMU_ARCH_ALL) 1500STEXI 1501@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}] 1502@findex -net 1503Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n} 1504= 0 is the default). The NIC is an e1000 by default on the PC 1505target. Optionally, the MAC address can be changed to @var{mac}, the 1506device address set to @var{addr} (PCI cards only), 1507and a @var{name} can be assigned for use in monitor commands. 1508Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors 1509that the card should have; this option currently only affects virtio cards; set 1510@var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single 1511NIC is created. QEMU can emulate several different models of network card. 1512Valid values for @var{type} are 1513@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er}, 1514@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139}, 1515@code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}. 1516Not all devices are supported on all targets. Use @code{-net nic,model=help} 1517for a list of available devices for your target. 1518 1519@item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...] 1520@findex -netdev 1521@item -net user[,@var{option}][,@var{option}][,...] 1522Use the user mode network stack which requires no administrator 1523privilege to run. Valid options are: 1524 1525@table @option 1526@item vlan=@var{n} 1527Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default). 1528 1529@item id=@var{id} 1530@item name=@var{name} 1531Assign symbolic name for use in monitor commands. 1532 1533@item net=@var{addr}[/@var{mask}] 1534Set IP network address the guest will see. Optionally specify the netmask, 1535either in the form a.b.c.d or as number of valid top-most bits. Default is 153610.0.2.0/24. 1537 1538@item host=@var{addr} 1539Specify the guest-visible address of the host. Default is the 2nd IP in the 1540guest network, i.e. x.x.x.2. 1541 1542@item restrict=on|off 1543If this option is enabled, the guest will be isolated, i.e. it will not be 1544able to contact the host and no guest IP packets will be routed over the host 1545to the outside. This option does not affect any explicitly set forwarding rules. 1546 1547@item hostname=@var{name} 1548Specifies the client hostname reported by the built-in DHCP server. 1549 1550@item dhcpstart=@var{addr} 1551Specify the first of the 16 IPs the built-in DHCP server can assign. Default 1552is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31. 1553 1554@item dns=@var{addr} 1555Specify the guest-visible address of the virtual nameserver. The address must 1556be different from the host address. Default is the 3rd IP in the guest network, 1557i.e. x.x.x.3. 1558 1559@item dnssearch=@var{domain} 1560Provides an entry for the domain-search list sent by the built-in 1561DHCP server. More than one domain suffix can be transmitted by specifying 1562this option multiple times. If supported, this will cause the guest to 1563automatically try to append the given domain suffix(es) in case a domain name 1564can not be resolved. 1565 1566Example: 1567@example 1568qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...] 1569@end example 1570 1571@item tftp=@var{dir} 1572When using the user mode network stack, activate a built-in TFTP 1573server. The files in @var{dir} will be exposed as the root of a TFTP server. 1574The TFTP client on the guest must be configured in binary mode (use the command 1575@code{bin} of the Unix TFTP client). 1576 1577@item bootfile=@var{file} 1578When using the user mode network stack, broadcast @var{file} as the BOOTP 1579filename. In conjunction with @option{tftp}, this can be used to network boot 1580a guest from a local directory. 1581 1582Example (using pxelinux): 1583@example 1584qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 1585@end example 1586 1587@item smb=@var{dir}[,smbserver=@var{addr}] 1588When using the user mode network stack, activate a built-in SMB 1589server so that Windows OSes can access to the host files in @file{@var{dir}} 1590transparently. The IP address of the SMB server can be set to @var{addr}. By 1591default the 4th IP in the guest network is used, i.e. x.x.x.4. 1592 1593In the guest Windows OS, the line: 1594@example 159510.0.2.4 smbserver 1596@end example 1597must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me) 1598or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). 1599 1600Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}. 1601 1602Note that a SAMBA server must be installed on the host OS. 1603QEMU was tested successfully with smbd versions from Red Hat 9, 1604Fedora Core 3 and OpenSUSE 11.x. 1605 1606@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport} 1607Redirect incoming TCP or UDP connections to the host port @var{hostport} to 1608the guest IP address @var{guestaddr} on guest port @var{guestport}. If 1609@var{guestaddr} is not specified, its value is x.x.x.15 (default first address 1610given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can 1611be bound to a specific host interface. If no connection type is set, TCP is 1612used. This option can be given multiple times. 1613 1614For example, to redirect host X11 connection from screen 1 to guest 1615screen 0, use the following: 1616 1617@example 1618# on the host 1619qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...] 1620# this host xterm should open in the guest X11 server 1621xterm -display :1 1622@end example 1623 1624To redirect telnet connections from host port 5555 to telnet port on 1625the guest, use the following: 1626 1627@example 1628# on the host 1629qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...] 1630telnet localhost 5555 1631@end example 1632 1633Then when you use on the host @code{telnet localhost 5555}, you 1634connect to the guest telnet server. 1635 1636@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev} 1637@item guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command} 1638Forward guest TCP connections to the IP address @var{server} on port @var{port} 1639to the character device @var{dev} or to a program executed by @var{cmd:command} 1640which gets spawned for each connection. This option can be given multiple times. 1641 1642You can either use a chardev directly and have that one used throughout QEMU's 1643lifetime, like in the following example: 1644 1645@example 1646# open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever 1647# the guest accesses it 1648qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...] 1649@end example 1650 1651Or you can execute a command on every TCP connection established by the guest, 1652so that QEMU behaves similar to an inetd process for that virtual server: 1653 1654@example 1655# call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 1656# and connect the TCP stream to its stdin/stdout 1657qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' 1658@end example 1659 1660@end table 1661 1662Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still 1663processed and applied to -net user. Mixing them with the new configuration 1664syntax gives undefined results. Their use for new applications is discouraged 1665as they will be removed from future versions. 1666 1667@item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,helper=@var{helper}] 1668@item -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,helper=@var{helper}] 1669Connect the host TAP network interface @var{name} to VLAN @var{n}. 1670 1671Use the network script @var{file} to configure it and the network script 1672@var{dfile} to deconfigure it. If @var{name} is not provided, the OS 1673automatically provides one. The default network configure script is 1674@file{/etc/qemu-ifup} and the default network deconfigure script is 1675@file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no} 1676to disable script execution. 1677 1678If running QEMU as an unprivileged user, use the network helper 1679@var{helper} to configure the TAP interface. The default network 1680helper executable is @file{/path/to/qemu-bridge-helper}. 1681 1682@option{fd}=@var{h} can be used to specify the handle of an already 1683opened host TAP interface. 1684 1685Examples: 1686 1687@example 1688#launch a QEMU instance with the default network script 1689qemu-system-i386 linux.img -net nic -net tap 1690@end example 1691 1692@example 1693#launch a QEMU instance with two NICs, each one connected 1694#to a TAP device 1695qemu-system-i386 linux.img \ 1696 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ 1697 -net nic,vlan=1 -net tap,vlan=1,ifname=tap1 1698@end example 1699 1700@example 1701#launch a QEMU instance with the default network helper to 1702#connect a TAP device to bridge br0 1703qemu-system-i386 linux.img \ 1704 -net nic -net tap,"helper=/path/to/qemu-bridge-helper" 1705@end example 1706 1707@item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}] 1708@item -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}] 1709Connect a host TAP network interface to a host bridge device. 1710 1711Use the network helper @var{helper} to configure the TAP interface and 1712attach it to the bridge. The default network helper executable is 1713@file{/path/to/qemu-bridge-helper} and the default bridge 1714device is @file{br0}. 1715 1716Examples: 1717 1718@example 1719#launch a QEMU instance with the default network helper to 1720#connect a TAP device to bridge br0 1721qemu-system-i386 linux.img -net bridge -net nic,model=virtio 1722@end example 1723 1724@example 1725#launch a QEMU instance with the default network helper to 1726#connect a TAP device to bridge qemubr0 1727qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio 1728@end example 1729 1730@item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] 1731@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] 1732 1733Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual 1734machine using a TCP socket connection. If @option{listen} is 1735specified, QEMU waits for incoming connections on @var{port} 1736(@var{host} is optional). @option{connect} is used to connect to 1737another QEMU instance using the @option{listen} option. @option{fd}=@var{h} 1738specifies an already opened TCP socket. 1739 1740Example: 1741@example 1742# launch a first QEMU instance 1743qemu-system-i386 linux.img \ 1744 -net nic,macaddr=52:54:00:12:34:56 \ 1745 -net socket,listen=:1234 1746# connect the VLAN 0 of this instance to the VLAN 0 1747# of the first instance 1748qemu-system-i386 linux.img \ 1749 -net nic,macaddr=52:54:00:12:34:57 \ 1750 -net socket,connect=127.0.0.1:1234 1751@end example 1752 1753@item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]] 1754@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]] 1755 1756Create a VLAN @var{n} shared with another QEMU virtual 1757machines using a UDP multicast socket, effectively making a bus for 1758every QEMU with same multicast address @var{maddr} and @var{port}. 1759NOTES: 1760@enumerate 1761@item 1762Several QEMU can be running on different hosts and share same bus (assuming 1763correct multicast setup for these hosts). 1764@item 1765mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see 1766@url{http://user-mode-linux.sf.net}. 1767@item 1768Use @option{fd=h} to specify an already opened UDP multicast socket. 1769@end enumerate 1770 1771Example: 1772@example 1773# launch one QEMU instance 1774qemu-system-i386 linux.img \ 1775 -net nic,macaddr=52:54:00:12:34:56 \ 1776 -net socket,mcast=230.0.0.1:1234 1777# launch another QEMU instance on same "bus" 1778qemu-system-i386 linux.img \ 1779 -net nic,macaddr=52:54:00:12:34:57 \ 1780 -net socket,mcast=230.0.0.1:1234 1781# launch yet another QEMU instance on same "bus" 1782qemu-system-i386 linux.img \ 1783 -net nic,macaddr=52:54:00:12:34:58 \ 1784 -net socket,mcast=230.0.0.1:1234 1785@end example 1786 1787Example (User Mode Linux compat.): 1788@example 1789# launch QEMU instance (note mcast address selected 1790# is UML's default) 1791qemu-system-i386 linux.img \ 1792 -net nic,macaddr=52:54:00:12:34:56 \ 1793 -net socket,mcast=239.192.168.1:1102 1794# launch UML 1795/path/to/linux ubd0=/path/to/root_fs eth0=mcast 1796@end example 1797 1798Example (send packets from host's 1.2.3.4): 1799@example 1800qemu-system-i386 linux.img \ 1801 -net nic,macaddr=52:54:00:12:34:56 \ 1802 -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4 1803@end example 1804 1805@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}] 1806@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}] 1807Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular 1808protocol to transport Ethernet (and other Layer 2) data frames between 1809two systems. It is present in routers, firewalls and the Linux kernel 1810(from version 3.3 onwards). 1811 1812This transport allows a VM to communicate to another VM, router or firewall directly. 1813 1814@item src=@var{srcaddr} 1815 source address (mandatory) 1816@item dst=@var{dstaddr} 1817 destination address (mandatory) 1818@item udp 1819 select udp encapsulation (default is ip). 1820@item srcport=@var{srcport} 1821 source udp port. 1822@item dstport=@var{dstport} 1823 destination udp port. 1824@item ipv6 1825 force v6, otherwise defaults to v4. 1826@item rxcookie=@var{rxcookie} 1827@item txcookie=@var{txcookie} 1828 Cookies are a weak form of security in the l2tpv3 specification. 1829Their function is mostly to prevent misconfiguration. By default they are 32 1830bit. 1831@item cookie64 1832 Set cookie size to 64 bit instead of the default 32 1833@item counter=off 1834 Force a 'cut-down' L2TPv3 with no counter as in 1835draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 1836@item pincounter=on 1837 Work around broken counter handling in peer. This may also help on 1838networks which have packet reorder. 1839@item offset=@var{offset} 1840 Add an extra offset between header and data 1841 1842For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan 1843on the remote Linux host 1.2.3.4: 1844@example 1845# Setup tunnel on linux host using raw ip as encapsulation 1846# on 1.2.3.4 1847ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \ 1848 encap udp udp_sport 16384 udp_dport 16384 1849ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \ 1850 0xFFFFFFFF peer_session_id 0xFFFFFFFF 1851ifconfig vmtunnel0 mtu 1500 1852ifconfig vmtunnel0 up 1853brctl addif br-lan vmtunnel0 1854 1855 1856# on 4.3.2.1 1857# launch QEMU instance - if your network has reorder or is very lossy add ,pincounter 1858 1859qemu-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 1860 1861 1862@end example 1863 1864@item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] 1865@item -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] 1866Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and 1867listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname} 1868and MODE @var{octalmode} to change default ownership and permissions for 1869communication port. This option is only available if QEMU has been compiled 1870with vde support enabled. 1871 1872Example: 1873@example 1874# launch vde switch 1875vde_switch -F -sock /tmp/myswitch 1876# launch QEMU instance 1877qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch 1878@end example 1879 1880@item -netdev hubport,id=@var{id},hubid=@var{hubid} 1881 1882Create a hub port on QEMU "vlan" @var{hubid}. 1883 1884The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single 1885netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the 1886required hub automatically. 1887 1888@item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off] 1889 1890Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should 1891be a unix domain socket backed one. The vhost-user uses a specifically defined 1892protocol to pass vhost ioctl replacement messages to an application on the other 1893end of the socket. On non-MSIX guests, the feature can be forced with 1894@var{vhostforce}. 1895 1896Example: 1897@example 1898qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ 1899 -numa node,memdev=mem \ 1900 -chardev socket,path=/path/to/socket \ 1901 -netdev type=vhost-user,id=net0,chardev=chr0 \ 1902 -device virtio-net-pci,netdev=net0 1903@end example 1904 1905@item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}] 1906Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default). 1907At most @var{len} bytes (64k by default) per packet are stored. The file format is 1908libpcap, so it can be analyzed with tools such as tcpdump or Wireshark. 1909 1910@item -net none 1911Indicate that no network devices should be configured. It is used to 1912override the default configuration (@option{-net nic -net user}) which 1913is activated if no @option{-net} options are provided. 1914ETEXI 1915 1916STEXI 1917@end table 1918ETEXI 1919DEFHEADING() 1920 1921DEFHEADING(Character device options:) 1922STEXI 1923 1924The general form of a character device option is: 1925@table @option 1926ETEXI 1927 1928DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, 1929 "-chardev null,id=id[,mux=on|off]\n" 1930 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay]\n" 1931 " [,server][,nowait][,telnet][,mux=on|off] (tcp)\n" 1932 "-chardev socket,id=id,path=path[,server][,nowait][,telnet],[mux=on|off] (unix)\n" 1933 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" 1934 " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n" 1935 "-chardev msmouse,id=id[,mux=on|off]\n" 1936 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n" 1937 " [,mux=on|off]\n" 1938 "-chardev ringbuf,id=id[,size=size]\n" 1939 "-chardev file,id=id,path=path[,mux=on|off]\n" 1940 "-chardev pipe,id=id,path=path[,mux=on|off]\n" 1941#ifdef _WIN32 1942 "-chardev console,id=id[,mux=on|off]\n" 1943 "-chardev serial,id=id,path=path[,mux=on|off]\n" 1944#else 1945 "-chardev pty,id=id[,mux=on|off]\n" 1946 "-chardev stdio,id=id[,mux=on|off][,signal=on|off]\n" 1947#endif 1948#ifdef CONFIG_BRLAPI 1949 "-chardev braille,id=id[,mux=on|off]\n" 1950#endif 1951#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ 1952 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 1953 "-chardev serial,id=id,path=path[,mux=on|off]\n" 1954 "-chardev tty,id=id,path=path[,mux=on|off]\n" 1955#endif 1956#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) 1957 "-chardev parallel,id=id,path=path[,mux=on|off]\n" 1958 "-chardev parport,id=id,path=path[,mux=on|off]\n" 1959#endif 1960#if defined(CONFIG_SPICE) 1961 "-chardev spicevmc,id=id,name=name[,debug=debug]\n" 1962 "-chardev spiceport,id=id,name=name[,debug=debug]\n" 1963#endif 1964 , QEMU_ARCH_ALL 1965) 1966 1967STEXI 1968@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}] 1969@findex -chardev 1970Backend is one of: 1971@option{null}, 1972@option{socket}, 1973@option{udp}, 1974@option{msmouse}, 1975@option{vc}, 1976@option{ringbuf}, 1977@option{file}, 1978@option{pipe}, 1979@option{console}, 1980@option{serial}, 1981@option{pty}, 1982@option{stdio}, 1983@option{braille}, 1984@option{tty}, 1985@option{parallel}, 1986@option{parport}, 1987@option{spicevmc}. 1988@option{spiceport}. 1989The specific backend will determine the applicable options. 1990 1991All devices must have an id, which can be any string up to 127 characters long. 1992It is used to uniquely identify this device in other command line directives. 1993 1994A character device may be used in multiplexing mode by multiple front-ends. 1995The key sequence of @key{Control-a} and @key{c} will rotate the input focus 1996between attached front-ends. Specify @option{mux=on} to enable this mode. 1997 1998Options to each backend are described below. 1999 2000@item -chardev null ,id=@var{id} 2001A void device. This device will not emit any data, and will drop any data it 2002receives. The null backend does not take any options. 2003 2004@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] 2005 2006Create a two-way stream socket, which can be either a TCP or a unix socket. A 2007unix socket will be created if @option{path} is specified. Behaviour is 2008undefined if TCP options are specified for a unix socket. 2009 2010@option{server} specifies that the socket shall be a listening socket. 2011 2012@option{nowait} specifies that QEMU should not block waiting for a client to 2013connect to a listening socket. 2014 2015@option{telnet} specifies that traffic on the socket should interpret telnet 2016escape sequences. 2017 2018TCP and unix socket options are given below: 2019 2020@table @option 2021 2022@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay] 2023 2024@option{host} for a listening socket specifies the local address to be bound. 2025For a connecting socket species the remote host to connect to. @option{host} is 2026optional for listening sockets. If not specified it defaults to @code{0.0.0.0}. 2027 2028@option{port} for a listening socket specifies the local port to be bound. For a 2029connecting socket specifies the port on the remote host to connect to. 2030@option{port} can be given as either a port number or a service name. 2031@option{port} is required. 2032 2033@option{to} is only relevant to listening sockets. If it is specified, and 2034@option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up 2035to and including @option{to} until it succeeds. @option{to} must be specified 2036as a port number. 2037 2038@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. 2039If neither is specified the socket may use either protocol. 2040 2041@option{nodelay} disables the Nagle algorithm. 2042 2043@item unix options: path=@var{path} 2044 2045@option{path} specifies the local path of the unix socket. @option{path} is 2046required. 2047 2048@end table 2049 2050@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6] 2051 2052Sends all traffic from the guest to a remote host over UDP. 2053 2054@option{host} specifies the remote host to connect to. If not specified it 2055defaults to @code{localhost}. 2056 2057@option{port} specifies the port on the remote host to connect to. @option{port} 2058is required. 2059 2060@option{localaddr} specifies the local address to bind to. If not specified it 2061defaults to @code{0.0.0.0}. 2062 2063@option{localport} specifies the local port to bind to. If not specified any 2064available local port will be used. 2065 2066@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. 2067If neither is specified the device may use either protocol. 2068 2069@item -chardev msmouse ,id=@var{id} 2070 2071Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not 2072take any options. 2073 2074@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]] 2075 2076Connect to a QEMU text console. @option{vc} may optionally be given a specific 2077size. 2078 2079@option{width} and @option{height} specify the width and height respectively of 2080the console, in pixels. 2081 2082@option{cols} and @option{rows} specify that the console be sized to fit a text 2083console with the given dimensions. 2084 2085@item -chardev ringbuf ,id=@var{id} [,size=@var{size}] 2086 2087Create a ring buffer with fixed size @option{size}. 2088@var{size} must be a power of two, and defaults to @code{64K}). 2089 2090@item -chardev file ,id=@var{id} ,path=@var{path} 2091 2092Log all traffic received from the guest to a file. 2093 2094@option{path} specifies the path of the file to be opened. This file will be 2095created if it does not already exist, and overwritten if it does. @option{path} 2096is required. 2097 2098@item -chardev pipe ,id=@var{id} ,path=@var{path} 2099 2100Create a two-way connection to the guest. The behaviour differs slightly between 2101Windows hosts and other hosts: 2102 2103On Windows, a single duplex pipe will be created at 2104@file{\\.pipe\@option{path}}. 2105 2106On other hosts, 2 pipes will be created called @file{@option{path}.in} and 2107@file{@option{path}.out}. Data written to @file{@option{path}.in} will be 2108received by the guest. Data written by the guest can be read from 2109@file{@option{path}.out}. QEMU will not create these fifos, and requires them to 2110be present. 2111 2112@option{path} forms part of the pipe path as described above. @option{path} is 2113required. 2114 2115@item -chardev console ,id=@var{id} 2116 2117Send traffic from the guest to QEMU's standard output. @option{console} does not 2118take any options. 2119 2120@option{console} is only available on Windows hosts. 2121 2122@item -chardev serial ,id=@var{id} ,path=@option{path} 2123 2124Send traffic from the guest to a serial device on the host. 2125 2126On Unix hosts serial will actually accept any tty device, 2127not only serial lines. 2128 2129@option{path} specifies the name of the serial device to open. 2130 2131@item -chardev pty ,id=@var{id} 2132 2133Create a new pseudo-terminal on the host and connect to it. @option{pty} does 2134not take any options. 2135 2136@option{pty} is not available on Windows hosts. 2137 2138@item -chardev stdio ,id=@var{id} [,signal=on|off] 2139Connect to standard input and standard output of the QEMU process. 2140 2141@option{signal} controls if signals are enabled on the terminal, that includes 2142exiting QEMU with the key sequence @key{Control-c}. This option is enabled by 2143default, use @option{signal=off} to disable it. 2144 2145@option{stdio} is not available on Windows hosts. 2146 2147@item -chardev braille ,id=@var{id} 2148 2149Connect to a local BrlAPI server. @option{braille} does not take any options. 2150 2151@item -chardev tty ,id=@var{id} ,path=@var{path} 2152 2153@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and 2154DragonFlyBSD hosts. It is an alias for @option{serial}. 2155 2156@option{path} specifies the path to the tty. @option{path} is required. 2157 2158@item -chardev parallel ,id=@var{id} ,path=@var{path} 2159@item -chardev parport ,id=@var{id} ,path=@var{path} 2160 2161@option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts. 2162 2163Connect to a local parallel port. 2164 2165@option{path} specifies the path to the parallel port device. @option{path} is 2166required. 2167 2168@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name} 2169 2170@option{spicevmc} is only available when spice support is built in. 2171 2172@option{debug} debug level for spicevmc 2173 2174@option{name} name of spice channel to connect to 2175 2176Connect to a spice virtual machine channel, such as vdiport. 2177 2178@item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name} 2179 2180@option{spiceport} is only available when spice support is built in. 2181 2182@option{debug} debug level for spicevmc 2183 2184@option{name} name of spice port to connect to 2185 2186Connect to a spice port, allowing a Spice client to handle the traffic 2187identified by a name (preferably a fqdn). 2188ETEXI 2189 2190STEXI 2191@end table 2192ETEXI 2193DEFHEADING() 2194 2195DEFHEADING(Device URL Syntax:) 2196STEXI 2197 2198In addition to using normal file images for the emulated storage devices, 2199QEMU can also use networked resources such as iSCSI devices. These are 2200specified using a special URL syntax. 2201 2202@table @option 2203@item iSCSI 2204iSCSI support allows QEMU to access iSCSI resources directly and use as 2205images for the guest storage. Both disk and cdrom images are supported. 2206 2207Syntax for specifying iSCSI LUNs is 2208``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>'' 2209 2210By default qemu will use the iSCSI initiator-name 2211'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command 2212line or a configuration file. 2213 2214 2215Example (without authentication): 2216@example 2217qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \ 2218 -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \ 2219 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1 2220@end example 2221 2222Example (CHAP username/password via URL): 2223@example 2224qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1 2225@end example 2226 2227Example (CHAP username/password via environment variables): 2228@example 2229LIBISCSI_CHAP_USERNAME="user" \ 2230LIBISCSI_CHAP_PASSWORD="password" \ 2231qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1 2232@end example 2233 2234iSCSI support is an optional feature of QEMU and only available when 2235compiled and linked against libiscsi. 2236ETEXI 2237DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi, 2238 "-iscsi [user=user][,password=password]\n" 2239 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n" 2240 " [,initiator-name=initiator-iqn][,id=target-iqn]\n" 2241 " iSCSI session parameters\n", QEMU_ARCH_ALL) 2242STEXI 2243 2244iSCSI parameters such as username and password can also be specified via 2245a configuration file. See qemu-doc for more information and examples. 2246 2247@item NBD 2248QEMU supports NBD (Network Block Devices) both using TCP protocol as well 2249as Unix Domain Sockets. 2250 2251Syntax for specifying a NBD device using TCP 2252``nbd:<server-ip>:<port>[:exportname=<export>]'' 2253 2254Syntax for specifying a NBD device using Unix Domain Sockets 2255``nbd:unix:<domain-socket>[:exportname=<export>]'' 2256 2257 2258Example for TCP 2259@example 2260qemu-system-i386 --drive file=nbd:192.0.2.1:30000 2261@end example 2262 2263Example for Unix Domain Sockets 2264@example 2265qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket 2266@end example 2267 2268@item SSH 2269QEMU supports SSH (Secure Shell) access to remote disks. 2270 2271Examples: 2272@example 2273qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img 2274qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img 2275@end example 2276 2277Currently authentication must be done using ssh-agent. Other 2278authentication methods may be supported in future. 2279 2280@item Sheepdog 2281Sheepdog is a distributed storage system for QEMU. 2282QEMU supports using either local sheepdog devices or remote networked 2283devices. 2284 2285Syntax for specifying a sheepdog device 2286@example 2287sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag] 2288@end example 2289 2290Example 2291@example 2292qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine 2293@end example 2294 2295See also @url{http://http://www.osrg.net/sheepdog/}. 2296 2297@item GlusterFS 2298GlusterFS is an user space distributed file system. 2299QEMU supports the use of GlusterFS volumes for hosting VM disk images using 2300TCP, Unix Domain Sockets and RDMA transport protocols. 2301 2302Syntax for specifying a VM disk image on GlusterFS volume is 2303@example 2304gluster[+transport]://[server[:port]]/volname/image[?socket=...] 2305@end example 2306 2307 2308Example 2309@example 2310qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img 2311@end example 2312 2313See also @url{http://www.gluster.org}. 2314 2315@item HTTP/HTTPS/FTP/FTPS/TFTP 2316QEMU supports read-only access to files accessed over http(s), ftp(s) and tftp. 2317 2318Syntax using a single filename: 2319@example 2320<protocol>://[<username>[:<password>]@@]<host>/<path> 2321@end example 2322 2323where: 2324@table @option 2325@item protocol 2326'http', 'https', 'ftp', 'ftps', or 'tftp'. 2327 2328@item username 2329Optional username for authentication to the remote server. 2330 2331@item password 2332Optional password for authentication to the remote server. 2333 2334@item host 2335Address of the remote server. 2336 2337@item path 2338Path on the remote server, including any query string. 2339@end table 2340 2341The following options are also supported: 2342@table @option 2343@item url 2344The full URL when passing options to the driver explicitly. 2345 2346@item readahead 2347The amount of data to read ahead with each range request to the remote server. 2348This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it 2349does not have a suffix, it will be assumed to be in bytes. The value must be a 2350multiple of 512 bytes. It defaults to 256k. 2351 2352@item sslverify 2353Whether to verify the remote server's certificate when connecting over SSL. It 2354can have the value 'on' or 'off'. It defaults to 'on'. 2355 2356@item cookie 2357Send this cookie (it can also be a list of cookies separated by ';') with 2358each outgoing request. Only supported when using protocols such as HTTP 2359which support cookies, otherwise ignored. 2360 2361@item timeout 2362Set the timeout in seconds of the CURL connection. This timeout is the time 2363that CURL waits for a response from the remote server to get the size of the 2364image to be downloaded. If not set, the default timeout of 5 seconds is used. 2365@end table 2366 2367Note that when passing options to qemu explicitly, @option{driver} is the value 2368of <protocol>. 2369 2370Example: boot from a remote Fedora 20 live ISO image 2371@example 2372qemu-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 2373 2374qemu-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 2375@end example 2376 2377Example: boot from a remote Fedora 20 cloud image using a local overlay for 2378writes, copy-on-read, and a readahead of 64k 2379@example 2380qemu-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 2381 2382qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on 2383@end example 2384 2385Example: boot from an image stored on a VMware vSphere server with a self-signed 2386certificate using a local overlay for writes, a readahead of 64k and a timeout 2387of 10 seconds. 2388@example 2389qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2 2390 2391qemu-system-x86_64 -drive file=/tmp/test.qcow2 2392@end example 2393ETEXI 2394 2395STEXI 2396@end table 2397ETEXI 2398 2399DEFHEADING(Bluetooth(R) options:) 2400STEXI 2401@table @option 2402ETEXI 2403 2404DEF("bt", HAS_ARG, QEMU_OPTION_bt, \ 2405 "-bt hci,null dumb bluetooth HCI - doesn't respond to commands\n" \ 2406 "-bt hci,host[:id]\n" \ 2407 " use host's HCI with the given name\n" \ 2408 "-bt hci[,vlan=n]\n" \ 2409 " emulate a standard HCI in virtual scatternet 'n'\n" \ 2410 "-bt vhci[,vlan=n]\n" \ 2411 " add host computer to virtual scatternet 'n' using VHCI\n" \ 2412 "-bt device:dev[,vlan=n]\n" \ 2413 " emulate a bluetooth device 'dev' in scatternet 'n'\n", 2414 QEMU_ARCH_ALL) 2415STEXI 2416@item -bt hci[...] 2417@findex -bt 2418Defines the function of the corresponding Bluetooth HCI. -bt options 2419are matched with the HCIs present in the chosen machine type. For 2420example when emulating a machine with only one HCI built into it, only 2421the first @code{-bt hci[...]} option is valid and defines the HCI's 2422logic. The Transport Layer is decided by the machine type. Currently 2423the machines @code{n800} and @code{n810} have one HCI and all other 2424machines have none. 2425 2426@anchor{bt-hcis} 2427The following three types are recognized: 2428 2429@table @option 2430@item -bt hci,null 2431(default) The corresponding Bluetooth HCI assumes no internal logic 2432and will not respond to any HCI commands or emit events. 2433 2434@item -bt hci,host[:@var{id}] 2435(@code{bluez} only) The corresponding HCI passes commands / events 2436to / from the physical HCI identified by the name @var{id} (default: 2437@code{hci0}) on the computer running QEMU. Only available on @code{bluez} 2438capable systems like Linux. 2439 2440@item -bt hci[,vlan=@var{n}] 2441Add a virtual, standard HCI that will participate in the Bluetooth 2442scatternet @var{n} (default @code{0}). Similarly to @option{-net} 2443VLANs, devices inside a bluetooth network @var{n} can only communicate 2444with other devices in the same network (scatternet). 2445@end table 2446 2447@item -bt vhci[,vlan=@var{n}] 2448(Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached 2449to the host bluetooth stack instead of to the emulated target. This 2450allows the host and target machines to participate in a common scatternet 2451and communicate. Requires the Linux @code{vhci} driver installed. Can 2452be used as following: 2453 2454@example 2455qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5 2456@end example 2457 2458@item -bt device:@var{dev}[,vlan=@var{n}] 2459Emulate a bluetooth device @var{dev} and place it in network @var{n} 2460(default @code{0}). QEMU can only emulate one type of bluetooth devices 2461currently: 2462 2463@table @option 2464@item keyboard 2465Virtual wireless keyboard implementing the HIDP bluetooth profile. 2466@end table 2467ETEXI 2468 2469STEXI 2470@end table 2471ETEXI 2472DEFHEADING() 2473 2474#ifdef CONFIG_TPM 2475DEFHEADING(TPM device options:) 2476 2477DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ 2478 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" 2479 " use path to provide path to a character device; default is /dev/tpm0\n" 2480 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" 2481 " not provided it will be searched for in /sys/class/misc/tpm?/device\n", 2482 QEMU_ARCH_ALL) 2483STEXI 2484 2485The general form of a TPM device option is: 2486@table @option 2487 2488@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}] 2489@findex -tpmdev 2490Backend type must be: 2491@option{passthrough}. 2492 2493The specific backend type will determine the applicable options. 2494The @code{-tpmdev} option creates the TPM backend and requires a 2495@code{-device} option that specifies the TPM frontend interface model. 2496 2497Options to each backend are described below. 2498 2499Use 'help' to print all available TPM backend types. 2500@example 2501qemu -tpmdev help 2502@end example 2503 2504@item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path} 2505 2506(Linux-host only) Enable access to the host's TPM using the passthrough 2507driver. 2508 2509@option{path} specifies the path to the host's TPM device, i.e., on 2510a Linux host this would be @code{/dev/tpm0}. 2511@option{path} is optional and by default @code{/dev/tpm0} is used. 2512 2513@option{cancel-path} specifies the path to the host TPM device's sysfs 2514entry allowing for cancellation of an ongoing TPM command. 2515@option{cancel-path} is optional and by default QEMU will search for the 2516sysfs entry to use. 2517 2518Some notes about using the host's TPM with the passthrough driver: 2519 2520The TPM device accessed by the passthrough driver must not be 2521used by any other application on the host. 2522 2523Since the host's firmware (BIOS/UEFI) has already initialized the TPM, 2524the VM's firmware (BIOS/UEFI) will not be able to initialize the 2525TPM again and may therefore not show a TPM-specific menu that would 2526otherwise allow the user to configure the TPM, e.g., allow the user to 2527enable/disable or activate/deactivate the TPM. 2528Further, if TPM ownership is released from within a VM then the host's TPM 2529will get disabled and deactivated. To enable and activate the 2530TPM again afterwards, the host has to be rebooted and the user is 2531required to enter the firmware's menu to enable and activate the TPM. 2532If the TPM is left disabled and/or deactivated most TPM commands will fail. 2533 2534To create a passthrough TPM use the following two options: 2535@example 2536-tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 2537@end example 2538Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by 2539@code{tpmdev=tpm0} in the device option. 2540 2541@end table 2542 2543ETEXI 2544 2545DEFHEADING() 2546 2547#endif 2548 2549DEFHEADING(Linux/Multiboot boot specific:) 2550STEXI 2551 2552When using these options, you can use a given Linux or Multiboot 2553kernel without installing it in the disk image. It can be useful 2554for easier testing of various kernels. 2555 2556@table @option 2557ETEXI 2558 2559DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \ 2560 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL) 2561STEXI 2562@item -kernel @var{bzImage} 2563@findex -kernel 2564Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel 2565or in multiboot format. 2566ETEXI 2567 2568DEF("append", HAS_ARG, QEMU_OPTION_append, \ 2569 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL) 2570STEXI 2571@item -append @var{cmdline} 2572@findex -append 2573Use @var{cmdline} as kernel command line 2574ETEXI 2575 2576DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \ 2577 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL) 2578STEXI 2579@item -initrd @var{file} 2580@findex -initrd 2581Use @var{file} as initial ram disk. 2582 2583@item -initrd "@var{file1} arg=foo,@var{file2}" 2584 2585This syntax is only available with multiboot. 2586 2587Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the 2588first module. 2589ETEXI 2590 2591DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \ 2592 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL) 2593STEXI 2594@item -dtb @var{file} 2595@findex -dtb 2596Use @var{file} as a device tree binary (dtb) image and pass it to the kernel 2597on boot. 2598ETEXI 2599 2600STEXI 2601@end table 2602ETEXI 2603DEFHEADING() 2604 2605DEFHEADING(Debug/Expert options:) 2606STEXI 2607@table @option 2608ETEXI 2609 2610DEF("serial", HAS_ARG, QEMU_OPTION_serial, \ 2611 "-serial dev redirect the serial port to char device 'dev'\n", 2612 QEMU_ARCH_ALL) 2613STEXI 2614@item -serial @var{dev} 2615@findex -serial 2616Redirect the virtual serial port to host character device 2617@var{dev}. The default device is @code{vc} in graphical mode and 2618@code{stdio} in non graphical mode. 2619 2620This option can be used several times to simulate up to 4 serial 2621ports. 2622 2623Use @code{-serial none} to disable all serial ports. 2624 2625Available character devices are: 2626@table @option 2627@item vc[:@var{W}x@var{H}] 2628Virtual console. Optionally, a width and height can be given in pixel with 2629@example 2630vc:800x600 2631@end example 2632It is also possible to specify width or height in characters: 2633@example 2634vc:80Cx24C 2635@end example 2636@item pty 2637[Linux only] Pseudo TTY (a new PTY is automatically allocated) 2638@item none 2639No device is allocated. 2640@item null 2641void device 2642@item chardev:@var{id} 2643Use a named character device defined with the @code{-chardev} option. 2644@item /dev/XXX 2645[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port 2646parameters are set according to the emulated ones. 2647@item /dev/parport@var{N} 2648[Linux only, parallel port only] Use host parallel port 2649@var{N}. Currently SPP and EPP parallel port features can be used. 2650@item file:@var{filename} 2651Write output to @var{filename}. No character can be read. 2652@item stdio 2653[Unix only] standard input/output 2654@item pipe:@var{filename} 2655name pipe @var{filename} 2656@item COM@var{n} 2657[Windows only] Use host serial port @var{n} 2658@item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}] 2659This implements UDP Net Console. 2660When @var{remote_host} or @var{src_ip} are not specified 2661they default to @code{0.0.0.0}. 2662When not using a specified @var{src_port} a random port is automatically chosen. 2663 2664If you just want a simple readonly console you can use @code{netcat} or 2665@code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as: 2666@code{nc -u -l -p 4555}. Any time QEMU writes something to that port it 2667will appear in the netconsole session. 2668 2669If you plan to send characters back via netconsole or you want to stop 2670and start QEMU a lot of times, you should have QEMU use the same 2671source port each time by using something like @code{-serial 2672udp::4555@@:4556} to QEMU. Another approach is to use a patched 2673version of netcat which can listen to a TCP port and send and receive 2674characters via udp. If you have a patched version of netcat which 2675activates telnet remote echo and single char transfer, then you can 2676use the following options to step up a netcat redirector to allow 2677telnet on port 5555 to access the QEMU port. 2678@table @code 2679@item QEMU Options: 2680-serial udp::4555@@:4556 2681@item netcat options: 2682-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T 2683@item telnet options: 2684localhost 5555 2685@end table 2686 2687@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay] 2688The TCP Net Console has two modes of operation. It can send the serial 2689I/O to a location or wait for a connection from a location. By default 2690the TCP Net Console is sent to @var{host} at the @var{port}. If you use 2691the @var{server} option QEMU will wait for a client socket application 2692to connect to the port before continuing, unless the @code{nowait} 2693option was specified. The @code{nodelay} option disables the Nagle buffering 2694algorithm. If @var{host} is omitted, 0.0.0.0 is assumed. Only 2695one TCP connection at a time is accepted. You can use @code{telnet} to 2696connect to the corresponding character device. 2697@table @code 2698@item Example to send tcp console to 192.168.0.2 port 4444 2699-serial tcp:192.168.0.2:4444 2700@item Example to listen and wait on port 4444 for connection 2701-serial tcp::4444,server 2702@item Example to not wait and listen on ip 192.168.0.100 port 4444 2703-serial tcp:192.168.0.100:4444,server,nowait 2704@end table 2705 2706@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay] 2707The telnet protocol is used instead of raw tcp sockets. The options 2708work the same as if you had specified @code{-serial tcp}. The 2709difference is that the port acts like a telnet server or client using 2710telnet option negotiation. This will also allow you to send the 2711MAGIC_SYSRQ sequence if you use a telnet that supports sending the break 2712sequence. Typically in unix telnet you do it with Control-] and then 2713type "send break" followed by pressing the enter key. 2714 2715@item unix:@var{path}[,server][,nowait] 2716A unix domain socket is used instead of a tcp socket. The option works the 2717same as if you had specified @code{-serial tcp} except the unix domain socket 2718@var{path} is used for connections. 2719 2720@item mon:@var{dev_string} 2721This is a special option to allow the monitor to be multiplexed onto 2722another serial port. The monitor is accessed with key sequence of 2723@key{Control-a} and then pressing @key{c}. 2724@var{dev_string} should be any one of the serial devices specified 2725above. An example to multiplex the monitor onto a telnet server 2726listening on port 4444 would be: 2727@table @code 2728@item -serial mon:telnet::4444,server,nowait 2729@end table 2730When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate 2731QEMU any more but will be passed to the guest instead. 2732 2733@item braille 2734Braille device. This will use BrlAPI to display the braille output on a real 2735or fake device. 2736 2737@item msmouse 2738Three button serial mouse. Configure the guest to use Microsoft protocol. 2739@end table 2740ETEXI 2741 2742DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \ 2743 "-parallel dev redirect the parallel port to char device 'dev'\n", 2744 QEMU_ARCH_ALL) 2745STEXI 2746@item -parallel @var{dev} 2747@findex -parallel 2748Redirect the virtual parallel port to host device @var{dev} (same 2749devices as the serial port). On Linux hosts, @file{/dev/parportN} can 2750be used to use hardware devices connected on the corresponding host 2751parallel port. 2752 2753This option can be used several times to simulate up to 3 parallel 2754ports. 2755 2756Use @code{-parallel none} to disable all parallel ports. 2757ETEXI 2758 2759DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \ 2760 "-monitor dev redirect the monitor to char device 'dev'\n", 2761 QEMU_ARCH_ALL) 2762STEXI 2763@item -monitor @var{dev} 2764@findex -monitor 2765Redirect the monitor to host device @var{dev} (same devices as the 2766serial port). 2767The default device is @code{vc} in graphical mode and @code{stdio} in 2768non graphical mode. 2769Use @code{-monitor none} to disable the default monitor. 2770ETEXI 2771DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ 2772 "-qmp dev like -monitor but opens in 'control' mode\n", 2773 QEMU_ARCH_ALL) 2774STEXI 2775@item -qmp @var{dev} 2776@findex -qmp 2777Like -monitor but opens in 'control' mode. 2778ETEXI 2779 2780DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ 2781 "-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL) 2782STEXI 2783@item -mon [chardev=]name[,mode=readline|control][,default] 2784@findex -mon 2785Setup monitor on chardev @var{name}. 2786ETEXI 2787 2788DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \ 2789 "-debugcon dev redirect the debug console to char device 'dev'\n", 2790 QEMU_ARCH_ALL) 2791STEXI 2792@item -debugcon @var{dev} 2793@findex -debugcon 2794Redirect the debug console to host device @var{dev} (same devices as the 2795serial port). The debug console is an I/O port which is typically port 27960xe9; writing to that I/O port sends output to this device. 2797The default device is @code{vc} in graphical mode and @code{stdio} in 2798non graphical mode. 2799ETEXI 2800 2801DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \ 2802 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL) 2803STEXI 2804@item -pidfile @var{file} 2805@findex -pidfile 2806Store the QEMU process PID in @var{file}. It is useful if you launch QEMU 2807from a script. 2808ETEXI 2809 2810DEF("singlestep", 0, QEMU_OPTION_singlestep, \ 2811 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) 2812STEXI 2813@item -singlestep 2814@findex -singlestep 2815Run the emulation in single step mode. 2816ETEXI 2817 2818DEF("S", 0, QEMU_OPTION_S, \ 2819 "-S freeze CPU at startup (use 'c' to start execution)\n", 2820 QEMU_ARCH_ALL) 2821STEXI 2822@item -S 2823@findex -S 2824Do not start CPU at startup (you must type 'c' in the monitor). 2825ETEXI 2826 2827DEF("realtime", HAS_ARG, QEMU_OPTION_realtime, 2828 "-realtime [mlock=on|off]\n" 2829 " run qemu with realtime features\n" 2830 " mlock=on|off controls mlock support (default: on)\n", 2831 QEMU_ARCH_ALL) 2832STEXI 2833@item -realtime mlock=on|off 2834@findex -realtime 2835Run qemu with realtime features. 2836mlocking qemu and guest memory can be enabled via @option{mlock=on} 2837(enabled by default). 2838ETEXI 2839 2840DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \ 2841 "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL) 2842STEXI 2843@item -gdb @var{dev} 2844@findex -gdb 2845Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical 2846connections will likely be TCP-based, but also UDP, pseudo TTY, or even 2847stdio are reasonable use case. The latter is allowing to start QEMU from 2848within gdb and establish the connection via a pipe: 2849@example 2850(gdb) target remote | exec qemu-system-i386 -gdb stdio ... 2851@end example 2852ETEXI 2853 2854DEF("s", 0, QEMU_OPTION_s, \ 2855 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n", 2856 QEMU_ARCH_ALL) 2857STEXI 2858@item -s 2859@findex -s 2860Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 2861(@pxref{gdb_usage}). 2862ETEXI 2863 2864DEF("d", HAS_ARG, QEMU_OPTION_d, \ 2865 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n", 2866 QEMU_ARCH_ALL) 2867STEXI 2868@item -d @var{item1}[,...] 2869@findex -d 2870Enable logging of specified items. Use '-d help' for a list of log items. 2871ETEXI 2872 2873DEF("D", HAS_ARG, QEMU_OPTION_D, \ 2874 "-D logfile output log to logfile (default stderr)\n", 2875 QEMU_ARCH_ALL) 2876STEXI 2877@item -D @var{logfile} 2878@findex -D 2879Output log in @var{logfile} instead of to stderr 2880ETEXI 2881 2882DEF("L", HAS_ARG, QEMU_OPTION_L, \ 2883 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n", 2884 QEMU_ARCH_ALL) 2885STEXI 2886@item -L @var{path} 2887@findex -L 2888Set the directory for the BIOS, VGA BIOS and keymaps. 2889ETEXI 2890 2891DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ 2892 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) 2893STEXI 2894@item -bios @var{file} 2895@findex -bios 2896Set the filename for the BIOS. 2897ETEXI 2898 2899DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ 2900 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL) 2901STEXI 2902@item -enable-kvm 2903@findex -enable-kvm 2904Enable KVM full virtualization support. This option is only available 2905if KVM support is enabled when compiling. 2906ETEXI 2907 2908DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid, 2909 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL) 2910DEF("xen-create", 0, QEMU_OPTION_xen_create, 2911 "-xen-create create domain using xen hypercalls, bypassing xend\n" 2912 " warning: should not be used when xend is in use\n", 2913 QEMU_ARCH_ALL) 2914DEF("xen-attach", 0, QEMU_OPTION_xen_attach, 2915 "-xen-attach attach to existing xen domain\n" 2916 " xend will use this when starting QEMU\n", 2917 QEMU_ARCH_ALL) 2918STEXI 2919@item -xen-domid @var{id} 2920@findex -xen-domid 2921Specify xen guest domain @var{id} (XEN only). 2922@item -xen-create 2923@findex -xen-create 2924Create domain using xen hypercalls, bypassing xend. 2925Warning: should not be used when xend is in use (XEN only). 2926@item -xen-attach 2927@findex -xen-attach 2928Attach to existing xen domain. 2929xend will use this when starting QEMU (XEN only). 2930ETEXI 2931 2932DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \ 2933 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL) 2934STEXI 2935@item -no-reboot 2936@findex -no-reboot 2937Exit instead of rebooting. 2938ETEXI 2939 2940DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \ 2941 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL) 2942STEXI 2943@item -no-shutdown 2944@findex -no-shutdown 2945Don't exit QEMU on guest shutdown, but instead only stop the emulation. 2946This allows for instance switching to monitor to commit changes to the 2947disk image. 2948ETEXI 2949 2950DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ 2951 "-loadvm [tag|id]\n" \ 2952 " start right away with a saved state (loadvm in monitor)\n", 2953 QEMU_ARCH_ALL) 2954STEXI 2955@item -loadvm @var{file} 2956@findex -loadvm 2957Start right away with a saved state (@code{loadvm} in monitor) 2958ETEXI 2959 2960#ifndef _WIN32 2961DEF("daemonize", 0, QEMU_OPTION_daemonize, \ 2962 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL) 2963#endif 2964STEXI 2965@item -daemonize 2966@findex -daemonize 2967Daemonize the QEMU process after initialization. QEMU will not detach from 2968standard IO until it is ready to receive connections on any of its devices. 2969This option is a useful way for external programs to launch QEMU without having 2970to cope with initialization race conditions. 2971ETEXI 2972 2973DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \ 2974 "-option-rom rom load a file, rom, into the option ROM space\n", 2975 QEMU_ARCH_ALL) 2976STEXI 2977@item -option-rom @var{file} 2978@findex -option-rom 2979Load the contents of @var{file} as an option ROM. 2980This option is useful to load things like EtherBoot. 2981ETEXI 2982 2983DEF("clock", HAS_ARG, QEMU_OPTION_clock, \ 2984 "-clock force the use of the given methods for timer alarm.\n" \ 2985 " To see what timers are available use '-clock help'\n", 2986 QEMU_ARCH_ALL) 2987STEXI 2988@item -clock @var{method} 2989@findex -clock 2990Force the use of the given methods for timer alarm. To see what timers 2991are available use @code{-clock help}. 2992ETEXI 2993 2994HXCOMM Options deprecated by -rtc 2995DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL) 2996DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL) 2997 2998DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ 2999 "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \ 3000 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n", 3001 QEMU_ARCH_ALL) 3002 3003STEXI 3004 3005@item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew] 3006@findex -rtc 3007Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current 3008UTC or local time, respectively. @code{localtime} is required for correct date in 3009MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the 3010format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC. 3011 3012By default the RTC is driven by the host system time. This allows using of the 3013RTC as accurate reference clock inside the guest, specifically if the host 3014time is smoothly following an accurate external reference clock, e.g. via NTP. 3015If you want to isolate the guest time from the host, you can set @option{clock} 3016to @code{rt} instead. To even prevent it from progressing during suspension, 3017you can set it to @code{vm}. 3018 3019Enable @option{driftfix} (i386 targets only) if you experience time drift problems, 3020specifically with Windows' ACPI HAL. This option will try to figure out how 3021many timer interrupts were not processed by the Windows guest and will 3022re-inject them. 3023ETEXI 3024 3025DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ 3026 "-icount [shift=N|auto][,align=on|off]\n" \ 3027 " enable virtual instruction counter with 2^N clock ticks per\n" \ 3028 " instruction and enable aligning the host and virtual clocks\n", QEMU_ARCH_ALL) 3029STEXI 3030@item -icount [shift=@var{N}|auto] 3031@findex -icount 3032Enable virtual instruction counter. The virtual cpu will execute one 3033instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified 3034then the virtual cpu speed will be automatically adjusted to keep virtual 3035time within a few seconds of real time. 3036 3037Note that while this option can give deterministic behavior, it does not 3038provide cycle accurate emulation. Modern CPUs contain superscalar out of 3039order cores with complex cache hierarchies. The number of instructions 3040executed often has little or no correlation with actual performance. 3041 3042@option{align=on} will activate the delay algorithm which will try to 3043to synchronise the host clock and the virtual clock. The goal is to 3044have a guest running at the real frequency imposed by the shift option. 3045Whenever the guest clock is behind the host clock and if 3046@option{align=on} is specified then we print a messsage to the user 3047to inform about the delay. 3048Currently this option does not work when @option{shift} is @code{auto}. 3049Note: The sync algorithm will work for those shift values for which 3050the guest clock runs ahead of the host clock. Typically this happens 3051when the shift value is high (how high depends on the host machine). 3052ETEXI 3053 3054DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \ 3055 "-watchdog i6300esb|ib700\n" \ 3056 " enable virtual hardware watchdog [default=none]\n", 3057 QEMU_ARCH_ALL) 3058STEXI 3059@item -watchdog @var{model} 3060@findex -watchdog 3061Create a virtual hardware watchdog device. Once enabled (by a guest 3062action), the watchdog must be periodically polled by an agent inside 3063the guest or else the guest will be restarted. 3064 3065The @var{model} is the model of hardware watchdog to emulate. Choices 3066for model are: @code{ib700} (iBASE 700) which is a very simple ISA 3067watchdog with a single timer, or @code{i6300esb} (Intel 6300ESB I/O 3068controller hub) which is a much more featureful PCI-based dual-timer 3069watchdog. Choose a model for which your guest has drivers. 3070 3071Use @code{-watchdog help} to list available hardware models. Only one 3072watchdog can be enabled for a guest. 3073ETEXI 3074 3075DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \ 3076 "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \ 3077 " action when watchdog fires [default=reset]\n", 3078 QEMU_ARCH_ALL) 3079STEXI 3080@item -watchdog-action @var{action} 3081@findex -watchdog-action 3082 3083The @var{action} controls what QEMU will do when the watchdog timer 3084expires. 3085The default is 3086@code{reset} (forcefully reset the guest). 3087Other possible actions are: 3088@code{shutdown} (attempt to gracefully shutdown the guest), 3089@code{poweroff} (forcefully poweroff the guest), 3090@code{pause} (pause the guest), 3091@code{debug} (print a debug message and continue), or 3092@code{none} (do nothing). 3093 3094Note that the @code{shutdown} action requires that the guest responds 3095to ACPI signals, which it may not be able to do in the sort of 3096situations where the watchdog would have expired, and thus 3097@code{-watchdog-action shutdown} is not recommended for production use. 3098 3099Examples: 3100 3101@table @code 3102@item -watchdog i6300esb -watchdog-action pause 3103@item -watchdog ib700 3104@end table 3105ETEXI 3106 3107DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ 3108 "-echr chr set terminal escape character instead of ctrl-a\n", 3109 QEMU_ARCH_ALL) 3110STEXI 3111 3112@item -echr @var{numeric_ascii_value} 3113@findex -echr 3114Change the escape character used for switching to the monitor when using 3115monitor and serial sharing. The default is @code{0x01} when using the 3116@code{-nographic} option. @code{0x01} is equal to pressing 3117@code{Control-a}. You can select a different character from the ascii 3118control keys where 1 through 26 map to Control-a through Control-z. For 3119instance you could use the either of the following to change the escape 3120character to Control-t. 3121@table @code 3122@item -echr 0x14 3123@item -echr 20 3124@end table 3125ETEXI 3126 3127DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \ 3128 "-virtioconsole c\n" \ 3129 " set virtio console\n", QEMU_ARCH_ALL) 3130STEXI 3131@item -virtioconsole @var{c} 3132@findex -virtioconsole 3133Set virtio console. 3134 3135This option is maintained for backward compatibility. 3136 3137Please use @code{-device virtconsole} for the new way of invocation. 3138ETEXI 3139 3140DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \ 3141 "-show-cursor show cursor\n", QEMU_ARCH_ALL) 3142STEXI 3143@item -show-cursor 3144@findex -show-cursor 3145Show cursor. 3146ETEXI 3147 3148DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \ 3149 "-tb-size n set TB size\n", QEMU_ARCH_ALL) 3150STEXI 3151@item -tb-size @var{n} 3152@findex -tb-size 3153Set TB size. 3154ETEXI 3155 3156DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ 3157 "-incoming p prepare for incoming migration, listen on port p\n", 3158 QEMU_ARCH_ALL) 3159STEXI 3160@item -incoming @var{port} 3161@findex -incoming 3162Prepare for incoming migration, listen on @var{port}. 3163ETEXI 3164 3165DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ 3166 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL) 3167STEXI 3168@item -nodefaults 3169@findex -nodefaults 3170Don't create default devices. Normally, QEMU sets the default devices like serial 3171port, parallel port, virtual console, monitor device, VGA adapter, floppy and 3172CD-ROM drive and others. The @code{-nodefaults} option will disable all those 3173default devices. 3174ETEXI 3175 3176#ifndef _WIN32 3177DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ 3178 "-chroot dir chroot to dir just before starting the VM\n", 3179 QEMU_ARCH_ALL) 3180#endif 3181STEXI 3182@item -chroot @var{dir} 3183@findex -chroot 3184Immediately before starting guest execution, chroot to the specified 3185directory. Especially useful in combination with -runas. 3186ETEXI 3187 3188#ifndef _WIN32 3189DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ 3190 "-runas user change to user id user just before starting the VM\n", 3191 QEMU_ARCH_ALL) 3192#endif 3193STEXI 3194@item -runas @var{user} 3195@findex -runas 3196Immediately before starting guest execution, drop root privileges, switching 3197to the specified user. 3198ETEXI 3199 3200DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, 3201 "-prom-env variable=value\n" 3202 " set OpenBIOS nvram variables\n", 3203 QEMU_ARCH_PPC | QEMU_ARCH_SPARC) 3204STEXI 3205@item -prom-env @var{variable}=@var{value} 3206@findex -prom-env 3207Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only). 3208ETEXI 3209DEF("semihosting", 0, QEMU_OPTION_semihosting, 3210 "-semihosting semihosting mode\n", 3211 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32) 3212STEXI 3213@item -semihosting 3214@findex -semihosting 3215Semihosting mode (ARM, M68K, Xtensa only). 3216ETEXI 3217DEF("old-param", 0, QEMU_OPTION_old_param, 3218 "-old-param old param mode\n", QEMU_ARCH_ARM) 3219STEXI 3220@item -old-param 3221@findex -old-param (ARM) 3222Old param mode (ARM only). 3223ETEXI 3224 3225DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ 3226 "-sandbox <arg> Enable seccomp mode 2 system call filter (default 'off').\n", 3227 QEMU_ARCH_ALL) 3228STEXI 3229@item -sandbox @var{arg} 3230@findex -sandbox 3231Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will 3232disable it. The default is 'off'. 3233ETEXI 3234 3235DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig, 3236 "-readconfig <file>\n", QEMU_ARCH_ALL) 3237STEXI 3238@item -readconfig @var{file} 3239@findex -readconfig 3240Read device configuration from @var{file}. This approach is useful when you want to spawn 3241QEMU process with many command line options but you don't want to exceed the command line 3242character limit. 3243ETEXI 3244DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig, 3245 "-writeconfig <file>\n" 3246 " read/write config file\n", QEMU_ARCH_ALL) 3247STEXI 3248@item -writeconfig @var{file} 3249@findex -writeconfig 3250Write device configuration to @var{file}. The @var{file} can be either filename to save 3251command line and device configuration into file or dash @code{-}) character to print the 3252output to stdout. This can be later used as input file for @code{-readconfig} option. 3253ETEXI 3254DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, 3255 "-nodefconfig\n" 3256 " do not load default config files at startup\n", 3257 QEMU_ARCH_ALL) 3258STEXI 3259@item -nodefconfig 3260@findex -nodefconfig 3261Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup. 3262The @code{-nodefconfig} option will prevent QEMU from loading any of those config files. 3263ETEXI 3264DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, 3265 "-no-user-config\n" 3266 " do not load user-provided config files at startup\n", 3267 QEMU_ARCH_ALL) 3268STEXI 3269@item -no-user-config 3270@findex -no-user-config 3271The @code{-no-user-config} option makes QEMU not load any of the user-provided 3272config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config 3273files from @var{datadir}. 3274ETEXI 3275DEF("trace", HAS_ARG, QEMU_OPTION_trace, 3276 "-trace [events=<file>][,file=<file>]\n" 3277 " specify tracing options\n", 3278 QEMU_ARCH_ALL) 3279STEXI 3280HXCOMM This line is not accurate, as some sub-options are backend-specific but 3281HXCOMM HX does not support conditional compilation of text. 3282@item -trace [events=@var{file}][,file=@var{file}] 3283@findex -trace 3284 3285Specify tracing options. 3286 3287@table @option 3288@item events=@var{file} 3289Immediately enable events listed in @var{file}. 3290The file must contain one event name (as listed in the @var{trace-events} file) 3291per line. 3292This option is only available if QEMU has been compiled with 3293either @var{simple} or @var{stderr} tracing backend. 3294@item file=@var{file} 3295Log output traces to @var{file}. 3296 3297This option is only available if QEMU has been compiled with 3298the @var{simple} tracing backend. 3299@end table 3300ETEXI 3301 3302HXCOMM Internal use 3303DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) 3304DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) 3305 3306#ifdef __linux__ 3307DEF("enable-fips", 0, QEMU_OPTION_enablefips, 3308 "-enable-fips enable FIPS 140-2 compliance\n", 3309 QEMU_ARCH_ALL) 3310#endif 3311STEXI 3312@item -enable-fips 3313@findex -enable-fips 3314Enable FIPS 140-2 compliance mode. 3315ETEXI 3316 3317HXCOMM Deprecated by -machine accel=tcg property 3318DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386) 3319 3320HXCOMM Deprecated by kvm-pit driver properties 3321DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection, 3322 "", QEMU_ARCH_I386) 3323 3324HXCOMM Deprecated (ignored) 3325DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386) 3326 3327HXCOMM Deprecated by -machine kernel_irqchip=on|off property 3328DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386) 3329 3330HXCOMM Deprecated (ignored) 3331DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL) 3332 3333DEF("object", HAS_ARG, QEMU_OPTION_object, 3334 "-object TYPENAME[,PROP1=VALUE1,...]\n" 3335 " create an new object of type TYPENAME setting properties\n" 3336 " in the order they are specified. Note that the 'id'\n" 3337 " property must be set. These objects are placed in the\n" 3338 " '/objects' path.\n", 3339 QEMU_ARCH_ALL) 3340STEXI 3341@item -object @var{typename}[,@var{prop1}=@var{value1},...] 3342@findex -object 3343Create an new object of type @var{typename} setting properties 3344in the order they are specified. Note that the 'id' 3345property must be set. These objects are placed in the 3346'/objects' path. 3347ETEXI 3348 3349DEF("msg", HAS_ARG, QEMU_OPTION_msg, 3350 "-msg timestamp[=on|off]\n" 3351 " change the format of messages\n" 3352 " on|off controls leading timestamps (default:on)\n", 3353 QEMU_ARCH_ALL) 3354STEXI 3355@item -msg timestamp[=on|off] 3356@findex -msg 3357prepend a timestamp to each log message.(default:on) 3358ETEXI 3359 3360DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate, 3361 "-dump-vmstate <file>\n" 3362 " Output vmstate information in JSON format to file.\n" 3363 " Use the scripts/vmstate-static-checker.py file to\n" 3364 " check for possible regressions in migration code\n" 3365 " by comparing two such vmstate dumps.", 3366 QEMU_ARCH_ALL) 3367STEXI 3368@item -dump-vmstate @var{file} 3369@findex -dump-vmstate 3370Dump json-encoded vmstate information for current machine type to file 3371in @var{file} 3372ETEXI 3373 3374HXCOMM This is the last statement. Insert new options before this line! 3375STEXI 3376@end table 3377ETEXI 3378