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