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