1HXCOMM Use DEFHEADING() to define headings in both help text and rST. 2HXCOMM Text between SRST and ERST is copied to the rST 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 rST and C. 8 9DEFHEADING(Standard options:) 10 11DEF("help", 0, QEMU_OPTION_h, 12 "-h or -help display this help and exit\n", QEMU_ARCH_ALL) 13SRST 14``-h`` 15 Display help and exit 16ERST 17 18DEF("version", 0, QEMU_OPTION_version, 19 "-version display version information and exit\n", QEMU_ARCH_ALL) 20SRST 21``-version`` 22 Display version information and exit 23ERST 24 25DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ 26 "-machine [type=]name[,prop[=value][,...]]\n" 27 " selects emulated machine ('-machine help' for list)\n" 28 " property accel=accel1[:accel2[:...]] selects accelerator\n" 29 " supported accelerators are kvm, xen, hax, hvf, nvmm, whpx or tcg (default: tcg)\n" 30 " vmport=on|off|auto controls emulation of vmport (default: auto)\n" 31 " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" 32 " mem-merge=on|off controls memory merge support (default: on)\n" 33 " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n" 34 " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n" 35 " suppress-vmdesc=on|off disables self-describing migration (default=off)\n" 36 " nvdimm=on|off controls NVDIMM support (default=off)\n" 37 " memory-encryption=@var{} memory encryption object to use (default=none)\n" 38 " hmat=on|off controls ACPI HMAT support (default=off)\n" 39 " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n", 40 QEMU_ARCH_ALL) 41SRST 42``-machine [type=]name[,prop=value[,...]]`` 43 Select the emulated machine by name. Use ``-machine help`` to list 44 available machines. 45 46 For architectures which aim to support live migration compatibility 47 across releases, each release will introduce a new versioned machine 48 type. For example, the 2.8.0 release introduced machine types 49 "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures. 50 51 To allow live migration of guests from QEMU version 2.8.0, to QEMU 52 version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8" 53 and "pc-q35-2.8" machines too. To allow users live migrating VMs to 54 skip multiple intermediate releases when upgrading, new releases of 55 QEMU will support machine types from many previous versions. 56 57 Supported machine properties are: 58 59 ``accel=accels1[:accels2[:...]]`` 60 This is used to enable an accelerator. Depending on the target 61 architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. 62 By default, tcg is used. If there is more than one accelerator 63 specified, the next one is used if the previous one fails to 64 initialize. 65 66 ``vmport=on|off|auto`` 67 Enables emulation of VMWare IO port, for vmmouse etc. auto says 68 to select the value based on accel. For accel=xen the default is 69 off otherwise the default is on. 70 71 ``dump-guest-core=on|off`` 72 Include guest memory in a core dump. The default is on. 73 74 ``mem-merge=on|off`` 75 Enables or disables memory merge support. This feature, when 76 supported by the host, de-duplicates identical memory pages 77 among VMs instances (enabled by default). 78 79 ``aes-key-wrap=on|off`` 80 Enables or disables AES key wrapping support on s390-ccw hosts. 81 This feature controls whether AES wrapping keys will be created 82 to allow execution of AES cryptographic functions. The default 83 is on. 84 85 ``dea-key-wrap=on|off`` 86 Enables or disables DEA key wrapping support on s390-ccw hosts. 87 This feature controls whether DEA wrapping keys will be created 88 to allow execution of DEA cryptographic functions. The default 89 is on. 90 91 ``nvdimm=on|off`` 92 Enables or disables NVDIMM support. The default is off. 93 94 ``memory-encryption=`` 95 Memory encryption object to use. The default is none. 96 97 ``hmat=on|off`` 98 Enables or disables ACPI Heterogeneous Memory Attribute Table 99 (HMAT) support. The default is off. 100 101 ``memory-backend='id'`` 102 An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options. 103 Allows to use a memory backend as main RAM. 104 105 For example: 106 :: 107 -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on 108 -machine memory-backend=pc.ram 109 -m 512M 110 111 Migration compatibility note: 112 a) as backend id one shall use value of 'default-ram-id', advertised by 113 machine type (available via ``query-machines`` QMP command), if migration 114 to/from old QEMU (<5.0) is expected. 115 b) for machine types 4.0 and older, user shall 116 use ``x-use-canonical-path-for-ramblock-id=off`` backend option 117 if migration to/from old QEMU (<5.0) is expected. 118 For example: 119 :: 120 -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off 121 -machine memory-backend=pc.ram 122 -m 512M 123ERST 124 125HXCOMM Deprecated by -machine 126DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL) 127 128DEF("cpu", HAS_ARG, QEMU_OPTION_cpu, 129 "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL) 130SRST 131``-cpu model`` 132 Select CPU model (``-cpu help`` for list and additional feature 133 selection) 134ERST 135 136DEF("accel", HAS_ARG, QEMU_OPTION_accel, 137 "-accel [accel=]accelerator[,prop[=value][,...]]\n" 138 " select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n" 139 " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" 140 " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" 141 " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" 142 " split-wx=on|off (enable TCG split w^x mapping)\n" 143 " tb-size=n (TCG translation block cache size)\n" 144 " dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n" 145 " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL) 146SRST 147``-accel name[,prop=value[,...]]`` 148 This is used to enable an accelerator. Depending on the target 149 architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. By 150 default, tcg is used. If there is more than one accelerator 151 specified, the next one is used if the previous one fails to 152 initialize. 153 154 ``igd-passthru=on|off`` 155 When Xen is in use, this option controls whether Intel 156 integrated graphics devices can be passed through to the guest 157 (default=off) 158 159 ``kernel-irqchip=on|off|split`` 160 Controls KVM in-kernel irqchip support. The default is full 161 acceleration of the interrupt controllers. On x86, split irqchip 162 reduces the kernel attack surface, at a performance cost for 163 non-MSI interrupts. Disabling the in-kernel irqchip completely 164 is not recommended except for debugging purposes. 165 166 ``kvm-shadow-mem=size`` 167 Defines the size of the KVM shadow MMU. 168 169 ``split-wx=on|off`` 170 Controls the use of split w^x mapping for the TCG code generation 171 buffer. Some operating systems require this to be enabled, and in 172 such a case this will default on. On other operating systems, this 173 will default off, but one may enable this for testing or debugging. 174 175 ``tb-size=n`` 176 Controls the size (in MiB) of the TCG translation block cache. 177 178 ``thread=single|multi`` 179 Controls number of TCG threads. When the TCG is multi-threaded 180 there will be one thread per vCPU therefore taking advantage of 181 additional host cores. The default is to enable multi-threading 182 where both the back-end and front-ends support it and no 183 incompatible TCG features have been enabled (e.g. 184 icount/replay). 185 186 ``dirty-ring-size=n`` 187 When the KVM accelerator is used, it controls the size of the per-vCPU 188 dirty page ring buffer (number of entries for each vCPU). It should 189 be a value that is power of two, and it should be 1024 or bigger (but 190 still less than the maximum value that the kernel supports). 4096 191 could be a good initial value if you have no idea which is the best. 192 Set this value to 0 to disable the feature. By default, this feature 193 is disabled (dirty-ring-size=0). When enabled, KVM will instead 194 record dirty pages in a bitmap. 195 196ERST 197 198DEF("smp", HAS_ARG, QEMU_OPTION_smp, 199 "-smp [[cpus=]n][,maxcpus=cpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n" 200 " set the number of CPUs to 'n' [default=1]\n" 201 " maxcpus= maximum number of total CPUs, including\n" 202 " offline CPUs for hotplug, etc\n" 203 " sockets= number of discrete sockets in the system\n" 204 " dies= number of CPU dies on one socket (for PC only)\n" 205 " cores= number of CPU cores on one socket (for PC, it's on one die)\n" 206 " threads= number of threads on one CPU core\n", 207 QEMU_ARCH_ALL) 208SRST 209``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]`` 210 Simulate a SMP system with '\ ``n``\ ' CPUs initially present on 211 the machine type board. On boards supporting CPU hotplug, the optional 212 '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be 213 added at runtime. If omitted the maximum number of CPUs will be 214 set to match the initial CPU count. Both parameters are subject to 215 an upper limit that is determined by the specific machine type chosen. 216 217 To control reporting of CPU topology information, the number of sockets, 218 dies per socket, cores per die, and threads per core can be specified. 219 The sum `` sockets * cores * dies * threads `` must be equal to the 220 maximum CPU count. CPU targets may only support a subset of the topology 221 parameters. Where a CPU target does not support use of a particular 222 topology parameter, its value should be assumed to be 1 for the purpose 223 of computing the CPU maximum count. 224 225 Either the initial CPU count, or at least one of the topology parameters 226 must be specified. Values for any omitted parameters will be computed 227 from those which are given. Historically preference was given to the 228 coarsest topology parameters when computing missing values (ie sockets 229 preferred over cores, which were preferred over threads), however, this 230 behaviour is considered liable to change. 231ERST 232 233DEF("numa", HAS_ARG, QEMU_OPTION_numa, 234 "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 235 "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 236 "-numa dist,src=source,dst=destination,val=distance\n" 237 "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" 238 "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n" 239 "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", 240 QEMU_ARCH_ALL) 241SRST 242``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 243 \ 244``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 245 \ 246``-numa dist,src=source,dst=destination,val=distance`` 247 \ 248``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]`` 249 \ 250``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]`` 251 \ 252``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]`` 253 Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA 254 distance from a source node to a destination node. Set the ACPI 255 Heterogeneous Memory Attributes for the given nodes. 256 257 Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and 258 lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a 259 contiguous range of CPU indexes (or a single VCPU if lastcpu is 260 omitted). A non-contiguous set of VCPUs can be represented by 261 providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is 262 omitted on all nodes, VCPUs are automatically split between them. 263 264 For example, the following option assigns VCPUs 0, 1, 2 and 5 to a 265 NUMA node: 266 267 :: 268 269 -numa node,cpus=0-2,cpus=5 270 271 '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option 272 which uses '\ ``socket-id|core-id|thread-id``\ ' properties to 273 assign CPU objects to a node using topology layout properties of 274 CPU. The set of properties is machine specific, and depends on used 275 machine type/'\ ``smp``\ ' options. It could be queried with 276 '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ ' 277 property specifies node to which CPU object will be assigned, it's 278 required for node to be declared with '\ ``node``\ ' option before 279 it's used with '\ ``cpu``\ ' option. 280 281 For example: 282 283 :: 284 285 -M pc \ 286 -smp 1,sockets=2,maxcpus=2 \ 287 -numa node,nodeid=0 -numa node,nodeid=1 \ 288 -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 289 290 Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported 291 for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from 292 a given memory backend device to a node. If '\ ``mem``\ ' and 293 '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them. 294 295 296 '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive. 297 Furthermore, if one node uses '\ ``memdev``\ ', all of them have to 298 use it. 299 300 '\ ``initiator``\ ' is an additional option that points to an 301 initiator NUMA node that has best performance (the lowest latency or 302 largest bandwidth) to this NUMA node. Note that this option can be 303 set only when the machine property 'hmat' is set to 'on'. 304 305 Following example creates a machine with 2 NUMA nodes, node 0 has 306 CPU. node 1 has only memory, and its initiator is node 0. Note that 307 because node 0 has CPU, by default the initiator of node 0 is itself 308 and must be itself. 309 310 :: 311 312 -machine hmat=on \ 313 -m 2G,slots=2,maxmem=4G \ 314 -object memory-backend-ram,size=1G,id=m0 \ 315 -object memory-backend-ram,size=1G,id=m1 \ 316 -numa node,nodeid=0,memdev=m0 \ 317 -numa node,nodeid=1,memdev=m1,initiator=0 \ 318 -smp 2,sockets=2,maxcpus=2 \ 319 -numa cpu,node-id=0,socket-id=0 \ 320 -numa cpu,node-id=0,socket-id=1 321 322 source and destination are NUMA node IDs. distance is the NUMA 323 distance from source to destination. The distance from a node to 324 itself is always 10. If any pair of nodes is given a distance, then 325 all pairs must be given distances. Although, when distances are only 326 given in one direction for each pair of nodes, then the distances in 327 the opposite directions are assumed to be the same. If, however, an 328 asymmetrical pair of distances is given for even one node pair, then 329 all node pairs must be provided distance values for both directions, 330 even when they are symmetrical. When a node is unreachable from 331 another node, set the pair's distance to 255. 332 333 Note that the -``numa`` option doesn't allocate any of the specified 334 resources, it just assigns existing resources to NUMA nodes. This 335 means that one still has to use the ``-m``, ``-smp`` options to 336 allocate RAM and VCPUs respectively. 337 338 Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth 339 Information between initiator and target NUMA nodes in ACPI 340 Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can 341 create memory requests, usually it has one or more processors. 342 Target NUMA node contains addressable memory. 343 344 In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is 345 the memory hierarchy of the target NUMA node: if hierarchy is 346 'memory', the structure represents the memory performance; if 347 hierarchy is 'first-level\|second-level\|third-level', this 348 structure represents aggregated performance of memory side caches 349 for each domain. type of 'data-type' is type of data represented by 350 this structure instance: if 'hierarchy' is 'memory', 'data-type' is 351 'access\|read\|write' latency or 'access\|read\|write' bandwidth of 352 the target memory; if 'hierarchy' is 353 'first-level\|second-level\|third-level', 'data-type' is 354 'access\|read\|write' hit latency or 'access\|read\|write' hit 355 bandwidth of the target memory side cache. 356 357 lat is latency value in nanoseconds. bw is bandwidth value, the 358 possible value and units are NUM[M\|G\|T], mean that the bandwidth 359 value are NUM byte per second (or MB/s, GB/s or TB/s depending on 360 used suffix). Note that if latency or bandwidth value is 0, means 361 the corresponding latency or bandwidth information is not provided. 362 363 In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory 364 belongs. size is the size of memory side cache in bytes. level is 365 the cache level described in this structure, note that the cache 366 level 0 should not be used with '\ ``hmat-cache``\ ' option. 367 associativity is the cache associativity, the possible value is 368 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy 369 is the write policy. line is the cache Line size in bytes. 370 371 For example, the following options describe 2 NUMA nodes. Node 0 has 372 2 cpus and a ram, node 1 has only a ram. The processors in node 0 373 access memory in node 0 with access-latency 5 nanoseconds, 374 access-bandwidth is 200 MB/s; The processors in NUMA node 0 access 375 memory in NUMA node 1 with access-latency 10 nanoseconds, 376 access-bandwidth is 100 MB/s. And for memory side cache information, 377 NUMA node 0 and 1 both have 1 level memory cache, size is 10KB, 378 policy is write-back, the cache Line size is 8 bytes: 379 380 :: 381 382 -machine hmat=on \ 383 -m 2G \ 384 -object memory-backend-ram,size=1G,id=m0 \ 385 -object memory-backend-ram,size=1G,id=m1 \ 386 -smp 2 \ 387 -numa node,nodeid=0,memdev=m0 \ 388 -numa node,nodeid=1,memdev=m1,initiator=0 \ 389 -numa cpu,node-id=0,socket-id=0 \ 390 -numa cpu,node-id=0,socket-id=1 \ 391 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \ 392 -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ 393 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \ 394 -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ 395 -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \ 396 -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 397ERST 398 399DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, 400 "-add-fd fd=fd,set=set[,opaque=opaque]\n" 401 " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) 402SRST 403``-add-fd fd=fd,set=set[,opaque=opaque]`` 404 Add a file descriptor to an fd set. Valid options are: 405 406 ``fd=fd`` 407 This option defines the file descriptor of which a duplicate is 408 added to fd set. The file descriptor cannot be stdin, stdout, or 409 stderr. 410 411 ``set=set`` 412 This option defines the ID of the fd set to add the file 413 descriptor to. 414 415 ``opaque=opaque`` 416 This option defines a free-form string that can be used to 417 describe fd. 418 419 You can open an image using pre-opened file descriptors from an fd 420 set: 421 422 .. parsed-literal:: 423 424 |qemu_system| \\ 425 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 426 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 427 -drive file=/dev/fdset/2,index=0,media=disk 428ERST 429 430DEF("set", HAS_ARG, QEMU_OPTION_set, 431 "-set group.id.arg=value\n" 432 " set <arg> parameter for item <id> of type <group>\n" 433 " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL) 434SRST 435``-set group.id.arg=value`` 436 Set parameter arg for item id of type group 437ERST 438 439DEF("global", HAS_ARG, QEMU_OPTION_global, 440 "-global driver.property=value\n" 441 "-global driver=driver,property=property,value=value\n" 442 " set a global default for a driver property\n", 443 QEMU_ARCH_ALL) 444SRST 445``-global driver.prop=value`` 446 \ 447``-global driver=driver,property=property,value=value`` 448 Set default value of driver's property prop to value, e.g.: 449 450 .. parsed-literal:: 451 452 |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img 453 454 In particular, you can use this to set driver properties for devices 455 which are created automatically by the machine model. To create a 456 device which is not created automatically and set properties on it, 457 use -``device``. 458 459 -global driver.prop=value is shorthand for -global 460 driver=driver,property=prop,value=value. The longhand syntax works 461 even when driver contains a dot. 462ERST 463 464DEF("boot", HAS_ARG, QEMU_OPTION_boot, 465 "-boot [order=drives][,once=drives][,menu=on|off]\n" 466 " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n" 467 " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n" 468 " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n" 469 " 'sp_time': the period that splash picture last if menu=on, unit is ms\n" 470 " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n", 471 QEMU_ARCH_ALL) 472SRST 473``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]`` 474 Specify boot order drives as a string of drive letters. Valid drive 475 letters depend on the target architecture. The x86 PC uses: a, b 476 (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p 477 (Etherboot from network adapter 1-4), hard disk boot is the default. 478 To apply a particular boot order only on the first startup, specify 479 it via ``once``. Note that the ``order`` or ``once`` parameter 480 should not be used together with the ``bootindex`` property of 481 devices, since the firmware implementations normally do not support 482 both at the same time. 483 484 Interactive boot menus/prompts can be enabled via ``menu=on`` as far 485 as firmware/BIOS supports them. The default is non-interactive boot. 486 487 A splash picture could be passed to bios, enabling user to show it 488 as logo, when option splash=sp\_name is given and menu=on, If 489 firmware/BIOS supports them. Currently Seabios for X86 system 490 support it. limitation: The splash file could be a jpeg file or a 491 BMP file in 24 BPP format(true color). The resolution should be 492 supported by the SVGA mode, so the recommended is 320x240, 640x480, 493 800x640. 494 495 A timeout could be passed to bios, guest will pause for rb\_timeout 496 ms when boot failed, then reboot. If rb\_timeout is '-1', guest will 497 not reboot, qemu passes '-1' to bios by default. Currently Seabios 498 for X86 system support it. 499 500 Do strict boot via ``strict=on`` as far as firmware/BIOS supports 501 it. This only effects when boot priority is changed by bootindex 502 options. The default is non-strict boot. 503 504 .. parsed-literal:: 505 506 # try to boot from network first, then from hard disk 507 |qemu_system_x86| -boot order=nc 508 # boot from CD-ROM first, switch back to default order after reboot 509 |qemu_system_x86| -boot once=d 510 # boot with a splash picture for 5 seconds. 511 |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000 512 513 Note: The legacy format '-boot drives' is still supported but its 514 use is discouraged as it may be removed from future versions. 515ERST 516 517DEF("m", HAS_ARG, QEMU_OPTION_m, 518 "-m [size=]megs[,slots=n,maxmem=size]\n" 519 " configure guest RAM\n" 520 " size: initial amount of guest memory\n" 521 " slots: number of hotplug slots (default: none)\n" 522 " maxmem: maximum amount of guest memory (default: none)\n" 523 "NOTE: Some architectures might enforce a specific granularity\n", 524 QEMU_ARCH_ALL) 525SRST 526``-m [size=]megs[,slots=n,maxmem=size]`` 527 Sets guest startup RAM size to megs megabytes. Default is 128 MiB. 528 Optionally, a suffix of "M" or "G" can be used to signify a value in 529 megabytes or gigabytes respectively. Optional pair slots, maxmem 530 could be used to set amount of hotpluggable memory slots and maximum 531 amount of memory. Note that maxmem must be aligned to the page size. 532 533 For example, the following command-line sets the guest startup RAM 534 size to 1GB, creates 3 slots to hotplug additional memory and sets 535 the maximum memory the guest can reach to 4GB: 536 537 .. parsed-literal:: 538 539 |qemu_system| -m 1G,slots=3,maxmem=4G 540 541 If slots and maxmem are not specified, memory hotplug won't be 542 enabled and the guest startup RAM will never increase. 543ERST 544 545DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, 546 "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL) 547SRST 548``-mem-path path`` 549 Allocate guest RAM from a temporarily created file in path. 550ERST 551 552DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc, 553 "-mem-prealloc preallocate guest memory (use with -mem-path)\n", 554 QEMU_ARCH_ALL) 555SRST 556``-mem-prealloc`` 557 Preallocate memory when using -mem-path. 558ERST 559 560DEF("k", HAS_ARG, QEMU_OPTION_k, 561 "-k language use keyboard layout (for example 'fr' for French)\n", 562 QEMU_ARCH_ALL) 563SRST 564``-k language`` 565 Use keyboard layout language (for example ``fr`` for French). This 566 option is only needed where it is not easy to get raw PC keycodes 567 (e.g. on Macs, with some X11 servers or with a VNC or curses 568 display). You don't normally need to use it on PC/Linux or 569 PC/Windows hosts. 570 571 The available layouts are: 572 573 :: 574 575 ar de-ch es fo fr-ca hu ja mk no pt-br sv 576 da en-gb et fr fr-ch is lt nl pl ru th 577 de en-us fi fr-be hr it lv nl-be pt sl tr 578 579 The default is ``en-us``. 580ERST 581 582 583HXCOMM Deprecated by -audiodev 584DEF("audio-help", 0, QEMU_OPTION_audio_help, 585 "-audio-help show -audiodev equivalent of the currently specified audio settings\n", 586 QEMU_ARCH_ALL) 587SRST 588``-audio-help`` 589 Will show the -audiodev equivalent of the currently specified 590 (deprecated) environment variables. 591ERST 592 593DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, 594 "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n" 595 " specifies the audio backend to use\n" 596 " id= identifier of the backend\n" 597 " timer-period= timer period in microseconds\n" 598 " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n" 599 " in|out.fixed-settings= use fixed settings for host audio\n" 600 " in|out.frequency= frequency to use with fixed settings\n" 601 " in|out.channels= number of channels to use with fixed settings\n" 602 " in|out.format= sample format to use with fixed settings\n" 603 " valid values: s8, s16, s32, u8, u16, u32, f32\n" 604 " in|out.voices= number of voices to use\n" 605 " in|out.buffer-length= length of buffer in microseconds\n" 606 "-audiodev none,id=id,[,prop[=value][,...]]\n" 607 " dummy driver that discards all output\n" 608#ifdef CONFIG_AUDIO_ALSA 609 "-audiodev alsa,id=id[,prop[=value][,...]]\n" 610 " in|out.dev= name of the audio device to use\n" 611 " in|out.period-length= length of period in microseconds\n" 612 " in|out.try-poll= attempt to use poll mode\n" 613 " threshold= threshold (in microseconds) when playback starts\n" 614#endif 615#ifdef CONFIG_AUDIO_COREAUDIO 616 "-audiodev coreaudio,id=id[,prop[=value][,...]]\n" 617 " in|out.buffer-count= number of buffers\n" 618#endif 619#ifdef CONFIG_AUDIO_DSOUND 620 "-audiodev dsound,id=id[,prop[=value][,...]]\n" 621 " latency= add extra latency to playback in microseconds\n" 622#endif 623#ifdef CONFIG_AUDIO_OSS 624 "-audiodev oss,id=id[,prop[=value][,...]]\n" 625 " in|out.dev= path of the audio device to use\n" 626 " in|out.buffer-count= number of buffers\n" 627 " in|out.try-poll= attempt to use poll mode\n" 628 " try-mmap= try using memory mapped access\n" 629 " exclusive= open device in exclusive mode\n" 630 " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n" 631#endif 632#ifdef CONFIG_AUDIO_PA 633 "-audiodev pa,id=id[,prop[=value][,...]]\n" 634 " server= PulseAudio server address\n" 635 " in|out.name= source/sink device name\n" 636 " in|out.latency= desired latency in microseconds\n" 637#endif 638#ifdef CONFIG_AUDIO_SDL 639 "-audiodev sdl,id=id[,prop[=value][,...]]\n" 640 " in|out.buffer-count= number of buffers\n" 641#endif 642#ifdef CONFIG_SPICE 643 "-audiodev spice,id=id[,prop[=value][,...]]\n" 644#endif 645 "-audiodev wav,id=id[,prop[=value][,...]]\n" 646 " path= path of wav file to record\n", 647 QEMU_ARCH_ALL) 648SRST 649``-audiodev [driver=]driver,id=id[,prop[=value][,...]]`` 650 Adds a new audio backend driver identified by id. There are global 651 and driver specific properties. Some values can be set differently 652 for input and output, they're marked with ``in|out.``. You can set 653 the input's property with ``in.prop`` and the output's property with 654 ``out.prop``. For example: 655 656 :: 657 658 -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000 659 -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified 660 661 NOTE: parameter validation is known to be incomplete, in many cases 662 specifying an invalid option causes QEMU to print an error message 663 and continue emulation without sound. 664 665 Valid global options are: 666 667 ``id=identifier`` 668 Identifies the audio backend. 669 670 ``timer-period=period`` 671 Sets the timer period used by the audio subsystem in 672 microseconds. Default is 10000 (10 ms). 673 674 ``in|out.mixing-engine=on|off`` 675 Use QEMU's mixing engine to mix all streams inside QEMU and 676 convert audio formats when not supported by the backend. When 677 off, fixed-settings must be off too. Note that disabling this 678 option means that the selected backend must support multiple 679 streams and the audio formats used by the virtual cards, 680 otherwise you'll get no sound. It's not recommended to disable 681 this option unless you want to use 5.1 or 7.1 audio, as mixing 682 engine only supports mono and stereo audio. Default is on. 683 684 ``in|out.fixed-settings=on|off`` 685 Use fixed settings for host audio. When off, it will change 686 based on how the guest opens the sound card. In this case you 687 must not specify frequency, channels or format. Default is on. 688 689 ``in|out.frequency=frequency`` 690 Specify the frequency to use when using fixed-settings. Default 691 is 44100Hz. 692 693 ``in|out.channels=channels`` 694 Specify the number of channels to use when using fixed-settings. 695 Default is 2 (stereo). 696 697 ``in|out.format=format`` 698 Specify the sample format to use when using fixed-settings. 699 Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``, 700 ``u32``, ``f32``. Default is ``s16``. 701 702 ``in|out.voices=voices`` 703 Specify the number of voices to use. Default is 1. 704 705 ``in|out.buffer-length=usecs`` 706 Sets the size of the buffer in microseconds. 707 708``-audiodev none,id=id[,prop[=value][,...]]`` 709 Creates a dummy backend that discards all outputs. This backend has 710 no backend specific properties. 711 712``-audiodev alsa,id=id[,prop[=value][,...]]`` 713 Creates backend using the ALSA. This backend is only available on 714 Linux. 715 716 ALSA specific options are: 717 718 ``in|out.dev=device`` 719 Specify the ALSA device to use for input and/or output. Default 720 is ``default``. 721 722 ``in|out.period-length=usecs`` 723 Sets the period length in microseconds. 724 725 ``in|out.try-poll=on|off`` 726 Attempt to use poll mode with the device. Default is on. 727 728 ``threshold=threshold`` 729 Threshold (in microseconds) when playback starts. Default is 0. 730 731``-audiodev coreaudio,id=id[,prop[=value][,...]]`` 732 Creates a backend using Apple's Core Audio. This backend is only 733 available on Mac OS and only supports playback. 734 735 Core Audio specific options are: 736 737 ``in|out.buffer-count=count`` 738 Sets the count of the buffers. 739 740``-audiodev dsound,id=id[,prop[=value][,...]]`` 741 Creates a backend using Microsoft's DirectSound. This backend is 742 only available on Windows and only supports playback. 743 744 DirectSound specific options are: 745 746 ``latency=usecs`` 747 Add extra usecs microseconds latency to playback. Default is 748 10000 (10 ms). 749 750``-audiodev oss,id=id[,prop[=value][,...]]`` 751 Creates a backend using OSS. This backend is available on most 752 Unix-like systems. 753 754 OSS specific options are: 755 756 ``in|out.dev=device`` 757 Specify the file name of the OSS device to use. Default is 758 ``/dev/dsp``. 759 760 ``in|out.buffer-count=count`` 761 Sets the count of the buffers. 762 763 ``in|out.try-poll=on|of`` 764 Attempt to use poll mode with the device. Default is on. 765 766 ``try-mmap=on|off`` 767 Try using memory mapped device access. Default is off. 768 769 ``exclusive=on|off`` 770 Open the device in exclusive mode (vmix won't work in this 771 case). Default is off. 772 773 ``dsp-policy=policy`` 774 Sets the timing policy (between 0 and 10, where smaller number 775 means smaller latency but higher CPU usage). Use -1 to use 776 buffer sizes specified by ``buffer`` and ``buffer-count``. This 777 option is ignored if you do not have OSS 4. Default is 5. 778 779``-audiodev pa,id=id[,prop[=value][,...]]`` 780 Creates a backend using PulseAudio. This backend is available on 781 most systems. 782 783 PulseAudio specific options are: 784 785 ``server=server`` 786 Sets the PulseAudio server to connect to. 787 788 ``in|out.name=sink`` 789 Use the specified source/sink for recording/playback. 790 791 ``in|out.latency=usecs`` 792 Desired latency in microseconds. The PulseAudio server will try 793 to honor this value but actual latencies may be lower or higher. 794 795``-audiodev sdl,id=id[,prop[=value][,...]]`` 796 Creates a backend using SDL. This backend is available on most 797 systems, but you should use your platform's native backend if 798 possible. 799 800 SDL specific options are: 801 802 ``in|out.buffer-count=count`` 803 Sets the count of the buffers. 804 805``-audiodev spice,id=id[,prop[=value][,...]]`` 806 Creates a backend that sends audio through SPICE. This backend 807 requires ``-spice`` and automatically selected in that case, so 808 usually you can ignore this option. This backend has no backend 809 specific properties. 810 811``-audiodev wav,id=id[,prop[=value][,...]]`` 812 Creates a backend that writes audio to a WAV file. 813 814 Backend specific options are: 815 816 ``path=path`` 817 Write recorded audio into the specified file. Default is 818 ``qemu.wav``. 819ERST 820 821DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw, 822 "-soundhw c1,... enable audio support\n" 823 " and only specified sound cards (comma separated list)\n" 824 " use '-soundhw help' to get the list of supported cards\n" 825 " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL) 826SRST 827``-soundhw card1[,card2,...] or -soundhw all`` 828 Enable audio and selected sound hardware. Use 'help' to print all 829 available sound hardware. For example: 830 831 .. parsed-literal:: 832 833 |qemu_system_x86| -soundhw sb16,adlib disk.img 834 |qemu_system_x86| -soundhw es1370 disk.img 835 |qemu_system_x86| -soundhw ac97 disk.img 836 |qemu_system_x86| -soundhw hda disk.img 837 |qemu_system_x86| -soundhw all disk.img 838 |qemu_system_x86| -soundhw help 839 840 Note that Linux's i810\_audio OSS kernel (for AC97) module might 841 require manually specifying clocking. 842 843 :: 844 845 modprobe i810_audio clocking=48000 846ERST 847 848DEF("device", HAS_ARG, QEMU_OPTION_device, 849 "-device driver[,prop[=value][,...]]\n" 850 " add device (based on driver)\n" 851 " prop=value,... sets driver properties\n" 852 " use '-device help' to print all possible drivers\n" 853 " use '-device driver,help' to print all possible properties\n", 854 QEMU_ARCH_ALL) 855SRST 856``-device driver[,prop[=value][,...]]`` 857 Add device driver. prop=value sets driver properties. Valid 858 properties depend on the driver. To get help on possible drivers and 859 properties, use ``-device help`` and ``-device driver,help``. 860 861 Some drivers are: 862 863``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]`` 864 Add an IPMI BMC. This is a simulation of a hardware management 865 interface processor that normally sits on a system. It provides a 866 watchdog and the ability to reset and power control the system. You 867 need to connect this to an IPMI interface to make it useful 868 869 The IPMI slave address to use for the BMC. The default is 0x20. This 870 address is the BMC's address on the I2C network of management 871 controllers. If you don't know what this means, it is safe to ignore 872 it. 873 874 ``id=id`` 875 The BMC id for interfaces to use this device. 876 877 ``slave_addr=val`` 878 Define slave address to use for the BMC. The default is 0x20. 879 880 ``sdrfile=file`` 881 file containing raw Sensor Data Records (SDR) data. The default 882 is none. 883 884 ``fruareasize=val`` 885 size of a Field Replaceable Unit (FRU) area. The default is 886 1024. 887 888 ``frudatafile=file`` 889 file containing raw Field Replaceable Unit (FRU) inventory data. 890 The default is none. 891 892 ``guid=uuid`` 893 value for the GUID for the BMC, in standard UUID format. If this 894 is set, get "Get GUID" command to the BMC will return it. 895 Otherwise "Get GUID" will return an error. 896 897``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]`` 898 Add a connection to an external IPMI BMC simulator. Instead of 899 locally emulating the BMC like the above item, instead connect to an 900 external entity that provides the IPMI services. 901 902 A connection is made to an external BMC simulator. If you do this, 903 it is strongly recommended that you use the "reconnect=" chardev 904 option to reconnect to the simulator if the connection is lost. Note 905 that if this is not used carefully, it can be a security issue, as 906 the interface has the ability to send resets, NMIs, and power off 907 the VM. It's best if QEMU makes a connection to an external 908 simulator running on a secure port on localhost, so neither the 909 simulator nor QEMU is exposed to any outside network. 910 911 See the "lanserv/README.vm" file in the OpenIPMI library for more 912 details on the external interface. 913 914``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]`` 915 Add a KCS IPMI interafce on the ISA bus. This also adds a 916 corresponding ACPI and SMBIOS entries, if appropriate. 917 918 ``bmc=id`` 919 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern 920 above. 921 922 ``ioport=val`` 923 Define the I/O address of the interface. The default is 0xca0 924 for KCS. 925 926 ``irq=val`` 927 Define the interrupt to use. The default is 5. To disable 928 interrupts, set this to 0. 929 930``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]`` 931 Like the KCS interface, but defines a BT interface. The default port 932 is 0xe4 and the default interrupt is 5. 933 934``-device pci-ipmi-kcs,bmc=id`` 935 Add a KCS IPMI interafce on the PCI bus. 936 937 ``bmc=id`` 938 The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. 939 940``-device pci-ipmi-bt,bmc=id`` 941 Like the KCS interface, but defines a BT interface on the PCI bus. 942 943``-device intel-iommu[,option=...]`` 944 This is only supported by ``-machine q35``, which will enable Intel VT-d 945 emulation within the guest. It supports below options: 946 947 ``intremap=on|off`` (default: auto) 948 This enables interrupt remapping feature. It's required to enable 949 complete x2apic. Currently it only supports kvm kernel-irqchip modes 950 ``off`` or ``split``, while full kernel-irqchip is not yet supported. 951 The default value is "auto", which will be decided by the mode of 952 kernel-irqchip. 953 954 ``caching-mode=on|off`` (default: off) 955 This enables caching mode for the VT-d emulated device. When 956 caching-mode is enabled, each guest DMA buffer mapping will generate an 957 IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in 958 a synchronous way. It is required for ``-device vfio-pci`` to work 959 with the VT-d device, because host assigned devices requires to setup 960 the DMA mapping on the host before guest DMA starts. 961 962 ``device-iotlb=on|off`` (default: off) 963 This enables device-iotlb capability for the emulated VT-d device. So 964 far virtio/vhost should be the only real user for this parameter, 965 paired with ats=on configured for the device. 966 967 ``aw-bits=39|48`` (default: 39) 968 This decides the address width of IOVA address space. The address 969 space has 39 bits width for 3-level IOMMU page tables, and 48 bits for 970 4-level IOMMU page tables. 971 972 Please also refer to the wiki page for general scenarios of VT-d 973 emulation in QEMU: https://wiki.qemu.org/Features/VT-d. 974 975ERST 976 977DEF("name", HAS_ARG, QEMU_OPTION_name, 978 "-name string1[,process=string2][,debug-threads=on|off]\n" 979 " set the name of the guest\n" 980 " string1 sets the window title and string2 the process name\n" 981 " When debug-threads is enabled, individual threads are given a separate name\n" 982 " NOTE: The thread names are for debugging and not a stable API.\n", 983 QEMU_ARCH_ALL) 984SRST 985``-name name`` 986 Sets the name of the guest. This name will be displayed in the SDL 987 window caption. The name will also be used for the VNC server. Also 988 optionally set the top visible process name in Linux. Naming of 989 individual threads can also be enabled on Linux to aid debugging. 990ERST 991 992DEF("uuid", HAS_ARG, QEMU_OPTION_uuid, 993 "-uuid %08x-%04x-%04x-%04x-%012x\n" 994 " specify machine UUID\n", QEMU_ARCH_ALL) 995SRST 996``-uuid uuid`` 997 Set system UUID. 998ERST 999 1000DEFHEADING() 1001 1002DEFHEADING(Block device options:) 1003 1004DEF("fda", HAS_ARG, QEMU_OPTION_fda, 1005 "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL) 1006DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL) 1007SRST 1008``-fda file`` 1009 \ 1010``-fdb file`` 1011 Use file as floppy disk 0/1 image (see the :ref:`disk images` chapter in 1012 the System Emulation Users Guide). 1013ERST 1014 1015DEF("hda", HAS_ARG, QEMU_OPTION_hda, 1016 "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL) 1017DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL) 1018DEF("hdc", HAS_ARG, QEMU_OPTION_hdc, 1019 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL) 1020DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL) 1021SRST 1022``-hda file`` 1023 \ 1024``-hdb file`` 1025 \ 1026``-hdc file`` 1027 \ 1028``-hdd file`` 1029 Use file as hard disk 0, 1, 2 or 3 image (see the :ref:`disk images` 1030 chapter in the System Emulation Users Guide). 1031ERST 1032 1033DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom, 1034 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n", 1035 QEMU_ARCH_ALL) 1036SRST 1037``-cdrom file`` 1038 Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at 1039 the same time). You can use the host CD-ROM by using ``/dev/cdrom`` 1040 as filename. 1041ERST 1042 1043DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev, 1044 "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n" 1045 " [,cache.direct=on|off][,cache.no-flush=on|off]\n" 1046 " [,read-only=on|off][,auto-read-only=on|off]\n" 1047 " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n" 1048 " [,driver specific parameters...]\n" 1049 " configure a block backend\n", QEMU_ARCH_ALL) 1050SRST 1051``-blockdev option[,option[,option[,...]]]`` 1052 Define a new block driver node. Some of the options apply to all 1053 block drivers, other options are only accepted for a specific block 1054 driver. See below for a list of generic options and options for the 1055 most common block drivers. 1056 1057 Options that expect a reference to another node (e.g. ``file``) can 1058 be given in two ways. Either you specify the node name of an already 1059 existing node (file=node-name), or you define a new node inline, 1060 adding options for the referenced node after a dot 1061 (file.filename=path,file.aio=native). 1062 1063 A block driver node created with ``-blockdev`` can be used for a 1064 guest device by specifying its node name for the ``drive`` property 1065 in a ``-device`` argument that defines a block device. 1066 1067 ``Valid options for any block driver node:`` 1068 ``driver`` 1069 Specifies the block driver to use for the given node. 1070 1071 ``node-name`` 1072 This defines the name of the block driver node by which it 1073 will be referenced later. The name must be unique, i.e. it 1074 must not match the name of a different block driver node, or 1075 (if you use ``-drive`` as well) the ID of a drive. 1076 1077 If no node name is specified, it is automatically generated. 1078 The generated node name is not intended to be predictable 1079 and changes between QEMU invocations. For the top level, an 1080 explicit node name must be specified. 1081 1082 ``read-only`` 1083 Open the node read-only. Guest write attempts will fail. 1084 1085 Note that some block drivers support only read-only access, 1086 either generally or in certain configurations. In this case, 1087 the default value ``read-only=off`` does not work and the 1088 option must be specified explicitly. 1089 1090 ``auto-read-only`` 1091 If ``auto-read-only=on`` is set, QEMU may fall back to 1092 read-only usage even when ``read-only=off`` is requested, or 1093 even switch between modes as needed, e.g. depending on 1094 whether the image file is writable or whether a writing user 1095 is attached to the node. 1096 1097 ``force-share`` 1098 Override the image locking system of QEMU by forcing the 1099 node to utilize weaker shared access for permissions where 1100 it would normally request exclusive access. When there is 1101 the potential for multiple instances to have the same file 1102 open (whether this invocation of QEMU is the first or the 1103 second instance), both instances must permit shared access 1104 for the second instance to succeed at opening the file. 1105 1106 Enabling ``force-share=on`` requires ``read-only=on``. 1107 1108 ``cache.direct`` 1109 The host page cache can be avoided with ``cache.direct=on``. 1110 This will attempt to do disk IO directly to the guest's 1111 memory. QEMU may still perform an internal copy of the data. 1112 1113 ``cache.no-flush`` 1114 In case you don't care about data integrity over host 1115 failures, you can use ``cache.no-flush=on``. This option 1116 tells QEMU that it never needs to write any data to the disk 1117 but can instead keep things in cache. If anything goes 1118 wrong, like your host losing power, the disk storage getting 1119 disconnected accidentally, etc. your image will most 1120 probably be rendered unusable. 1121 1122 ``discard=discard`` 1123 discard is one of "ignore" (or "off") or "unmap" (or "on") 1124 and controls whether ``discard`` (also known as ``trim`` or 1125 ``unmap``) requests are ignored or passed to the filesystem. 1126 Some machine types may not support discard requests. 1127 1128 ``detect-zeroes=detect-zeroes`` 1129 detect-zeroes is "off", "on" or "unmap" and enables the 1130 automatic conversion of plain zero writes by the OS to 1131 driver specific optimized zero write commands. You may even 1132 choose "unmap" if discard is set to "unmap" to allow a zero 1133 write to be converted to an ``unmap`` operation. 1134 1135 ``Driver-specific options for file`` 1136 This is the protocol-level block driver for accessing regular 1137 files. 1138 1139 ``filename`` 1140 The path to the image file in the local filesystem 1141 1142 ``aio`` 1143 Specifies the AIO backend (threads/native/io_uring, 1144 default: threads) 1145 1146 ``locking`` 1147 Specifies whether the image file is protected with Linux OFD 1148 / POSIX locks. The default is to use the Linux Open File 1149 Descriptor API if available, otherwise no lock is applied. 1150 (auto/on/off, default: auto) 1151 1152 Example: 1153 1154 :: 1155 1156 -blockdev driver=file,node-name=disk,filename=disk.img 1157 1158 ``Driver-specific options for raw`` 1159 This is the image format block driver for raw images. It is 1160 usually stacked on top of a protocol level block driver such as 1161 ``file``. 1162 1163 ``file`` 1164 Reference to or definition of the data source block driver 1165 node (e.g. a ``file`` driver node) 1166 1167 Example 1: 1168 1169 :: 1170 1171 -blockdev driver=file,node-name=disk_file,filename=disk.img 1172 -blockdev driver=raw,node-name=disk,file=disk_file 1173 1174 Example 2: 1175 1176 :: 1177 1178 -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img 1179 1180 ``Driver-specific options for qcow2`` 1181 This is the image format block driver for qcow2 images. It is 1182 usually stacked on top of a protocol level block driver such as 1183 ``file``. 1184 1185 ``file`` 1186 Reference to or definition of the data source block driver 1187 node (e.g. a ``file`` driver node) 1188 1189 ``backing`` 1190 Reference to or definition of the backing file block device 1191 (default is taken from the image file). It is allowed to 1192 pass ``null`` here in order to disable the default backing 1193 file. 1194 1195 ``lazy-refcounts`` 1196 Whether to enable the lazy refcounts feature (on/off; 1197 default is taken from the image file) 1198 1199 ``cache-size`` 1200 The maximum total size of the L2 table and refcount block 1201 caches in bytes (default: the sum of l2-cache-size and 1202 refcount-cache-size) 1203 1204 ``l2-cache-size`` 1205 The maximum size of the L2 table cache in bytes (default: if 1206 cache-size is not specified - 32M on Linux platforms, and 8M 1207 on non-Linux platforms; otherwise, as large as possible 1208 within the cache-size, while permitting the requested or the 1209 minimal refcount cache size) 1210 1211 ``refcount-cache-size`` 1212 The maximum size of the refcount block cache in bytes 1213 (default: 4 times the cluster size; or if cache-size is 1214 specified, the part of it which is not used for the L2 1215 cache) 1216 1217 ``cache-clean-interval`` 1218 Clean unused entries in the L2 and refcount caches. The 1219 interval is in seconds. The default value is 600 on 1220 supporting platforms, and 0 on other platforms. Setting it 1221 to 0 disables this feature. 1222 1223 ``pass-discard-request`` 1224 Whether discard requests to the qcow2 device should be 1225 forwarded to the data source (on/off; default: on if 1226 discard=unmap is specified, off otherwise) 1227 1228 ``pass-discard-snapshot`` 1229 Whether discard requests for the data source should be 1230 issued when a snapshot operation (e.g. deleting a snapshot) 1231 frees clusters in the qcow2 file (on/off; default: on) 1232 1233 ``pass-discard-other`` 1234 Whether discard requests for the data source should be 1235 issued on other occasions where a cluster gets freed 1236 (on/off; default: off) 1237 1238 ``overlap-check`` 1239 Which overlap checks to perform for writes to the image 1240 (none/constant/cached/all; default: cached). For details or 1241 finer granularity control refer to the QAPI documentation of 1242 ``blockdev-add``. 1243 1244 Example 1: 1245 1246 :: 1247 1248 -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2 1249 -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216 1250 1251 Example 2: 1252 1253 :: 1254 1255 -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 1256 1257 ``Driver-specific options for other drivers`` 1258 Please refer to the QAPI documentation of the ``blockdev-add`` 1259 QMP command. 1260ERST 1261 1262DEF("drive", HAS_ARG, QEMU_OPTION_drive, 1263 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" 1264 " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" 1265 " [,snapshot=on|off][,rerror=ignore|stop|report]\n" 1266 " [,werror=ignore|stop|report|enospc][,id=name]\n" 1267 " [,aio=threads|native|io_uring]\n" 1268 " [,readonly=on|off][,copy-on-read=on|off]\n" 1269 " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" 1270 " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" 1271 " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" 1272 " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" 1273 " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" 1274 " [[,iops_size=is]]\n" 1275 " [[,group=g]]\n" 1276 " use 'file' as a drive image\n", QEMU_ARCH_ALL) 1277SRST 1278``-drive option[,option[,option[,...]]]`` 1279 Define a new drive. This includes creating a block driver node (the 1280 backend) as well as a guest device, and is mostly a shortcut for 1281 defining the corresponding ``-blockdev`` and ``-device`` options. 1282 1283 ``-drive`` accepts all options that are accepted by ``-blockdev``. 1284 In addition, it knows the following options: 1285 1286 ``file=file`` 1287 This option defines which disk image (see the :ref:`disk images` 1288 chapter in the System Emulation Users Guide) to use with this drive. 1289 If the filename contains comma, you must double it (for instance, 1290 "file=my,,file" to use file "my,file"). 1291 1292 Special files such as iSCSI devices can be specified using 1293 protocol specific URLs. See the section for "Device URL Syntax" 1294 for more information. 1295 1296 ``if=interface`` 1297 This option defines on which type on interface the drive is 1298 connected. Available types are: ide, scsi, sd, mtd, floppy, 1299 pflash, virtio, none. 1300 1301 ``bus=bus,unit=unit`` 1302 These options define where is connected the drive by defining 1303 the bus number and the unit id. 1304 1305 ``index=index`` 1306 This option defines where is connected the drive by using an 1307 index in the list of available connectors of a given interface 1308 type. 1309 1310 ``media=media`` 1311 This option defines the type of the media: disk or cdrom. 1312 1313 ``snapshot=snapshot`` 1314 snapshot is "on" or "off" and controls snapshot mode for the 1315 given drive (see ``-snapshot``). 1316 1317 ``cache=cache`` 1318 cache is "none", "writeback", "unsafe", "directsync" or 1319 "writethrough" and controls how the host cache is used to access 1320 block data. This is a shortcut that sets the ``cache.direct`` 1321 and ``cache.no-flush`` options (as in ``-blockdev``), and 1322 additionally ``cache.writeback``, which provides a default for 1323 the ``write-cache`` option of block guest devices (as in 1324 ``-device``). The modes correspond to the following settings: 1325 1326 ============= =============== ============ ============== 1327 \ cache.writeback cache.direct cache.no-flush 1328 ============= =============== ============ ============== 1329 writeback on off off 1330 none on on off 1331 writethrough off off off 1332 directsync off on off 1333 unsafe on off on 1334 ============= =============== ============ ============== 1335 1336 The default mode is ``cache=writeback``. 1337 1338 ``aio=aio`` 1339 aio is "threads", "native", or "io_uring" and selects between pthread 1340 based disk I/O, native Linux AIO, or Linux io_uring API. 1341 1342 ``format=format`` 1343 Specify which disk format will be used rather than detecting the 1344 format. Can be used to specify format=raw to avoid interpreting 1345 an untrusted format header. 1346 1347 ``werror=action,rerror=action`` 1348 Specify which action to take on write and read errors. Valid 1349 actions are: "ignore" (ignore the error and try to continue), 1350 "stop" (pause QEMU), "report" (report the error to the guest), 1351 "enospc" (pause QEMU only if the host disk is full; report the 1352 error to the guest otherwise). The default setting is 1353 ``werror=enospc`` and ``rerror=report``. 1354 1355 ``copy-on-read=copy-on-read`` 1356 copy-on-read is "on" or "off" and enables whether to copy read 1357 backing file sectors into the image file. 1358 1359 ``bps=b,bps_rd=r,bps_wr=w`` 1360 Specify bandwidth throttling limits in bytes per second, either 1361 for all request types or for reads or writes only. Small values 1362 can lead to timeouts or hangs inside the guest. A safe minimum 1363 for disks is 2 MB/s. 1364 1365 ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm`` 1366 Specify bursts in bytes per second, either for all request types 1367 or for reads or writes only. Bursts allow the guest I/O to spike 1368 above the limit temporarily. 1369 1370 ``iops=i,iops_rd=r,iops_wr=w`` 1371 Specify request rate limits in requests per second, either for 1372 all request types or for reads or writes only. 1373 1374 ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm`` 1375 Specify bursts in requests per second, either for all request 1376 types or for reads or writes only. Bursts allow the guest I/O to 1377 spike above the limit temporarily. 1378 1379 ``iops_size=is`` 1380 Let every is bytes of a request count as a new request for iops 1381 throttling purposes. Use this option to prevent guests from 1382 circumventing iops limits by sending fewer but larger requests. 1383 1384 ``group=g`` 1385 Join a throttling quota group with given name g. All drives that 1386 are members of the same group are accounted for together. Use 1387 this option to prevent guests from circumventing throttling 1388 limits by using many small disks instead of a single larger 1389 disk. 1390 1391 By default, the ``cache.writeback=on`` mode is used. It will report 1392 data writes as completed as soon as the data is present in the host 1393 page cache. This is safe as long as your guest OS makes sure to 1394 correctly flush disk caches where needed. If your guest OS does not 1395 handle volatile disk write caches correctly and your host crashes or 1396 loses power, then the guest may experience data corruption. 1397 1398 For such guests, you should consider using ``cache.writeback=off``. 1399 This means that the host page cache will be used to read and write 1400 data, but write notification will be sent to the guest only after 1401 QEMU has made sure to flush each write to the disk. Be aware that 1402 this has a major impact on performance. 1403 1404 When using the ``-snapshot`` option, unsafe caching is always used. 1405 1406 Copy-on-read avoids accessing the same backing file sectors 1407 repeatedly and is useful when the backing file is over a slow 1408 network. By default copy-on-read is off. 1409 1410 Instead of ``-cdrom`` you can use: 1411 1412 .. parsed-literal:: 1413 1414 |qemu_system| -drive file=file,index=2,media=cdrom 1415 1416 Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use: 1417 1418 .. parsed-literal:: 1419 1420 |qemu_system| -drive file=file,index=0,media=disk 1421 |qemu_system| -drive file=file,index=1,media=disk 1422 |qemu_system| -drive file=file,index=2,media=disk 1423 |qemu_system| -drive file=file,index=3,media=disk 1424 1425 You can open an image using pre-opened file descriptors from an fd 1426 set: 1427 1428 .. parsed-literal:: 1429 1430 |qemu_system| \\ 1431 -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 1432 -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 1433 -drive file=/dev/fdset/2,index=0,media=disk 1434 1435 You can connect a CDROM to the slave of ide0: 1436 1437 .. parsed-literal:: 1438 1439 |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom 1440 1441 If you don't specify the "file=" argument, you define an empty 1442 drive: 1443 1444 .. parsed-literal:: 1445 1446 |qemu_system_x86| -drive if=ide,index=1,media=cdrom 1447 1448 Instead of ``-fda``, ``-fdb``, you can use: 1449 1450 .. parsed-literal:: 1451 1452 |qemu_system_x86| -drive file=file,index=0,if=floppy 1453 |qemu_system_x86| -drive file=file,index=1,if=floppy 1454 1455 By default, interface is "ide" and index is automatically 1456 incremented: 1457 1458 .. parsed-literal:: 1459 1460 |qemu_system_x86| -drive file=a -drive file=b" 1461 1462 is interpreted like: 1463 1464 .. parsed-literal:: 1465 1466 |qemu_system_x86| -hda a -hdb b 1467ERST 1468 1469DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock, 1470 "-mtdblock file use 'file' as on-board Flash memory image\n", 1471 QEMU_ARCH_ALL) 1472SRST 1473``-mtdblock file`` 1474 Use file as on-board Flash memory image. 1475ERST 1476 1477DEF("sd", HAS_ARG, QEMU_OPTION_sd, 1478 "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL) 1479SRST 1480``-sd file`` 1481 Use file as SecureDigital card image. 1482ERST 1483 1484DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, 1485 "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) 1486SRST 1487``-pflash file`` 1488 Use file as a parallel flash image. 1489ERST 1490 1491DEF("snapshot", 0, QEMU_OPTION_snapshot, 1492 "-snapshot write to temporary files instead of disk image files\n", 1493 QEMU_ARCH_ALL) 1494SRST 1495``-snapshot`` 1496 Write to temporary files instead of disk image files. In this case, 1497 the raw disk image you use is not written back. You can however 1498 force the write back by pressing C-a s (see the :ref:`disk images` 1499 chapter in the System Emulation Users Guide). 1500ERST 1501 1502DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, 1503 "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1504 " [,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode]\n" 1505 " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n" 1506 " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n" 1507 " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n" 1508 " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n" 1509 " [[,throttling.iops-size=is]]\n" 1510 "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly=on]\n" 1511 "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly=on]\n" 1512 "-fsdev synth,id=id\n", 1513 QEMU_ARCH_ALL) 1514 1515SRST 1516``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly=on][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]`` 1517 \ 1518``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly=on]`` 1519 \ 1520``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly=on]`` 1521 \ 1522``-fsdev synth,id=id[,readonly=on]`` 1523 Define a new file system device. Valid options are: 1524 1525 ``local`` 1526 Accesses to the filesystem are done by QEMU. 1527 1528 ``proxy`` 1529 Accesses to the filesystem are done by virtfs-proxy-helper(1). 1530 1531 ``synth`` 1532 Synthetic filesystem, only used by QTests. 1533 1534 ``id=id`` 1535 Specifies identifier for this device. 1536 1537 ``path=path`` 1538 Specifies the export path for the file system device. Files 1539 under this path will be available to the 9p client on the guest. 1540 1541 ``security_model=security_model`` 1542 Specifies the security model to be used for this export path. 1543 Supported security models are "passthrough", "mapped-xattr", 1544 "mapped-file" and "none". In "passthrough" security model, files 1545 are stored using the same credentials as they are created on the 1546 guest. This requires QEMU to run as root. In "mapped-xattr" 1547 security model, some of the file attributes like uid, gid, mode 1548 bits and link target are stored as file attributes. For 1549 "mapped-file" these attributes are stored in the hidden 1550 .virtfs\_metadata directory. Directories exported by this 1551 security model cannot interact with other unix tools. "none" 1552 security model is same as passthrough except the sever won't 1553 report failures if it fails to set file attributes like 1554 ownership. Security model is mandatory only for local fsdriver. 1555 Other fsdrivers (like proxy) don't take security model as a 1556 parameter. 1557 1558 ``writeout=writeout`` 1559 This is an optional argument. The only supported value is 1560 "immediate". This means that host page cache will be used to 1561 read and write data but write notification will be sent to the 1562 guest only when the data has been reported as written by the 1563 storage subsystem. 1564 1565 ``readonly=on`` 1566 Enables exporting 9p share as a readonly mount for guests. By 1567 default read-write access is given. 1568 1569 ``socket=socket`` 1570 Enables proxy filesystem driver to use passed socket file for 1571 communicating with virtfs-proxy-helper(1). 1572 1573 ``sock_fd=sock_fd`` 1574 Enables proxy filesystem driver to use passed socket descriptor 1575 for communicating with virtfs-proxy-helper(1). Usually a helper 1576 like libvirt will create socketpair and pass one of the fds as 1577 sock\_fd. 1578 1579 ``fmode=fmode`` 1580 Specifies the default mode for newly created files on the host. 1581 Works only with security models "mapped-xattr" and 1582 "mapped-file". 1583 1584 ``dmode=dmode`` 1585 Specifies the default mode for newly created directories on the 1586 host. Works only with security models "mapped-xattr" and 1587 "mapped-file". 1588 1589 ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w`` 1590 Specify bandwidth throttling limits in bytes per second, either 1591 for all request types or for reads or writes only. 1592 1593 ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm`` 1594 Specify bursts in bytes per second, either for all request types 1595 or for reads or writes only. Bursts allow the guest I/O to spike 1596 above the limit temporarily. 1597 1598 ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w`` 1599 Specify request rate limits in requests per second, either for 1600 all request types or for reads or writes only. 1601 1602 ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm`` 1603 Specify bursts in requests per second, either for all request 1604 types or for reads or writes only. Bursts allow the guest I/O to 1605 spike above the limit temporarily. 1606 1607 ``throttling.iops-size=is`` 1608 Let every is bytes of a request count as a new request for iops 1609 throttling purposes. 1610 1611 -fsdev option is used along with -device driver "virtio-9p-...". 1612 1613``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag`` 1614 Options for virtio-9p-... driver are: 1615 1616 ``type`` 1617 Specifies the variant to be used. Supported values are "pci", 1618 "ccw" or "device", depending on the machine type. 1619 1620 ``fsdev=id`` 1621 Specifies the id value specified along with -fsdev option. 1622 1623 ``mount_tag=mount_tag`` 1624 Specifies the tag name to be used by the guest to mount this 1625 export point. 1626ERST 1627 1628DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, 1629 "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1630 " [,id=id][,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n" 1631 "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly=on]\n" 1632 "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly=on]\n" 1633 "-virtfs synth,mount_tag=tag[,id=id][,readonly=on]\n", 1634 QEMU_ARCH_ALL) 1635 1636SRST 1637``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly=on] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]`` 1638 \ 1639``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 1640 \ 1641``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 1642 \ 1643``-virtfs synth,mount_tag=mount_tag`` 1644 Define a new virtual filesystem device and expose it to the guest using 1645 a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain 1646 directory on host is made directly accessible by guest as a pass-through 1647 file system by using the 9P network protocol for communication between 1648 host and guests, if desired even accessible, shared by several guests 1649 simultaniously. 1650 1651 Note that ``-virtfs`` is actually just a convenience shortcut for its 1652 generalized form ``-fsdev -device virtio-9p-pci``. 1653 1654 The general form of pass-through file system options are: 1655 1656 ``local`` 1657 Accesses to the filesystem are done by QEMU. 1658 1659 ``proxy`` 1660 Accesses to the filesystem are done by virtfs-proxy-helper(1). 1661 1662 ``synth`` 1663 Synthetic filesystem, only used by QTests. 1664 1665 ``id=id`` 1666 Specifies identifier for the filesystem device 1667 1668 ``path=path`` 1669 Specifies the export path for the file system device. Files 1670 under this path will be available to the 9p client on the guest. 1671 1672 ``security_model=security_model`` 1673 Specifies the security model to be used for this export path. 1674 Supported security models are "passthrough", "mapped-xattr", 1675 "mapped-file" and "none". In "passthrough" security model, files 1676 are stored using the same credentials as they are created on the 1677 guest. This requires QEMU to run as root. In "mapped-xattr" 1678 security model, some of the file attributes like uid, gid, mode 1679 bits and link target are stored as file attributes. For 1680 "mapped-file" these attributes are stored in the hidden 1681 .virtfs\_metadata directory. Directories exported by this 1682 security model cannot interact with other unix tools. "none" 1683 security model is same as passthrough except the sever won't 1684 report failures if it fails to set file attributes like 1685 ownership. Security model is mandatory only for local fsdriver. 1686 Other fsdrivers (like proxy) don't take security model as a 1687 parameter. 1688 1689 ``writeout=writeout`` 1690 This is an optional argument. The only supported value is 1691 "immediate". This means that host page cache will be used to 1692 read and write data but write notification will be sent to the 1693 guest only when the data has been reported as written by the 1694 storage subsystem. 1695 1696 ``readonly=on`` 1697 Enables exporting 9p share as a readonly mount for guests. By 1698 default read-write access is given. 1699 1700 ``socket=socket`` 1701 Enables proxy filesystem driver to use passed socket file for 1702 communicating with virtfs-proxy-helper(1). Usually a helper like 1703 libvirt will create socketpair and pass one of the fds as 1704 sock\_fd. 1705 1706 ``sock_fd`` 1707 Enables proxy filesystem driver to use passed 'sock\_fd' as the 1708 socket descriptor for interfacing with virtfs-proxy-helper(1). 1709 1710 ``fmode=fmode`` 1711 Specifies the default mode for newly created files on the host. 1712 Works only with security models "mapped-xattr" and 1713 "mapped-file". 1714 1715 ``dmode=dmode`` 1716 Specifies the default mode for newly created directories on the 1717 host. Works only with security models "mapped-xattr" and 1718 "mapped-file". 1719 1720 ``mount_tag=mount_tag`` 1721 Specifies the tag name to be used by the guest to mount this 1722 export point. 1723 1724 ``multidevs=multidevs`` 1725 Specifies how to deal with multiple devices being shared with a 1726 9p export. Supported behaviours are either "remap", "forbid" or 1727 "warn". The latter is the default behaviour on which virtfs 9p 1728 expects only one device to be shared with the same export, and 1729 if more than one device is shared and accessed via the same 9p 1730 export then only a warning message is logged (once) by qemu on 1731 host side. In order to avoid file ID collisions on guest you 1732 should either create a separate virtfs export for each device to 1733 be shared with guests (recommended way) or you might use "remap" 1734 instead which allows you to share multiple devices with only one 1735 export instead, which is achieved by remapping the original 1736 inode numbers from host to guest in a way that would prevent 1737 such collisions. Remapping inodes in such use cases is required 1738 because the original device IDs from host are never passed and 1739 exposed on guest. Instead all files of an export shared with 1740 virtfs always share the same device id on guest. So two files 1741 with identical inode numbers but from actually different devices 1742 on host would otherwise cause a file ID collision and hence 1743 potential misbehaviours on guest. "forbid" on the other hand 1744 assumes like "warn" that only one device is shared by the same 1745 export, however it will not only log a warning message but also 1746 deny access to additional devices on guest. Note though that 1747 "forbid" does currently not block all possible file access 1748 operations (e.g. readdir() would still return entries from other 1749 devices). 1750ERST 1751 1752DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi, 1753 "-iscsi [user=user][,password=password]\n" 1754 " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n" 1755 " [,initiator-name=initiator-iqn][,id=target-iqn]\n" 1756 " [,timeout=timeout]\n" 1757 " iSCSI session parameters\n", QEMU_ARCH_ALL) 1758 1759SRST 1760``-iscsi`` 1761 Configure iSCSI session parameters. 1762ERST 1763 1764DEFHEADING() 1765 1766DEFHEADING(USB convenience options:) 1767 1768DEF("usb", 0, QEMU_OPTION_usb, 1769 "-usb enable on-board USB host controller (if not enabled by default)\n", 1770 QEMU_ARCH_ALL) 1771SRST 1772``-usb`` 1773 Enable USB emulation on machine types with an on-board USB host 1774 controller (if not enabled by default). Note that on-board USB host 1775 controllers may not support USB 3.0. In this case 1776 ``-device qemu-xhci`` can be used instead on machines with PCI. 1777ERST 1778 1779DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice, 1780 "-usbdevice name add the host or guest USB device 'name'\n", 1781 QEMU_ARCH_ALL) 1782SRST 1783``-usbdevice devname`` 1784 Add the USB device devname, and enable an on-board USB controller 1785 if possible and necessary (just like it can be done via 1786 ``-machine usb=on``). Note that this option is mainly intended for 1787 the user's convenience only. More fine-grained control can be 1788 achieved by selecting a USB host controller (if necessary) and the 1789 desired USB device via the ``-device`` option instead. For example, 1790 instead of using ``-usbdevice mouse`` it is possible to use 1791 ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse 1792 to a USB 3.0 controller instead (at least on machines that support 1793 PCI and do not have an USB controller enabled by default yet). 1794 For more details, see the chapter about 1795 :ref:`Connecting USB devices` in the System Emulation Users Guide. 1796 Possible devices for devname are: 1797 1798 ``braille`` 1799 Braille device. This will use BrlAPI to display the braille 1800 output on a real or fake device (i.e. it also creates a 1801 corresponding ``braille`` chardev automatically beside the 1802 ``usb-braille`` USB device). 1803 1804 ``keyboard`` 1805 Standard USB keyboard. Will override the PS/2 keyboard (if present). 1806 1807 ``mouse`` 1808 Virtual Mouse. This will override the PS/2 mouse emulation when 1809 activated. 1810 1811 ``tablet`` 1812 Pointer device that uses absolute coordinates (like a 1813 touchscreen). This means QEMU is able to report the mouse 1814 position without having to grab the mouse. Also overrides the 1815 PS/2 mouse emulation when activated. 1816 1817 ``wacom-tablet`` 1818 Wacom PenPartner USB tablet. 1819 1820 1821ERST 1822 1823DEFHEADING() 1824 1825DEFHEADING(Display options:) 1826 1827DEF("display", HAS_ARG, QEMU_OPTION_display, 1828#if defined(CONFIG_SPICE) 1829 "-display spice-app[,gl=on|off]\n" 1830#endif 1831#if defined(CONFIG_SDL) 1832 "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n" 1833 " [,show-cursor=on|off][,window-close=on|off]\n" 1834#endif 1835#if defined(CONFIG_GTK) 1836 "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" 1837 " [,show-cursor=on|off][,window-close=on|off]\n" 1838#endif 1839#if defined(CONFIG_VNC) 1840 "-display vnc=<display>[,<optargs>]\n" 1841#endif 1842#if defined(CONFIG_CURSES) 1843 "-display curses[,charset=<encoding>]\n" 1844#endif 1845#if defined(CONFIG_OPENGL) 1846 "-display egl-headless[,rendernode=<file>]\n" 1847#endif 1848 "-display none\n" 1849 " select display backend type\n" 1850 " The default display is equivalent to\n " 1851#if defined(CONFIG_GTK) 1852 "\"-display gtk\"\n" 1853#elif defined(CONFIG_SDL) 1854 "\"-display sdl\"\n" 1855#elif defined(CONFIG_COCOA) 1856 "\"-display cocoa\"\n" 1857#elif defined(CONFIG_VNC) 1858 "\"-vnc localhost:0,to=99,id=default\"\n" 1859#else 1860 "\"-display none\"\n" 1861#endif 1862 , QEMU_ARCH_ALL) 1863SRST 1864``-display type`` 1865 Select type of display to use. This option is a replacement for the 1866 old style -sdl/-curses/... options. Use ``-display help`` to list 1867 the available display types. Valid values for type are 1868 1869 ``spice-app[,gl=on|off]`` 1870 Start QEMU as a Spice server and launch the default Spice client 1871 application. The Spice server will redirect the serial consoles 1872 and QEMU monitors. (Since 4.0) 1873 1874 ``sdl`` 1875 Display video output via SDL (usually in a separate graphics 1876 window; see the SDL documentation for other possibilities). 1877 Valid parameters are: 1878 1879 ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing 1880 1881 ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing 1882 1883 ``gl=on|off|core|es`` : Use OpenGL for displaying 1884 1885 ``show-cursor=on|off`` : Force showing the mouse cursor 1886 1887 ``window-close=on|off`` : Allow to quit qemu with window close button 1888 1889 ``gtk`` 1890 Display video output in a GTK window. This interface provides 1891 drop-down menus and other UI elements to configure and control 1892 the VM during runtime. Valid parameters are: 1893 1894 ``full-screen=on|off`` : Start in fullscreen mode 1895 1896 ``gl=on|off`` : Use OpenGL for displaying 1897 1898 ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover 1899 1900 ``show-cursor=on|off`` : Force showing the mouse cursor 1901 1902 ``window-close=on|off`` : Allow to quit qemu with window close button 1903 1904 ``curses[,charset=<encoding>]`` 1905 Display video output via curses. For graphics device models 1906 which support a text mode, QEMU can display this output using a 1907 curses/ncurses interface. Nothing is displayed when the graphics 1908 device is in graphical mode or if the graphics device does not 1909 support a text mode. Generally only the VGA device models 1910 support text mode. The font charset used by the guest can be 1911 specified with the ``charset`` option, for example 1912 ``charset=CP850`` for IBM CP850 encoding. The default is 1913 ``CP437``. 1914 1915 ``egl-headless[,rendernode=<file>]`` 1916 Offload all OpenGL operations to a local DRI device. For any 1917 graphical display, this display needs to be paired with either 1918 VNC or SPICE displays. 1919 1920 ``vnc=<display>`` 1921 Start a VNC server on display <display> 1922 1923 ``none`` 1924 Do not display video output. The guest will still see an 1925 emulated graphics card, but its output will not be displayed to 1926 the QEMU user. This option differs from the -nographic option in 1927 that it only affects what is done with video output; -nographic 1928 also changes the destination of the serial and parallel port 1929 data. 1930ERST 1931 1932DEF("nographic", 0, QEMU_OPTION_nographic, 1933 "-nographic disable graphical output and redirect serial I/Os to console\n", 1934 QEMU_ARCH_ALL) 1935SRST 1936``-nographic`` 1937 Normally, if QEMU is compiled with graphical window support, it 1938 displays output such as guest graphics, guest console, and the QEMU 1939 monitor in a window. With this option, you can totally disable 1940 graphical output so that QEMU is a simple command line application. 1941 The emulated serial port is redirected on the console and muxed with 1942 the monitor (unless redirected elsewhere explicitly). Therefore, you 1943 can still use QEMU to debug a Linux kernel with a serial console. 1944 Use C-a h for help on switching between the console and monitor. 1945ERST 1946 1947DEF("curses", 0, QEMU_OPTION_curses, 1948 "-curses shorthand for -display curses\n", 1949 QEMU_ARCH_ALL) 1950SRST 1951``-curses`` 1952 Normally, if QEMU is compiled with graphical window support, it 1953 displays output such as guest graphics, guest console, and the QEMU 1954 monitor in a window. With this option, QEMU can display the VGA 1955 output when in text mode using a curses/ncurses interface. Nothing 1956 is displayed in graphical mode. 1957ERST 1958 1959DEF("alt-grab", 0, QEMU_OPTION_alt_grab, 1960 "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n", 1961 QEMU_ARCH_ALL) 1962SRST 1963``-alt-grab`` 1964 Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that 1965 this also affects the special keys (for fullscreen, monitor-mode 1966 switching, etc). 1967ERST 1968 1969DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, 1970 "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n", 1971 QEMU_ARCH_ALL) 1972SRST 1973``-ctrl-grab`` 1974 Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this 1975 also affects the special keys (for fullscreen, monitor-mode 1976 switching, etc). 1977ERST 1978 1979DEF("no-quit", 0, QEMU_OPTION_no_quit, 1980 "-no-quit disable SDL/GTK window close capability (deprecated)\n", QEMU_ARCH_ALL) 1981SRST 1982``-no-quit`` 1983 Disable window close capability (SDL and GTK only). This option is 1984 deprecated, please use ``-display ...,window-close=off`` instead. 1985ERST 1986 1987DEF("sdl", 0, QEMU_OPTION_sdl, 1988 "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL) 1989SRST 1990``-sdl`` 1991 Enable SDL. 1992ERST 1993 1994DEF("spice", HAS_ARG, QEMU_OPTION_spice, 1995 "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n" 1996 " [,x509-key-file=<file>][,x509-key-password=<file>]\n" 1997 " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n" 1998 " [,x509-dh-key-file=<file>][,addr=addr]\n" 1999 " [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n" 2000 " [,tls-ciphers=<list>]\n" 2001 " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" 2002 " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" 2003 " [,sasl=on|off][,disable-ticketing=on|off]\n" 2004 " [,password=<string>][,password-secret=<secret-id>]\n" 2005 " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" 2006 " [,jpeg-wan-compression=[auto|never|always]]\n" 2007 " [,zlib-glz-wan-compression=[auto|never|always]]\n" 2008 " [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n" 2009 " [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n" 2010 " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" 2011 " [,gl=[on|off]][,rendernode=<file>]\n" 2012 " enable spice\n" 2013 " at least one of {port, tls-port} is mandatory\n", 2014 QEMU_ARCH_ALL) 2015SRST 2016``-spice option[,option[,...]]`` 2017 Enable the spice remote desktop protocol. Valid options are 2018 2019 ``port=<nr>`` 2020 Set the TCP port spice is listening on for plaintext channels. 2021 2022 ``addr=<addr>`` 2023 Set the IP address spice is listening on. Default is any 2024 address. 2025 2026 ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off`` 2027 Force using the specified IP version. 2028 2029 ``password=<string>`` 2030 Set the password you need to authenticate. 2031 2032 This option is deprecated and insecure because it leaves the 2033 password visible in the process listing. Use ``password-secret`` 2034 instead. 2035 2036 ``password-secret=<secret-id>`` 2037 Set the ID of the ``secret`` object containing the password 2038 you need to authenticate. 2039 2040 ``sasl=on|off`` 2041 Require that the client use SASL to authenticate with the spice. 2042 The exact choice of authentication method used is controlled 2043 from the system / user's SASL configuration file for the 'qemu' 2044 service. This is typically found in /etc/sasl2/qemu.conf. If 2045 running QEMU as an unprivileged user, an environment variable 2046 SASL\_CONF\_PATH can be used to make it search alternate 2047 locations for the service config. While some SASL auth methods 2048 can also provide data encryption (eg GSSAPI), it is recommended 2049 that SASL always be combined with the 'tls' and 'x509' settings 2050 to enable use of SSL and server certificates. This ensures a 2051 data encryption preventing compromise of authentication 2052 credentials. 2053 2054 ``disable-ticketing=on|off`` 2055 Allow client connects without authentication. 2056 2057 ``disable-copy-paste=on|off`` 2058 Disable copy paste between the client and the guest. 2059 2060 ``disable-agent-file-xfer=on|off`` 2061 Disable spice-vdagent based file-xfer between the client and the 2062 guest. 2063 2064 ``tls-port=<nr>`` 2065 Set the TCP port spice is listening on for encrypted channels. 2066 2067 ``x509-dir=<dir>`` 2068 Set the x509 file directory. Expects same filenames as -vnc 2069 $display,x509=$dir 2070 2071 ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>`` 2072 The x509 file names can also be configured individually. 2073 2074 ``tls-ciphers=<list>`` 2075 Specify which ciphers to use. 2076 2077 ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]`` 2078 Force specific channel to be used with or without TLS 2079 encryption. The options can be specified multiple times to 2080 configure multiple channels. The special name "default" can be 2081 used to set the default mode. For channels which are not 2082 explicitly forced into one mode the spice client is allowed to 2083 pick tls/plaintext as he pleases. 2084 2085 ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]`` 2086 Configure image compression (lossless). Default is auto\_glz. 2087 2088 ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]`` 2089 Configure wan image compression (lossy for slow links). Default 2090 is auto. 2091 2092 ``streaming-video=[off|all|filter]`` 2093 Configure video stream detection. Default is off. 2094 2095 ``agent-mouse=[on|off]`` 2096 Enable/disable passing mouse events via vdagent. Default is on. 2097 2098 ``playback-compression=[on|off]`` 2099 Enable/disable audio stream compression (using celt 0.5.1). 2100 Default is on. 2101 2102 ``seamless-migration=[on|off]`` 2103 Enable/disable spice seamless migration. Default is off. 2104 2105 ``gl=[on|off]`` 2106 Enable/disable OpenGL context. Default is off. 2107 2108 ``rendernode=<file>`` 2109 DRM render node for OpenGL rendering. If not specified, it will 2110 pick the first available. (Since 2.9) 2111ERST 2112 2113DEF("portrait", 0, QEMU_OPTION_portrait, 2114 "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", 2115 QEMU_ARCH_ALL) 2116SRST 2117``-portrait`` 2118 Rotate graphical output 90 deg left (only PXA LCD). 2119ERST 2120 2121DEF("rotate", HAS_ARG, QEMU_OPTION_rotate, 2122 "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n", 2123 QEMU_ARCH_ALL) 2124SRST 2125``-rotate deg`` 2126 Rotate graphical output some deg left (only PXA LCD). 2127ERST 2128 2129DEF("vga", HAS_ARG, QEMU_OPTION_vga, 2130 "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n" 2131 " select video card type\n", QEMU_ARCH_ALL) 2132SRST 2133``-vga type`` 2134 Select type of VGA card to emulate. Valid values for type are 2135 2136 ``cirrus`` 2137 Cirrus Logic GD5446 Video card. All Windows versions starting 2138 from Windows 95 should recognize and use this graphic card. For 2139 optimal performances, use 16 bit color depth in the guest and 2140 the host OS. (This card was the default before QEMU 2.2) 2141 2142 ``std`` 2143 Standard VGA card with Bochs VBE extensions. If your guest OS 2144 supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if 2145 you want to use high resolution modes (>= 1280x1024x16) then you 2146 should use this option. (This card is the default since QEMU 2147 2.2) 2148 2149 ``vmware`` 2150 VMWare SVGA-II compatible adapter. Use it if you have 2151 sufficiently recent XFree86/XOrg server or Windows guest with a 2152 driver for this card. 2153 2154 ``qxl`` 2155 QXL paravirtual graphic card. It is VGA compatible (including 2156 VESA 2.0 VBE support). Works best with qxl guest drivers 2157 installed though. Recommended choice when using the spice 2158 protocol. 2159 2160 ``tcx`` 2161 (sun4m only) Sun TCX framebuffer. This is the default 2162 framebuffer for sun4m machines and offers both 8-bit and 24-bit 2163 colour depths at a fixed resolution of 1024x768. 2164 2165 ``cg3`` 2166 (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit 2167 framebuffer for sun4m machines available in both 1024x768 2168 (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people 2169 wishing to run older Solaris versions. 2170 2171 ``virtio`` 2172 Virtio VGA card. 2173 2174 ``none`` 2175 Disable VGA card. 2176ERST 2177 2178DEF("full-screen", 0, QEMU_OPTION_full_screen, 2179 "-full-screen start in full screen\n", QEMU_ARCH_ALL) 2180SRST 2181``-full-screen`` 2182 Start in full screen. 2183ERST 2184 2185DEF("g", HAS_ARG, QEMU_OPTION_g , 2186 "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", 2187 QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K) 2188SRST 2189``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]`` 2190 Set the initial graphical resolution and depth (PPC, SPARC only). 2191 2192 For PPC the default is 800x600x32. 2193 2194 For SPARC with the TCX graphics device, the default is 1024x768x8 2195 with the option of 1024x768x24. For cgthree, the default is 2196 1024x768x8 with the option of 1152x900x8 for people who wish to use 2197 OBP. 2198ERST 2199 2200DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , 2201 "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL) 2202SRST 2203``-vnc display[,option[,option[,...]]]`` 2204 Normally, if QEMU is compiled with graphical window support, it 2205 displays output such as guest graphics, guest console, and the QEMU 2206 monitor in a window. With this option, you can have QEMU listen on 2207 VNC display display and redirect the VGA display over the VNC 2208 session. It is very useful to enable the usb tablet device when 2209 using this option (option ``-device usb-tablet``). When using the 2210 VNC display, you must use the ``-k`` parameter to set the keyboard 2211 layout if you are not using en-us. Valid syntax for the display is 2212 2213 ``to=L`` 2214 With this option, QEMU will try next available VNC displays, 2215 until the number L, if the origianlly defined "-vnc display" is 2216 not available, e.g. port 5900+display is already used by another 2217 application. By default, to=0. 2218 2219 ``host:d`` 2220 TCP connections will only be allowed from host on display d. By 2221 convention the TCP port is 5900+d. Optionally, host can be 2222 omitted in which case the server will accept connections from 2223 any host. 2224 2225 ``unix:path`` 2226 Connections will be allowed over UNIX domain sockets where path 2227 is the location of a unix socket to listen for connections on. 2228 2229 ``none`` 2230 VNC is initialized but not started. The monitor ``change`` 2231 command can be used to later start the VNC server. 2232 2233 Following the display value there may be one or more option flags 2234 separated by commas. Valid options are 2235 2236 ``reverse=on|off`` 2237 Connect to a listening VNC client via a "reverse" connection. 2238 The client is specified by the display. For reverse network 2239 connections (host:d,``reverse``), the d argument is a TCP port 2240 number, not a display number. 2241 2242 ``websocket=on|off`` 2243 Opens an additional TCP listening port dedicated to VNC 2244 Websocket connections. If a bare websocket option is given, the 2245 Websocket port is 5700+display. An alternative port can be 2246 specified with the syntax ``websocket``\ =port. 2247 2248 If host is specified connections will only be allowed from this 2249 host. It is possible to control the websocket listen address 2250 independently, using the syntax ``websocket``\ =host:port. 2251 2252 If no TLS credentials are provided, the websocket connection 2253 runs in unencrypted mode. If TLS credentials are provided, the 2254 websocket connection requires encrypted client connections. 2255 2256 ``password=on|off`` 2257 Require that password based authentication is used for client 2258 connections. 2259 2260 The password must be set separately using the ``set_password`` 2261 command in the :ref:`QEMU monitor`. The 2262 syntax to change your password is: 2263 ``set_password <protocol> <password>`` where <protocol> could be 2264 either "vnc" or "spice". 2265 2266 If you would like to change <protocol> password expiration, you 2267 should use ``expire_password <protocol> <expiration-time>`` 2268 where expiration time could be one of the following options: 2269 now, never, +seconds or UNIX time of expiration, e.g. +60 to 2270 make password expire in 60 seconds, or 1335196800 to make 2271 password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for 2272 this date and time). 2273 2274 You can also use keywords "now" or "never" for the expiration 2275 time to allow <protocol> password to expire immediately or never 2276 expire. 2277 2278 ``password-secret=<secret-id>`` 2279 Require that password based authentication is used for client 2280 connections, using the password provided by the ``secret`` 2281 object identified by ``secret-id``. 2282 2283 ``tls-creds=ID`` 2284 Provides the ID of a set of TLS credentials to use to secure the 2285 VNC server. They will apply to both the normal VNC server socket 2286 and the websocket socket (if enabled). Setting TLS credentials 2287 will cause the VNC server socket to enable the VeNCrypt auth 2288 mechanism. The credentials should have been previously created 2289 using the ``-object tls-creds`` argument. 2290 2291 ``tls-authz=ID`` 2292 Provides the ID of the QAuthZ authorization object against which 2293 the client's x509 distinguished name will validated. This object 2294 is only resolved at time of use, so can be deleted and recreated 2295 on the fly while the VNC server is active. If missing, it will 2296 default to denying access. 2297 2298 ``sasl=on|off`` 2299 Require that the client use SASL to authenticate with the VNC 2300 server. The exact choice of authentication method used is 2301 controlled from the system / user's SASL configuration file for 2302 the 'qemu' service. This is typically found in 2303 /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, 2304 an environment variable SASL\_CONF\_PATH can be used to make it 2305 search alternate locations for the service config. While some 2306 SASL auth methods can also provide data encryption (eg GSSAPI), 2307 it is recommended that SASL always be combined with the 'tls' 2308 and 'x509' settings to enable use of SSL and server 2309 certificates. This ensures a data encryption preventing 2310 compromise of authentication credentials. See the 2311 :ref:`VNC security` section in the System Emulation Users Guide 2312 for details on using SASL authentication. 2313 2314 ``sasl-authz=ID`` 2315 Provides the ID of the QAuthZ authorization object against which 2316 the client's SASL username will validated. This object is only 2317 resolved at time of use, so can be deleted and recreated on the 2318 fly while the VNC server is active. If missing, it will default 2319 to denying access. 2320 2321 ``acl=on|off`` 2322 Legacy method for enabling authorization of clients against the 2323 x509 distinguished name and SASL username. It results in the 2324 creation of two ``authz-list`` objects with IDs of 2325 ``vnc.username`` and ``vnc.x509dname``. The rules for these 2326 objects must be configured with the HMP ACL commands. 2327 2328 This option is deprecated and should no longer be used. The new 2329 ``sasl-authz`` and ``tls-authz`` options are a replacement. 2330 2331 ``lossy=on|off`` 2332 Enable lossy compression methods (gradient, JPEG, ...). If this 2333 option is set, VNC client may receive lossy framebuffer updates 2334 depending on its encoding settings. Enabling this option can 2335 save a lot of bandwidth at the expense of quality. 2336 2337 ``non-adaptive=on|off`` 2338 Disable adaptive encodings. Adaptive encodings are enabled by 2339 default. An adaptive encoding will try to detect frequently 2340 updated screen regions, and send updates in these regions using 2341 a lossy encoding (like JPEG). This can be really helpful to save 2342 bandwidth when playing videos. Disabling adaptive encodings 2343 restores the original static behavior of encodings like Tight. 2344 2345 ``share=[allow-exclusive|force-shared|ignore]`` 2346 Set display sharing policy. 'allow-exclusive' allows clients to 2347 ask for exclusive access. As suggested by the rfb spec this is 2348 implemented by dropping other connections. Connecting multiple 2349 clients in parallel requires all clients asking for a shared 2350 session (vncviewer: -shared switch). This is the default. 2351 'force-shared' disables exclusive client access. Useful for 2352 shared desktop sessions, where you don't want someone forgetting 2353 specify -shared disconnect everybody else. 'ignore' completely 2354 ignores the shared flag and allows everybody connect 2355 unconditionally. Doesn't conform to the rfb spec but is 2356 traditional QEMU behavior. 2357 2358 ``key-delay-ms`` 2359 Set keyboard delay, for key down and key up events, in 2360 milliseconds. Default is 10. Keyboards are low-bandwidth 2361 devices, so this slowdown can help the device and guest to keep 2362 up and not lose events in case events are arriving in bulk. 2363 Possible causes for the latter are flaky network connections, or 2364 scripts for automated testing. 2365 2366 ``audiodev=audiodev`` 2367 Use the specified audiodev when the VNC client requests audio 2368 transmission. When not using an -audiodev argument, this option 2369 must be omitted, otherwise is must be present and specify a 2370 valid audiodev. 2371 2372 ``power-control=on|off`` 2373 Permit the remote client to issue shutdown, reboot or reset power 2374 control requests. 2375ERST 2376 2377ARCHHEADING(, QEMU_ARCH_I386) 2378 2379ARCHHEADING(i386 target only:, QEMU_ARCH_I386) 2380 2381DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack, 2382 "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n", 2383 QEMU_ARCH_I386) 2384SRST 2385``-win2k-hack`` 2386 Use it when installing Windows 2000 to avoid a disk full bug. After 2387 Windows 2000 is installed, you no longer need this option (this 2388 option slows down the IDE transfers). 2389ERST 2390 2391DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, 2392 "-no-fd-bootchk disable boot signature checking for floppy disks\n", 2393 QEMU_ARCH_I386) 2394SRST 2395``-no-fd-bootchk`` 2396 Disable boot signature checking for floppy disks in BIOS. May be 2397 needed to boot from old floppy disks. 2398ERST 2399 2400DEF("no-acpi", 0, QEMU_OPTION_no_acpi, 2401 "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM) 2402SRST 2403``-no-acpi`` 2404 Disable ACPI (Advanced Configuration and Power Interface) support. 2405 Use it if your guest OS complains about ACPI problems (PC target 2406 machine only). 2407ERST 2408 2409DEF("no-hpet", 0, QEMU_OPTION_no_hpet, 2410 "-no-hpet disable HPET\n", QEMU_ARCH_I386) 2411SRST 2412``-no-hpet`` 2413 Disable HPET support. 2414ERST 2415 2416DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, 2417 "-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" 2418 " ACPI table description\n", QEMU_ARCH_I386) 2419SRST 2420``-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]`` 2421 Add ACPI table with specified header fields and context from 2422 specified files. For file=, take whole ACPI table from the specified 2423 files, including all ACPI headers (possible overridden by other 2424 options). For data=, only data portion of the table is used, all 2425 header information is specified in the command line. If a SLIC table 2426 is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id 2427 fields will override the same in the RSDT and the FADT (a.k.a. 2428 FACP), in order to ensure the field matches required by the 2429 Microsoft SLIC spec and the ACPI spec. 2430ERST 2431 2432DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, 2433 "-smbios file=binary\n" 2434 " load SMBIOS entry from binary file\n" 2435 "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n" 2436 " [,uefi=on|off]\n" 2437 " specify SMBIOS type 0 fields\n" 2438 "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2439 " [,uuid=uuid][,sku=str][,family=str]\n" 2440 " specify SMBIOS type 1 fields\n" 2441 "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2442 " [,asset=str][,location=str]\n" 2443 " specify SMBIOS type 2 fields\n" 2444 "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n" 2445 " [,sku=str]\n" 2446 " specify SMBIOS type 3 fields\n" 2447 "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n" 2448 " [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n" 2449 " specify SMBIOS type 4 fields\n" 2450 "-smbios type=11[,value=str][,path=filename]\n" 2451 " specify SMBIOS type 11 fields\n" 2452 "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n" 2453 " [,asset=str][,part=str][,speed=%d]\n" 2454 " specify SMBIOS type 17 fields\n" 2455 "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n" 2456 " specify SMBIOS type 41 fields\n", 2457 QEMU_ARCH_I386 | QEMU_ARCH_ARM) 2458SRST 2459``-smbios file=binary`` 2460 Load SMBIOS entry from binary file. 2461 2462``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]`` 2463 Specify SMBIOS type 0 fields 2464 2465``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]`` 2466 Specify SMBIOS type 1 fields 2467 2468``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]`` 2469 Specify SMBIOS type 2 fields 2470 2471``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]`` 2472 Specify SMBIOS type 3 fields 2473 2474``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]`` 2475 Specify SMBIOS type 4 fields 2476 2477``-smbios type=11[,value=str][,path=filename]`` 2478 Specify SMBIOS type 11 fields 2479 2480 This argument can be repeated multiple times, and values are added in the order they are parsed. 2481 Applications intending to use OEM strings data are encouraged to use their application name as 2482 a prefix for the value string. This facilitates passing information for multiple applications 2483 concurrently. 2484 2485 The ``value=str`` syntax provides the string data inline, while the ``path=filename`` syntax 2486 loads data from a file on disk. Note that the file is not permitted to contain any NUL bytes. 2487 2488 Both the ``value`` and ``path`` options can be repeated multiple times and will be added to 2489 the SMBIOS table in the order in which they appear. 2490 2491 Note that on the x86 architecture, the total size of all SMBIOS tables is limited to 65535 2492 bytes. Thus the OEM strings data is not suitable for passing large amounts of data into the 2493 guest. Instead it should be used as a indicator to inform the guest where to locate the real 2494 data set, for example, by specifying the serial ID of a block device. 2495 2496 An example passing three strings is 2497 2498 .. parsed-literal:: 2499 2500 -smbios type=11,value=cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/,\\ 2501 value=anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os,\\ 2502 path=/some/file/with/oemstringsdata.txt 2503 2504 In the guest OS this is visible with the ``dmidecode`` command 2505 2506 .. parsed-literal:: 2507 2508 $ dmidecode -t 11 2509 Handle 0x0E00, DMI type 11, 5 bytes 2510 OEM Strings 2511 String 1: cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/ 2512 String 2: anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os 2513 String 3: myapp:some extra data 2514 2515 2516``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]`` 2517 Specify SMBIOS type 17 fields 2518 2519``-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]`` 2520 Specify SMBIOS type 41 fields 2521 2522 This argument can be repeated multiple times. Its main use is to allow network interfaces be created 2523 as ``enoX`` on Linux, with X being the instance number, instead of the name depending on the interface 2524 position on the PCI bus. 2525 2526 Here is an example of use: 2527 2528 .. parsed-literal:: 2529 2530 -netdev user,id=internet \\ 2531 -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \\ 2532 -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev 2533 2534 In the guest OS, the device should then appear as ``eno1``: 2535 2536 ..parsed-literal:: 2537 2538 $ ip -brief l 2539 lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 2540 eno1 UP 50:54:00:00:00:42 <BROADCAST,MULTICAST,UP,LOWER_UP> 2541 2542 Currently, the PCI device has to be attached to the root bus. 2543 2544ERST 2545 2546DEFHEADING() 2547 2548DEFHEADING(Network options:) 2549 2550DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, 2551#ifdef CONFIG_SLIRP 2552 "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n" 2553 " [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n" 2554 " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n" 2555 " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n" 2556 " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]" 2557#ifndef _WIN32 2558 "[,smb=dir[,smbserver=addr]]\n" 2559#endif 2560 " configure a user mode network backend with ID 'str',\n" 2561 " its DHCP server and optional services\n" 2562#endif 2563#ifdef _WIN32 2564 "-netdev tap,id=str,ifname=name\n" 2565 " configure a host TAP network backend with ID 'str'\n" 2566#else 2567 "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n" 2568 " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n" 2569 " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" 2570 " [,poll-us=n]\n" 2571 " configure a host TAP network backend with ID 'str'\n" 2572 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 2573 " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" 2574 " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" 2575 " to deconfigure it\n" 2576 " use '[down]script=no' to disable script execution\n" 2577 " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" 2578 " configure it\n" 2579 " use 'fd=h' to connect to an already opened TAP interface\n" 2580 " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" 2581 " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n" 2582 " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n" 2583 " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" 2584 " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" 2585 " use vhost=on to enable experimental in kernel accelerator\n" 2586 " (only has effect for virtio guests which use MSIX)\n" 2587 " use vhostforce=on to force vhost on for non-MSIX virtio guests\n" 2588 " use 'vhostfd=h' to connect to an already opened vhost net device\n" 2589 " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" 2590 " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" 2591 " use 'poll-us=n' to specify the maximum number of microseconds that could be\n" 2592 " spent on busy polling for vhost net\n" 2593 "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" 2594 " configure a host TAP network backend with ID 'str' that is\n" 2595 " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 2596 " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" 2597#endif 2598#ifdef __linux__ 2599 "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n" 2600 " [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n" 2601 " [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n" 2602 " [,rxcookie=rxcookie][,offset=offset]\n" 2603 " configure a network backend with ID 'str' connected to\n" 2604 " an Ethernet over L2TPv3 pseudowire.\n" 2605 " Linux kernel 3.3+ as well as most routers can talk\n" 2606 " L2TPv3. This transport allows connecting a VM to a VM,\n" 2607 " VM to a router and even VM to Host. It is a nearly-universal\n" 2608 " standard (RFC3931). Note - this implementation uses static\n" 2609 " pre-configured tunnels (same as the Linux kernel).\n" 2610 " use 'src=' to specify source address\n" 2611 " use 'dst=' to specify destination address\n" 2612 " use 'udp=on' to specify udp encapsulation\n" 2613 " use 'srcport=' to specify source udp port\n" 2614 " use 'dstport=' to specify destination udp port\n" 2615 " use 'ipv6=on' to force v6\n" 2616 " L2TPv3 uses cookies to prevent misconfiguration as\n" 2617 " well as a weak security measure\n" 2618 " use 'rxcookie=0x012345678' to specify a rxcookie\n" 2619 " use 'txcookie=0x012345678' to specify a txcookie\n" 2620 " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n" 2621 " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n" 2622 " use 'pincounter=on' to work around broken counter handling in peer\n" 2623 " use 'offset=X' to add an extra offset between header and data\n" 2624#endif 2625 "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n" 2626 " configure a network backend to connect to another network\n" 2627 " using a socket connection\n" 2628 "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" 2629 " configure a network backend to connect to a multicast maddr and port\n" 2630 " use 'localaddr=addr' to specify the host address to send packets from\n" 2631 "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n" 2632 " configure a network backend to connect to another network\n" 2633 " using an UDP tunnel\n" 2634#ifdef CONFIG_VDE 2635 "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" 2636 " configure a network backend to connect to port 'n' of a vde switch\n" 2637 " running on host and listening for incoming connections on 'socketpath'.\n" 2638 " Use group 'groupname' and mode 'octalmode' to change default\n" 2639 " ownership and permissions for communication port.\n" 2640#endif 2641#ifdef CONFIG_NETMAP 2642 "-netdev netmap,id=str,ifname=name[,devname=nmname]\n" 2643 " attach to the existing netmap-enabled network interface 'name', or to a\n" 2644 " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" 2645 " netmap device, defaults to '/dev/netmap')\n" 2646#endif 2647#ifdef CONFIG_POSIX 2648 "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" 2649 " configure a vhost-user network, backed by a chardev 'dev'\n" 2650#endif 2651#ifdef __linux__ 2652 "-netdev vhost-vdpa,id=str,vhostdev=/path/to/dev\n" 2653 " configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n" 2654#endif 2655 "-netdev hubport,id=str,hubid=n[,netdev=nd]\n" 2656 " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL) 2657DEF("nic", HAS_ARG, QEMU_OPTION_nic, 2658 "-nic [tap|bridge|" 2659#ifdef CONFIG_SLIRP 2660 "user|" 2661#endif 2662#ifdef __linux__ 2663 "l2tpv3|" 2664#endif 2665#ifdef CONFIG_VDE 2666 "vde|" 2667#endif 2668#ifdef CONFIG_NETMAP 2669 "netmap|" 2670#endif 2671#ifdef CONFIG_POSIX 2672 "vhost-user|" 2673#endif 2674 "socket][,option][,...][mac=macaddr]\n" 2675 " initialize an on-board / default host NIC (using MAC address\n" 2676 " macaddr) and connect it to the given host network backend\n" 2677 "-nic none use it alone to have zero network devices (the default is to\n" 2678 " provided a 'user' network connection)\n", 2679 QEMU_ARCH_ALL) 2680DEF("net", HAS_ARG, QEMU_OPTION_net, 2681 "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" 2682 " configure or create an on-board (or machine default) NIC and\n" 2683 " connect it to hub 0 (please use -nic unless you need a hub)\n" 2684 "-net [" 2685#ifdef CONFIG_SLIRP 2686 "user|" 2687#endif 2688 "tap|" 2689 "bridge|" 2690#ifdef CONFIG_VDE 2691 "vde|" 2692#endif 2693#ifdef CONFIG_NETMAP 2694 "netmap|" 2695#endif 2696 "socket][,option][,option][,...]\n" 2697 " old way to initialize a host network interface\n" 2698 " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL) 2699SRST 2700``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]`` 2701 This option is a shortcut for configuring both the on-board 2702 (default) guest NIC hardware and the host network backend in one go. 2703 The host backend options are the same as with the corresponding 2704 ``-netdev`` options below. The guest NIC model can be set with 2705 ``model=modelname``. Use ``model=help`` to list the available device 2706 types. The hardware MAC address can be set with ``mac=macaddr``. 2707 2708 The following two example do exactly the same, to show how ``-nic`` 2709 can be used to shorten the command line length: 2710 2711 .. parsed-literal:: 2712 2713 |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 2714 |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 2715 2716``-nic none`` 2717 Indicate that no network devices should be configured. It is used to 2718 override the default configuration (default NIC with "user" host 2719 network backend) which is activated if no other networking options 2720 are provided. 2721 2722``-netdev user,id=id[,option][,option][,...]`` 2723 Configure user mode host network backend which requires no 2724 administrator privilege to run. Valid options are: 2725 2726 ``id=id`` 2727 Assign symbolic name for use in monitor commands. 2728 2729 ``ipv4=on|off and ipv6=on|off`` 2730 Specify that either IPv4 or IPv6 must be enabled. If neither is 2731 specified both protocols are enabled. 2732 2733 ``net=addr[/mask]`` 2734 Set IP network address the guest will see. Optionally specify 2735 the netmask, either in the form a.b.c.d or as number of valid 2736 top-most bits. Default is 10.0.2.0/24. 2737 2738 ``host=addr`` 2739 Specify the guest-visible address of the host. Default is the 2740 2nd IP in the guest network, i.e. x.x.x.2. 2741 2742 ``ipv6-net=addr[/int]`` 2743 Set IPv6 network address the guest will see (default is 2744 fec0::/64). The network prefix is given in the usual hexadecimal 2745 IPv6 address notation. The prefix size is optional, and is given 2746 as the number of valid top-most bits (default is 64). 2747 2748 ``ipv6-host=addr`` 2749 Specify the guest-visible IPv6 address of the host. Default is 2750 the 2nd IPv6 in the guest network, i.e. xxxx::2. 2751 2752 ``restrict=on|off`` 2753 If this option is enabled, the guest will be isolated, i.e. it 2754 will not be able to contact the host and no guest IP packets 2755 will be routed over the host to the outside. This option does 2756 not affect any explicitly set forwarding rules. 2757 2758 ``hostname=name`` 2759 Specifies the client hostname reported by the built-in DHCP 2760 server. 2761 2762 ``dhcpstart=addr`` 2763 Specify the first of the 16 IPs the built-in DHCP server can 2764 assign. Default is the 15th to 31st IP in the guest network, 2765 i.e. x.x.x.15 to x.x.x.31. 2766 2767 ``dns=addr`` 2768 Specify the guest-visible address of the virtual nameserver. The 2769 address must be different from the host address. Default is the 2770 3rd IP in the guest network, i.e. x.x.x.3. 2771 2772 ``ipv6-dns=addr`` 2773 Specify the guest-visible address of the IPv6 virtual 2774 nameserver. The address must be different from the host address. 2775 Default is the 3rd IP in the guest network, i.e. xxxx::3. 2776 2777 ``dnssearch=domain`` 2778 Provides an entry for the domain-search list sent by the 2779 built-in DHCP server. More than one domain suffix can be 2780 transmitted by specifying this option multiple times. If 2781 supported, this will cause the guest to automatically try to 2782 append the given domain suffix(es) in case a domain name can not 2783 be resolved. 2784 2785 Example: 2786 2787 .. parsed-literal:: 2788 2789 |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org 2790 2791 ``domainname=domain`` 2792 Specifies the client domain name reported by the built-in DHCP 2793 server. 2794 2795 ``tftp=dir`` 2796 When using the user mode network stack, activate a built-in TFTP 2797 server. The files in dir will be exposed as the root of a TFTP 2798 server. The TFTP client on the guest must be configured in 2799 binary mode (use the command ``bin`` of the Unix TFTP client). 2800 2801 ``tftp-server-name=name`` 2802 In BOOTP reply, broadcast name as the "TFTP server name" 2803 (RFC2132 option 66). This can be used to advise the guest to 2804 load boot files or configurations from a different server than 2805 the host address. 2806 2807 ``bootfile=file`` 2808 When using the user mode network stack, broadcast file as the 2809 BOOTP filename. In conjunction with ``tftp``, this can be used 2810 to network boot a guest from a local directory. 2811 2812 Example (using pxelinux): 2813 2814 .. parsed-literal:: 2815 2816 |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \\ 2817 -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 2818 2819 ``smb=dir[,smbserver=addr]`` 2820 When using the user mode network stack, activate a built-in SMB 2821 server so that Windows OSes can access to the host files in 2822 ``dir`` transparently. The IP address of the SMB server can be 2823 set to addr. By default the 4th IP in the guest network is used, 2824 i.e. x.x.x.4. 2825 2826 In the guest Windows OS, the line: 2827 2828 :: 2829 2830 10.0.2.4 smbserver 2831 2832 must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows 2833 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows 2834 NT/2000). 2835 2836 Then ``dir`` can be accessed in ``\\smbserver\qemu``. 2837 2838 Note that a SAMBA server must be installed on the host OS. 2839 2840 ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport`` 2841 Redirect incoming TCP or UDP connections to the host port 2842 hostport to the guest IP address guestaddr on guest port 2843 guestport. If guestaddr is not specified, its value is x.x.x.15 2844 (default first address given by the built-in DHCP server). By 2845 specifying hostaddr, the rule can be bound to a specific host 2846 interface. If no connection type is set, TCP is used. This 2847 option can be given multiple times. 2848 2849 For example, to redirect host X11 connection from screen 1 to 2850 guest screen 0, use the following: 2851 2852 .. parsed-literal:: 2853 2854 # on the host 2855 |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000 2856 # this host xterm should open in the guest X11 server 2857 xterm -display :1 2858 2859 To redirect telnet connections from host port 5555 to telnet 2860 port on the guest, use the following: 2861 2862 .. parsed-literal:: 2863 2864 # on the host 2865 |qemu_system| -nic user,hostfwd=tcp::5555-:23 2866 telnet localhost 5555 2867 2868 Then when you use on the host ``telnet localhost 5555``, you 2869 connect to the guest telnet server. 2870 2871 ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command`` 2872 Forward guest TCP connections to the IP address server on port 2873 port to the character device dev or to a program executed by 2874 cmd:command which gets spawned for each connection. This option 2875 can be given multiple times. 2876 2877 You can either use a chardev directly and have that one used 2878 throughout QEMU's lifetime, like in the following example: 2879 2880 .. parsed-literal:: 2881 2882 # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever 2883 # the guest accesses it 2884 |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 2885 2886 Or you can execute a command on every TCP connection established 2887 by the guest, so that QEMU behaves similar to an inetd process 2888 for that virtual server: 2889 2890 .. parsed-literal:: 2891 2892 # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 2893 # and connect the TCP stream to its stdin/stdout 2894 |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' 2895 2896``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]`` 2897 Configure a host TAP network backend with ID id. 2898 2899 Use the network script file to configure it and the network script 2900 dfile to deconfigure it. If name is not provided, the OS 2901 automatically provides one. The default network configure script is 2902 ``/etc/qemu-ifup`` and the default network deconfigure script is 2903 ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to 2904 disable script execution. 2905 2906 If running QEMU as an unprivileged user, use the network helper 2907 to configure the TAP interface and attach it to the bridge. 2908 The default network helper executable is 2909 ``/path/to/qemu-bridge-helper`` and the default bridge device is 2910 ``br0``. 2911 2912 ``fd``\ =h can be used to specify the handle of an already opened 2913 host TAP interface. 2914 2915 Examples: 2916 2917 .. parsed-literal:: 2918 2919 #launch a QEMU instance with the default network script 2920 |qemu_system| linux.img -nic tap 2921 2922 .. parsed-literal:: 2923 2924 #launch a QEMU instance with two NICs, each one connected 2925 #to a TAP device 2926 |qemu_system| linux.img \\ 2927 -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \\ 2928 -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1 2929 2930 .. parsed-literal:: 2931 2932 #launch a QEMU instance with the default network helper to 2933 #connect a TAP device to bridge br0 2934 |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 2935 -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper" 2936 2937``-netdev bridge,id=id[,br=bridge][,helper=helper]`` 2938 Connect a host TAP network interface to a host bridge device. 2939 2940 Use the network helper helper to configure the TAP interface and 2941 attach it to the bridge. The default network helper executable is 2942 ``/path/to/qemu-bridge-helper`` and the default bridge device is 2943 ``br0``. 2944 2945 Examples: 2946 2947 .. parsed-literal:: 2948 2949 #launch a QEMU instance with the default network helper to 2950 #connect a TAP device to bridge br0 2951 |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1 2952 2953 .. parsed-literal:: 2954 2955 #launch a QEMU instance with the default network helper to 2956 #connect a TAP device to bridge qemubr0 2957 |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1 2958 2959``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]`` 2960 This host network backend can be used to connect the guest's network 2961 to another QEMU virtual machine using a TCP socket connection. If 2962 ``listen`` is specified, QEMU waits for incoming connections on port 2963 (host is optional). ``connect`` is used to connect to another QEMU 2964 instance using the ``listen`` option. ``fd``\ =h specifies an 2965 already opened TCP socket. 2966 2967 Example: 2968 2969 .. parsed-literal:: 2970 2971 # launch a first QEMU instance 2972 |qemu_system| linux.img \\ 2973 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 2974 -netdev socket,id=n1,listen=:1234 2975 # connect the network of this instance to the network of the first instance 2976 |qemu_system| linux.img \\ 2977 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 2978 -netdev socket,id=n2,connect=127.0.0.1:1234 2979 2980``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]`` 2981 Configure a socket host network backend to share the guest's network 2982 traffic with another QEMU virtual machines using a UDP multicast 2983 socket, effectively making a bus for every QEMU with same multicast 2984 address maddr and port. NOTES: 2985 2986 1. Several QEMU can be running on different hosts and share same bus 2987 (assuming correct multicast setup for these hosts). 2988 2989 2. mcast support is compatible with User Mode Linux (argument 2990 ``ethN=mcast``), see http://user-mode-linux.sf.net. 2991 2992 3. Use ``fd=h`` to specify an already opened UDP multicast socket. 2993 2994 Example: 2995 2996 .. parsed-literal:: 2997 2998 # launch one QEMU instance 2999 |qemu_system| linux.img \\ 3000 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3001 -netdev socket,id=n1,mcast=230.0.0.1:1234 3002 # launch another QEMU instance on same "bus" 3003 |qemu_system| linux.img \\ 3004 -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 3005 -netdev socket,id=n2,mcast=230.0.0.1:1234 3006 # launch yet another QEMU instance on same "bus" 3007 |qemu_system| linux.img \\ 3008 -device e1000,netdev=n3,mac=52:54:00:12:34:58 \\ 3009 -netdev socket,id=n3,mcast=230.0.0.1:1234 3010 3011 Example (User Mode Linux compat.): 3012 3013 .. parsed-literal:: 3014 3015 # launch QEMU instance (note mcast address selected is UML's default) 3016 |qemu_system| linux.img \\ 3017 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3018 -netdev socket,id=n1,mcast=239.192.168.1:1102 3019 # launch UML 3020 /path/to/linux ubd0=/path/to/root_fs eth0=mcast 3021 3022 Example (send packets from host's 1.2.3.4): 3023 3024 .. parsed-literal:: 3025 3026 |qemu_system| linux.img \\ 3027 -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3028 -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 3029 3030``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]`` 3031 Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) 3032 is a popular protocol to transport Ethernet (and other Layer 2) data 3033 frames between two systems. It is present in routers, firewalls and 3034 the Linux kernel (from version 3.3 onwards). 3035 3036 This transport allows a VM to communicate to another VM, router or 3037 firewall directly. 3038 3039 ``src=srcaddr`` 3040 source address (mandatory) 3041 3042 ``dst=dstaddr`` 3043 destination address (mandatory) 3044 3045 ``udp`` 3046 select udp encapsulation (default is ip). 3047 3048 ``srcport=srcport`` 3049 source udp port. 3050 3051 ``dstport=dstport`` 3052 destination udp port. 3053 3054 ``ipv6`` 3055 force v6, otherwise defaults to v4. 3056 3057 ``rxcookie=rxcookie``; \ ``txcookie=txcookie`` 3058 Cookies are a weak form of security in the l2tpv3 specification. 3059 Their function is mostly to prevent misconfiguration. By default 3060 they are 32 bit. 3061 3062 ``cookie64`` 3063 Set cookie size to 64 bit instead of the default 32 3064 3065 ``counter=off`` 3066 Force a 'cut-down' L2TPv3 with no counter as in 3067 draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 3068 3069 ``pincounter=on`` 3070 Work around broken counter handling in peer. This may also help 3071 on networks which have packet reorder. 3072 3073 ``offset=offset`` 3074 Add an extra offset between header and data 3075 3076 For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to 3077 the bridge br-lan on the remote Linux host 1.2.3.4: 3078 3079 .. parsed-literal:: 3080 3081 # Setup tunnel on linux host using raw ip as encapsulation 3082 # on 1.2.3.4 3083 ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \\ 3084 encap udp udp_sport 16384 udp_dport 16384 3085 ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \\ 3086 0xFFFFFFFF peer_session_id 0xFFFFFFFF 3087 ifconfig vmtunnel0 mtu 1500 3088 ifconfig vmtunnel0 up 3089 brctl addif br-lan vmtunnel0 3090 3091 3092 # on 4.3.2.1 3093 # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter 3094 3095 |qemu_system| linux.img -device e1000,netdev=n1 \\ 3096 -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter 3097 3098``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]`` 3099 Configure VDE backend to connect to PORT n of a vde switch running 3100 on host and listening for incoming connections on socketpath. Use 3101 GROUP groupname and MODE octalmode to change default ownership and 3102 permissions for communication port. This option is only available if 3103 QEMU has been compiled with vde support enabled. 3104 3105 Example: 3106 3107 .. parsed-literal:: 3108 3109 # launch vde switch 3110 vde_switch -F -sock /tmp/myswitch 3111 # launch QEMU instance 3112 |qemu_system| linux.img -nic vde,sock=/tmp/myswitch 3113 3114``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]`` 3115 Establish a vhost-user netdev, backed by a chardev id. The chardev 3116 should be a unix domain socket backed one. The vhost-user uses a 3117 specifically defined protocol to pass vhost ioctl replacement 3118 messages to an application on the other end of the socket. On 3119 non-MSIX guests, the feature can be forced with vhostforce. Use 3120 'queues=n' to specify the number of queues to be created for 3121 multiqueue vhost-user. 3122 3123 Example: 3124 3125 :: 3126 3127 qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ 3128 -numa node,memdev=mem \ 3129 -chardev socket,id=chr0,path=/path/to/socket \ 3130 -netdev type=vhost-user,id=net0,chardev=chr0 \ 3131 -device virtio-net-pci,netdev=net0 3132 3133``-netdev vhost-vdpa,vhostdev=/path/to/dev`` 3134 Establish a vhost-vdpa netdev. 3135 3136 vDPA device is a device that uses a datapath which complies with 3137 the virtio specifications with a vendor specific control path. 3138 vDPA devices can be both physically located on the hardware or 3139 emulated by software. 3140 3141``-netdev hubport,id=id,hubid=hubid[,netdev=nd]`` 3142 Create a hub port on the emulated hub with ID hubid. 3143 3144 The hubport netdev lets you connect a NIC to a QEMU emulated hub 3145 instead of a single netdev. Alternatively, you can also connect the 3146 hubport to another netdev with ID nd by using the ``netdev=nd`` 3147 option. 3148 3149``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]`` 3150 Legacy option to configure or create an on-board (or machine 3151 default) Network Interface Card(NIC) and connect it either to the 3152 emulated hub with ID 0 (i.e. the default hub), or to the netdev nd. 3153 If model is omitted, then the default NIC model associated with the 3154 machine type is used. Note that the default NIC model may change in 3155 future QEMU releases, so it is highly recommended to always specify 3156 a model. Optionally, the MAC address can be changed to mac, the 3157 device address set to addr (PCI cards only), and a name can be 3158 assigned for use in monitor commands. Optionally, for PCI cards, you 3159 can specify the number v of MSI-X vectors that the card should have; 3160 this option currently only affects virtio cards; set v = 0 to 3161 disable MSI-X. If no ``-net`` option is specified, a single NIC is 3162 created. QEMU can emulate several different models of network card. 3163 Use ``-net nic,model=help`` for a list of available devices for your 3164 target. 3165 3166``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]`` 3167 Configure a host network backend (with the options corresponding to 3168 the same ``-netdev`` option) and connect it to the emulated hub 0 3169 (the default hub). Use name to specify the name of the hub port. 3170ERST 3171 3172DEFHEADING() 3173 3174DEFHEADING(Character device options:) 3175 3176DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, 3177 "-chardev help\n" 3178 "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3179 "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off][,reconnect=seconds]\n" 3180 " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n" 3181 " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n" 3182 "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n" 3183 " [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n" 3184 "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" 3185 " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n" 3186 " [,logfile=PATH][,logappend=on|off]\n" 3187 "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3188 "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n" 3189 " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3190 "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n" 3191 "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3192 "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3193#ifdef _WIN32 3194 "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3195 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3196#else 3197 "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3198 "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n" 3199#endif 3200#ifdef CONFIG_BRLAPI 3201 "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3202#endif 3203#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ 3204 || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 3205 "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3206 "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3207#endif 3208#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) 3209 "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3210 "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3211#endif 3212#if defined(CONFIG_SPICE) 3213 "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3214 "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3215#endif 3216 , QEMU_ARCH_ALL 3217) 3218 3219SRST 3220The general form of a character device option is: 3221 3222``-chardev backend,id=id[,mux=on|off][,options]`` 3223 Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, 3224 ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``, 3225 ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``, 3226 ``spicevmc``, ``spiceport``. The specific backend will determine the 3227 applicable options. 3228 3229 Use ``-chardev help`` to print all available chardev backend types. 3230 3231 All devices must have an id, which can be any string up to 127 3232 characters long. It is used to uniquely identify this device in 3233 other command line directives. 3234 3235 A character device may be used in multiplexing mode by multiple 3236 front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is 3237 a "1:N" device, and here the "1" end is your specified chardev 3238 backend, and the "N" end is the various parts of QEMU that can talk 3239 to a chardev. If you create a chardev with ``id=myid`` and 3240 ``mux=on``, QEMU will create a multiplexer with your specified ID, 3241 and you can then configure multiple front ends to use that chardev 3242 ID for their input/output. Up to four different front ends can be 3243 connected to a single multiplexed chardev. (Without multiplexing 3244 enabled, a chardev can only be used by a single front end.) For 3245 instance you could use this to allow a single stdio chardev to be 3246 used by two serial ports and the QEMU monitor: 3247 3248 :: 3249 3250 -chardev stdio,mux=on,id=char0 \ 3251 -mon chardev=char0,mode=readline \ 3252 -serial chardev:char0 \ 3253 -serial chardev:char0 3254 3255 You can have more than one multiplexer in a system configuration; 3256 for instance you could have a TCP port multiplexed between UART 0 3257 and UART 1, and stdio multiplexed between the QEMU monitor and a 3258 parallel port: 3259 3260 :: 3261 3262 -chardev stdio,mux=on,id=char0 \ 3263 -mon chardev=char0,mode=readline \ 3264 -parallel chardev:char0 \ 3265 -chardev tcp,...,mux=on,id=char1 \ 3266 -serial chardev:char1 \ 3267 -serial chardev:char1 3268 3269 When you're using a multiplexed character device, some escape 3270 sequences are interpreted in the input. See the chapter about 3271 :ref:`keys in the character backend multiplexer` in the 3272 System Emulation Users Guide for more details. 3273 3274 Note that some other command line options may implicitly create 3275 multiplexed character backends; for instance ``-serial mon:stdio`` 3276 creates a multiplexed stdio backend connected to the serial port and 3277 the QEMU monitor, and ``-nographic`` also multiplexes the console 3278 and the monitor to stdio. 3279 3280 There is currently no support for multiplexing in the other 3281 direction (where a single QEMU front end takes input and output from 3282 multiple chardevs). 3283 3284 Every backend supports the ``logfile`` option, which supplies the 3285 path to a file to record all data transmitted via the backend. The 3286 ``logappend`` option controls whether the log file will be truncated 3287 or appended to when opened. 3288 3289The available backends are: 3290 3291``-chardev null,id=id`` 3292 A void device. This device will not emit any data, and will drop any 3293 data it receives. The null backend does not take any options. 3294 3295``-chardev socket,id=id[,TCP options or unix options][,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,tls-creds=id][,tls-authz=id]`` 3296 Create a two-way stream socket, which can be either a TCP or a unix 3297 socket. A unix socket will be created if ``path`` is specified. 3298 Behaviour is undefined if TCP options are specified for a unix 3299 socket. 3300 3301 ``server=on|off`` specifies that the socket shall be a listening socket. 3302 3303 ``wait=on|off`` specifies that QEMU should not block waiting for a client 3304 to connect to a listening socket. 3305 3306 ``telnet=on|off`` specifies that traffic on the socket should interpret 3307 telnet escape sequences. 3308 3309 ``websocket=on|off`` specifies that the socket uses WebSocket protocol for 3310 communication. 3311 3312 ``reconnect`` sets the timeout for reconnecting on non-server 3313 sockets when the remote end goes away. qemu will delay this many 3314 seconds and then attempt to reconnect. Zero disables reconnecting, 3315 and is the default. 3316 3317 ``tls-creds`` requests enablement of the TLS protocol for 3318 encryption, and specifies the id of the TLS credentials to use for 3319 the handshake. The credentials must be previously created with the 3320 ``-object tls-creds`` argument. 3321 3322 ``tls-auth`` provides the ID of the QAuthZ authorization object 3323 against which the client's x509 distinguished name will be 3324 validated. This object is only resolved at time of use, so can be 3325 deleted and recreated on the fly while the chardev server is active. 3326 If missing, it will default to denying access. 3327 3328 TCP and unix socket options are given below: 3329 3330 ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]`` 3331 ``host`` for a listening socket specifies the local address to 3332 be bound. For a connecting socket species the remote host to 3333 connect to. ``host`` is optional for listening sockets. If not 3334 specified it defaults to ``0.0.0.0``. 3335 3336 ``port`` for a listening socket specifies the local port to be 3337 bound. For a connecting socket specifies the port on the remote 3338 host to connect to. ``port`` can be given as either a port 3339 number or a service name. ``port`` is required. 3340 3341 ``to`` is only relevant to listening sockets. If it is 3342 specified, and ``port`` cannot be bound, QEMU will attempt to 3343 bind to subsequent ports up to and including ``to`` until it 3344 succeeds. ``to`` must be specified as a port number. 3345 3346 ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 3347 or IPv6 must be used. If neither is specified the socket may 3348 use either protocol. 3349 3350 ``nodelay=on|off`` disables the Nagle algorithm. 3351 3352 ``unix options: path=path[,abstract=on|off][,tight=on|off]`` 3353 ``path`` specifies the local path of the unix socket. ``path`` 3354 is required. 3355 ``abstract=on|off`` specifies the use of the abstract socket namespace, 3356 rather than the filesystem. Optional, defaults to false. 3357 ``tight=on|off`` sets the socket length of abstract sockets to their minimum, 3358 rather than the full sun_path length. Optional, defaults to true. 3359 3360``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]`` 3361 Sends all traffic from the guest to a remote host over UDP. 3362 3363 ``host`` specifies the remote host to connect to. If not specified 3364 it defaults to ``localhost``. 3365 3366 ``port`` specifies the port on the remote host to connect to. 3367 ``port`` is required. 3368 3369 ``localaddr`` specifies the local address to bind to. If not 3370 specified it defaults to ``0.0.0.0``. 3371 3372 ``localport`` specifies the local port to bind to. If not specified 3373 any available local port will be used. 3374 3375 ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used. 3376 If neither is specified the device may use either protocol. 3377 3378``-chardev msmouse,id=id`` 3379 Forward QEMU's emulated msmouse events to the guest. ``msmouse`` 3380 does not take any options. 3381 3382``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]`` 3383 Connect to a QEMU text console. ``vc`` may optionally be given a 3384 specific size. 3385 3386 ``width`` and ``height`` specify the width and height respectively 3387 of the console, in pixels. 3388 3389 ``cols`` and ``rows`` specify that the console be sized to fit a 3390 text console with the given dimensions. 3391 3392``-chardev ringbuf,id=id[,size=size]`` 3393 Create a ring buffer with fixed size ``size``. size must be a power 3394 of two and defaults to ``64K``. 3395 3396``-chardev file,id=id,path=path`` 3397 Log all traffic received from the guest to a file. 3398 3399 ``path`` specifies the path of the file to be opened. This file will 3400 be created if it does not already exist, and overwritten if it does. 3401 ``path`` is required. 3402 3403``-chardev pipe,id=id,path=path`` 3404 Create a two-way connection to the guest. The behaviour differs 3405 slightly between Windows hosts and other hosts: 3406 3407 On Windows, a single duplex pipe will be created at 3408 ``\\.pipe\path``. 3409 3410 On other hosts, 2 pipes will be created called ``path.in`` and 3411 ``path.out``. Data written to ``path.in`` will be received by the 3412 guest. Data written by the guest can be read from ``path.out``. QEMU 3413 will not create these fifos, and requires them to be present. 3414 3415 ``path`` forms part of the pipe path as described above. ``path`` is 3416 required. 3417 3418``-chardev console,id=id`` 3419 Send traffic from the guest to QEMU's standard output. ``console`` 3420 does not take any options. 3421 3422 ``console`` is only available on Windows hosts. 3423 3424``-chardev serial,id=id,path=path`` 3425 Send traffic from the guest to a serial device on the host. 3426 3427 On Unix hosts serial will actually accept any tty device, not only 3428 serial lines. 3429 3430 ``path`` specifies the name of the serial device to open. 3431 3432``-chardev pty,id=id`` 3433 Create a new pseudo-terminal on the host and connect to it. ``pty`` 3434 does not take any options. 3435 3436 ``pty`` is not available on Windows hosts. 3437 3438``-chardev stdio,id=id[,signal=on|off]`` 3439 Connect to standard input and standard output of the QEMU process. 3440 3441 ``signal`` controls if signals are enabled on the terminal, that 3442 includes exiting QEMU with the key sequence Control-c. This option 3443 is enabled by default, use ``signal=off`` to disable it. 3444 3445``-chardev braille,id=id`` 3446 Connect to a local BrlAPI server. ``braille`` does not take any 3447 options. 3448 3449``-chardev tty,id=id,path=path`` 3450 ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD 3451 and DragonFlyBSD hosts. It is an alias for ``serial``. 3452 3453 ``path`` specifies the path to the tty. ``path`` is required. 3454 3455``-chardev parallel,id=id,path=path`` 3456 \ 3457``-chardev parport,id=id,path=path`` 3458 ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD 3459 hosts. 3460 3461 Connect to a local parallel port. 3462 3463 ``path`` specifies the path to the parallel port device. ``path`` is 3464 required. 3465 3466``-chardev spicevmc,id=id,debug=debug,name=name`` 3467 ``spicevmc`` is only available when spice support is built in. 3468 3469 ``debug`` debug level for spicevmc 3470 3471 ``name`` name of spice channel to connect to 3472 3473 Connect to a spice virtual machine channel, such as vdiport. 3474 3475``-chardev spiceport,id=id,debug=debug,name=name`` 3476 ``spiceport`` is only available when spice support is built in. 3477 3478 ``debug`` debug level for spicevmc 3479 3480 ``name`` name of spice port to connect to 3481 3482 Connect to a spice port, allowing a Spice client to handle the 3483 traffic identified by a name (preferably a fqdn). 3484ERST 3485 3486DEFHEADING() 3487 3488#ifdef CONFIG_TPM 3489DEFHEADING(TPM device options:) 3490 3491DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ 3492 "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" 3493 " use path to provide path to a character device; default is /dev/tpm0\n" 3494 " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" 3495 " not provided it will be searched for in /sys/class/misc/tpm?/device\n" 3496 "-tpmdev emulator,id=id,chardev=dev\n" 3497 " configure the TPM device using chardev backend\n", 3498 QEMU_ARCH_ALL) 3499SRST 3500The general form of a TPM device option is: 3501 3502``-tpmdev backend,id=id[,options]`` 3503 The specific backend type will determine the applicable options. The 3504 ``-tpmdev`` option creates the TPM backend and requires a 3505 ``-device`` option that specifies the TPM frontend interface model. 3506 3507 Use ``-tpmdev help`` to print all available TPM backend types. 3508 3509The available backends are: 3510 3511``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path`` 3512 (Linux-host only) Enable access to the host's TPM using the 3513 passthrough driver. 3514 3515 ``path`` specifies the path to the host's TPM device, i.e., on a 3516 Linux host this would be ``/dev/tpm0``. ``path`` is optional and by 3517 default ``/dev/tpm0`` is used. 3518 3519 ``cancel-path`` specifies the path to the host TPM device's sysfs 3520 entry allowing for cancellation of an ongoing TPM command. 3521 ``cancel-path`` is optional and by default QEMU will search for the 3522 sysfs entry to use. 3523 3524 Some notes about using the host's TPM with the passthrough driver: 3525 3526 The TPM device accessed by the passthrough driver must not be used 3527 by any other application on the host. 3528 3529 Since the host's firmware (BIOS/UEFI) has already initialized the 3530 TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize 3531 the TPM again and may therefore not show a TPM-specific menu that 3532 would otherwise allow the user to configure the TPM, e.g., allow the 3533 user to enable/disable or activate/deactivate the TPM. Further, if 3534 TPM ownership is released from within a VM then the host's TPM will 3535 get disabled and deactivated. To enable and activate the TPM again 3536 afterwards, the host has to be rebooted and the user is required to 3537 enter the firmware's menu to enable and activate the TPM. If the TPM 3538 is left disabled and/or deactivated most TPM commands will fail. 3539 3540 To create a passthrough TPM use the following two options: 3541 3542 :: 3543 3544 -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 3545 3546 Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by 3547 ``tpmdev=tpm0`` in the device option. 3548 3549``-tpmdev emulator,id=id,chardev=dev`` 3550 (Linux-host only) Enable access to a TPM emulator using Unix domain 3551 socket based chardev backend. 3552 3553 ``chardev`` specifies the unique ID of a character device backend 3554 that provides connection to the software TPM server. 3555 3556 To create a TPM emulator backend device with chardev socket backend: 3557 3558 :: 3559 3560 -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 3561ERST 3562 3563DEFHEADING() 3564 3565#endif 3566 3567DEFHEADING(Linux/Multiboot boot specific:) 3568SRST 3569When using these options, you can use a given Linux or Multiboot kernel 3570without installing it in the disk image. It can be useful for easier 3571testing of various kernels. 3572 3573 3574ERST 3575 3576DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \ 3577 "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL) 3578SRST 3579``-kernel bzImage`` 3580 Use bzImage as kernel image. The kernel can be either a Linux kernel 3581 or in multiboot format. 3582ERST 3583 3584DEF("append", HAS_ARG, QEMU_OPTION_append, \ 3585 "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL) 3586SRST 3587``-append cmdline`` 3588 Use cmdline as kernel command line 3589ERST 3590 3591DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \ 3592 "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL) 3593SRST 3594``-initrd file`` 3595 Use file as initial ram disk. 3596 3597``-initrd "file1 arg=foo,file2"`` 3598 This syntax is only available with multiboot. 3599 3600 Use file1 and file2 as modules and pass arg=foo as parameter to the 3601 first module. 3602ERST 3603 3604DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \ 3605 "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL) 3606SRST 3607``-dtb file`` 3608 Use file as a device tree binary (dtb) image and pass it to the 3609 kernel on boot. 3610ERST 3611 3612DEFHEADING() 3613 3614DEFHEADING(Debug/Expert options:) 3615 3616DEF("compat", HAS_ARG, QEMU_OPTION_compat, 3617 "-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n" 3618 " Policy for handling deprecated management interfaces\n", 3619 QEMU_ARCH_ALL) 3620SRST 3621``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]`` 3622 Set policy for handling deprecated management interfaces (experimental): 3623 3624 ``deprecated-input=accept`` (default) 3625 Accept deprecated commands and arguments 3626 ``deprecated-input=reject`` 3627 Reject deprecated commands and arguments 3628 ``deprecated-input=crash`` 3629 Crash on deprecated commands and arguments 3630 ``deprecated-output=accept`` (default) 3631 Emit deprecated command results and events 3632 ``deprecated-output=hide`` 3633 Suppress deprecated command results and events 3634 3635 Limitation: covers only syntactic aspects of QMP. 3636ERST 3637 3638DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, 3639 "-fw_cfg [name=]<name>,file=<file>\n" 3640 " add named fw_cfg entry with contents from file\n" 3641 "-fw_cfg [name=]<name>,string=<str>\n" 3642 " add named fw_cfg entry with contents from string\n", 3643 QEMU_ARCH_ALL) 3644SRST 3645``-fw_cfg [name=]name,file=file`` 3646 Add named fw\_cfg entry with contents from file file. 3647 3648``-fw_cfg [name=]name,string=str`` 3649 Add named fw\_cfg entry with contents from string str. 3650 3651 The terminating NUL character of the contents of str will not be 3652 included as part of the fw\_cfg item data. To insert contents with 3653 embedded NUL characters, you have to use the file parameter. 3654 3655 The fw\_cfg entries are passed by QEMU through to the guest. 3656 3657 Example: 3658 3659 :: 3660 3661 -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin 3662 3663 creates an fw\_cfg entry named opt/com.mycompany/blob with contents 3664 from ./my\_blob.bin. 3665ERST 3666 3667DEF("serial", HAS_ARG, QEMU_OPTION_serial, \ 3668 "-serial dev redirect the serial port to char device 'dev'\n", 3669 QEMU_ARCH_ALL) 3670SRST 3671``-serial dev`` 3672 Redirect the virtual serial port to host character device dev. The 3673 default device is ``vc`` in graphical mode and ``stdio`` in non 3674 graphical mode. 3675 3676 This option can be used several times to simulate up to 4 serial 3677 ports. 3678 3679 Use ``-serial none`` to disable all serial ports. 3680 3681 Available character devices are: 3682 3683 ``vc[:WxH]`` 3684 Virtual console. Optionally, a width and height can be given in 3685 pixel with 3686 3687 :: 3688 3689 vc:800x600 3690 3691 It is also possible to specify width or height in characters: 3692 3693 :: 3694 3695 vc:80Cx24C 3696 3697 ``pty`` 3698 [Linux only] Pseudo TTY (a new PTY is automatically allocated) 3699 3700 ``none`` 3701 No device is allocated. 3702 3703 ``null`` 3704 void device 3705 3706 ``chardev:id`` 3707 Use a named character device defined with the ``-chardev`` 3708 option. 3709 3710 ``/dev/XXX`` 3711 [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial 3712 port parameters are set according to the emulated ones. 3713 3714 ``/dev/parportN`` 3715 [Linux only, parallel port only] Use host parallel port N. 3716 Currently SPP and EPP parallel port features can be used. 3717 3718 ``file:filename`` 3719 Write output to filename. No character can be read. 3720 3721 ``stdio`` 3722 [Unix only] standard input/output 3723 3724 ``pipe:filename`` 3725 name pipe filename 3726 3727 ``COMn`` 3728 [Windows only] Use host serial port n 3729 3730 ``udp:[remote_host]:remote_port[@[src_ip]:src_port]`` 3731 This implements UDP Net Console. When remote\_host or src\_ip 3732 are not specified they default to ``0.0.0.0``. When not using a 3733 specified src\_port a random port is automatically chosen. 3734 3735 If you just want a simple readonly console you can use 3736 ``netcat`` or ``nc``, by starting QEMU with: 3737 ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time 3738 QEMU writes something to that port it will appear in the 3739 netconsole session. 3740 3741 If you plan to send characters back via netconsole or you want 3742 to stop and start QEMU a lot of times, you should have QEMU use 3743 the same source port each time by using something like ``-serial 3744 udp::4555@:4556`` to QEMU. Another approach is to use a patched 3745 version of netcat which can listen to a TCP port and send and 3746 receive characters via udp. If you have a patched version of 3747 netcat which activates telnet remote echo and single char 3748 transfer, then you can use the following options to set up a 3749 netcat redirector to allow telnet on port 5555 to access the 3750 QEMU port. 3751 3752 ``QEMU Options:`` 3753 -serial udp::4555@:4556 3754 3755 ``netcat options:`` 3756 -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T 3757 3758 ``telnet options:`` 3759 localhost 5555 3760 3761 ``tcp:[host]:port[,server=on|off][,wait=on|off][,nodelay=on|off][,reconnect=seconds]`` 3762 The TCP Net Console has two modes of operation. It can send the 3763 serial I/O to a location or wait for a connection from a 3764 location. By default the TCP Net Console is sent to host at the 3765 port. If you use the ``server=on`` option QEMU will wait for a client 3766 socket application to connect to the port before continuing, 3767 unless the ``wait=on|off`` option was specified. The ``nodelay=on|off`` 3768 option disables the Nagle buffering algorithm. The ``reconnect=on`` 3769 option only applies if ``server=no`` is set, if the connection goes 3770 down it will attempt to reconnect at the given interval. If host 3771 is omitted, 0.0.0.0 is assumed. Only one TCP connection at a 3772 time is accepted. You can use ``telnet=on`` to connect to the 3773 corresponding character device. 3774 3775 ``Example to send tcp console to 192.168.0.2 port 4444`` 3776 -serial tcp:192.168.0.2:4444 3777 3778 ``Example to listen and wait on port 4444 for connection`` 3779 -serial tcp::4444,server=on 3780 3781 ``Example to not wait and listen on ip 192.168.0.100 port 4444`` 3782 -serial tcp:192.168.0.100:4444,server=on,wait=off 3783 3784 ``telnet:host:port[,server=on|off][,wait=on|off][,nodelay=on|off]`` 3785 The telnet protocol is used instead of raw tcp sockets. The 3786 options work the same as if you had specified ``-serial tcp``. 3787 The difference is that the port acts like a telnet server or 3788 client using telnet option negotiation. This will also allow you 3789 to send the MAGIC\_SYSRQ sequence if you use a telnet that 3790 supports sending the break sequence. Typically in unix telnet 3791 you do it with Control-] and then type "send break" followed by 3792 pressing the enter key. 3793 3794 ``websocket:host:port,server=on[,wait=on|off][,nodelay=on|off]`` 3795 The WebSocket protocol is used instead of raw tcp socket. The 3796 port acts as a WebSocket server. Client mode is not supported. 3797 3798 ``unix:path[,server=on|off][,wait=on|off][,reconnect=seconds]`` 3799 A unix domain socket is used instead of a tcp socket. The option 3800 works the same as if you had specified ``-serial tcp`` except 3801 the unix domain socket path is used for connections. 3802 3803 ``mon:dev_string`` 3804 This is a special option to allow the monitor to be multiplexed 3805 onto another serial port. The monitor is accessed with key 3806 sequence of Control-a and then pressing c. dev\_string should be 3807 any one of the serial devices specified above. An example to 3808 multiplex the monitor onto a telnet server listening on port 3809 4444 would be: 3810 3811 ``-serial mon:telnet::4444,server=on,wait=off`` 3812 3813 When the monitor is multiplexed to stdio in this way, Ctrl+C 3814 will not terminate QEMU any more but will be passed to the guest 3815 instead. 3816 3817 ``braille`` 3818 Braille device. This will use BrlAPI to display the braille 3819 output on a real or fake device. 3820 3821 ``msmouse`` 3822 Three button serial mouse. Configure the guest to use Microsoft 3823 protocol. 3824ERST 3825 3826DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \ 3827 "-parallel dev redirect the parallel port to char device 'dev'\n", 3828 QEMU_ARCH_ALL) 3829SRST 3830``-parallel dev`` 3831 Redirect the virtual parallel port to host device dev (same devices 3832 as the serial port). On Linux hosts, ``/dev/parportN`` can be used 3833 to use hardware devices connected on the corresponding host parallel 3834 port. 3835 3836 This option can be used several times to simulate up to 3 parallel 3837 ports. 3838 3839 Use ``-parallel none`` to disable all parallel ports. 3840ERST 3841 3842DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \ 3843 "-monitor dev redirect the monitor to char device 'dev'\n", 3844 QEMU_ARCH_ALL) 3845SRST 3846``-monitor dev`` 3847 Redirect the monitor to host device dev (same devices as the serial 3848 port). The default device is ``vc`` in graphical mode and ``stdio`` 3849 in non graphical mode. Use ``-monitor none`` to disable the default 3850 monitor. 3851ERST 3852DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ 3853 "-qmp dev like -monitor but opens in 'control' mode\n", 3854 QEMU_ARCH_ALL) 3855SRST 3856``-qmp dev`` 3857 Like -monitor but opens in 'control' mode. 3858ERST 3859DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \ 3860 "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n", 3861 QEMU_ARCH_ALL) 3862SRST 3863``-qmp-pretty dev`` 3864 Like -qmp but uses pretty JSON formatting. 3865ERST 3866 3867DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ 3868 "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL) 3869SRST 3870``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]`` 3871 Setup monitor on chardev name. ``mode=control`` configures 3872 a QMP monitor (a JSON RPC-style protocol) and it is not the 3873 same as HMP, the human monitor that has a "(qemu)" prompt. 3874 ``pretty`` is only valid when ``mode=control``, 3875 turning on JSON pretty printing to ease 3876 human reading and debugging. 3877ERST 3878 3879DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \ 3880 "-debugcon dev redirect the debug console to char device 'dev'\n", 3881 QEMU_ARCH_ALL) 3882SRST 3883``-debugcon dev`` 3884 Redirect the debug console to host device dev (same devices as the 3885 serial port). The debug console is an I/O port which is typically 3886 port 0xe9; writing to that I/O port sends output to this device. The 3887 default device is ``vc`` in graphical mode and ``stdio`` in non 3888 graphical mode. 3889ERST 3890 3891DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \ 3892 "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL) 3893SRST 3894``-pidfile file`` 3895 Store the QEMU process PID in file. It is useful if you launch QEMU 3896 from a script. 3897ERST 3898 3899DEF("singlestep", 0, QEMU_OPTION_singlestep, \ 3900 "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) 3901SRST 3902``-singlestep`` 3903 Run the emulation in single step mode. 3904ERST 3905 3906DEF("preconfig", 0, QEMU_OPTION_preconfig, \ 3907 "--preconfig pause QEMU before machine is initialized (experimental)\n", 3908 QEMU_ARCH_ALL) 3909SRST 3910``--preconfig`` 3911 Pause QEMU for interactive configuration before the machine is 3912 created, which allows querying and configuring properties that will 3913 affect machine initialization. Use QMP command 'x-exit-preconfig' to 3914 exit the preconfig state and move to the next state (i.e. run guest 3915 if -S isn't used or pause the second time if -S is used). This 3916 option is experimental. 3917ERST 3918 3919DEF("S", 0, QEMU_OPTION_S, \ 3920 "-S freeze CPU at startup (use 'c' to start execution)\n", 3921 QEMU_ARCH_ALL) 3922SRST 3923``-S`` 3924 Do not start CPU at startup (you must type 'c' in the monitor). 3925ERST 3926 3927DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit, 3928 "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n" 3929 " run qemu with overcommit hints\n" 3930 " mem-lock=on|off controls memory lock support (default: off)\n" 3931 " cpu-pm=on|off controls cpu power management (default: off)\n", 3932 QEMU_ARCH_ALL) 3933SRST 3934``-overcommit mem-lock=on|off`` 3935 \ 3936``-overcommit cpu-pm=on|off`` 3937 Run qemu with hints about host resource overcommit. The default is 3938 to assume that host overcommits all resources. 3939 3940 Locking qemu and guest memory can be enabled via ``mem-lock=on`` 3941 (disabled by default). This works when host memory is not 3942 overcommitted and reduces the worst-case latency for guest. 3943 3944 Guest ability to manage power state of host cpus (increasing latency 3945 for other processes on the same host cpu, but decreasing latency for 3946 guest) can be enabled via ``cpu-pm=on`` (disabled by default). This 3947 works best when host CPU is not overcommitted. When used, host 3948 estimates of CPU cycle and power utilization will be incorrect, not 3949 taking into account guest idle time. 3950ERST 3951 3952DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \ 3953 "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n" 3954 " the guest without waiting for gdb to connect; use -S too\n" 3955 " if you want it to not start execution.)\n", 3956 QEMU_ARCH_ALL) 3957SRST 3958``-gdb dev`` 3959 Accept a gdb connection on device dev (see the :ref:`GDB usage` chapter 3960 in the System Emulation Users Guide). Note that this option does not pause QEMU 3961 execution -- if you want QEMU to not start the guest until you 3962 connect with gdb and issue a ``continue`` command, you will need to 3963 also pass the ``-S`` option to QEMU. 3964 3965 The most usual configuration is to listen on a local TCP socket:: 3966 3967 -gdb tcp::3117 3968 3969 but you can specify other backends; UDP, pseudo TTY, or even stdio 3970 are all reasonable use cases. For example, a stdio connection 3971 allows you to start QEMU from within gdb and establish the 3972 connection via a pipe: 3973 3974 .. parsed-literal:: 3975 3976 (gdb) target remote | exec |qemu_system| -gdb stdio ... 3977ERST 3978 3979DEF("s", 0, QEMU_OPTION_s, \ 3980 "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n", 3981 QEMU_ARCH_ALL) 3982SRST 3983``-s`` 3984 Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 3985 (see the :ref:`GDB usage` chapter in the System Emulation Users Guide). 3986ERST 3987 3988DEF("d", HAS_ARG, QEMU_OPTION_d, \ 3989 "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n", 3990 QEMU_ARCH_ALL) 3991SRST 3992``-d item1[,...]`` 3993 Enable logging of specified items. Use '-d help' for a list of log 3994 items. 3995ERST 3996 3997DEF("D", HAS_ARG, QEMU_OPTION_D, \ 3998 "-D logfile output log to logfile (default stderr)\n", 3999 QEMU_ARCH_ALL) 4000SRST 4001``-D logfile`` 4002 Output log in logfile instead of to stderr 4003ERST 4004 4005DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \ 4006 "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n", 4007 QEMU_ARCH_ALL) 4008SRST 4009``-dfilter range1[,...]`` 4010 Filter debug output to that relevant to a range of target addresses. 4011 The filter spec can be either start+size, start-size or start..end 4012 where start end and size are the addresses and sizes required. For 4013 example: 4014 4015 :: 4016 4017 -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000 4018 4019 Will dump output for any code in the 0x1000 sized block starting at 4020 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and 4021 another 0x1000 sized block starting at 0xffffffc00005f000. 4022ERST 4023 4024DEF("seed", HAS_ARG, QEMU_OPTION_seed, \ 4025 "-seed number seed the pseudo-random number generator\n", 4026 QEMU_ARCH_ALL) 4027SRST 4028``-seed number`` 4029 Force the guest to use a deterministic pseudo-random number 4030 generator, seeded with number. This does not affect crypto routines 4031 within the host. 4032ERST 4033 4034DEF("L", HAS_ARG, QEMU_OPTION_L, \ 4035 "-L path set the directory for the BIOS, VGA BIOS and keymaps\n", 4036 QEMU_ARCH_ALL) 4037SRST 4038``-L path`` 4039 Set the directory for the BIOS, VGA BIOS and keymaps. 4040 4041 To list all the data directories, use ``-L help``. 4042ERST 4043 4044DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ 4045 "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) 4046SRST 4047``-bios file`` 4048 Set the filename for the BIOS. 4049ERST 4050 4051DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ 4052 "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL) 4053SRST 4054``-enable-kvm`` 4055 Enable KVM full virtualization support. This option is only 4056 available if KVM support is enabled when compiling. 4057ERST 4058 4059DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid, 4060 "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL) 4061DEF("xen-attach", 0, QEMU_OPTION_xen_attach, 4062 "-xen-attach attach to existing xen domain\n" 4063 " libxl will use this when starting QEMU\n", 4064 QEMU_ARCH_ALL) 4065DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict, 4066 "-xen-domid-restrict restrict set of available xen operations\n" 4067 " to specified domain id. (Does not affect\n" 4068 " xenpv machine type).\n", 4069 QEMU_ARCH_ALL) 4070SRST 4071``-xen-domid id`` 4072 Specify xen guest domain id (XEN only). 4073 4074``-xen-attach`` 4075 Attach to existing xen domain. libxl will use this when starting 4076 QEMU (XEN only). Restrict set of available xen operations to 4077 specified domain id (XEN only). 4078ERST 4079 4080DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \ 4081 "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL) 4082SRST 4083``-no-reboot`` 4084 Exit instead of rebooting. 4085ERST 4086 4087DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \ 4088 "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL) 4089SRST 4090``-no-shutdown`` 4091 Don't exit QEMU on guest shutdown, but instead only stop the 4092 emulation. This allows for instance switching to monitor to commit 4093 changes to the disk image. 4094ERST 4095 4096DEF("action", HAS_ARG, QEMU_OPTION_action, 4097 "-action reboot=reset|shutdown\n" 4098 " action when guest reboots [default=reset]\n" 4099 "-action shutdown=poweroff|pause\n" 4100 " action when guest shuts down [default=poweroff]\n" 4101 "-action panic=pause|shutdown|none\n" 4102 " action when guest panics [default=shutdown]\n" 4103 "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" 4104 " action when watchdog fires [default=reset]\n", 4105 QEMU_ARCH_ALL) 4106SRST 4107``-action event=action`` 4108 The action parameter serves to modify QEMU's default behavior when 4109 certain guest events occur. It provides a generic method for specifying the 4110 same behaviors that are modified by the ``-no-reboot`` and ``-no-shutdown`` 4111 parameters. 4112 4113 Examples: 4114 4115 ``-action panic=none`` 4116 ``-action reboot=shutdown,shutdown=pause`` 4117 ``-watchdog i6300esb -action watchdog=pause`` 4118 4119ERST 4120 4121DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ 4122 "-loadvm [tag|id]\n" \ 4123 " start right away with a saved state (loadvm in monitor)\n", 4124 QEMU_ARCH_ALL) 4125SRST 4126``-loadvm file`` 4127 Start right away with a saved state (``loadvm`` in monitor) 4128ERST 4129 4130#ifndef _WIN32 4131DEF("daemonize", 0, QEMU_OPTION_daemonize, \ 4132 "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL) 4133#endif 4134SRST 4135``-daemonize`` 4136 Daemonize the QEMU process after initialization. QEMU will not 4137 detach from standard IO until it is ready to receive connections on 4138 any of its devices. This option is a useful way for external 4139 programs to launch QEMU without having to cope with initialization 4140 race conditions. 4141ERST 4142 4143DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \ 4144 "-option-rom rom load a file, rom, into the option ROM space\n", 4145 QEMU_ARCH_ALL) 4146SRST 4147``-option-rom file`` 4148 Load the contents of file as an option ROM. This option is useful to 4149 load things like EtherBoot. 4150ERST 4151 4152DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ 4153 "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \ 4154 " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n", 4155 QEMU_ARCH_ALL) 4156 4157SRST 4158``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]`` 4159 Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at 4160 the current UTC or local time, respectively. ``localtime`` is 4161 required for correct date in MS-DOS or Windows. To start at a 4162 specific point in time, provide datetime in the format 4163 ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC. 4164 4165 By default the RTC is driven by the host system time. This allows 4166 using of the RTC as accurate reference clock inside the guest, 4167 specifically if the host time is smoothly following an accurate 4168 external reference clock, e.g. via NTP. If you want to isolate the 4169 guest time from the host, you can set ``clock`` to ``rt`` instead, 4170 which provides a host monotonic clock if host support it. To even 4171 prevent the RTC from progressing during suspension, you can set 4172 ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is 4173 recommended especially in icount mode in order to preserve 4174 determinism; however, note that in icount mode the speed of the 4175 virtual clock is variable and can in general differ from the host 4176 clock. 4177 4178 Enable ``driftfix`` (i386 targets only) if you experience time drift 4179 problems, specifically with Windows' ACPI HAL. This option will try 4180 to figure out how many timer interrupts were not processed by the 4181 Windows guest and will re-inject them. 4182ERST 4183 4184DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ 4185 "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=<filename>[,rrsnapshot=<snapshot>]]\n" \ 4186 " enable virtual instruction counter with 2^N clock ticks per\n" \ 4187 " instruction, enable aligning the host and virtual clocks\n" \ 4188 " or disable real time cpu sleeping, and optionally enable\n" \ 4189 " record-and-replay mode\n", QEMU_ARCH_ALL) 4190SRST 4191``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]`` 4192 Enable virtual instruction counter. The virtual cpu will execute one 4193 instruction every 2^N ns of virtual time. If ``auto`` is specified 4194 then the virtual cpu speed will be automatically adjusted to keep 4195 virtual time within a few seconds of real time. 4196 4197 Note that while this option can give deterministic behavior, it does 4198 not provide cycle accurate emulation. Modern CPUs contain 4199 superscalar out of order cores with complex cache hierarchies. The 4200 number of instructions executed often has little or no correlation 4201 with actual performance. 4202 4203 When the virtual cpu is sleeping, the virtual time will advance at 4204 default speed unless ``sleep=on`` is specified. With 4205 ``sleep=on``, the virtual time will jump to the next timer 4206 deadline instantly whenever the virtual cpu goes to sleep mode and 4207 will not advance if no timer is enabled. This behavior gives 4208 deterministic execution times from the guest point of view. 4209 The default if icount is enabled is ``sleep=off``. 4210 ``sleep=on`` cannot be used together with either ``shift=auto`` 4211 or ``align=on``. 4212 4213 ``align=on`` will activate the delay algorithm which will try to 4214 synchronise the host clock and the virtual clock. The goal is to 4215 have a guest running at the real frequency imposed by the shift 4216 option. Whenever the guest clock is behind the host clock and if 4217 ``align=on`` is specified then we print a message to the user to 4218 inform about the delay. Currently this option does not work when 4219 ``shift`` is ``auto``. Note: The sync algorithm will work for those 4220 shift values for which the guest clock runs ahead of the host clock. 4221 Typically this happens when the shift value is high (how high 4222 depends on the host machine). The default if icount is enabled 4223 is ``align=off``. 4224 4225 When the ``rr`` option is specified deterministic record/replay is 4226 enabled. The ``rrfile=`` option must also be provided to 4227 specify the path to the replay log. In record mode data is written 4228 to this file, and in replay mode it is read back. 4229 If the ``rrsnapshot`` option is given then it specifies a VM snapshot 4230 name. In record mode, a new VM snapshot with the given name is created 4231 at the start of execution recording. In replay mode this option 4232 specifies the snapshot name used to load the initial VM state. 4233ERST 4234 4235DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \ 4236 "-watchdog model\n" \ 4237 " enable virtual hardware watchdog [default=none]\n", 4238 QEMU_ARCH_ALL) 4239SRST 4240``-watchdog model`` 4241 Create a virtual hardware watchdog device. Once enabled (by a guest 4242 action), the watchdog must be periodically polled by an agent inside 4243 the guest or else the guest will be restarted. Choose a model for 4244 which your guest has drivers. 4245 4246 The model is the model of hardware watchdog to emulate. Use 4247 ``-watchdog help`` to list available hardware models. Only one 4248 watchdog can be enabled for a guest. 4249 4250 The following models may be available: 4251 4252 ``ib700`` 4253 iBASE 700 is a very simple ISA watchdog with a single timer. 4254 4255 ``i6300esb`` 4256 Intel 6300ESB I/O controller hub is a much more featureful 4257 PCI-based dual-timer watchdog. 4258 4259 ``diag288`` 4260 A virtual watchdog for s390x backed by the diagnose 288 4261 hypercall (currently KVM only). 4262ERST 4263 4264DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \ 4265 "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \ 4266 " action when watchdog fires [default=reset]\n", 4267 QEMU_ARCH_ALL) 4268SRST 4269``-watchdog-action action`` 4270 The action controls what QEMU will do when the watchdog timer 4271 expires. The default is ``reset`` (forcefully reset the guest). 4272 Other possible actions are: ``shutdown`` (attempt to gracefully 4273 shutdown the guest), ``poweroff`` (forcefully poweroff the guest), 4274 ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the 4275 guest), ``debug`` (print a debug message and continue), or ``none`` 4276 (do nothing). 4277 4278 Note that the ``shutdown`` action requires that the guest responds 4279 to ACPI signals, which it may not be able to do in the sort of 4280 situations where the watchdog would have expired, and thus 4281 ``-watchdog-action shutdown`` is not recommended for production use. 4282 4283 Examples: 4284 4285 ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700`` 4286 4287ERST 4288 4289DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ 4290 "-echr chr set terminal escape character instead of ctrl-a\n", 4291 QEMU_ARCH_ALL) 4292SRST 4293``-echr numeric_ascii_value`` 4294 Change the escape character used for switching to the monitor when 4295 using monitor and serial sharing. The default is ``0x01`` when using 4296 the ``-nographic`` option. ``0x01`` is equal to pressing 4297 ``Control-a``. You can select a different character from the ascii 4298 control keys where 1 through 26 map to Control-a through Control-z. 4299 For instance you could use the either of the following to change the 4300 escape character to Control-t. 4301 4302 ``-echr 0x14``; \ ``-echr 20`` 4303 4304ERST 4305 4306DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ 4307 "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \ 4308 "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \ 4309 "-incoming unix:socketpath\n" \ 4310 " prepare for incoming migration, listen on\n" \ 4311 " specified protocol and socket address\n" \ 4312 "-incoming fd:fd\n" \ 4313 "-incoming exec:cmdline\n" \ 4314 " accept incoming migration on given file descriptor\n" \ 4315 " or from given external command\n" \ 4316 "-incoming defer\n" \ 4317 " wait for the URI to be specified via migrate_incoming\n", 4318 QEMU_ARCH_ALL) 4319SRST 4320``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]`` 4321 \ 4322``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]`` 4323 Prepare for incoming migration, listen on a given tcp port. 4324 4325``-incoming unix:socketpath`` 4326 Prepare for incoming migration, listen on a given unix socket. 4327 4328``-incoming fd:fd`` 4329 Accept incoming migration from a given filedescriptor. 4330 4331``-incoming exec:cmdline`` 4332 Accept incoming migration as an output from specified external 4333 command. 4334 4335``-incoming defer`` 4336 Wait for the URI to be specified via migrate\_incoming. The monitor 4337 can be used to change settings (such as migration parameters) prior 4338 to issuing the migrate\_incoming to allow the migration to begin. 4339ERST 4340 4341DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \ 4342 "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL) 4343SRST 4344``-only-migratable`` 4345 Only allow migratable devices. Devices will not be allowed to enter 4346 an unmigratable state. 4347ERST 4348 4349DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ 4350 "-nodefaults don't create default devices\n", QEMU_ARCH_ALL) 4351SRST 4352``-nodefaults`` 4353 Don't create default devices. Normally, QEMU sets the default 4354 devices like serial port, parallel port, virtual console, monitor 4355 device, VGA adapter, floppy and CD-ROM drive and others. The 4356 ``-nodefaults`` option will disable all those default devices. 4357ERST 4358 4359#ifndef _WIN32 4360DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ 4361 "-chroot dir chroot to dir just before starting the VM\n", 4362 QEMU_ARCH_ALL) 4363#endif 4364SRST 4365``-chroot dir`` 4366 Immediately before starting guest execution, chroot to the specified 4367 directory. Especially useful in combination with -runas. 4368ERST 4369 4370#ifndef _WIN32 4371DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ 4372 "-runas user change to user id user just before starting the VM\n" \ 4373 " user can be numeric uid:gid instead\n", 4374 QEMU_ARCH_ALL) 4375#endif 4376SRST 4377``-runas user`` 4378 Immediately before starting guest execution, drop root privileges, 4379 switching to the specified user. 4380ERST 4381 4382DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, 4383 "-prom-env variable=value\n" 4384 " set OpenBIOS nvram variables\n", 4385 QEMU_ARCH_PPC | QEMU_ARCH_SPARC) 4386SRST 4387``-prom-env variable=value`` 4388 Set OpenBIOS nvram variable to given value (PPC, SPARC only). 4389 4390 :: 4391 4392 qemu-system-sparc -prom-env 'auto-boot?=false' \ 4393 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single' 4394 4395 :: 4396 4397 qemu-system-ppc -prom-env 'auto-boot?=false' \ 4398 -prom-env 'boot-device=hd:2,\yaboot' \ 4399 -prom-env 'boot-args=conf=hd:2,\yaboot.conf' 4400ERST 4401DEF("semihosting", 0, QEMU_OPTION_semihosting, 4402 "-semihosting semihosting mode\n", 4403 QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4404 QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4405SRST 4406``-semihosting`` 4407 Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only). 4408 4409 Note that this allows guest direct access to the host filesystem, so 4410 should only be used with a trusted guest OS. 4411 4412 See the -semihosting-config option documentation for further 4413 information about the facilities this enables. 4414ERST 4415DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config, 4416 "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \ 4417 " semihosting configuration\n", 4418QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4419QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4420SRST 4421``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]`` 4422 Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V 4423 only). 4424 4425 Note that this allows guest direct access to the host filesystem, so 4426 should only be used with a trusted guest OS. 4427 4428 On Arm this implements the standard semihosting API, version 2.0. 4429 4430 On M68K this implements the "ColdFire GDB" interface used by 4431 libgloss. 4432 4433 Xtensa semihosting provides basic file IO calls, such as 4434 open/read/write/seek/select. Tensilica baremetal libc for ISS and 4435 linux platform "sim" use this interface. 4436 4437 On RISC-V this implements the standard semihosting API, version 0.2. 4438 4439 ``target=native|gdb|auto`` 4440 Defines where the semihosting calls will be addressed, to QEMU 4441 (``native``) or to GDB (``gdb``). The default is ``auto``, which 4442 means ``gdb`` during debug sessions and ``native`` otherwise. 4443 4444 ``chardev=str1`` 4445 Send the output to a chardev backend output for native or auto 4446 output when not in gdb 4447 4448 ``arg=str1,arg=str2,...`` 4449 Allows the user to pass input arguments, and can be used 4450 multiple times to build up a list. The old-style 4451 ``-kernel``/``-append`` method of passing a command line is 4452 still supported for backward compatibility. If both the 4453 ``--semihosting-config arg`` and the ``-kernel``/``-append`` are 4454 specified, the former is passed to semihosting as it always 4455 takes precedence. 4456ERST 4457DEF("old-param", 0, QEMU_OPTION_old_param, 4458 "-old-param old param mode\n", QEMU_ARCH_ARM) 4459SRST 4460``-old-param`` 4461 Old param mode (ARM only). 4462ERST 4463 4464DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ 4465 "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \ 4466 " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \ 4467 " Enable seccomp mode 2 system call filter (default 'off').\n" \ 4468 " use 'obsolete' to allow obsolete system calls that are provided\n" \ 4469 " by the kernel, but typically no longer used by modern\n" \ 4470 " C library implementations.\n" \ 4471 " use 'elevateprivileges' to allow or deny the QEMU process ability\n" \ 4472 " to elevate privileges using set*uid|gid system calls.\n" \ 4473 " The value 'children' will deny set*uid|gid system calls for\n" \ 4474 " main QEMU process but will allow forks and execves to run unprivileged\n" \ 4475 " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \ 4476 " blocking *fork and execve\n" \ 4477 " use 'resourcecontrol' to disable process affinity and schedular priority\n", 4478 QEMU_ARCH_ALL) 4479SRST 4480``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]`` 4481 Enable Seccomp mode 2 system call filter. 'on' will enable syscall 4482 filtering and 'off' will disable it. The default is 'off'. 4483 4484 ``obsolete=string`` 4485 Enable Obsolete system calls 4486 4487 ``elevateprivileges=string`` 4488 Disable set\*uid\|gid system calls 4489 4490 ``spawn=string`` 4491 Disable \*fork and execve 4492 4493 ``resourcecontrol=string`` 4494 Disable process affinity and schedular priority 4495ERST 4496 4497DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig, 4498 "-readconfig <file>\n", QEMU_ARCH_ALL) 4499SRST 4500``-readconfig file`` 4501 Read device configuration from file. This approach is useful when 4502 you want to spawn QEMU process with many command line options but 4503 you don't want to exceed the command line character limit. 4504ERST 4505DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig, 4506 "-writeconfig <file>\n" 4507 " read/write config file (deprecated)\n", QEMU_ARCH_ALL) 4508SRST 4509ERST 4510 4511DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, 4512 "-no-user-config\n" 4513 " do not load default user-provided config files at startup\n", 4514 QEMU_ARCH_ALL) 4515SRST 4516``-no-user-config`` 4517 The ``-no-user-config`` option makes QEMU not load any of the 4518 user-provided config files on sysconfdir. 4519ERST 4520 4521DEF("trace", HAS_ARG, QEMU_OPTION_trace, 4522 "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" 4523 " specify tracing options\n", 4524 QEMU_ARCH_ALL) 4525SRST 4526``-trace [[enable=]pattern][,events=file][,file=file]`` 4527 .. include:: ../qemu-option-trace.rst.inc 4528 4529ERST 4530DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, 4531 "-plugin [file=]<file>[,arg=<string>]\n" 4532 " load a plugin\n", 4533 QEMU_ARCH_ALL) 4534SRST 4535``-plugin file=file[,arg=string]`` 4536 Load a plugin. 4537 4538 ``file=file`` 4539 Load the given plugin from a shared library file. 4540 4541 ``arg=string`` 4542 Argument string passed to the plugin. (Can be given multiple 4543 times.) 4544ERST 4545 4546HXCOMM Internal use 4547DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) 4548DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) 4549 4550#ifdef __linux__ 4551DEF("enable-fips", 0, QEMU_OPTION_enablefips, 4552 "-enable-fips enable FIPS 140-2 compliance\n", 4553 QEMU_ARCH_ALL) 4554#endif 4555SRST 4556``-enable-fips`` 4557 Enable FIPS 140-2 compliance mode. 4558ERST 4559 4560DEF("msg", HAS_ARG, QEMU_OPTION_msg, 4561 "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n" 4562 " control error message format\n" 4563 " timestamp=on enables timestamps (default: off)\n" 4564 " guest-name=on enables guest name prefix but only if\n" 4565 " -name guest option is set (default: off)\n", 4566 QEMU_ARCH_ALL) 4567SRST 4568``-msg [timestamp[=on|off]][,guest-name[=on|off]]`` 4569 Control error message format. 4570 4571 ``timestamp=on|off`` 4572 Prefix messages with a timestamp. Default is off. 4573 4574 ``guest-name=on|off`` 4575 Prefix messages with guest name but only if -name guest option is set 4576 otherwise the option is ignored. Default is off. 4577ERST 4578 4579DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate, 4580 "-dump-vmstate <file>\n" 4581 " Output vmstate information in JSON format to file.\n" 4582 " Use the scripts/vmstate-static-checker.py file to\n" 4583 " check for possible regressions in migration code\n" 4584 " by comparing two such vmstate dumps.\n", 4585 QEMU_ARCH_ALL) 4586SRST 4587``-dump-vmstate file`` 4588 Dump json-encoded vmstate information for current machine type to 4589 file in file 4590ERST 4591 4592DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile, 4593 "-enable-sync-profile\n" 4594 " enable synchronization profiling\n", 4595 QEMU_ARCH_ALL) 4596SRST 4597``-enable-sync-profile`` 4598 Enable synchronization profiling. 4599ERST 4600 4601DEFHEADING() 4602 4603DEFHEADING(Generic object creation:) 4604 4605DEF("object", HAS_ARG, QEMU_OPTION_object, 4606 "-object TYPENAME[,PROP1=VALUE1,...]\n" 4607 " create a new object of type TYPENAME setting properties\n" 4608 " in the order they are specified. Note that the 'id'\n" 4609 " property must be set. These objects are placed in the\n" 4610 " '/objects' path.\n", 4611 QEMU_ARCH_ALL) 4612SRST 4613``-object typename[,prop1=value1,...]`` 4614 Create a new object of type typename setting properties in the order 4615 they are specified. Note that the 'id' property must be set. These 4616 objects are placed in the '/objects' path. 4617 4618 ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,readonly=on|off`` 4619 Creates a memory file backend object, which can be used to back 4620 the guest RAM with huge pages. 4621 4622 The ``id`` parameter is a unique ID that will be used to 4623 reference this memory region in other parameters, e.g. ``-numa``, 4624 ``-device nvdimm``, etc. 4625 4626 The ``size`` option provides the size of the memory region, and 4627 accepts common suffixes, e.g. ``500M``. 4628 4629 The ``mem-path`` provides the path to either a shared memory or 4630 huge page filesystem mount. 4631 4632 The ``share`` boolean option determines whether the memory 4633 region is marked as private to QEMU, or shared. The latter 4634 allows a co-operating external process to access the QEMU memory 4635 region. 4636 4637 The ``share`` is also required for pvrdma devices due to 4638 limitations in the RDMA API provided by Linux. 4639 4640 Setting share=on might affect the ability to configure NUMA 4641 bindings for the memory backend under some circumstances, see 4642 Documentation/vm/numa\_memory\_policy.txt on the Linux kernel 4643 source tree for additional details. 4644 4645 Setting the ``discard-data`` boolean option to on indicates that 4646 file contents can be destroyed when QEMU exits, to avoid 4647 unnecessarily flushing data to the backing file. Note that 4648 ``discard-data`` is only an optimization, and QEMU might not 4649 discard file contents if it aborts unexpectedly or is terminated 4650 using SIGKILL. 4651 4652 The ``merge`` boolean option enables memory merge, also known as 4653 MADV\_MERGEABLE, so that Kernel Samepage Merging will consider 4654 the pages for memory deduplication. 4655 4656 Setting the ``dump`` boolean option to off excludes the memory 4657 from core dumps. This feature is also known as MADV\_DONTDUMP. 4658 4659 The ``prealloc`` boolean option enables memory preallocation. 4660 4661 The ``host-nodes`` option binds the memory range to a list of 4662 NUMA host nodes. 4663 4664 The ``policy`` option sets the NUMA policy to one of the 4665 following values: 4666 4667 ``default`` 4668 default host policy 4669 4670 ``preferred`` 4671 prefer the given host node list for allocation 4672 4673 ``bind`` 4674 restrict memory allocation to the given host node list 4675 4676 ``interleave`` 4677 interleave memory allocations across the given host node 4678 list 4679 4680 The ``align`` option specifies the base address alignment when 4681 QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg 4682 ``2M``. Some backend store specified by ``mem-path`` requires an 4683 alignment different than the default one used by QEMU, eg the 4684 device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In 4685 such cases, users can specify the required alignment via this 4686 option. 4687 4688 The ``pmem`` option specifies whether the backing file specified 4689 by ``mem-path`` is in host persistent memory that can be 4690 accessed using the SNIA NVM programming model (e.g. Intel 4691 NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary 4692 operations to guarantee the persistence of its own writes to 4693 ``mem-path`` (e.g. in vNVDIMM label emulation and live 4694 migration). Also, we will map the backend-file with MAP\_SYNC 4695 flag, which ensures the file metadata is in sync for 4696 ``mem-path`` in case of host crash or a power failure. MAP\_SYNC 4697 requires support from both the host kernel (since Linux kernel 4698 4.15) and the filesystem of ``mem-path`` mounted with DAX 4699 option. 4700 4701 The ``readonly`` option specifies whether the backing file is opened 4702 read-only or read-write (default). 4703 4704 ``-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave`` 4705 Creates a memory backend object, which can be used to back the 4706 guest RAM. Memory backend objects offer more control than the 4707 ``-m`` option that is traditionally used to define guest RAM. 4708 Please refer to ``memory-backend-file`` for a description of the 4709 options. 4710 4711 ``-object memory-backend-memfd,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave,seal=on|off,hugetlb=on|off,hugetlbsize=size`` 4712 Creates an anonymous memory file backend object, which allows 4713 QEMU to share the memory with an external process (e.g. when 4714 using vhost-user). The memory is allocated with memfd and 4715 optional sealing. (Linux only) 4716 4717 The ``seal`` option creates a sealed-file, that will block 4718 further resizing the memory ('on' by default). 4719 4720 The ``hugetlb`` option specify the file to be created resides in 4721 the hugetlbfs filesystem (since Linux 4.14). Used in conjunction 4722 with the ``hugetlb`` option, the ``hugetlbsize`` option specify 4723 the hugetlb page size on systems that support multiple hugetlb 4724 page sizes (it must be a power of 2 value supported by the 4725 system). 4726 4727 In some versions of Linux, the ``hugetlb`` option is 4728 incompatible with the ``seal`` option (requires at least Linux 4729 4.16). 4730 4731 Please refer to ``memory-backend-file`` for a description of the 4732 other options. 4733 4734 The ``share`` boolean option is on by default with memfd. 4735 4736 ``-object rng-builtin,id=id`` 4737 Creates a random number generator backend which obtains entropy 4738 from QEMU builtin functions. The ``id`` parameter is a unique ID 4739 that will be used to reference this entropy backend from the 4740 ``virtio-rng`` device. By default, the ``virtio-rng`` device 4741 uses this RNG backend. 4742 4743 ``-object rng-random,id=id,filename=/dev/random`` 4744 Creates a random number generator backend which obtains entropy 4745 from a device on the host. The ``id`` parameter is a unique ID 4746 that will be used to reference this entropy backend from the 4747 ``virtio-rng`` device. The ``filename`` parameter specifies 4748 which file to obtain entropy from and if omitted defaults to 4749 ``/dev/urandom``. 4750 4751 ``-object rng-egd,id=id,chardev=chardevid`` 4752 Creates a random number generator backend which obtains entropy 4753 from an external daemon running on the host. The ``id`` 4754 parameter is a unique ID that will be used to reference this 4755 entropy backend from the ``virtio-rng`` device. The ``chardev`` 4756 parameter is the unique ID of a character device backend that 4757 provides the connection to the RNG daemon. 4758 4759 ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off`` 4760 Creates a TLS anonymous credentials object, which can be used to 4761 provide TLS support on network backends. The ``id`` parameter is 4762 a unique ID which network backends will use to access the 4763 credentials. The ``endpoint`` is either ``server`` or ``client`` 4764 depending on whether the QEMU network backend that uses the 4765 credentials will be acting as a client or as a server. If 4766 ``verify-peer`` is enabled (the default) then once the handshake 4767 is completed, the peer credentials will be verified, though this 4768 is a no-op for anonymous credentials. 4769 4770 The dir parameter tells QEMU where to find the credential files. 4771 For server endpoints, this directory may contain a file 4772 dh-params.pem providing diffie-hellman parameters to use for the 4773 TLS server. If the file is missing, QEMU will generate a set of 4774 DH parameters at startup. This is a computationally expensive 4775 operation that consumes random pool entropy, so it is 4776 recommended that a persistent set of parameters be generated 4777 upfront and saved. 4778 4779 ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]`` 4780 Creates a TLS Pre-Shared Keys (PSK) credentials object, which 4781 can be used to provide TLS support on network backends. The 4782 ``id`` parameter is a unique ID which network backends will use 4783 to access the credentials. The ``endpoint`` is either ``server`` 4784 or ``client`` depending on whether the QEMU network backend that 4785 uses the credentials will be acting as a client or as a server. 4786 For clients only, ``username`` is the username which will be 4787 sent to the server. If omitted it defaults to "qemu". 4788 4789 The dir parameter tells QEMU where to find the keys file. It is 4790 called "dir/keys.psk" and contains "username:key" pairs. This 4791 file can most easily be created using the GnuTLS ``psktool`` 4792 program. 4793 4794 For server endpoints, dir may also contain a file dh-params.pem 4795 providing diffie-hellman parameters to use for the TLS server. 4796 If the file is missing, QEMU will generate a set of DH 4797 parameters at startup. This is a computationally expensive 4798 operation that consumes random pool entropy, so it is 4799 recommended that a persistent set of parameters be generated up 4800 front and saved. 4801 4802 ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id`` 4803 Creates a TLS anonymous credentials object, which can be used to 4804 provide TLS support on network backends. The ``id`` parameter is 4805 a unique ID which network backends will use to access the 4806 credentials. The ``endpoint`` is either ``server`` or ``client`` 4807 depending on whether the QEMU network backend that uses the 4808 credentials will be acting as a client or as a server. If 4809 ``verify-peer`` is enabled (the default) then once the handshake 4810 is completed, the peer credentials will be verified. With x509 4811 certificates, this implies that the clients must be provided 4812 with valid client certificates too. 4813 4814 The dir parameter tells QEMU where to find the credential files. 4815 For server endpoints, this directory may contain a file 4816 dh-params.pem providing diffie-hellman parameters to use for the 4817 TLS server. If the file is missing, QEMU will generate a set of 4818 DH parameters at startup. This is a computationally expensive 4819 operation that consumes random pool entropy, so it is 4820 recommended that a persistent set of parameters be generated 4821 upfront and saved. 4822 4823 For x509 certificate credentials the directory will contain 4824 further files providing the x509 certificates. The certificates 4825 must be stored in PEM format, in filenames ca-cert.pem, 4826 ca-crl.pem (optional), server-cert.pem (only servers), 4827 server-key.pem (only servers), client-cert.pem (only clients), 4828 and client-key.pem (only clients). 4829 4830 For the server-key.pem and client-key.pem files which contain 4831 sensitive private keys, it is possible to use an encrypted 4832 version by providing the passwordid parameter. This provides the 4833 ID of a previously created ``secret`` object containing the 4834 password for decryption. 4835 4836 The priority parameter allows to override the global default 4837 priority used by gnutls. This can be useful if the system 4838 administrator needs to use a weaker set of crypto priorities for 4839 QEMU without potentially forcing the weakness onto all 4840 applications. Or conversely if one wants wants a stronger 4841 default for QEMU than for all other applications, they can do 4842 this through this parameter. Its format is a gnutls priority 4843 string as described at 4844 https://gnutls.org/manual/html_node/Priority-Strings.html. 4845 4846 ``-object tls-cipher-suites,id=id,priority=priority`` 4847 Creates a TLS cipher suites object, which can be used to control 4848 the TLS cipher/protocol algorithms that applications are permitted 4849 to use. 4850 4851 The ``id`` parameter is a unique ID which frontends will use to 4852 access the ordered list of permitted TLS cipher suites from the 4853 host. 4854 4855 The ``priority`` parameter allows to override the global default 4856 priority used by gnutls. This can be useful if the system 4857 administrator needs to use a weaker set of crypto priorities for 4858 QEMU without potentially forcing the weakness onto all 4859 applications. Or conversely if one wants wants a stronger 4860 default for QEMU than for all other applications, they can do 4861 this through this parameter. Its format is a gnutls priority 4862 string as described at 4863 https://gnutls.org/manual/html_node/Priority-Strings.html. 4864 4865 An example of use of this object is to control UEFI HTTPS Boot. 4866 The tls-cipher-suites object exposes the ordered list of permitted 4867 TLS cipher suites from the host side to the guest firmware, via 4868 fw_cfg. The list is represented as an array of IANA_TLS_CIPHER 4869 objects. The firmware uses the IANA_TLS_CIPHER array for configuring 4870 guest-side TLS. 4871 4872 In the following example, the priority at which the host-side policy 4873 is retrieved is given by the ``priority`` property. 4874 Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to 4875 refer to /etc/crypto-policies/back-ends/gnutls.config. 4876 4877 .. parsed-literal:: 4878 4879 # |qemu_system| \\ 4880 -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \\ 4881 -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0 4882 4883 ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]`` 4884 Interval t can't be 0, this filter batches the packet delivery: 4885 all packets arriving in a given interval on netdev netdevid are 4886 delayed until the end of the interval. Interval is in 4887 microseconds. ``status`` is optional that indicate whether the 4888 netfilter is on (enabled) or off (disabled), the default status 4889 for netfilter will be 'on'. 4890 4891 queue all\|rx\|tx is an option that can be applied to any 4892 netfilter. 4893 4894 ``all``: the filter is attached both to the receive and the 4895 transmit queue of the netdev (default). 4896 4897 ``rx``: the filter is attached to the receive queue of the 4898 netdev, where it will receive packets sent to the netdev. 4899 4900 ``tx``: the filter is attached to the transmit queue of the 4901 netdev, where it will receive packets sent by the netdev. 4902 4903 position head\|tail\|id=<id> is an option to specify where the 4904 filter should be inserted in the filter list. It can be applied 4905 to any netfilter. 4906 4907 ``head``: the filter is inserted at the head of the filter list, 4908 before any existing filters. 4909 4910 ``tail``: the filter is inserted at the tail of the filter list, 4911 behind any existing filters (default). 4912 4913 ``id=<id>``: the filter is inserted before or behind the filter 4914 specified by <id>, see the insert option below. 4915 4916 insert behind\|before is an option to specify where to insert 4917 the new filter relative to the one specified with 4918 position=id=<id>. It can be applied to any netfilter. 4919 4920 ``before``: insert before the specified filter. 4921 4922 ``behind``: insert behind the specified filter (default). 4923 4924 ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4925 filter-mirror on netdev netdevid,mirror net packet to 4926 chardevchardevid, if it has the vnet\_hdr\_support flag, 4927 filter-mirror will mirror packet with vnet\_hdr\_len. 4928 4929 ``-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4930 filter-redirector on netdev netdevid,redirect filter's net 4931 packet to chardev chardevid,and redirect indev's packet to 4932 filter.if it has the vnet\_hdr\_support flag, filter-redirector 4933 will redirect packet with vnet\_hdr\_len. Create a 4934 filter-redirector we need to differ outdev id from indev id, id 4935 can not be the same. we can just use indev or outdev, but at 4936 least one of indev or outdev need to be specified. 4937 4938 ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4939 Filter-rewriter is a part of COLO project.It will rewrite tcp 4940 packet to secondary from primary to keep secondary tcp 4941 connection,and rewrite tcp packet to primary from secondary make 4942 tcp packet can be handled by client.if it has the 4943 vnet\_hdr\_support flag, we can parse packet with vnet header. 4944 4945 usage: colo secondary: -object 4946 filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object 4947 filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object 4948 filter-rewriter,id=rew0,netdev=hn0,queue=all 4949 4950 ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]`` 4951 Dump the network traffic on netdev dev to the file specified by 4952 filename. At most len bytes (64k by default) per packet are 4953 stored. The file format is libpcap, so it can be analyzed with 4954 tools such as tcpdump or Wireshark. 4955 4956 ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]`` 4957 Colo-compare gets packet from primary\_in chardevid and 4958 secondary\_in, then compare whether the payload of primary packet 4959 and secondary packet are the same. If same, it will output 4960 primary packet to out\_dev, else it will notify COLO-framework to do 4961 checkpoint and send primary packet to out\_dev. In order to 4962 improve efficiency, we need to put the task of comparison in 4963 another iothread. If it has the vnet\_hdr\_support flag, 4964 colo compare will send/recv packet with vnet\_hdr\_len. 4965 The compare\_timeout=@var{ms} determines the maximum time of the 4966 colo-compare hold the packet. The expired\_scan\_cycle=@var{ms} 4967 is to set the period of scanning expired primary node network packets. 4968 The max\_queue\_size=@var{size} is to set the max compare queue 4969 size depend on user environment. 4970 If user want to use Xen COLO, need to add the notify\_dev to 4971 notify Xen colo-frame to do checkpoint. 4972 4973 COLO-compare must be used with the help of filter-mirror, 4974 filter-redirector and filter-rewriter. 4975 4976 :: 4977 4978 KVM COLO 4979 4980 primary: 4981 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 4982 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 4983 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 4984 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 4985 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 4986 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 4987 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 4988 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 4989 -object iothread,id=iothread1 4990 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 4991 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 4992 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 4993 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1 4994 4995 secondary: 4996 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 4997 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 4998 -chardev socket,id=red0,host=3.3.3.3,port=9003 4999 -chardev socket,id=red1,host=3.3.3.3,port=9004 5000 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5001 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5002 5003 5004 Xen COLO 5005 5006 primary: 5007 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 5008 -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 5009 -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 5010 -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 5011 -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 5012 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 5013 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 5014 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 5015 -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off 5016 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 5017 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 5018 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 5019 -object iothread,id=iothread1 5020 -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1 5021 5022 secondary: 5023 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 5024 -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 5025 -chardev socket,id=red0,host=3.3.3.3,port=9003 5026 -chardev socket,id=red1,host=3.3.3.3,port=9004 5027 -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5028 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5029 5030 If you want to know the detail of above command line, you can 5031 read the colo-compare git log. 5032 5033 ``-object cryptodev-backend-builtin,id=id[,queues=queues]`` 5034 Creates a cryptodev backend which executes crypto opreation from 5035 the QEMU cipher APIS. The id parameter is a unique ID that will 5036 be used to reference this cryptodev backend from the 5037 ``virtio-crypto`` device. The queues parameter is optional, 5038 which specify the queue number of cryptodev backend, the default 5039 of queues is 1. 5040 5041 .. parsed-literal:: 5042 5043 # |qemu_system| \\ 5044 [...] \\ 5045 -object cryptodev-backend-builtin,id=cryptodev0 \\ 5046 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5047 [...] 5048 5049 ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]`` 5050 Creates a vhost-user cryptodev backend, backed by a chardev 5051 chardevid. The id parameter is a unique ID that will be used to 5052 reference this cryptodev backend from the ``virtio-crypto`` 5053 device. The chardev should be a unix domain socket backed one. 5054 The vhost-user uses a specifically defined protocol to pass 5055 vhost ioctl replacement messages to an application on the other 5056 end of the socket. The queues parameter is optional, which 5057 specify the queue number of cryptodev backend for multiqueue 5058 vhost-user, the default of queues is 1. 5059 5060 .. parsed-literal:: 5061 5062 # |qemu_system| \\ 5063 [...] \\ 5064 -chardev socket,id=chardev0,path=/path/to/socket \\ 5065 -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \\ 5066 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5067 [...] 5068 5069 ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]`` 5070 \ 5071 ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]`` 5072 Defines a secret to store a password, encryption key, or some 5073 other sensitive data. The sensitive data can either be passed 5074 directly via the data parameter, or indirectly via the file 5075 parameter. Using the data parameter is insecure unless the 5076 sensitive data is encrypted. 5077 5078 The sensitive data can be provided in raw format (the default), 5079 or base64. When encoded as JSON, the raw format only supports 5080 valid UTF-8 characters, so base64 is recommended for sending 5081 binary data. QEMU will convert from which ever format is 5082 provided to the format it needs internally. eg, an RBD password 5083 can be provided in raw format, even though it will be base64 5084 encoded when passed onto the RBD sever. 5085 5086 For added protection, it is possible to encrypt the data 5087 associated with a secret using the AES-256-CBC cipher. Use of 5088 encryption is indicated by providing the keyid and iv 5089 parameters. The keyid parameter provides the ID of a previously 5090 defined secret that contains the AES-256 decryption key. This 5091 key should be 32-bytes long and be base64 encoded. The iv 5092 parameter provides the random initialization vector used for 5093 encryption of this particular secret and should be a base64 5094 encrypted string of the 16-byte IV. 5095 5096 The simplest (insecure) usage is to provide the secret inline 5097 5098 .. parsed-literal:: 5099 5100 # |qemu_system| -object secret,id=sec0,data=letmein,format=raw 5101 5102 The simplest secure usage is to provide the secret via a file 5103 5104 # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object 5105 secret,id=sec0,file=mypasswd.txt,format=raw 5106 5107 For greater security, AES-256-CBC should be used. To illustrate 5108 usage, consider the openssl command line tool which can encrypt 5109 the data. Note that when encrypting, the plaintext must be 5110 padded to the cipher block size (32 bytes) using the standard 5111 PKCS#5/6 compatible padding algorithm. 5112 5113 First a master key needs to be created in base64 encoding: 5114 5115 :: 5116 5117 # openssl rand -base64 32 > key.b64 5118 # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"') 5119 5120 Each secret to be encrypted needs to have a random 5121 initialization vector generated. These do not need to be kept 5122 secret 5123 5124 :: 5125 5126 # openssl rand -base64 16 > iv.b64 5127 # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"') 5128 5129 The secret to be defined can now be encrypted, in this case 5130 we're telling openssl to base64 encode the result, but it could 5131 be left as raw bytes if desired. 5132 5133 :: 5134 5135 # SECRET=$(printf "letmein" | 5136 openssl enc -aes-256-cbc -a -K $KEY -iv $IV) 5137 5138 When launching QEMU, create a master secret pointing to 5139 ``key.b64`` and specify that to be used to decrypt the user 5140 password. Pass the contents of ``iv.b64`` to the second secret 5141 5142 .. parsed-literal:: 5143 5144 # |qemu_system| \\ 5145 -object secret,id=secmaster0,format=base64,file=key.b64 \\ 5146 -object secret,id=sec0,keyid=secmaster0,format=base64,\\ 5147 data=$SECRET,iv=$(<iv.b64) 5148 5149 ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file]`` 5150 Create a Secure Encrypted Virtualization (SEV) guest object, 5151 which can be used to provide the guest memory encryption support 5152 on AMD processors. 5153 5154 When memory encryption is enabled, one of the physical address 5155 bit (aka the C-bit) is utilized to mark if a memory page is 5156 protected. The ``cbitpos`` is used to provide the C-bit 5157 position. The C-bit position is Host family dependent hence user 5158 must provide this value. On EPYC, the value should be 47. 5159 5160 When memory encryption is enabled, we loose certain bits in 5161 physical address space. The ``reduced-phys-bits`` is used to 5162 provide the number of bits we loose in physical address space. 5163 Similar to C-bit, the value is Host family dependent. On EPYC, 5164 the value should be 5. 5165 5166 The ``sev-device`` provides the device file to use for 5167 communicating with the SEV firmware running inside AMD Secure 5168 Processor. The default device is '/dev/sev'. If hardware 5169 supports memory encryption then /dev/sev devices are created by 5170 CCP driver. 5171 5172 The ``policy`` provides the guest policy to be enforced by the 5173 SEV firmware and restrict what configuration and operational 5174 commands can be performed on this guest by the hypervisor. The 5175 policy should be provided by the guest owner and is bound to the 5176 guest and cannot be changed throughout the lifetime of the 5177 guest. The default is 0. 5178 5179 If guest ``policy`` allows sharing the key with another SEV 5180 guest then ``handle`` can be use to provide handle of the guest 5181 from which to share the key. 5182 5183 The ``dh-cert-file`` and ``session-file`` provides the guest 5184 owner's Public Diffie-Hillman key defined in SEV spec. The PDH 5185 and session parameters are used for establishing a cryptographic 5186 session with the guest owner to negotiate keys used for 5187 attestation. The file must be encoded in base64. 5188 5189 e.g to launch a SEV guest 5190 5191 .. parsed-literal:: 5192 5193 # |qemu_system_x86| \\ 5194 ...... \\ 5195 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \\ 5196 -machine ...,memory-encryption=sev0 \\ 5197 ..... 5198 5199 ``-object authz-simple,id=id,identity=string`` 5200 Create an authorization object that will control access to 5201 network services. 5202 5203 The ``identity`` parameter is identifies the user and its format 5204 depends on the network service that authorization object is 5205 associated with. For authorizing based on TLS x509 certificates, 5206 the identity must be the x509 distinguished name. Note that care 5207 must be taken to escape any commas in the distinguished name. 5208 5209 An example authorization object to validate a x509 distinguished 5210 name would look like: 5211 5212 .. parsed-literal:: 5213 5214 # |qemu_system| \\ 5215 ... \\ 5216 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \\ 5217 ... 5218 5219 Note the use of quotes due to the x509 distinguished name 5220 containing whitespace, and escaping of ','. 5221 5222 ``-object authz-listfile,id=id,filename=path,refresh=on|off`` 5223 Create an authorization object that will control access to 5224 network services. 5225 5226 The ``filename`` parameter is the fully qualified path to a file 5227 containing the access control list rules in JSON format. 5228 5229 An example set of rules that match against SASL usernames might 5230 look like: 5231 5232 :: 5233 5234 { 5235 "rules": [ 5236 { "match": "fred", "policy": "allow", "format": "exact" }, 5237 { "match": "bob", "policy": "allow", "format": "exact" }, 5238 { "match": "danb", "policy": "deny", "format": "glob" }, 5239 { "match": "dan*", "policy": "allow", "format": "exact" }, 5240 ], 5241 "policy": "deny" 5242 } 5243 5244 When checking access the object will iterate over all the rules 5245 and the first rule to match will have its ``policy`` value 5246 returned as the result. If no rules match, then the default 5247 ``policy`` value is returned. 5248 5249 The rules can either be an exact string match, or they can use 5250 the simple UNIX glob pattern matching to allow wildcards to be 5251 used. 5252 5253 If ``refresh`` is set to true the file will be monitored and 5254 automatically reloaded whenever its content changes. 5255 5256 As with the ``authz-simple`` object, the format of the identity 5257 strings being matched depends on the network service, but is 5258 usually a TLS x509 distinguished name, or a SASL username. 5259 5260 An example authorization object to validate a SASL username 5261 would look like: 5262 5263 .. parsed-literal:: 5264 5265 # |qemu_system| \\ 5266 ... \\ 5267 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=on \\ 5268 ... 5269 5270 ``-object authz-pam,id=id,service=string`` 5271 Create an authorization object that will control access to 5272 network services. 5273 5274 The ``service`` parameter provides the name of a PAM service to 5275 use for authorization. It requires that a file 5276 ``/etc/pam.d/service`` exist to provide the configuration for 5277 the ``account`` subsystem. 5278 5279 An example authorization object to validate a TLS x509 5280 distinguished name would look like: 5281 5282 .. parsed-literal:: 5283 5284 # |qemu_system| \\ 5285 ... \\ 5286 -object authz-pam,id=auth0,service=qemu-vnc \\ 5287 ... 5288 5289 There would then be a corresponding config file for PAM at 5290 ``/etc/pam.d/qemu-vnc`` that contains: 5291 5292 :: 5293 5294 account requisite pam_listfile.so item=user sense=allow \ 5295 file=/etc/qemu/vnc.allow 5296 5297 Finally the ``/etc/qemu/vnc.allow`` file would contain the list 5298 of x509 distingished names that are permitted access 5299 5300 :: 5301 5302 CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB 5303 5304 ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink,aio-max-batch=aio-max-batch`` 5305 Creates a dedicated event loop thread that devices can be 5306 assigned to. This is known as an IOThread. By default device 5307 emulation happens in vCPU threads or the main event loop thread. 5308 This can become a scalability bottleneck. IOThreads allow device 5309 emulation and I/O to run on other host CPUs. 5310 5311 The ``id`` parameter is a unique ID that will be used to 5312 reference this IOThread from ``-device ...,iothread=id``. 5313 Multiple devices can be assigned to an IOThread. Note that not 5314 all devices support an ``iothread`` parameter. 5315 5316 The ``query-iothreads`` QMP command lists IOThreads and reports 5317 their thread IDs so that the user can configure host CPU 5318 pinning/affinity. 5319 5320 IOThreads use an adaptive polling algorithm to reduce event loop 5321 latency. Instead of entering a blocking system call to monitor 5322 file descriptors and then pay the cost of being woken up when an 5323 event occurs, the polling algorithm spins waiting for events for 5324 a short time. The algorithm's default parameters are suitable 5325 for many cases but can be adjusted based on knowledge of the 5326 workload and/or host device latency. 5327 5328 The ``poll-max-ns`` parameter is the maximum number of 5329 nanoseconds to busy wait for events. Polling can be disabled by 5330 setting this value to 0. 5331 5332 The ``poll-grow`` parameter is the multiplier used to increase 5333 the polling time when the algorithm detects it is missing events 5334 due to not polling long enough. 5335 5336 The ``poll-shrink`` parameter is the divisor used to decrease 5337 the polling time when the algorithm detects it is spending too 5338 long polling without encountering events. 5339 5340 The ``aio-max-batch`` parameter is the maximum number of requests 5341 in a batch for the AIO engine, 0 means that the engine will use 5342 its default. 5343 5344 The IOThread parameters can be modified at run-time using the 5345 ``qom-set`` command (where ``iothread1`` is the IOThread's 5346 ``id``): 5347 5348 :: 5349 5350 (qemu) qom-set /objects/iothread1 poll-max-ns 100000 5351ERST 5352 5353 5354HXCOMM This is the last statement. Insert new options before this line! 5355 5356#undef DEF 5357#undef DEFHEADING 5358#undef ARCHHEADING 5359