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