.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "QEMU.1 1" .TH QEMU.1 1 "2020-07-24" " " " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" qemu\-doc \- QEMU version 3.1.0 User Documentation .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBqemu\-system\-i386\fR [\fIoptions\fR] [\fIdisk_image\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \s-1QEMU PC\s0 System emulator simulates the following peripherals: .IP "\-" 4 i440FX host \s-1PCI\s0 bridge and \s-1PIIX3 PCI\s0 to \s-1ISA\s0 bridge .IP "\-" 4 Cirrus \s-1CLGD 5446 PCI VGA\s0 card or dummy \s-1VGA\s0 card with Bochs \s-1VESA\s0 extensions (hardware level, including all non standard modes). .IP "\-" 4 \&\s-1PS/2\s0 mouse and keyboard .IP "\-" 4 2 \s-1PCI IDE\s0 interfaces with hard disk and CD-ROM support .IP "\-" 4 Floppy disk .IP "\-" 4 \&\s-1PCI\s0 and \s-1ISA\s0 network adapters .IP "\-" 4 Serial ports .IP "\-" 4 \&\s-1IPMI BMC,\s0 either and internal or external one .IP "\-" 4 Creative SoundBlaster 16 sound card .IP "\-" 4 \&\s-1ENSONIQ\s0 AudioPCI \s-1ES1370\s0 sound card .IP "\-" 4 Intel 82801AA \s-1AC97\s0 Audio compatible sound card .IP "\-" 4 Intel \s-1HD\s0 Audio Controller and \s-1HDA\s0 codec .IP "\-" 4 Adlib (\s-1OPL2\s0) \- Yamaha \s-1YM3812\s0 compatible chip .IP "\-" 4 Gravis Ultrasound \s-1GF1\s0 sound card .IP "\-" 4 \&\s-1CS4231A\s0 compatible sound card .IP "\-" 4 \&\s-1PCI UHCI, OHCI, EHCI\s0 or \s-1XHCI USB\s0 controller and a virtual \s-1USB\-1.1\s0 hub. .PP \&\s-1SMP\s0 is supported with up to 255 CPUs. .PP \&\s-1QEMU\s0 uses the \s-1PC BIOS\s0 from the Seabios project and the Plex86/Bochs \s-1LGPL VGA BIOS.\s0 .PP \&\s-1QEMU\s0 uses \s-1YM3812\s0 emulation by Tatsuyuki Satoh. .PP \&\s-1QEMU\s0 uses \s-1GUS\s0 emulation (\s-1GUSEMU32\s0 <\fBhttp://www.deinmeister.de/gusemu/\fR>) by Tibor \*(L"\s-1TS\*(R"\s0 Schütz. .PP Note that, by default, \s-1GUS\s0 shares \s-1\fBIRQ\s0\fR\|(7) with parallel ports and so \&\s-1QEMU\s0 must be told to not have parallel ports to have working \s-1GUS.\s0 .PP .Vb 1 \& qemu\-system\-i386 dos.img \-soundhw gus \-parallel none .Ve .PP Alternatively: .PP .Vb 1 \& qemu\-system\-i386 dos.img \-device gus,irq=5 .Ve .PP Or some other unclaimed \s-1IRQ.\s0 .PP \&\s-1CS4231A\s0 is the chip used in Windows Sound System and \s-1GUSMAX\s0 products .SH "OPTIONS" .IX Header "OPTIONS" \&\fIdisk_image\fR is a raw hard disk image for \s-1IDE\s0 hard disk 0. Some targets do not need a disk image. .PP \fIStandard options\fR .IX Subsection "Standard options" .IP "\fB\-h\fR" 4 .IX Item "-h" Display help and exit .IP "\fB\-version\fR" 4 .IX Item "-version" Display version information and exit .IP "\fB\-machine [type=]\fR\fIname\fR\fB[,prop=\fR\fIvalue\fR\fB[,...]]\fR" 4 .IX Item "-machine [type=]name[,prop=value[,...]]" Select the emulated machine by \fIname\fR. Use \f(CW\*(C`\-machine help\*(C'\fR to list available machines. .Sp For architectures which aim to support live migration compatibility across releases, each release will introduce a new versioned machine type. For example, the 2.8.0 release introduced machine types \&\*(L"pc\-i440fx\-2.8\*(R" and \*(L"pc\-q35\-2.8\*(R" for the x86_64/i686 architectures. .Sp To allow live migration of guests from \s-1QEMU\s0 version 2.8.0, to \s-1QEMU\s0 version 2.9.0, the 2.9.0 version must support the \*(L"pc\-i440fx\-2.8\*(R" and \*(L"pc\-q35\-2.8\*(R" machines too. To allow users live migrating VMs to skip multiple intermediate releases when upgrading, new releases of \s-1QEMU\s0 will support machine types from many previous versions. .Sp Supported machine properties are: .RS 4 .IP "\fBaccel=\fR\fIaccels1\fR\fB[:\fR\fIaccels2\fR\fB[:...]]\fR" 4 .IX Item "accel=accels1[:accels2[:...]]" This is used to enable an accelerator. Depending on the target architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is more than one accelerator specified, the next one is used if the previous one fails to initialize. .IP "\fBkernel_irqchip=on|off\fR" 4 .IX Item "kernel_irqchip=on|off" Controls in-kernel irqchip support for the chosen accelerator when available. .IP "\fBgfx_passthru=on|off\fR" 4 .IX Item "gfx_passthru=on|off" Enables \s-1IGD GFX\s0 passthrough support for the chosen machine when available. .IP "\fBvmport=on|off|auto\fR" 4 .IX Item "vmport=on|off|auto" Enables emulation of VMWare \s-1IO\s0 port, for vmmouse etc. auto says to select the value based on accel. For accel=xen the default is off otherwise the default is on. .IP "\fBkvm_shadow_mem=size\fR" 4 .IX Item "kvm_shadow_mem=size" Defines the size of the \s-1KVM\s0 shadow \s-1MMU.\s0 .IP "\fBdump\-guest\-core=on|off\fR" 4 .IX Item "dump-guest-core=on|off" Include guest memory in a core dump. The default is on. .IP "\fBmem\-merge=on|off\fR" 4 .IX Item "mem-merge=on|off" Enables or disables memory merge support. This feature, when supported by the host, de-duplicates identical memory pages among VMs instances (enabled by default). .IP "\fBaes\-key\-wrap=on|off\fR" 4 .IX Item "aes-key-wrap=on|off" Enables or disables \s-1AES\s0 key wrapping support on s390\-ccw hosts. This feature controls whether \s-1AES\s0 wrapping keys will be created to allow execution of \s-1AES\s0 cryptographic functions. The default is on. .IP "\fBdea\-key\-wrap=on|off\fR" 4 .IX Item "dea-key-wrap=on|off" Enables or disables \s-1DEA\s0 key wrapping support on s390\-ccw hosts. This feature controls whether \s-1DEA\s0 wrapping keys will be created to allow execution of \s-1DEA\s0 cryptographic functions. The default is on. .IP "\fBnvdimm=on|off\fR" 4 .IX Item "nvdimm=on|off" Enables or disables \s-1NVDIMM\s0 support. The default is off. .IP "\fBenforce\-config\-section=on|off\fR" 4 .IX Item "enforce-config-section=on|off" If \fBenforce-config-section\fR is set to \fIon\fR, force migration code to send configuration section even if the machine-type sets the \&\fBmigration.send\-configuration\fR property to \fIoff\fR. \&\s-1NOTE:\s0 this parameter is deprecated. Please use \fB\-global\fR \&\fBmigration.send\-configuration\fR=\fIon|off\fR instead. .IP "\fBmemory\-encryption=\fR" 4 .IX Item "memory-encryption=" Memory encryption object to use. The default is none. .RE .RS 4 .RE .IP "\fB\-cpu\fR \fImodel\fR" 4 .IX Item "-cpu model" Select \s-1CPU\s0 model (\f(CW\*(C`\-cpu help\*(C'\fR for list and additional feature selection) .IP "\fB\-accel\fR \fIname\fR\fB[,prop=\fR\fIvalue\fR\fB[,...]]\fR" 4 .IX Item "-accel name[,prop=value[,...]]" This is used to enable an accelerator. Depending on the target architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is more than one accelerator specified, the next one is used if the previous one fails to initialize. .RS 4 .IP "\fBthread=single|multi\fR" 4 .IX Item "thread=single|multi" Controls number of \s-1TCG\s0 threads. When the \s-1TCG\s0 is multi-threaded there will be one thread per vCPU therefor taking advantage of additional host cores. The default is to enable multi-threading where both the back-end and front-ends support it and no incompatible \s-1TCG\s0 features have been enabled (e.g. icount/replay). .RE .RS 4 .RE .IP "\fB\-smp [cpus=]\fR\fIn\fR\fB[,cores=\fR\fIcores\fR\fB][,threads=\fR\fIthreads\fR\fB][,sockets=\fR\fIsockets\fR\fB][,maxcpus=\fR\fImaxcpus\fR\fB]\fR" 4 .IX Item "-smp [cpus=]n[,cores=cores][,threads=threads][,sockets=sockets][,maxcpus=maxcpus]" Simulate an \s-1SMP\s0 system with \fIn\fR CPUs. On the \s-1PC\s0 target, up to 255 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs to 4. For the \s-1PC\s0 target, the number of \fIcores\fR per socket, the number of \fIthreads\fR per cores and the total number of \fIsockets\fR can be specified. Missing values will be computed. If any on the three values is given, the total number of CPUs \fIn\fR can be omitted. \fImaxcpus\fR specifies the maximum number of hotpluggable CPUs. .IP "\fB\-numa node[,mem=\fR\fIsize\fR\fB][,cpus=\fR\fIfirstcpu\fR\fB[\-\fR\fIlastcpu\fR\fB]][,nodeid=\fR\fInode\fR\fB]\fR" 4 .IX Item "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]" .PD 0 .IP "\fB\-numa node[,memdev=\fR\fIid\fR\fB][,cpus=\fR\fIfirstcpu\fR\fB[\-\fR\fIlastcpu\fR\fB]][,nodeid=\fR\fInode\fR\fB]\fR" 4 .IX Item "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]" .IP "\fB\-numa dist,src=\fR\fIsource\fR\fB,dst=\fR\fIdestination\fR\fB,val=\fR\fIdistance\fR" 4 .IX Item "-numa dist,src=source,dst=destination,val=distance" .IP "\fB\-numa cpu,node\-id=\fR\fInode\fR\fB[,socket\-id=\fR\fIx\fR\fB][,core\-id=\fR\fIy\fR\fB][,thread\-id=\fR\fIz\fR\fB]\fR" 4 .IX Item "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]" .PD Define a \s-1NUMA\s0 node and assign \s-1RAM\s0 and VCPUs to it. Set the \s-1NUMA\s0 distance from a source node to a destination node. .Sp Legacy \s-1VCPU\s0 assignment uses \fBcpus\fR option where \&\fIfirstcpu\fR and \fIlastcpu\fR are \s-1CPU\s0 indexes. Each \&\fBcpus\fR option represent a contiguous range of \s-1CPU\s0 indexes (or a single \s-1VCPU\s0 if \fIlastcpu\fR is omitted). A non-contiguous set of VCPUs can be represented by providing multiple \fBcpus\fR options. If \fBcpus\fR is omitted on all nodes, VCPUs are automatically split between them. .Sp For example, the following option assigns VCPUs 0, 1, 2 and 5 to a \s-1NUMA\s0 node: .Sp .Vb 1 \& \-numa node,cpus=0\-2,cpus=5 .Ve .Sp \&\fBcpu\fR option is a new alternative to \fBcpus\fR option which uses \fBsocket\-id|core\-id|thread\-id\fR properties to assign \&\s-1CPU\s0 objects to a \fInode\fR using topology layout properties of \s-1CPU.\s0 The set of properties is machine specific, and depends on used machine type/\fBsmp\fR options. It could be queried with \&\fBhotpluggable-cpus\fR monitor command. \&\fBnode-id\fR property specifies \fInode\fR to which \s-1CPU\s0 object will be assigned, it's required for \fInode\fR to be declared with \fBnode\fR option before it's used with \fBcpu\fR option. .Sp For example: .Sp .Vb 4 \& \-M pc \e \& \-smp 1,sockets=2,maxcpus=2 \e \& \-numa node,nodeid=0 \-numa node,nodeid=1 \e \& \-numa cpu,node\-id=0,socket\-id=0 \-numa cpu,node\-id=1,socket\-id=1 .Ve .Sp \&\fBmem\fR assigns a given \s-1RAM\s0 amount to a node. \fBmemdev\fR assigns \s-1RAM\s0 from a given memory backend device to a node. If \&\fBmem\fR and \fBmemdev\fR are omitted in all nodes, \s-1RAM\s0 is split equally between them. .Sp \&\fBmem\fR and \fBmemdev\fR are mutually exclusive. Furthermore, if one node uses \fBmemdev\fR, all of them have to use it. .Sp \&\fIsource\fR and \fIdestination\fR are \s-1NUMA\s0 node IDs. \&\fIdistance\fR is the \s-1NUMA\s0 distance from \fIsource\fR to \fIdestination\fR. The distance from a node to itself is always 10. If any pair of nodes is given a distance, then all pairs must be given distances. Although, when distances are only given in one direction for each pair of nodes, then the distances in the opposite directions are assumed to be the same. If, however, an asymmetrical pair of distances is given for even one node pair, then all node pairs must be provided distance values for both directions, even when they are symmetrical. When a node is unreachable from another node, set the pair's distance to 255. .Sp Note that the \-\fBnuma\fR option doesn't allocate any of the specified resources, it just assigns existing resources to \s-1NUMA\s0 nodes. This means that one still has to use the \fB\-m\fR, \&\fB\-smp\fR options to allocate \s-1RAM\s0 and VCPUs respectively. .IP "\fB\-add\-fd fd=\fR\fIfd\fR\fB,set=\fR\fIset\fR\fB[,opaque=\fR\fIopaque\fR\fB]\fR" 4 .IX Item "-add-fd fd=fd,set=set[,opaque=opaque]" Add a file descriptor to an fd set. Valid options are: .RS 4 .IP "\fBfd=\fR\fIfd\fR" 4 .IX Item "fd=fd" This option defines the file descriptor of which a duplicate is added to fd set. The file descriptor cannot be stdin, stdout, or stderr. .IP "\fBset=\fR\fIset\fR" 4 .IX Item "set=set" This option defines the \s-1ID\s0 of the fd set to add the file descriptor to. .IP "\fBopaque=\fR\fIopaque\fR" 4 .IX Item "opaque=opaque" This option defines a free-form string that can be used to describe \fIfd\fR. .RE .RS 4 .Sp You can open an image using pre-opened file descriptors from an fd set: .Sp .Vb 4 \& qemu\-system\-i386 \& \-add\-fd fd=3,set=2,opaque="rdwr:/path/to/file" \& \-add\-fd fd=4,set=2,opaque="rdonly:/path/to/file" \& \-drive file=/dev/fdset/2,index=0,media=disk .Ve .RE .IP "\fB\-set\fR \fIgroup\fR\fB.\fR\fIid\fR\fB.\fR\fIarg\fR\fB=\fR\fIvalue\fR" 4 .IX Item "-set group.id.arg=value" Set parameter \fIarg\fR for item \fIid\fR of type \fIgroup\fR .IP "\fB\-global\fR \fIdriver\fR\fB.\fR\fIprop\fR\fB=\fR\fIvalue\fR" 4 .IX Item "-global driver.prop=value" .PD 0 .IP "\fB\-global driver=\fR\fIdriver\fR\fB,property=\fR\fIproperty\fR\fB,value=\fR\fIvalue\fR" 4 .IX Item "-global driver=driver,property=property,value=value" .PD Set default value of \fIdriver\fR's property \fIprop\fR to \fIvalue\fR, e.g.: .Sp .Vb 1 \& qemu\-system\-i386 \-global ide\-hd.physical_block_size=4096 disk\-image.img .Ve .Sp In particular, you can use this to set driver properties for devices which are created automatically by the machine model. To create a device which is not created automatically and set properties on it, use \-\fBdevice\fR. .Sp \&\-global \fIdriver\fR.\fIprop\fR=\fIvalue\fR is shorthand for \-global driver=\fIdriver\fR,property=\fIprop\fR,value=\fIvalue\fR. The longhand syntax works even when \fIdriver\fR contains a dot. .IP "\fB\-boot [order=\fR\fIdrives\fR\fB][,once=\fR\fIdrives\fR\fB][,menu=on|off][,splash=\fR\fIsp_name\fR\fB][,splash\-time=\fR\fIsp_time\fR\fB][,reboot\-timeout=\fR\fIrb_timeout\fR\fB][,strict=on|off]\fR" 4 .IX Item "-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]" Specify boot order \fIdrives\fR as a string of drive letters. Valid drive letters depend on the target architecture. The x86 \s-1PC\s0 uses: a, b (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n\-p (Etherboot from network adapter 1\-4), hard disk boot is the default. To apply a particular boot order only on the first startup, specify it via \&\fBonce\fR. Note that the \fBorder\fR or \fBonce\fR parameter should not be used together with the \fBbootindex\fR property of devices, since the firmware implementations normally do not support both at the same time. .Sp Interactive boot menus/prompts can be enabled via \fBmenu=on\fR as far as firmware/BIOS supports them. The default is non-interactive boot. .Sp A splash picture could be passed to bios, enabling user to show it as logo, when option splash=\fIsp_name\fR is given and menu=on, If firmware/BIOS supports them. Currently Seabios for X86 system support it. limitation: The splash file could be a jpeg file or a \s-1BMP\s0 file in 24 \s-1BPP\s0 format(true color). The resolution should be supported by the \s-1SVGA\s0 mode, so the recommended is 320x240, 640x480, 800x640. .Sp A timeout could be passed to bios, guest will pause for \fIrb_timeout\fR ms when boot failed, then reboot. If \fIrb_timeout\fR is '\-1', guest will not reboot, qemu passes '\-1' to bios by default. Currently Seabios for X86 system support it. .Sp Do strict boot via \fBstrict=on\fR as far as firmware/BIOS supports it. This only effects when boot priority is changed by bootindex options. The default is non-strict boot. .Sp .Vb 6 \& # try to boot from network first, then from hard disk \& qemu\-system\-i386 \-boot order=nc \& # boot from CD\-ROM first, switch back to default order after reboot \& qemu\-system\-i386 \-boot once=d \& # boot with a splash picture for 5 seconds. \& qemu\-system\-i386 \-boot menu=on,splash=/root/boot.bmp,splash\-time=5000 .Ve .Sp Note: The legacy format '\-boot \fIdrives\fR' is still supported but its use is discouraged as it may be removed from future versions. .IP "\fB\-m [size=]\fR\fImegs\fR\fB[,slots=n,maxmem=size]\fR" 4 .IX Item "-m [size=]megs[,slots=n,maxmem=size]" Sets guest startup \s-1RAM\s0 size to \fImegs\fR megabytes. Default is 128 MiB. Optionally, a suffix of \*(L"M\*(R" or \*(L"G\*(R" can be used to signify a value in megabytes or gigabytes respectively. Optional pair \fIslots\fR, \fImaxmem\fR could be used to set amount of hotpluggable memory slots and maximum amount of memory. Note that \fImaxmem\fR must be aligned to the page size. .Sp For example, the following command-line sets the guest startup \s-1RAM\s0 size to 1GB, creates 3 slots to hotplug additional memory and sets the maximum memory the guest can reach to 4GB: .Sp .Vb 1 \& qemu\-system\-x86_64 \-m 1G,slots=3,maxmem=4G .Ve .Sp If \fIslots\fR and \fImaxmem\fR are not specified, memory hotplug won't be enabled and the guest startup \s-1RAM\s0 will never increase. .IP "\fB\-mem\-path\fR \fIpath\fR" 4 .IX Item "-mem-path path" Allocate guest \s-1RAM\s0 from a temporarily created file in \fIpath\fR. .IP "\fB\-mem\-prealloc\fR" 4 .IX Item "-mem-prealloc" Preallocate memory when using \-mem\-path. .IP "\fB\-k\fR \fIlanguage\fR" 4 .IX Item "-k language" Use keyboard layout \fIlanguage\fR (for example \f(CW\*(C`fr\*(C'\fR for French). This option is only needed where it is not easy to get raw \s-1PC\s0 keycodes (e.g. on Macs, with some X11 servers or with a \s-1VNC\s0 or curses display). You don't normally need to use it on PC/Linux or PC/Windows hosts. .Sp The available layouts are: .Sp .Vb 3 \& ar de\-ch es fo fr\-ca hu ja mk no pt\-br sv \& da en\-gb et fr fr\-ch is lt nl pl ru th \& de en\-us fi fr\-be hr it lv nl\-be pt sl tr .Ve .Sp The default is \f(CW\*(C`en\-us\*(C'\fR. .IP "\fB\-audio\-help\fR" 4 .IX Item "-audio-help" Will show the audio subsystem help: list of drivers, tunable parameters. .IP "\fB\-soundhw\fR \fIcard1\fR\fB[,\fR\fIcard2\fR\fB,...] or \-soundhw all\fR" 4 .IX Item "-soundhw card1[,card2,...] or -soundhw all" Enable audio and selected sound hardware. Use 'help' to print all available sound hardware. .Sp .Vb 6 \& qemu\-system\-i386 \-soundhw sb16,adlib disk.img \& qemu\-system\-i386 \-soundhw es1370 disk.img \& qemu\-system\-i386 \-soundhw ac97 disk.img \& qemu\-system\-i386 \-soundhw hda disk.img \& qemu\-system\-i386 \-soundhw all disk.img \& qemu\-system\-i386 \-soundhw help .Ve .Sp Note that Linux's i810_audio \s-1OSS\s0 kernel (for \s-1AC97\s0) module might require manually specifying clocking. .Sp .Vb 1 \& modprobe i810_audio clocking=48000 .Ve .IP "\fB\-device\fR \fIdriver\fR\fB[,\fR\fIprop\fR\fB[=\fR\fIvalue\fR\fB][,...]]\fR" 4 .IX Item "-device driver[,prop[=value][,...]]" Add device \fIdriver\fR. \fIprop\fR=\fIvalue\fR sets driver properties. Valid properties depend on the driver. To get help on possible drivers and properties, use \f(CW\*(C`\-device help\*(C'\fR and \&\f(CW\*(C`\-device \f(CIdriver\f(CW,help\*(C'\fR. .Sp Some drivers are: .IP "\fB\-device ipmi\-bmc\-sim,id=\fR\fIid\fR\fB[,slave_addr=\fR\fIval\fR\fB][,sdrfile=\fR\fIfile\fR\fB][,furareasize=\fR\fIval\fR\fB][,furdatafile=\fR\fIfile\fR\fB]\fR" 4 .IX Item "-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file]" Add an \s-1IPMI BMC.\s0 This is a simulation of a hardware management interface processor that normally sits on a system. It provides a watchdog and the ability to reset and power control the system. You need to connect this to an \s-1IPMI\s0 interface to make it useful .Sp The \s-1IPMI\s0 slave address to use for the \s-1BMC.\s0 The default is 0x20. This address is the \s-1BMC\s0's address on the I2C network of management controllers. If you don't know what this means, it is safe to ignore it. .RS 4 .IP "\fBbmc=\fR\fIid\fR" 4 .IX Item "bmc=id" The \s-1BMC\s0 to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. .IP "\fBslave_addr=\fR\fIval\fR" 4 .IX Item "slave_addr=val" Define slave address to use for the \s-1BMC.\s0 The default is 0x20. .IP "\fBsdrfile=\fR\fIfile\fR" 4 .IX Item "sdrfile=file" file containing raw Sensor Data Records (\s-1SDR\s0) data. The default is none. .IP "\fBfruareasize=\fR\fIval\fR" 4 .IX Item "fruareasize=val" size of a Field Replaceable Unit (\s-1FRU\s0) area. The default is 1024. .IP "\fBfrudatafile=\fR\fIfile\fR" 4 .IX Item "frudatafile=file" file containing raw Field Replaceable Unit (\s-1FRU\s0) inventory data. The default is none. .RE .RS 4 .RE .IP "\fB\-device ipmi\-bmc\-extern,id=\fR\fIid\fR\fB,chardev=\fR\fIid\fR\fB[,slave_addr=\fR\fIval\fR\fB]\fR" 4 .IX Item "-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]" Add a connection to an external \s-1IPMI BMC\s0 simulator. Instead of locally emulating the \s-1BMC\s0 like the above item, instead connect to an external entity that provides the \s-1IPMI\s0 services. .Sp A connection is made to an external \s-1BMC\s0 simulator. If you do this, it is strongly recommended that you use the \*(L"reconnect=\*(R" chardev option to reconnect to the simulator if the connection is lost. Note that if this is not used carefully, it can be a security issue, as the interface has the ability to send resets, NMIs, and power off the \s-1VM.\s0 It's best if \s-1QEMU\s0 makes a connection to an external simulator running on a secure port on localhost, so neither the simulator nor \s-1QEMU\s0 is exposed to any outside network. .Sp See the \*(L"lanserv/README.vm\*(R" file in the OpenIPMI library for more details on the external interface. .IP "\fB\-device isa\-ipmi\-kcs,bmc=\fR\fIid\fR\fB[,ioport=\fR\fIval\fR\fB][,irq=\fR\fIval\fR\fB]\fR" 4 .IX Item "-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]" Add a \s-1KCS IPMI\s0 interafce on the \s-1ISA\s0 bus. This also adds a corresponding \s-1ACPI\s0 and \s-1SMBIOS\s0 entries, if appropriate. .RS 4 .IP "\fBbmc=\fR\fIid\fR" 4 .IX Item "bmc=id" The \s-1BMC\s0 to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. .IP "\fBioport=\fR\fIval\fR" 4 .IX Item "ioport=val" Define the I/O address of the interface. The default is 0xca0 for \s-1KCS.\s0 .IP "\fBirq=\fR\fIval\fR" 4 .IX Item "irq=val" Define the interrupt to use. The default is 5. To disable interrupts, set this to 0. .RE .RS 4 .RE .IP "\fB\-device isa\-ipmi\-bt,bmc=\fR\fIid\fR\fB[,ioport=\fR\fIval\fR\fB][,irq=\fR\fIval\fR\fB]\fR" 4 .IX Item "-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]" Like the \s-1KCS\s0 interface, but defines a \s-1BT\s0 interface. The default port is 0xe4 and the default interrupt is 5. .IP "\fB\-name\fR \fIname\fR" 4 .IX Item "-name name" Sets the \fIname\fR of the guest. This name will be displayed in the \s-1SDL\s0 window caption. The \fIname\fR will also be used for the \s-1VNC\s0 server. Also optionally set the top visible process name in Linux. Naming of individual threads can also be enabled on Linux to aid debugging. .IP "\fB\-uuid\fR \fIuuid\fR" 4 .IX Item "-uuid uuid" Set system \s-1UUID.\s0 .PP \fIBlock device options\fR .IX Subsection "Block device options" .IP "\fB\-fda\fR \fIfile\fR" 4 .IX Item "-fda file" .PD 0 .IP "\fB\-fdb\fR \fIfile\fR" 4 .IX Item "-fdb file" .PD Use \fIfile\fR as floppy disk 0/1 image. .IP "\fB\-hda\fR \fIfile\fR" 4 .IX Item "-hda file" .PD 0 .IP "\fB\-hdb\fR \fIfile\fR" 4 .IX Item "-hdb file" .IP "\fB\-hdc\fR \fIfile\fR" 4 .IX Item "-hdc file" .IP "\fB\-hdd\fR \fIfile\fR" 4 .IX Item "-hdd file" .PD Use \fIfile\fR as hard disk 0, 1, 2 or 3 image. .IP "\fB\-cdrom\fR \fIfile\fR" 4 .IX Item "-cdrom file" Use \fIfile\fR as CD-ROM image (you cannot use \fB\-hdc\fR and \&\fB\-cdrom\fR at the same time). You can use the host CD-ROM by using \fI/dev/cdrom\fR as filename. .IP "\fB\-blockdev\fR \fIoption\fR\fB[,\fR\fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]]\fR" 4 .IX Item "-blockdev option[,option[,option[,...]]]" Define a new block driver node. Some of the options apply to all block drivers, other options are only accepted for a specific block driver. See below for a list of generic options and options for the most common block drivers. .Sp Options that expect a reference to another node (e.g. \f(CW\*(C`file\*(C'\fR) can be given in two ways. Either you specify the node name of an already existing node (file=\fInode-name\fR), or you define a new node inline, adding options for the referenced node after a dot (file.filename=\fIpath\fR,file.aio=native). .Sp A block driver node created with \fB\-blockdev\fR can be used for a guest device by specifying its node name for the \f(CW\*(C`drive\*(C'\fR property in a \&\fB\-device\fR argument that defines a block device. .RS 4 .IP "\fBValid options for any block driver node:\fR" 4 .IX Item "Valid options for any block driver node:" .RS 4 .PD 0 .ie n .IP """driver""" 4 .el .IP "\f(CWdriver\fR" 4 .IX Item "driver" .PD Specifies the block driver to use for the given node. .ie n .IP """node\-name""" 4 .el .IP "\f(CWnode\-name\fR" 4 .IX Item "node-name" This defines the name of the block driver node by which it will be referenced later. The name must be unique, i.e. it must not match the name of a different block driver node, or (if you use \fB\-drive\fR as well) the \s-1ID\s0 of a drive. .Sp If no node name is specified, it is automatically generated. The generated node name is not intended to be predictable and changes between \s-1QEMU\s0 invocations. For the top level, an explicit node name must be specified. .ie n .IP """read\-only""" 4 .el .IP "\f(CWread\-only\fR" 4 .IX Item "read-only" Open the node read-only. Guest write attempts will fail. .ie n .IP """cache.direct""" 4 .el .IP "\f(CWcache.direct\fR" 4 .IX Item "cache.direct" The host page cache can be avoided with \fBcache.direct=on\fR. This will attempt to do disk \s-1IO\s0 directly to the guest's memory. \s-1QEMU\s0 may still perform an internal copy of the data. .ie n .IP """cache.no\-flush""" 4 .el .IP "\f(CWcache.no\-flush\fR" 4 .IX Item "cache.no-flush" In case you don't care about data integrity over host failures, you can use \&\fBcache.no\-flush=on\fR. This option tells \s-1QEMU\s0 that it never needs to write any data to the disk but can instead keep things in cache. If anything goes wrong, like your host losing power, the disk storage getting disconnected accidentally, etc. your image will most probably be rendered unusable. .ie n .IP """discard=\fIdiscard\fP""" 4 .el .IP "\f(CWdiscard=\f(CIdiscard\f(CW\fR" 4 .IX Item "discard=discard" \&\fIdiscard\fR is one of \*(L"ignore\*(R" (or \*(L"off\*(R") or \*(L"unmap\*(R" (or \*(L"on\*(R") and controls whether \f(CW\*(C`discard\*(C'\fR (also known as \f(CW\*(C`trim\*(C'\fR or \f(CW\*(C`unmap\*(C'\fR) requests are ignored or passed to the filesystem. Some machine types may not support discard requests. .ie n .IP """detect\-zeroes=\fIdetect\-zeroes\fP""" 4 .el .IP "\f(CWdetect\-zeroes=\f(CIdetect\-zeroes\f(CW\fR" 4 .IX Item "detect-zeroes=detect-zeroes" \&\fIdetect-zeroes\fR is \*(L"off\*(R", \*(L"on\*(R" or \*(L"unmap\*(R" and enables the automatic conversion of plain zero writes by the \s-1OS\s0 to driver specific optimized zero write commands. You may even choose \*(L"unmap\*(R" if \fIdiscard\fR is set to \*(L"unmap\*(R" to allow a zero write to be converted to an \f(CW\*(C`unmap\*(C'\fR operation. .RE .RS 4 .RE .ie n .IP "\fBDriver-specific options for \f(CB""file""\fB\fR" 4 .el .IP "\fBDriver-specific options for \f(CBfile\fB\fR" 4 .IX Item "Driver-specific options for file" This is the protocol-level block driver for accessing regular files. .RS 4 .ie n .IP """filename""" 4 .el .IP "\f(CWfilename\fR" 4 .IX Item "filename" The path to the image file in the local filesystem .ie n .IP """aio""" 4 .el .IP "\f(CWaio\fR" 4 .IX Item "aio" Specifies the \s-1AIO\s0 backend (threads/native, default: threads) .ie n .IP """locking""" 4 .el .IP "\f(CWlocking\fR" 4 .IX Item "locking" Specifies whether the image file is protected with Linux \s-1OFD / POSIX\s0 locks. The default is to use the Linux Open File Descriptor \s-1API\s0 if available, otherwise no lock is applied. (auto/on/off, default: auto) .RE .RS 4 .Sp Example: .Sp .Vb 1 \& \-blockdev driver=file,node\-name=disk,filename=disk.img .Ve .RE .ie n .IP "\fBDriver-specific options for \f(CB""raw""\fB\fR" 4 .el .IP "\fBDriver-specific options for \f(CBraw\fB\fR" 4 .IX Item "Driver-specific options for raw" This is the image format block driver for raw images. It is usually stacked on top of a protocol level block driver such as \f(CW\*(C`file\*(C'\fR. .RS 4 .ie n .IP """file""" 4 .el .IP "\f(CWfile\fR" 4 .IX Item "file" Reference to or definition of the data source block driver node (e.g. a \f(CW\*(C`file\*(C'\fR driver node) .RE .RS 4 .Sp Example 1: .Sp .Vb 2 \& \-blockdev driver=file,node\-name=disk_file,filename=disk.img \& \-blockdev driver=raw,node\-name=disk,file=disk_file .Ve .Sp Example 2: .Sp .Vb 1 \& \-blockdev driver=raw,node\-name=disk,file.driver=file,file.filename=disk.img .Ve .RE .ie n .IP "\fBDriver-specific options for \f(CB""qcow2""\fB\fR" 4 .el .IP "\fBDriver-specific options for \f(CBqcow2\fB\fR" 4 .IX Item "Driver-specific options for qcow2" This is the image format block driver for qcow2 images. It is usually stacked on top of a protocol level block driver such as \f(CW\*(C`file\*(C'\fR. .RS 4 .ie n .IP """file""" 4 .el .IP "\f(CWfile\fR" 4 .IX Item "file" Reference to or definition of the data source block driver node (e.g. a \f(CW\*(C`file\*(C'\fR driver node) .ie n .IP """backing""" 4 .el .IP "\f(CWbacking\fR" 4 .IX Item "backing" Reference to or definition of the backing file block device (default is taken from the image file). It is allowed to pass \f(CW\*(C`null\*(C'\fR here in order to disable the default backing file. .ie n .IP """lazy\-refcounts""" 4 .el .IP "\f(CWlazy\-refcounts\fR" 4 .IX Item "lazy-refcounts" Whether to enable the lazy refcounts feature (on/off; default is taken from the image file) .ie n .IP """cache\-size""" 4 .el .IP "\f(CWcache\-size\fR" 4 .IX Item "cache-size" The maximum total size of the L2 table and refcount block caches in bytes (default: the sum of l2\-cache\-size and refcount-cache-size) .ie n .IP """l2\-cache\-size""" 4 .el .IP "\f(CWl2\-cache\-size\fR" 4 .IX Item "l2-cache-size" The maximum size of the L2 table cache in bytes (default: if cache-size is not specified \- 32M on Linux platforms, and 8M on non-Linux platforms; otherwise, as large as possible within the cache-size, while permitting the requested or the minimal refcount cache size) .ie n .IP """refcount\-cache\-size""" 4 .el .IP "\f(CWrefcount\-cache\-size\fR" 4 .IX Item "refcount-cache-size" The maximum size of the refcount block cache in bytes (default: 4 times the cluster size; or if cache-size is specified, the part of it which is not used for the L2 cache) .ie n .IP """cache\-clean\-interval""" 4 .el .IP "\f(CWcache\-clean\-interval\fR" 4 .IX Item "cache-clean-interval" Clean unused entries in the L2 and refcount caches. The interval is in seconds. The default value is 600 on supporting platforms, and 0 on other platforms. Setting it to 0 disables this feature. .ie n .IP """pass\-discard\-request""" 4 .el .IP "\f(CWpass\-discard\-request\fR" 4 .IX Item "pass-discard-request" Whether discard requests to the qcow2 device should be forwarded to the data source (on/off; default: on if discard=unmap is specified, off otherwise) .ie n .IP """pass\-discard\-snapshot""" 4 .el .IP "\f(CWpass\-discard\-snapshot\fR" 4 .IX Item "pass-discard-snapshot" Whether discard requests for the data source should be issued when a snapshot operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/off; default: on) .ie n .IP """pass\-discard\-other""" 4 .el .IP "\f(CWpass\-discard\-other\fR" 4 .IX Item "pass-discard-other" Whether discard requests for the data source should be issued on other occasions where a cluster gets freed (on/off; default: off) .ie n .IP """overlap\-check""" 4 .el .IP "\f(CWoverlap\-check\fR" 4 .IX Item "overlap-check" Which overlap checks to perform for writes to the image (none/constant/cached/all; default: cached). For details or finer granularity control refer to the \s-1QAPI\s0 documentation of \f(CW\*(C`blockdev\-add\*(C'\fR. .RE .RS 4 .Sp Example 1: .Sp .Vb 2 \& \-blockdev driver=file,node\-name=my_file,filename=/tmp/disk.qcow2 \& \-blockdev driver=qcow2,node\-name=hda,file=my_file,overlap\-check=none,cache\-size=16777216 .Ve .Sp Example 2: .Sp .Vb 1 \& \-blockdev driver=qcow2,node\-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 .Ve .RE .IP "\fBDriver-specific options for other drivers\fR" 4 .IX Item "Driver-specific options for other drivers" Please refer to the \s-1QAPI\s0 documentation of the \f(CW\*(C`blockdev\-add\*(C'\fR \s-1QMP\s0 command. .RE .RS 4 .RE .IP "\fB\-drive\fR \fIoption\fR\fB[,\fR\fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]]\fR" 4 .IX Item "-drive option[,option[,option[,...]]]" Define a new drive. This includes creating a block driver node (the backend) as well as a guest device, and is mostly a shortcut for defining the corresponding \&\fB\-blockdev\fR and \fB\-device\fR options. .Sp \&\fB\-drive\fR accepts all options that are accepted by \fB\-blockdev\fR. In addition, it knows the following options: .RS 4 .IP "\fBfile=\fR\fIfile\fR" 4 .IX Item "file=file" This option defines which disk image to use with this drive. If the filename contains comma, you must double it (for instance, \*(L"file=my,,file\*(R" to use file \*(L"my,file\*(R"). .Sp Special files such as iSCSI devices can be specified using protocol specific URLs. See the section for \*(L"Device \s-1URL\s0 Syntax\*(R" for more information. .IP "\fBif=\fR\fIinterface\fR" 4 .IX Item "if=interface" This option defines on which type on interface the drive is connected. Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none. .IP "\fBbus=\fR\fIbus\fR\fB,unit=\fR\fIunit\fR" 4 .IX Item "bus=bus,unit=unit" These options define where is connected the drive by defining the bus number and the unit id. .IP "\fBindex=\fR\fIindex\fR" 4 .IX Item "index=index" This option defines where is connected the drive by using an index in the list of available connectors of a given interface type. .IP "\fBmedia=\fR\fImedia\fR" 4 .IX Item "media=media" This option defines the type of the media: disk or cdrom. .IP "\fBsnapshot=\fR\fIsnapshot\fR" 4 .IX Item "snapshot=snapshot" \&\fIsnapshot\fR is \*(L"on\*(R" or \*(L"off\*(R" and controls snapshot mode for the given drive (see \fB\-snapshot\fR). .IP "\fBcache=\fR\fIcache\fR" 4 .IX Item "cache=cache" \&\fIcache\fR is \*(L"none\*(R", \*(L"writeback\*(R", \*(L"unsafe\*(R", \*(L"directsync\*(R" or \*(L"writethrough\*(R" and controls how the host cache is used to access block data. This is a shortcut that sets the \fBcache.direct\fR and \fBcache.no\-flush\fR options (as in \fB\-blockdev\fR), and additionally \fBcache.writeback\fR, which provides a default for the \fBwrite-cache\fR option of block guest devices (as in \fB\-device\fR). The modes correspond to the following settings: .Sp .Vb 7 \& │ cache.writeback cache.direct cache.no\-flush \& ─────────────┼───────────────────────────────────────────────── \& writeback │ on off off \& none │ on on off \& writethrough │ off off off \& directsync │ off on off \& unsafe │ on off on .Ve .Sp The default mode is \fBcache=writeback\fR. .IP "\fBaio=\fR\fIaio\fR" 4 .IX Item "aio=aio" \&\fIaio\fR is \*(L"threads\*(R", or \*(L"native\*(R" and selects between pthread based disk I/O and native Linux \s-1AIO.\s0 .IP "\fBformat=\fR\fIformat\fR" 4 .IX Item "format=format" Specify which disk \fIformat\fR will be used rather than detecting the format. Can be used to specify format=raw to avoid interpreting an untrusted format header. .IP "\fBwerror=\fR\fIaction\fR\fB,rerror=\fR\fIaction\fR" 4 .IX Item "werror=action,rerror=action" Specify which \fIaction\fR to take on write and read errors. Valid actions are: \&\*(L"ignore\*(R" (ignore the error and try to continue), \*(L"stop\*(R" (pause \s-1QEMU\s0), \&\*(L"report\*(R" (report the error to the guest), \*(L"enospc\*(R" (pause \s-1QEMU\s0 only if the host disk is full; report the error to the guest otherwise). The default setting is \fBwerror=enospc\fR and \fBrerror=report\fR. .IP "\fBcopy\-on\-read=\fR\fIcopy-on-read\fR" 4 .IX Item "copy-on-read=copy-on-read" \&\fIcopy-on-read\fR is \*(L"on\*(R" or \*(L"off\*(R" and enables whether to copy read backing file sectors into the image file. .IP "\fBbps=\fR\fIb\fR\fB,bps_rd=\fR\fIr\fR\fB,bps_wr=\fR\fIw\fR" 4 .IX Item "bps=b,bps_rd=r,bps_wr=w" Specify bandwidth throttling limits in bytes per second, either for all request types or for reads or writes only. Small values can lead to timeouts or hangs inside the guest. A safe minimum for disks is 2 MB/s. .IP "\fBbps_max=\fR\fIbm\fR\fB,bps_rd_max=\fR\fIrm\fR\fB,bps_wr_max=\fR\fIwm\fR" 4 .IX Item "bps_max=bm,bps_rd_max=rm,bps_wr_max=wm" Specify bursts in bytes per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily. .IP "\fBiops=\fR\fIi\fR\fB,iops_rd=\fR\fIr\fR\fB,iops_wr=\fR\fIw\fR" 4 .IX Item "iops=i,iops_rd=r,iops_wr=w" Specify request rate limits in requests per second, either for all request types or for reads or writes only. .IP "\fBiops_max=\fR\fIbm\fR\fB,iops_rd_max=\fR\fIrm\fR\fB,iops_wr_max=\fR\fIwm\fR" 4 .IX Item "iops_max=bm,iops_rd_max=rm,iops_wr_max=wm" Specify bursts in requests per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily. .IP "\fBiops_size=\fR\fIis\fR" 4 .IX Item "iops_size=is" Let every \fIis\fR bytes of a request count as a new request for iops throttling purposes. Use this option to prevent guests from circumventing iops limits by sending fewer but larger requests. .IP "\fBgroup=\fR\fIg\fR" 4 .IX Item "group=g" Join a throttling quota group with given name \fIg\fR. All drives that are members of the same group are accounted for together. Use this option to prevent guests from circumventing throttling limits by using many small disks instead of a single larger disk. .RE .RS 4 .Sp By default, the \fBcache.writeback=on\fR mode is used. It will report data writes as completed as soon as the data is present in the host page cache. This is safe as long as your guest \s-1OS\s0 makes sure to correctly flush disk caches where needed. If your guest \s-1OS\s0 does not handle volatile disk write caches correctly and your host crashes or loses power, then the guest may experience data corruption. .Sp For such guests, you should consider using \fBcache.writeback=off\fR. This means that the host page cache will be used to read and write data, but write notification will be sent to the guest only after \s-1QEMU\s0 has made sure to flush each write to the disk. Be aware that this has a major impact on performance. .Sp When using the \fB\-snapshot\fR option, unsafe caching is always used. .Sp Copy-on-read avoids accessing the same backing file sectors repeatedly and is useful when the backing file is over a slow network. By default copy-on-read is off. .Sp Instead of \fB\-cdrom\fR you can use: .Sp .Vb 1 \& qemu\-system\-i386 \-drive file=file,index=2,media=cdrom .Ve .Sp Instead of \fB\-hda\fR, \fB\-hdb\fR, \fB\-hdc\fR, \fB\-hdd\fR, you can use: .Sp .Vb 4 \& qemu\-system\-i386 \-drive file=file,index=0,media=disk \& qemu\-system\-i386 \-drive file=file,index=1,media=disk \& qemu\-system\-i386 \-drive file=file,index=2,media=disk \& qemu\-system\-i386 \-drive file=file,index=3,media=disk .Ve .Sp You can open an image using pre-opened file descriptors from an fd set: .Sp .Vb 4 \& qemu\-system\-i386 \& \-add\-fd fd=3,set=2,opaque="rdwr:/path/to/file" \& \-add\-fd fd=4,set=2,opaque="rdonly:/path/to/file" \& \-drive file=/dev/fdset/2,index=0,media=disk .Ve .Sp You can connect a \s-1CDROM\s0 to the slave of ide0: .Sp .Vb 1 \& qemu\-system\-i386 \-drive file=file,if=ide,index=1,media=cdrom .Ve .Sp If you don't specify the \*(L"file=\*(R" argument, you define an empty drive: .Sp .Vb 1 \& qemu\-system\-i386 \-drive if=ide,index=1,media=cdrom .Ve .Sp Instead of \fB\-fda\fR, \fB\-fdb\fR, you can use: .Sp .Vb 2 \& qemu\-system\-i386 \-drive file=file,index=0,if=floppy \& qemu\-system\-i386 \-drive file=file,index=1,if=floppy .Ve .Sp By default, \fIinterface\fR is \*(L"ide\*(R" and \fIindex\fR is automatically incremented: .Sp .Vb 1 \& qemu\-system\-i386 \-drive file=a \-drive file=b" .Ve .Sp is interpreted like: .Sp .Vb 1 \& qemu\-system\-i386 \-hda a \-hdb b .Ve .RE .IP "\fB\-mtdblock\fR \fIfile\fR" 4 .IX Item "-mtdblock file" Use \fIfile\fR as on-board Flash memory image. .IP "\fB\-sd\fR \fIfile\fR" 4 .IX Item "-sd file" Use \fIfile\fR as SecureDigital card image. .IP "\fB\-pflash\fR \fIfile\fR" 4 .IX Item "-pflash file" Use \fIfile\fR as a parallel flash image. .IP "\fB\-snapshot\fR" 4 .IX Item "-snapshot" Write to temporary files instead of disk image files. In this case, the raw disk image you use is not written back. You can however force the write back by pressing \fBC\-a s\fR. .IP "\fB\-fsdev\fR \fIfsdriver\fR\fB,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR\fB,[security_model=\fR\fIsecurity_model\fR\fB][,writeout=\fR\fIwriteout\fR\fB][,readonly][,socket=\fR\fIsocket\fR\fB|sock_fd=\fR\fIsock_fd\fR\fB][,fmode=\fR\fIfmode\fR\fB][,dmode=\fR\fIdmode\fR\fB]\fR" 4 .IX Item "-fsdev fsdriver,id=id,path=path,[security_model=security_model][,writeout=writeout][,readonly][,socket=socket|sock_fd=sock_fd][,fmode=fmode][,dmode=dmode]" Define a new file system device. Valid options are: .RS 4 .IP "\fIfsdriver\fR" 4 .IX Item "fsdriver" This option specifies the fs driver backend to use. Currently \*(L"local\*(R", \*(L"handle\*(R" and \*(L"proxy\*(R" file system drivers are supported. .IP "\fBid=\fR\fIid\fR" 4 .IX Item "id=id" Specifies identifier for this device .IP "\fBpath=\fR\fIpath\fR" 4 .IX Item "path=path" Specifies the export path for the file system device. Files under this path will be available to the 9p client on the guest. .IP "\fBsecurity_model=\fR\fIsecurity_model\fR" 4 .IX Item "security_model=security_model" Specifies the security model to be used for this export path. Supported security models are \*(L"passthrough\*(R", \*(L"mapped-xattr\*(R", \*(L"mapped-file\*(R" and \*(L"none\*(R". In \*(L"passthrough\*(R" security model, files are stored using the same credentials as they are created on the guest. This requires \s-1QEMU\s0 to run as root. In \*(L"mapped-xattr\*(R" security model, some of the file attributes like uid, gid, mode bits and link target are stored as file attributes. For \*(L"mapped-file\*(R" these attributes are stored in the hidden .virtfs_metadata directory. Directories exported by this security model cannot interact with other unix tools. \*(L"none\*(R" security model is same as passthrough except the sever won't report failures if it fails to set file attributes like ownership. Security model is mandatory only for local fsdriver. Other fsdrivers (like handle, proxy) don't take security model as a parameter. .IP "\fBwriteout=\fR\fIwriteout\fR" 4 .IX Item "writeout=writeout" This is an optional argument. The only supported value is \*(L"immediate\*(R". This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem. .IP "\fBreadonly\fR" 4 .IX Item "readonly" Enables exporting 9p share as a readonly mount for guests. By default read-write access is given. .IP "\fBsocket=\fR\fIsocket\fR" 4 .IX Item "socket=socket" Enables proxy filesystem driver to use passed socket file for communicating with virtfs-proxy-helper .IP "\fBsock_fd=\fR\fIsock_fd\fR" 4 .IX Item "sock_fd=sock_fd" Enables proxy filesystem driver to use passed socket descriptor for communicating with virtfs-proxy-helper. Usually a helper like libvirt will create socketpair and pass one of the fds as sock_fd .IP "\fBfmode=\fR\fIfmode\fR" 4 .IX Item "fmode=fmode" Specifies the default mode for newly created files on the host. Works only with security models \*(L"mapped-xattr\*(R" and \*(L"mapped-file\*(R". .IP "\fBdmode=\fR\fIdmode\fR" 4 .IX Item "dmode=dmode" Specifies the default mode for newly created directories on the host. Works only with security models \*(L"mapped-xattr\*(R" and \*(L"mapped-file\*(R". .RE .RS 4 .Sp \&\-fsdev option is used along with \-device driver \*(L"virtio\-9p\-pci\*(R". .RE .IP "\fB\-device virtio\-9p\-pci,fsdev=\fR\fIid\fR\fB,mount_tag=\fR\fImount_tag\fR" 4 .IX Item "-device virtio-9p-pci,fsdev=id,mount_tag=mount_tag" Options for virtio\-9p\-pci driver are: .RS 4 .IP "\fBfsdev=\fR\fIid\fR" 4 .IX Item "fsdev=id" Specifies the id value specified along with \-fsdev option .IP "\fBmount_tag=\fR\fImount_tag\fR" 4 .IX Item "mount_tag=mount_tag" Specifies the tag name to be used by the guest to mount this export point .RE .RS 4 .RE .IP "\fB\-virtfs\fR \fIfsdriver\fR\fB[,path=\fR\fIpath\fR\fB],mount_tag=\fR\fImount_tag\fR\fB[,security_model=\fR\fIsecurity_model\fR\fB][,writeout=\fR\fIwriteout\fR\fB][,readonly][,socket=\fR\fIsocket\fR\fB|sock_fd=\fR\fIsock_fd\fR\fB][,fmode=\fR\fIfmode\fR\fB][,dmode=\fR\fIdmode\fR\fB]\fR" 4 .IX Item "-virtfs fsdriver[,path=path],mount_tag=mount_tag[,security_model=security_model][,writeout=writeout][,readonly][,socket=socket|sock_fd=sock_fd][,fmode=fmode][,dmode=dmode]" The general form of a Virtual File system pass-through options are: .RS 4 .IP "\fIfsdriver\fR" 4 .IX Item "fsdriver" This option specifies the fs driver backend to use. Currently \*(L"local\*(R", \*(L"handle\*(R" and \*(L"proxy\*(R" file system drivers are supported. .IP "\fBid=\fR\fIid\fR" 4 .IX Item "id=id" Specifies identifier for this device .IP "\fBpath=\fR\fIpath\fR" 4 .IX Item "path=path" Specifies the export path for the file system device. Files under this path will be available to the 9p client on the guest. .IP "\fBsecurity_model=\fR\fIsecurity_model\fR" 4 .IX Item "security_model=security_model" Specifies the security model to be used for this export path. Supported security models are \*(L"passthrough\*(R", \*(L"mapped-xattr\*(R", \*(L"mapped-file\*(R" and \*(L"none\*(R". In \*(L"passthrough\*(R" security model, files are stored using the same credentials as they are created on the guest. This requires \s-1QEMU\s0 to run as root. In \*(L"mapped-xattr\*(R" security model, some of the file attributes like uid, gid, mode bits and link target are stored as file attributes. For \*(L"mapped-file\*(R" these attributes are stored in the hidden .virtfs_metadata directory. Directories exported by this security model cannot interact with other unix tools. \*(L"none\*(R" security model is same as passthrough except the sever won't report failures if it fails to set file attributes like ownership. Security model is mandatory only for local fsdriver. Other fsdrivers (like handle, proxy) don't take security model as a parameter. .IP "\fBwriteout=\fR\fIwriteout\fR" 4 .IX Item "writeout=writeout" This is an optional argument. The only supported value is \*(L"immediate\*(R". This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem. .IP "\fBreadonly\fR" 4 .IX Item "readonly" Enables exporting 9p share as a readonly mount for guests. By default read-write access is given. .IP "\fBsocket=\fR\fIsocket\fR" 4 .IX Item "socket=socket" Enables proxy filesystem driver to use passed socket file for communicating with virtfs-proxy-helper. Usually a helper like libvirt will create socketpair and pass one of the fds as sock_fd .IP "\fBsock_fd\fR" 4 .IX Item "sock_fd" Enables proxy filesystem driver to use passed 'sock_fd' as the socket descriptor for interfacing with virtfs-proxy-helper .IP "\fBfmode=\fR\fIfmode\fR" 4 .IX Item "fmode=fmode" Specifies the default mode for newly created files on the host. Works only with security models \*(L"mapped-xattr\*(R" and \*(L"mapped-file\*(R". .IP "\fBdmode=\fR\fIdmode\fR" 4 .IX Item "dmode=dmode" Specifies the default mode for newly created directories on the host. Works only with security models \*(L"mapped-xattr\*(R" and \*(L"mapped-file\*(R". .RE .RS 4 .RE .IP "\fB\-virtfs_synth\fR" 4 .IX Item "-virtfs_synth" Create synthetic file system image .IP "\fB\-iscsi\fR" 4 .IX Item "-iscsi" Configure iSCSI session parameters. .PP \fI\s-1USB\s0 options\fR .IX Subsection "USB options" .IP "\fB\-usb\fR" 4 .IX Item "-usb" Enable the \s-1USB\s0 driver (if it is not used by default yet). .IP "\fB\-usbdevice\fR \fIdevname\fR" 4 .IX Item "-usbdevice devname" Add the \s-1USB\s0 device \fIdevname\fR. Note that this option is deprecated, please use \f(CW\*(C`\-device usb\-...\*(C'\fR instead. .RS 4 .IP "\fBmouse\fR" 4 .IX Item "mouse" Virtual Mouse. This will override the \s-1PS/2\s0 mouse emulation when activated. .IP "\fBtablet\fR" 4 .IX Item "tablet" Pointer device that uses absolute coordinates (like a touchscreen). This means \s-1QEMU\s0 is able to report the mouse position without having to grab the mouse. Also overrides the \s-1PS/2\s0 mouse emulation when activated. .IP "\fBbraille\fR" 4 .IX Item "braille" Braille device. This will use BrlAPI to display the braille output on a real or fake device. .RE .RS 4 .RE .PP \fIDisplay options\fR .IX Subsection "Display options" .IP "\fB\-display\fR \fItype\fR" 4 .IX Item "-display type" Select type of display to use. This option is a replacement for the old style \-sdl/\-curses/... options. Valid values for \fItype\fR are .RS 4 .IP "\fBsdl\fR" 4 .IX Item "sdl" Display video output via \s-1SDL\s0 (usually in a separate graphics window; see the \s-1SDL\s0 documentation for other possibilities). .IP "\fBcurses\fR" 4 .IX Item "curses" Display video output via curses. For graphics device models which support a text mode, \s-1QEMU\s0 can display this output using a curses/ncurses interface. Nothing is displayed when the graphics device is in graphical mode or if the graphics device does not support a text mode. Generally only the \s-1VGA\s0 device models support text mode. .IP "\fBnone\fR" 4 .IX Item "none" Do not display video output. The guest will still see an emulated graphics card, but its output will not be displayed to the \s-1QEMU\s0 user. This option differs from the \-nographic option in that it only affects what is done with video output; \-nographic also changes the destination of the serial and parallel port data. .IP "\fBgtk\fR" 4 .IX Item "gtk" Display video output in a \s-1GTK\s0 window. This interface provides drop-down menus and other \s-1UI\s0 elements to configure and control the \s-1VM\s0 during runtime. .IP "\fBvnc\fR" 4 .IX Item "vnc" Start a \s-1VNC\s0 server on display .IP "\fBegl-headless\fR" 4 .IX Item "egl-headless" Offload all OpenGL operations to a local \s-1DRI\s0 device. For any graphical display, this display needs to be paired with either \s-1VNC\s0 or \s-1SPICE\s0 displays. .RE .RS 4 .RE .IP "\fB\-nographic\fR" 4 .IX Item "-nographic" Normally, if \s-1QEMU\s0 is compiled with graphical window support, it displays output such as guest graphics, guest console, and the \s-1QEMU\s0 monitor in a window. With this option, you can totally disable graphical output so that \s-1QEMU\s0 is a simple command line application. The emulated serial port is redirected on the console and muxed with the monitor (unless redirected elsewhere explicitly). Therefore, you can still use \s-1QEMU\s0 to debug a Linux kernel with a serial console. Use \fBC\-a h\fR for help on switching between the console and monitor. .IP "\fB\-curses\fR" 4 .IX Item "-curses" Normally, if \s-1QEMU\s0 is compiled with graphical window support, it displays output such as guest graphics, guest console, and the \s-1QEMU\s0 monitor in a window. With this option, \s-1QEMU\s0 can display the \s-1VGA\s0 output when in text mode using a curses/ncurses interface. Nothing is displayed in graphical mode. .IP "\fB\-no\-frame\fR" 4 .IX Item "-no-frame" Do not use decorations for \s-1SDL\s0 windows and start them using the whole available screen space. This makes the using \s-1QEMU\s0 in a dedicated desktop workspace more convenient. .IP "\fB\-alt\-grab\fR" 4 .IX Item "-alt-grab" Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also affects the special keys (for fullscreen, monitor-mode switching, etc). .IP "\fB\-ctrl\-grab\fR" 4 .IX Item "-ctrl-grab" Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also affects the special keys (for fullscreen, monitor-mode switching, etc). .IP "\fB\-no\-quit\fR" 4 .IX Item "-no-quit" Disable \s-1SDL\s0 window close capability. .IP "\fB\-sdl\fR" 4 .IX Item "-sdl" Enable \s-1SDL.\s0 .IP "\fB\-spice\fR \fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]\fR" 4 .IX Item "-spice option[,option[,...]]" Enable the spice remote desktop protocol. Valid options are .RS 4 .IP "\fBport=\fR" 4 .IX Item "port=" Set the \s-1TCP\s0 port spice is listening on for plaintext channels. .IP "\fBaddr=\fR" 4 .IX Item "addr=" Set the \s-1IP\s0 address spice is listening on. Default is any address. .IP "\fBipv4\fR" 4 .IX Item "ipv4" .PD 0 .IP "\fBipv6\fR" 4 .IX Item "ipv6" .IP "\fBunix\fR" 4 .IX Item "unix" .PD Force using the specified \s-1IP\s0 version. .IP "\fBpassword=\fR" 4 .IX Item "password=" Set the password you need to authenticate. .IP "\fBsasl\fR" 4 .IX Item "sasl" Require that the client use \s-1SASL\s0 to authenticate with the spice. The exact choice of authentication method used is controlled from the system / user's \s-1SASL\s0 configuration file for the 'qemu' service. This is typically found in /etc/sasl2/qemu.conf. If running \s-1QEMU\s0 as an unprivileged user, an environment variable \s-1SASL_CONF_PATH\s0 can be used to make it search alternate locations for the service config. While some \s-1SASL\s0 auth methods can also provide data encryption (eg \s-1GSSAPI\s0), it is recommended that \s-1SASL\s0 always be combined with the 'tls' and \&'x509' settings to enable use of \s-1SSL\s0 and server certificates. This ensures a data encryption preventing compromise of authentication credentials. .IP "\fBdisable-ticketing\fR" 4 .IX Item "disable-ticketing" Allow client connects without authentication. .IP "\fBdisable-copy-paste\fR" 4 .IX Item "disable-copy-paste" Disable copy paste between the client and the guest. .IP "\fBdisable-agent-file-xfer\fR" 4 .IX Item "disable-agent-file-xfer" Disable spice-vdagent based file-xfer between the client and the guest. .IP "\fBtls\-port=\fR" 4 .IX Item "tls-port=" Set the \s-1TCP\s0 port spice is listening on for encrypted channels. .IP "\fBx509\-dir=\fR" 4 .IX Item "x509-dir=" Set the x509 file directory. Expects same filenames as \-vnc \f(CW$display\fR,x509=$dir .IP "\fBx509\-key\-file=\fR" 4 .IX Item "x509-key-file=" .PD 0 .IP "\fBx509\-key\-password=\fR" 4 .IX Item "x509-key-password=" .IP "\fBx509\-cert\-file=\fR" 4 .IX Item "x509-cert-file=" .IP "\fBx509\-cacert\-file=\fR" 4 .IX Item "x509-cacert-file=" .IP "\fBx509\-dh\-key\-file=\fR" 4 .IX Item "x509-dh-key-file=" .PD The x509 file names can also be configured individually. .IP "\fBtls\-ciphers=\fR" 4 .IX Item "tls-ciphers=" Specify which ciphers to use. .IP "\fBtls\-channel=[main|display|cursor|inputs|record|playback]\fR" 4 .IX Item "tls-channel=[main|display|cursor|inputs|record|playback]" .PD 0 .IP "\fBplaintext\-channel=[main|display|cursor|inputs|record|playback]\fR" 4 .IX Item "plaintext-channel=[main|display|cursor|inputs|record|playback]" .PD Force specific channel to be used with or without \s-1TLS\s0 encryption. The options can be specified multiple times to configure multiple channels. The special name \*(L"default\*(R" can be used to set the default mode. For channels which are not explicitly forced into one mode the spice client is allowed to pick tls/plaintext as he pleases. .IP "\fBimage\-compression=[auto_glz|auto_lz|quic|glz|lz|off]\fR" 4 .IX Item "image-compression=[auto_glz|auto_lz|quic|glz|lz|off]" Configure image compression (lossless). Default is auto_glz. .IP "\fBjpeg\-wan\-compression=[auto|never|always]\fR" 4 .IX Item "jpeg-wan-compression=[auto|never|always]" .PD 0 .IP "\fBzlib\-glz\-wan\-compression=[auto|never|always]\fR" 4 .IX Item "zlib-glz-wan-compression=[auto|never|always]" .PD Configure wan image compression (lossy for slow links). Default is auto. .IP "\fBstreaming\-video=[off|all|filter]\fR" 4 .IX Item "streaming-video=[off|all|filter]" Configure video stream detection. Default is off. .IP "\fBagent\-mouse=[on|off]\fR" 4 .IX Item "agent-mouse=[on|off]" Enable/disable passing mouse events via vdagent. Default is on. .IP "\fBplayback\-compression=[on|off]\fR" 4 .IX Item "playback-compression=[on|off]" Enable/disable audio stream compression (using celt 0.5.1). Default is on. .IP "\fBseamless\-migration=[on|off]\fR" 4 .IX Item "seamless-migration=[on|off]" Enable/disable spice seamless migration. Default is off. .IP "\fBgl=[on|off]\fR" 4 .IX Item "gl=[on|off]" Enable/disable OpenGL context. Default is off. .IP "\fBrendernode=\fR" 4 .IX Item "rendernode=" \&\s-1DRM\s0 render node for OpenGL rendering. If not specified, it will pick the first available. (Since 2.9) .RE .RS 4 .RE .IP "\fB\-portrait\fR" 4 .IX Item "-portrait" Rotate graphical output 90 deg left (only \s-1PXA LCD\s0). .IP "\fB\-rotate\fR \fIdeg\fR" 4 .IX Item "-rotate deg" Rotate graphical output some deg left (only \s-1PXA LCD\s0). .IP "\fB\-vga\fR \fItype\fR" 4 .IX Item "-vga type" Select type of \s-1VGA\s0 card to emulate. Valid values for \fItype\fR are .RS 4 .IP "\fBcirrus\fR" 4 .IX Item "cirrus" Cirrus Logic \s-1GD5446\s0 Video card. All Windows versions starting from Windows 95 should recognize and use this graphic card. For optimal performances, use 16 bit color depth in the guest and the host \s-1OS.\s0 (This card was the default before \s-1QEMU 2.2\s0) .IP "\fBstd\fR" 4 .IX Item "std" Standard \s-1VGA\s0 card with Bochs \s-1VBE\s0 extensions. If your guest \s-1OS\s0 supports the \s-1VESA 2.0 VBE\s0 extensions (e.g. Windows \s-1XP\s0) and if you want to use high resolution modes (>= 1280x1024x16) then you should use this option. (This card is the default since \s-1QEMU 2.2\s0) .IP "\fBvmware\fR" 4 .IX Item "vmware" VMWare SVGA-II compatible adapter. Use it if you have sufficiently recent XFree86/XOrg server or Windows guest with a driver for this card. .IP "\fBqxl\fR" 4 .IX Item "qxl" \&\s-1QXL\s0 paravirtual graphic card. It is \s-1VGA\s0 compatible (including \s-1VESA 2.0 VBE\s0 support). Works best with qxl guest drivers installed though. Recommended choice when using the spice protocol. .IP "\fBtcx\fR" 4 .IX Item "tcx" (sun4m only) Sun \s-1TCX\s0 framebuffer. This is the default framebuffer for sun4m machines and offers both 8\-bit and 24\-bit colour depths at a fixed resolution of 1024x768. .IP "\fBcg3\fR" 4 .IX Item "cg3" (sun4m only) Sun cgthree framebuffer. This is a simple 8\-bit framebuffer for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (\s-1OBP\s0) resolutions aimed at people wishing to run older Solaris versions. .IP "\fBvirtio\fR" 4 .IX Item "virtio" Virtio \s-1VGA\s0 card. .IP "\fBnone\fR" 4 .IX Item "none" Disable \s-1VGA\s0 card. .RE .RS 4 .RE .IP "\fB\-full\-screen\fR" 4 .IX Item "-full-screen" Start in full screen. .IP "\fB\-g\fR \fIwidth\fR\fBx\fR\fIheight\fR\fB[x\fR\fIdepth\fR\fB]\fR" 4 .IX Item "-g widthxheight[xdepth]" Set the initial graphical resolution and depth (\s-1PPC, SPARC\s0 only). .IP "\fB\-vnc\fR \fIdisplay\fR\fB[,\fR\fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]]\fR" 4 .IX Item "-vnc display[,option[,option[,...]]]" Normally, if \s-1QEMU\s0 is compiled with graphical window support, it displays output such as guest graphics, guest console, and the \s-1QEMU\s0 monitor in a window. With this option, you can have \s-1QEMU\s0 listen on \s-1VNC\s0 display \&\fIdisplay\fR and redirect the \s-1VGA\s0 display over the \s-1VNC\s0 session. It is very useful to enable the usb tablet device when using this option (option \fB\-device usb-tablet\fR). When using the \s-1VNC\s0 display, you must use the \fB\-k\fR parameter to set the keyboard layout if you are not using en-us. Valid syntax for the \fIdisplay\fR is .RS 4 .IP "\fBto=\fR\fIL\fR" 4 .IX Item "to=L" With this option, \s-1QEMU\s0 will try next available \s-1VNC\s0 \fIdisplay\fRs, until the number \fIL\fR, if the origianlly defined "\-vnc \fIdisplay\fR" is not available, e.g. port 5900+\fIdisplay\fR is already used by another application. By default, to=0. .IP "\fIhost\fR\fB:\fR\fId\fR" 4 .IX Item "host:d" \&\s-1TCP\s0 connections will only be allowed from \fIhost\fR on display \fId\fR. By convention the \s-1TCP\s0 port is 5900+\fId\fR. Optionally, \fIhost\fR can be omitted in which case the server will accept connections from any host. .IP "\fBunix:\fR\fIpath\fR" 4 .IX Item "unix:path" Connections will be allowed over \s-1UNIX\s0 domain sockets where \fIpath\fR is the location of a unix socket to listen for connections on. .IP "\fBnone\fR" 4 .IX Item "none" \&\s-1VNC\s0 is initialized but not started. The monitor \f(CW\*(C`change\*(C'\fR command can be used to later start the \s-1VNC\s0 server. .RE .RS 4 .Sp Following the \fIdisplay\fR value there may be one or more \fIoption\fR flags separated by commas. Valid options are .IP "\fBreverse\fR" 4 .IX Item "reverse" Connect to a listening \s-1VNC\s0 client via a \*(L"reverse\*(R" connection. The client is specified by the \fIdisplay\fR. For reverse network connections (\fIhost\fR:\fId\fR,\f(CW\*(C`reverse\*(C'\fR), the \fId\fR argument is a \s-1TCP\s0 port number, not a display number. .IP "\fBwebsocket\fR" 4 .IX Item "websocket" Opens an additional \s-1TCP\s0 listening port dedicated to \s-1VNC\s0 Websocket connections. If a bare \fIwebsocket\fR option is given, the Websocket port is 5700+\fIdisplay\fR. An alternative port can be specified with the syntax \f(CW\*(C`websocket\*(C'\fR=\fIport\fR. .Sp If \fIhost\fR is specified connections will only be allowed from this host. It is possible to control the websocket listen address independently, using the syntax \f(CW\*(C`websocket\*(C'\fR=\fIhost\fR:\fIport\fR. .Sp If no \s-1TLS\s0 credentials are provided, the websocket connection runs in unencrypted mode. If \s-1TLS\s0 credentials are provided, the websocket connection requires encrypted client connections. .IP "\fBpassword\fR" 4 .IX Item "password" Require that password based authentication is used for client connections. .Sp The password must be set separately using the \f(CW\*(C`set_password\*(C'\fR command in the \fBpcsys_monitor\fR. The syntax to change your password is: \&\f(CW\*(C`set_password \*(C'\fR where could be either \&\*(L"vnc\*(R" or \*(L"spice\*(R". .Sp If you would like to change password expiration, you should use \&\f(CW\*(C`expire_password \*(C'\fR where expiration time could be one of the following options: now, never, +seconds or \s-1UNIX\s0 time of expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800 to make password expire on \*(L"Mon Apr 23 12:00:00 \s-1EDT 2012\*(R"\s0 (\s-1UNIX\s0 time for this date and time). .Sp You can also use keywords \*(L"now\*(R" or \*(L"never\*(R" for the expiration time to allow password to expire immediately or never expire. .IP "\fBtls\-creds=\fR\fI\s-1ID\s0\fR" 4 .IX Item "tls-creds=ID" Provides the \s-1ID\s0 of a set of \s-1TLS\s0 credentials to use to secure the \&\s-1VNC\s0 server. They will apply to both the normal \s-1VNC\s0 server socket and the websocket socket (if enabled). Setting \s-1TLS\s0 credentials will cause the \s-1VNC\s0 server socket to enable the VeNCrypt auth mechanism. The credentials should have been previously created using the \fB\-object tls-creds\fR argument. .IP "\fBsasl\fR" 4 .IX Item "sasl" Require that the client use \s-1SASL\s0 to authenticate with the \s-1VNC\s0 server. The exact choice of authentication method used is controlled from the system / user's \s-1SASL\s0 configuration file for the 'qemu' service. This is typically found in /etc/sasl2/qemu.conf. If running \s-1QEMU\s0 as an unprivileged user, an environment variable \s-1SASL_CONF_PATH\s0 can be used to make it search alternate locations for the service config. While some \s-1SASL\s0 auth methods can also provide data encryption (eg \s-1GSSAPI\s0), it is recommended that \s-1SASL\s0 always be combined with the 'tls' and \&'x509' settings to enable use of \s-1SSL\s0 and server certificates. This ensures a data encryption preventing compromise of authentication credentials. See the \fBvnc_security\fR section for details on using \&\s-1SASL\s0 authentication. .IP "\fBacl\fR" 4 .IX Item "acl" Turn on access control lists for checking of the x509 client certificate and \s-1SASL\s0 party. For x509 certs, the \s-1ACL\s0 check is made against the certificate's distinguished name. This is something that looks like \&\f(CW\*(C`C=GB,O=ACME,L=Boston,CN=bob\*(C'\fR. For \s-1SASL\s0 party, the \s-1ACL\s0 check is made against the username, which depending on the \s-1SASL\s0 plugin, may include a realm component, eg \f(CW\*(C`bob\*(C'\fR or \f(CW\*(C`bob@EXAMPLE.COM\*(C'\fR. When the \fBacl\fR flag is set, the initial access list will be empty, with a \f(CW\*(C`deny\*(C'\fR policy. Thus no one will be allowed to use the \s-1VNC\s0 server until the ACLs have been loaded. This can be achieved using the \f(CW\*(C`acl\*(C'\fR monitor command. .IP "\fBlossy\fR" 4 .IX Item "lossy" Enable lossy compression methods (gradient, \s-1JPEG, ...\s0). If this option is set, \s-1VNC\s0 client may receive lossy framebuffer updates depending on its encoding settings. Enabling this option can save a lot of bandwidth at the expense of quality. .IP "\fBnon-adaptive\fR" 4 .IX Item "non-adaptive" Disable adaptive encodings. Adaptive encodings are enabled by default. An adaptive encoding will try to detect frequently updated screen regions, and send updates in these regions using a lossy encoding (like \s-1JPEG\s0). This can be really helpful to save bandwidth when playing videos. Disabling adaptive encodings restores the original static behavior of encodings like Tight. .IP "\fBshare=[allow\-exclusive|force\-shared|ignore]\fR" 4 .IX Item "share=[allow-exclusive|force-shared|ignore]" Set display sharing policy. 'allow\-exclusive' allows clients to ask for exclusive access. As suggested by the rfb spec this is implemented by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: \-shared switch). This is the default. 'force\-shared' disables exclusive client access. Useful for shared desktop sessions, where you don't want someone forgetting specify \-shared disconnect everybody else. 'ignore' completely ignores the shared flag and allows everybody connect unconditionally. Doesn't conform to the rfb spec but is traditional \s-1QEMU\s0 behavior. .IP "\fBkey-delay-ms\fR" 4 .IX Item "key-delay-ms" Set keyboard delay, for key down and key up events, in milliseconds. Default is 10. Keyboards are low-bandwidth devices, so this slowdown can help the device and guest to keep up and not lose events in case events are arriving in bulk. Possible causes for the latter are flaky network connections, or scripts for automated testing. .RE .RS 4 .RE .PP \fIi386 target only\fR .IX Subsection "i386 target only" .IP "\fB\-win2k\-hack\fR" 4 .IX Item "-win2k-hack" Use it when installing Windows 2000 to avoid a disk full bug. After Windows 2000 is installed, you no longer need this option (this option slows down the \s-1IDE\s0 transfers). .IP "\fB\-no\-fd\-bootchk\fR" 4 .IX Item "-no-fd-bootchk" Disable boot signature checking for floppy disks in \s-1BIOS.\s0 May be needed to boot from old floppy disks. .IP "\fB\-no\-acpi\fR" 4 .IX Item "-no-acpi" Disable \s-1ACPI\s0 (Advanced Configuration and Power Interface) support. Use it if your guest \s-1OS\s0 complains about \s-1ACPI\s0 problems (\s-1PC\s0 target machine only). .IP "\fB\-no\-hpet\fR" 4 .IX Item "-no-hpet" Disable \s-1HPET\s0 support. .IP "\fB\-acpitable [sig=\fR\fIstr\fR\fB][,rev=\fR\fIn\fR\fB][,oem_id=\fR\fIstr\fR\fB][,oem_table_id=\fR\fIstr\fR\fB][,oem_rev=\fR\fIn\fR\fB] [,asl_compiler_id=\fR\fIstr\fR\fB][,asl_compiler_rev=\fR\fIn\fR\fB][,data=\fR\fIfile1\fR\fB[:\fR\fIfile2\fR\fB]...]\fR" 4 .IX Item "-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]...]" Add \s-1ACPI\s0 table with specified header fields and context from specified files. For file=, take whole \s-1ACPI\s0 table from the specified files, including all \&\s-1ACPI\s0 headers (possible overridden by other options). For data=, only data portion of the table is used, all header information is specified in the command line. If a \s-1SLIC\s0 table is supplied to \s-1QEMU,\s0 then the \s-1SLIC\s0's oem_id and oem_table_id fields will override the same in the \s-1RSDT\s0 and the \s-1FADT\s0 (a.k.a. \s-1FACP\s0), in order to ensure the field matches required by the Microsoft \s-1SLIC\s0 spec and the \s-1ACPI\s0 spec. .IP "\fB\-smbios file=\fR\fIbinary\fR" 4 .IX Item "-smbios file=binary" Load \s-1SMBIOS\s0 entry from binary file. .IP "\fB\-smbios type=0[,vendor=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,date=\fR\fIstr\fR\fB][,release=\fR\fI\f(CI%d\fI.%d\fR\fB][,uefi=on|off]\fR" 4 .IX Item "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]" Specify \s-1SMBIOS\s0 type 0 fields .IP "\fB\-smbios type=1[,manufacturer=\fR\fIstr\fR\fB][,product=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,uuid=\fR\fIuuid\fR\fB][,sku=\fR\fIstr\fR\fB][,family=\fR\fIstr\fR\fB]\fR" 4 .IX Item "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]" Specify \s-1SMBIOS\s0 type 1 fields .IP "\fB\-smbios type=2[,manufacturer=\fR\fIstr\fR\fB][,product=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,asset=\fR\fIstr\fR\fB][,location=\fR\fIstr\fR\fB][,family=\fR\fIstr\fR\fB]\fR" 4 .IX Item "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str][,family=str]" Specify \s-1SMBIOS\s0 type 2 fields .IP "\fB\-smbios type=3[,manufacturer=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,asset=\fR\fIstr\fR\fB][,sku=\fR\fIstr\fR\fB]\fR" 4 .IX Item "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]" Specify \s-1SMBIOS\s0 type 3 fields .IP "\fB\-smbios type=4[,sock_pfx=\fR\fIstr\fR\fB][,manufacturer=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,asset=\fR\fIstr\fR\fB][,part=\fR\fIstr\fR\fB]\fR" 4 .IX Item "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]" Specify \s-1SMBIOS\s0 type 4 fields .IP "\fB\-smbios type=17[,loc_pfx=\fR\fIstr\fR\fB][,bank=\fR\fIstr\fR\fB][,manufacturer=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,asset=\fR\fIstr\fR\fB][,part=\fR\fIstr\fR\fB][,speed=\fR\fI\f(CI%d\fI\fR\fB]\fR" 4 .IX Item "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]" Specify \s-1SMBIOS\s0 type 17 fields .PP \fINetwork options\fR .IX Subsection "Network options" .IP "\fB\-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost\-user|socket][,...][,mac=macaddr][,model=mn]\fR" 4 .IX Item "-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]" This option is a shortcut for configuring both the on-board (default) guest \&\s-1NIC\s0 hardware and the host network backend in one go. The host backend options are the same as with the corresponding \fB\-netdev\fR options below. The guest \s-1NIC\s0 model can be set with \fBmodel=\fR\fImodelname\fR. Use \fBmodel=help\fR to list the available device types. The hardware \s-1MAC\s0 address can be set with \fBmac=\fR\fImacaddr\fR. .Sp The following two example do exactly the same, to show how \fB\-nic\fR can be used to shorten the command line length (note that the e1000 is the default on i386, so the \fBmodel=e1000\fR parameter could even be omitted here, too): .Sp .Vb 2 \& qemu\-system\-i386 \-netdev user,id=n1,ipv6=off \-device e1000,netdev=n1,mac=52:54:98:76:54:32 \& qemu\-system\-i386 \-nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 .Ve .IP "\fB\-nic none\fR" 4 .IX Item "-nic none" Indicate that no network devices should be configured. It is used to override the default configuration (default \s-1NIC\s0 with \*(L"user\*(R" host network backend) which is activated if no other networking options are provided. .IP "\fB\-netdev user,id=\fR\fIid\fR\fB[,\fR\fIoption\fR\fB][,\fR\fIoption\fR\fB][,...]\fR" 4 .IX Item "-netdev user,id=id[,option][,option][,...]" Configure user mode host network backend which requires no administrator privilege to run. Valid options are: .RS 4 .IP "\fBid=\fR\fIid\fR" 4 .IX Item "id=id" Assign symbolic name for use in monitor commands. .IP "\fBipv4=on|off and ipv6=on|off\fR" 4 .IX Item "ipv4=on|off and ipv6=on|off" Specify that either IPv4 or IPv6 must be enabled. If neither is specified both protocols are enabled. .IP "\fBnet=\fR\fIaddr\fR\fB[/\fR\fImask\fR\fB]\fR" 4 .IX Item "net=addr[/mask]" Set \s-1IP\s0 network address the guest will see. Optionally specify the netmask, either in the form a.b.c.d or as number of valid top-most bits. Default is 10.0.2.0/24. .IP "\fBhost=\fR\fIaddr\fR" 4 .IX Item "host=addr" Specify the guest-visible address of the host. Default is the 2nd \s-1IP\s0 in the guest network, i.e. x.x.x.2. .IP "\fBipv6\-net=\fR\fIaddr\fR\fB[/\fR\fIint\fR\fB]\fR" 4 .IX Item "ipv6-net=addr[/int]" Set IPv6 network address the guest will see (default is fec0::/64). The network prefix is given in the usual hexadecimal IPv6 address notation. The prefix size is optional, and is given as the number of valid top-most bits (default is 64). .IP "\fBipv6\-host=\fR\fIaddr\fR" 4 .IX Item "ipv6-host=addr" Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in the guest network, i.e. xxxx::2. .IP "\fBrestrict=on|off\fR" 4 .IX Item "restrict=on|off" If this option is enabled, the guest will be isolated, i.e. it will not be able to contact the host and no guest \s-1IP\s0 packets will be routed over the host to the outside. This option does not affect any explicitly set forwarding rules. .IP "\fBhostname=\fR\fIname\fR" 4 .IX Item "hostname=name" Specifies the client hostname reported by the built-in \s-1DHCP\s0 server. .IP "\fBdhcpstart=\fR\fIaddr\fR" 4 .IX Item "dhcpstart=addr" Specify the first of the 16 IPs the built-in \s-1DHCP\s0 server can assign. Default is the 15th to 31st \s-1IP\s0 in the guest network, i.e. x.x.x.15 to x.x.x.31. .IP "\fBdns=\fR\fIaddr\fR" 4 .IX Item "dns=addr" Specify the guest-visible address of the virtual nameserver. The address must be different from the host address. Default is the 3rd \s-1IP\s0 in the guest network, i.e. x.x.x.3. .IP "\fBipv6\-dns=\fR\fIaddr\fR" 4 .IX Item "ipv6-dns=addr" Specify the guest-visible address of the IPv6 virtual nameserver. The address must be different from the host address. Default is the 3rd \s-1IP\s0 in the guest network, i.e. xxxx::3. .IP "\fBdnssearch=\fR\fIdomain\fR" 4 .IX Item "dnssearch=domain" Provides an entry for the domain-search list sent by the built-in \&\s-1DHCP\s0 server. More than one domain suffix can be transmitted by specifying this option multiple times. If supported, this will cause the guest to automatically try to append the given domain suffix(es) in case a domain name can not be resolved. .Sp Example: .Sp .Vb 1 \& qemu\-system\-i386 \-nic user,dnssearch=mgmt.example.org,dnssearch=example.org .Ve .IP "\fBdomainname=\fR\fIdomain\fR" 4 .IX Item "domainname=domain" Specifies the client domain name reported by the built-in \s-1DHCP\s0 server. .IP "\fBtftp=\fR\fIdir\fR" 4 .IX Item "tftp=dir" When using the user mode network stack, activate a built-in \s-1TFTP\s0 server. The files in \fIdir\fR will be exposed as the root of a \s-1TFTP\s0 server. The \s-1TFTP\s0 client on the guest must be configured in binary mode (use the command \&\f(CW\*(C`bin\*(C'\fR of the Unix \s-1TFTP\s0 client). .IP "\fBtftp\-server\-name=\fR\fIname\fR" 4 .IX Item "tftp-server-name=name" In \s-1BOOTP\s0 reply, broadcast \fIname\fR as the \*(L"\s-1TFTP\s0 server name\*(R" (\s-1RFC2132\s0 option 66). This can be used to advise the guest to load boot files or configurations from a different server than the host address. .IP "\fBbootfile=\fR\fIfile\fR" 4 .IX Item "bootfile=file" When using the user mode network stack, broadcast \fIfile\fR as the \s-1BOOTP\s0 filename. In conjunction with \fBtftp\fR, this can be used to network boot a guest from a local directory. .Sp Example (using pxelinux): .Sp .Vb 2 \& qemu\-system\-i386 \-hda linux.img \-boot n \-device e1000,netdev=n1 \e \& \-netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 .Ve .IP "\fBsmb=\fR\fIdir\fR\fB[,smbserver=\fR\fIaddr\fR\fB]\fR" 4 .IX Item "smb=dir[,smbserver=addr]" When using the user mode network stack, activate a built-in \s-1SMB\s0 server so that Windows OSes can access to the host files in \fI\fIdir\fI\fR transparently. The \s-1IP\s0 address of the \s-1SMB\s0 server can be set to \fIaddr\fR. By default the 4th \s-1IP\s0 in the guest network is used, i.e. x.x.x.4. .Sp In the guest Windows \s-1OS,\s0 the line: .Sp .Vb 1 \& 10.0.2.4 smbserver .Ve .Sp must be added in the file \fIC:\eWINDOWS\eLMHOSTS\fR (for windows 9x/Me) or \fIC:\eWINNT\eSYSTEM32\eDRIVERS\eETC\eLMHOSTS\fR (Windows \s-1NT/2000\s0). .Sp Then \fI\fIdir\fI\fR can be accessed in \fI\e\esmbserver\eqemu\fR. .Sp Note that a \s-1SAMBA\s0 server must be installed on the host \s-1OS.\s0 .IP "\fBhostfwd=[tcp|udp]:[\fR\fIhostaddr\fR\fB]:\fR\fIhostport\fR\fB\-[\fR\fIguestaddr\fR\fB]:\fR\fIguestport\fR" 4 .IX Item "hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport" Redirect incoming \s-1TCP\s0 or \s-1UDP\s0 connections to the host port \fIhostport\fR to the guest \s-1IP\s0 address \fIguestaddr\fR on guest port \fIguestport\fR. If \&\fIguestaddr\fR is not specified, its value is x.x.x.15 (default first address given by the built-in \s-1DHCP\s0 server). By specifying \fIhostaddr\fR, the rule can be bound to a specific host interface. If no connection type is set, \s-1TCP\s0 is used. This option can be given multiple times. .Sp For example, to redirect host X11 connection from screen 1 to guest screen 0, use the following: .Sp .Vb 4 \& # on the host \& qemu\-system\-i386 \-nic user,hostfwd=tcp:127.0.0.1:6001\-:6000 \& # this host xterm should open in the guest X11 server \& xterm \-display :1 .Ve .Sp To redirect telnet connections from host port 5555 to telnet port on the guest, use the following: .Sp .Vb 3 \& # on the host \& qemu\-system\-i386 \-nic user,hostfwd=tcp::5555\-:23 \& telnet localhost 5555 .Ve .Sp Then when you use on the host \f(CW\*(C`telnet localhost 5555\*(C'\fR, you connect to the guest telnet server. .IP "\fBguestfwd=[tcp]:\fR\fIserver\fR\fB:\fR\fIport\fR\fB\-\fR\fIdev\fR" 4 .IX Item "guestfwd=[tcp]:server:port-dev" .PD 0 .IP "\fBguestfwd=[tcp]:\fR\fIserver\fR\fB:\fR\fIport\fR\fB\-\fR\fIcmd:command\fR" 4 .IX Item "guestfwd=[tcp]:server:port-cmd:command" .PD Forward guest \s-1TCP\s0 connections to the \s-1IP\s0 address \fIserver\fR on port \fIport\fR to the character device \fIdev\fR or to a program executed by \fIcmd:command\fR which gets spawned for each connection. This option can be given multiple times. .Sp You can either use a chardev directly and have that one used throughout \s-1QEMU\s0's lifetime, like in the following example: .Sp .Vb 3 \& # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever \& # the guest accesses it \& qemu\-system\-i386 \-nic user,guestfwd=tcp:10.0.2.100:1234\-tcp:10.10.1.1:4321 .Ve .Sp Or you can execute a command on every \s-1TCP\s0 connection established by the guest, so that \s-1QEMU\s0 behaves similar to an inetd process for that virtual server: .Sp .Vb 3 \& # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 \& # and connect the TCP stream to its stdin/stdout \& qemu\-system\-i386 \-nic \*(Aquser,id=n1,guestfwd=tcp:10.0.2.100:1234\-cmd:netcat 10.10.1.1 4321\*(Aq .Ve .RE .RS 4 .RE .IP "\fB\-netdev tap,id=\fR\fIid\fR\fB[,fd=\fR\fIh\fR\fB][,ifname=\fR\fIname\fR\fB][,script=\fR\fIfile\fR\fB][,downscript=\fR\fIdfile\fR\fB][,br=\fR\fIbridge\fR\fB][,helper=\fR\fIhelper\fR\fB]\fR" 4 .IX Item "-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]" Configure a host \s-1TAP\s0 network backend with \s-1ID\s0 \fIid\fR. .Sp Use the network script \fIfile\fR to configure it and the network script \&\fIdfile\fR to deconfigure it. If \fIname\fR is not provided, the \s-1OS\s0 automatically provides one. The default network configure script is \&\fI/etc/qemu\-ifup\fR and the default network deconfigure script is \&\fI/etc/qemu\-ifdown\fR. Use \fBscript=no\fR or \fBdownscript=no\fR to disable script execution. .Sp If running \s-1QEMU\s0 as an unprivileged user, use the network helper \&\fIhelper\fR to configure the \s-1TAP\s0 interface and attach it to the bridge. The default network helper executable is \fI/path/to/qemu\-bridge\-helper\fR and the default bridge device is \fIbr0\fR. .Sp \&\fBfd\fR=\fIh\fR can be used to specify the handle of an already opened host \s-1TAP\s0 interface. .Sp Examples: .Sp .Vb 2 \& #launch a QEMU instance with the default network script \& qemu\-system\-i386 linux.img \-nic tap \& \& \& \& #launch a QEMU instance with two NICs, each one connected \& #to a TAP device \& qemu\-system\-i386 linux.img \e \& \-netdev tap,id=nd0,ifname=tap0 \-device e1000,netdev=nd0 \e \& \-netdev tap,id=nd1,ifname=tap1 \-device rtl8139,netdev=nd1 \& \& \& \& #launch a QEMU instance with the default network helper to \& #connect a TAP device to bridge br0 \& qemu\-system\-i386 linux.img \-device virtio\-net\-pci,netdev=n1 \e \& \-netdev tap,id=n1,"helper=/path/to/qemu\-bridge\-helper" .Ve .IP "\fB\-netdev bridge,id=\fR\fIid\fR\fB[,br=\fR\fIbridge\fR\fB][,helper=\fR\fIhelper\fR\fB]\fR" 4 .IX Item "-netdev bridge,id=id[,br=bridge][,helper=helper]" Connect a host \s-1TAP\s0 network interface to a host bridge device. .Sp Use the network helper \fIhelper\fR to configure the \s-1TAP\s0 interface and attach it to the bridge. The default network helper executable is \&\fI/path/to/qemu\-bridge\-helper\fR and the default bridge device is \fIbr0\fR. .Sp Examples: .Sp .Vb 3 \& #launch a QEMU instance with the default network helper to \& #connect a TAP device to bridge br0 \& qemu\-system\-i386 linux.img \-netdev bridge,id=n1 \-device virtio\-net,netdev=n1 \& \& \& \& #launch a QEMU instance with the default network helper to \& #connect a TAP device to bridge qemubr0 \& qemu\-system\-i386 linux.img \-netdev bridge,br=qemubr0,id=n1 \-device virtio\-net,netdev=n1 .Ve .IP "\fB\-netdev socket,id=\fR\fIid\fR\fB[,fd=\fR\fIh\fR\fB][,listen=[\fR\fIhost\fR\fB]:\fR\fIport\fR\fB][,connect=\fR\fIhost\fR\fB:\fR\fIport\fR\fB]\fR" 4 .IX Item "-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]" This host network backend can be used to connect the guest's network to another \s-1QEMU\s0 virtual machine using a \s-1TCP\s0 socket connection. If \fBlisten\fR is specified, \s-1QEMU\s0 waits for incoming connections on \fIport\fR (\fIhost\fR is optional). \fBconnect\fR is used to connect to another \s-1QEMU\s0 instance using the \fBlisten\fR option. \fBfd\fR=\fIh\fR specifies an already opened \s-1TCP\s0 socket. .Sp Example: .Sp .Vb 8 \& # launch a first QEMU instance \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n1,mac=52:54:00:12:34:56 \e \& \-netdev socket,id=n1,listen=:1234 \& # connect the network of this instance to the network of the first instance \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n2,mac=52:54:00:12:34:57 \e \& \-netdev socket,id=n2,connect=127.0.0.1:1234 .Ve .IP "\fB\-netdev socket,id=\fR\fIid\fR\fB[,fd=\fR\fIh\fR\fB][,mcast=\fR\fImaddr\fR\fB:\fR\fIport\fR\fB[,localaddr=\fR\fIaddr\fR\fB]]\fR" 4 .IX Item "-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]" Configure a socket host network backend to share the guest's network traffic with another \s-1QEMU\s0 virtual machines using a \s-1UDP\s0 multicast socket, effectively making a bus for every \s-1QEMU\s0 with same multicast address \fImaddr\fR and \fIport\fR. \&\s-1NOTES:\s0 .RS 4 .IP "1." 4 Several \s-1QEMU\s0 can be running on different hosts and share same bus (assuming correct multicast setup for these hosts). .IP "2." 4 mcast support is compatible with User Mode Linux (argument \fBeth\fR\fIN\fR\fB=mcast\fR), see <\fBhttp://user\-mode\-linux.sf.net\fR>. .IP "3." 4 Use \fBfd=h\fR to specify an already opened \s-1UDP\s0 multicast socket. .RE .RS 4 .Sp Example: .Sp .Vb 12 \& # launch one QEMU instance \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n1,mac=52:54:00:12:34:56 \e \& \-netdev socket,id=n1,mcast=230.0.0.1:1234 \& # launch another QEMU instance on same "bus" \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n2,mac=52:54:00:12:34:57 \e \& \-netdev socket,id=n2,mcast=230.0.0.1:1234 \& # launch yet another QEMU instance on same "bus" \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n3,mac=52:54:00:12:34:58 \e \& \-netdev socket,id=n3,mcast=230.0.0.1:1234 .Ve .Sp Example (User Mode Linux compat.): .Sp .Vb 6 \& # launch QEMU instance (note mcast address selected is UML\*(Aqs default) \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n1,mac=52:54:00:12:34:56 \e \& \-netdev socket,id=n1,mcast=239.192.168.1:1102 \& # launch UML \& /path/to/linux ubd0=/path/to/root_fs eth0=mcast .Ve .Sp Example (send packets from host's 1.2.3.4): .Sp .Vb 3 \& qemu\-system\-i386 linux.img \e \& \-device e1000,netdev=n1,mac=52:54:00:12:34:56 \e \& \-netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 .Ve .RE .IP "\fB\-netdev l2tpv3,id=\fR\fIid\fR\fB,src=\fR\fIsrcaddr\fR\fB,dst=\fR\fIdstaddr\fR\fB[,srcport=\fR\fIsrcport\fR\fB][,dstport=\fR\fIdstport\fR\fB],txsession=\fR\fItxsession\fR\fB[,rxsession=\fR\fIrxsession\fR\fB][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=\fR\fItxcookie\fR\fB][,rxcookie=\fR\fIrxcookie\fR\fB][,offset=\fR\fIoffset\fR\fB]\fR" 4 .IX Item "-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]" Configure a L2TPv3 pseudowire host network backend. L2TPv3 (\s-1RFC3391\s0) is a popular protocol to transport Ethernet (and other Layer 2) data frames between two systems. It is present in routers, firewalls and the Linux kernel (from version 3.3 onwards). .Sp This transport allows a \s-1VM\s0 to communicate to another \s-1VM,\s0 router or firewall directly. .RS 4 .IP "\fBsrc=\fR\fIsrcaddr\fR" 4 .IX Item "src=srcaddr" source address (mandatory) .IP "\fBdst=\fR\fIdstaddr\fR" 4 .IX Item "dst=dstaddr" destination address (mandatory) .IP "\fBudp\fR" 4 .IX Item "udp" select udp encapsulation (default is ip). .IP "\fBsrcport=\fR\fIsrcport\fR" 4 .IX Item "srcport=srcport" source udp port. .IP "\fBdstport=\fR\fIdstport\fR" 4 .IX Item "dstport=dstport" destination udp port. .IP "\fBipv6\fR" 4 .IX Item "ipv6" force v6, otherwise defaults to v4. .IP "\fBrxcookie=\fR\fIrxcookie\fR" 4 .IX Item "rxcookie=rxcookie" .PD 0 .IP "\fBtxcookie=\fR\fItxcookie\fR" 4 .IX Item "txcookie=txcookie" .PD Cookies are a weak form of security in the l2tpv3 specification. Their function is mostly to prevent misconfiguration. By default they are 32 bit. .IP "\fBcookie64\fR" 4 .IX Item "cookie64" Set cookie size to 64 bit instead of the default 32 .IP "\fBcounter=off\fR" 4 .IX Item "counter=off" Force a 'cut\-down' L2TPv3 with no counter as in draft\-mkonstan\-l2tpext\-keyed\-ipv6\-tunnel\-00 .IP "\fBpincounter=on\fR" 4 .IX Item "pincounter=on" Work around broken counter handling in peer. This may also help on networks which have packet reorder. .IP "\fBoffset=\fR\fIoffset\fR" 4 .IX Item "offset=offset" Add an extra offset between header and data .RE .RS 4 .Sp For example, to attach a \s-1VM\s0 running on host 4.3.2.1 via L2TPv3 to the bridge br-lan on the remote Linux host 1.2.3.4: .Sp .Vb 9 \& # Setup tunnel on linux host using raw ip as encapsulation \& # on 1.2.3.4 \& ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \e \& encap udp udp_sport 16384 udp_dport 16384 \& ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \e \& 0xFFFFFFFF peer_session_id 0xFFFFFFFF \& ifconfig vmtunnel0 mtu 1500 \& ifconfig vmtunnel0 up \& brctl addif br\-lan vmtunnel0 \& \& \& # on 4.3.2.1 \& # launch QEMU instance \- if your network has reorder or is very lossy add ,pincounter \& \& qemu\-system\-i386 linux.img \-device e1000,netdev=n1 \e \& \-netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter .Ve .RE .IP "\fB\-netdev vde,id=\fR\fIid\fR\fB[,sock=\fR\fIsocketpath\fR\fB][,port=\fR\fIn\fR\fB][,group=\fR\fIgroupname\fR\fB][,mode=\fR\fIoctalmode\fR\fB]\fR" 4 .IX Item "-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]" Configure \s-1VDE\s0 backend to connect to \s-1PORT\s0 \fIn\fR of a vde switch running on host and listening for incoming connections on \fIsocketpath\fR. Use \s-1GROUP\s0 \fIgroupname\fR and \s-1MODE\s0 \fIoctalmode\fR to change default ownership and permissions for communication port. This option is only available if \s-1QEMU\s0 has been compiled with vde support enabled. .Sp Example: .Sp .Vb 4 \& # launch vde switch \& vde_switch \-F \-sock /tmp/myswitch \& # launch QEMU instance \& qemu\-system\-i386 linux.img \-nic vde,sock=/tmp/myswitch .Ve .IP "\fB\-netdev vhost\-user,chardev=\fR\fIid\fR\fB[,vhostforce=on|off][,queues=n]\fR" 4 .IX Item "-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]" Establish a vhost-user netdev, backed by a chardev \fIid\fR. The chardev should be a unix domain socket backed one. The vhost-user uses a specifically defined protocol to pass vhost ioctl replacement messages to an application on the other end of the socket. On non-MSIX guests, the feature can be forced with \&\fIvhostforce\fR. Use 'queues=\fIn\fR' to specify the number of queues to be created for multiqueue vhost-user. .Sp Example: .Sp .Vb 5 \& qemu \-m 512 \-object memory\-backend\-file,id=mem,size=512M,mem\-path=/hugetlbfs,share=on \e \& \-numa node,memdev=mem \e \& \-chardev socket,id=chr0,path=/path/to/socket \e \& \-netdev type=vhost\-user,id=net0,chardev=chr0 \e \& \-device virtio\-net\-pci,netdev=net0 .Ve .IP "\fB\-netdev hubport,id=\fR\fIid\fR\fB,hubid=\fR\fIhubid\fR\fB[,netdev=\fR\fInd\fR\fB]\fR" 4 .IX Item "-netdev hubport,id=id,hubid=hubid[,netdev=nd]" Create a hub port on the emulated hub with \s-1ID\s0 \fIhubid\fR. .Sp The hubport netdev lets you connect a \s-1NIC\s0 to a \s-1QEMU\s0 emulated hub instead of a single netdev. Alternatively, you can also connect the hubport to another netdev with \s-1ID\s0 \fInd\fR by using the \fBnetdev=\fR\fInd\fR option. .IP "\fB\-net nic[,netdev=\fR\fInd\fR\fB][,macaddr=\fR\fImac\fR\fB][,model=\fR\fItype\fR\fB] [,name=\fR\fIname\fR\fB][,addr=\fR\fIaddr\fR\fB][,vectors=\fR\fIv\fR\fB]\fR" 4 .IX Item "-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]" Legacy option to configure or create an on-board (or machine default) Network Interface Card(\s-1NIC\s0) and connect it either to the emulated hub with \s-1ID 0\s0 (i.e. the default hub), or to the netdev \fInd\fR. The \s-1NIC\s0 is an e1000 by default on the \s-1PC\s0 target. Optionally, the \s-1MAC\s0 address can be changed to \fImac\fR, the device address set to \fIaddr\fR (\s-1PCI\s0 cards only), and a \fIname\fR can be assigned for use in monitor commands. Optionally, for \s-1PCI\s0 cards, you can specify the number \fIv\fR of MSI-X vectors that the card should have; this option currently only affects virtio cards; set \&\fIv\fR = 0 to disable MSI-X. If no \fB\-net\fR option is specified, a single \&\s-1NIC\s0 is created. \s-1QEMU\s0 can emulate several different models of network card. Use \f(CW\*(C`\-net nic,model=help\*(C'\fR for a list of available devices for your target. .IP "\fB\-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=\fR\fIname\fR\fB]\fR" 4 .IX Item "-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]" Configure a host network backend (with the options corresponding to the same \&\fB\-netdev\fR option) and connect it to the emulated hub 0 (the default hub). Use \fIname\fR to specify the name of the hub port. .PP \fICharacter device options\fR .IX Subsection "Character device options" .PP The general form of a character device option is: .IP "\fB\-chardev\fR \fIbackend\fR\fB,id=\fR\fIid\fR\fB[,mux=on|off][,\fR\fIoptions\fR\fB]\fR" 4 .IX Item "-chardev backend,id=id[,mux=on|off][,options]" Backend is one of: \&\fBnull\fR, \&\fBsocket\fR, \&\fBudp\fR, \&\fBmsmouse\fR, \&\fBvc\fR, \&\fBringbuf\fR, \&\fBfile\fR, \&\fBpipe\fR, \&\fBconsole\fR, \&\fBserial\fR, \&\fBpty\fR, \&\fBstdio\fR, \&\fBbraille\fR, \&\fBtty\fR, \&\fBparallel\fR, \&\fBparport\fR, \&\fBspicevmc\fR, \&\fBspiceport\fR. The specific backend will determine the applicable options. .Sp Use \f(CW\*(C`\-chardev help\*(C'\fR to print all available chardev backend types. .Sp All devices must have an id, which can be any string up to 127 characters long. It is used to uniquely identify this device in other command line directives. .Sp A character device may be used in multiplexing mode by multiple front-ends. Specify \fBmux=on\fR to enable this mode. A multiplexer is a \*(L"1:N\*(R" device, and here the \*(L"1\*(R" end is your specified chardev backend, and the \*(L"N\*(R" end is the various parts of \s-1QEMU\s0 that can talk to a chardev. If you create a chardev with \fBid=myid\fR and \fBmux=on\fR, \s-1QEMU\s0 will create a multiplexer with your specified \s-1ID,\s0 and you can then configure multiple front ends to use that chardev \s-1ID\s0 for their input/output. Up to four different front ends can be connected to a single multiplexed chardev. (Without multiplexing enabled, a chardev can only be used by a single front end.) For instance you could use this to allow a single stdio chardev to be used by two serial ports and the \s-1QEMU\s0 monitor: .Sp .Vb 4 \& \-chardev stdio,mux=on,id=char0 \e \& \-mon chardev=char0,mode=readline \e \& \-serial chardev:char0 \e \& \-serial chardev:char0 .Ve .Sp You can have more than one multiplexer in a system configuration; for instance you could have a \s-1TCP\s0 port multiplexed between \s-1UART 0\s0 and \s-1UART 1,\s0 and stdio multiplexed between the \s-1QEMU\s0 monitor and a parallel port: .Sp .Vb 6 \& \-chardev stdio,mux=on,id=char0 \e \& \-mon chardev=char0,mode=readline \e \& \-parallel chardev:char0 \e \& \-chardev tcp,...,mux=on,id=char1 \e \& \-serial chardev:char1 \e \& \-serial chardev:char1 .Ve .Sp When you're using a multiplexed character device, some escape sequences are interpreted in the input. .Sp Note that some other command line options may implicitly create multiplexed character backends; for instance \fB\-serial mon:stdio\fR creates a multiplexed stdio backend connected to the serial port and the \s-1QEMU\s0 monitor, and \fB\-nographic\fR also multiplexes the console and the monitor to stdio. .Sp There is currently no support for multiplexing in the other direction (where a single \s-1QEMU\s0 front end takes input and output from multiple chardevs). .Sp Every backend supports the \fBlogfile\fR option, which supplies the path to a file to record all data transmitted via the backend. The \fBlogappend\fR option controls whether the log file will be truncated or appended to when opened. .PP The available backends are: .IP "\fB\-chardev null,id=\fR\fIid\fR" 4 .IX Item "-chardev null,id=id" A void device. This device will not emit any data, and will drop any data it receives. The null backend does not take any options. .IP "\fB\-chardev socket,id=\fR\fIid\fR\fB[,\fR\fI\s-1TCP\s0 options\fR \fBor\fR \fIunix options\fR\fB][,server][,nowait][,telnet][,websocket][,reconnect=\fR\fIseconds\fR\fB][,tls\-creds=\fR\fIid\fR\fB]\fR" 4 .IX Item "-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id]" Create a two-way stream socket, which can be either a \s-1TCP\s0 or a unix socket. A unix socket will be created if \fBpath\fR is specified. Behaviour is undefined if \s-1TCP\s0 options are specified for a unix socket. .Sp \&\fBserver\fR specifies that the socket shall be a listening socket. .Sp \&\fBnowait\fR specifies that \s-1QEMU\s0 should not block waiting for a client to connect to a listening socket. .Sp \&\fBtelnet\fR specifies that traffic on the socket should interpret telnet escape sequences. .Sp \&\fBwebsocket\fR specifies that the socket uses WebSocket protocol for communication. .Sp \&\fBreconnect\fR sets the timeout for reconnecting on non-server sockets when the remote end goes away. qemu will delay this many seconds and then attempt to reconnect. Zero disables reconnecting, and is the default. .Sp \&\fBtls-creds\fR requests enablement of the \s-1TLS\s0 protocol for encryption, and specifies the id of the \s-1TLS\s0 credentials to use for the handshake. The credentials must be previously created with the \fB\-object tls-creds\fR argument. .Sp \&\s-1TCP\s0 and unix socket options are given below: .RS 4 .IP "\fB\s-1TCP\s0 options: port=\fR\fIport\fR\fB[,host=\fR\fIhost\fR\fB][,to=\fR\fIto\fR\fB][,ipv4][,ipv6][,nodelay]\fR" 4 .IX Item "TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]" \&\fBhost\fR for a listening socket specifies the local address to be bound. For a connecting socket species the remote host to connect to. \fBhost\fR is optional for listening sockets. If not specified it defaults to \f(CW0.0.0.0\fR. .Sp \&\fBport\fR for a listening socket specifies the local port to be bound. For a connecting socket specifies the port on the remote host to connect to. \&\fBport\fR can be given as either a port number or a service name. \&\fBport\fR is required. .Sp \&\fBto\fR is only relevant to listening sockets. If it is specified, and \&\fBport\fR cannot be bound, \s-1QEMU\s0 will attempt to bind to subsequent ports up to and including \fBto\fR until it succeeds. \fBto\fR must be specified as a port number. .Sp \&\fBipv4\fR and \fBipv6\fR specify that either IPv4 or IPv6 must be used. If neither is specified the socket may use either protocol. .Sp \&\fBnodelay\fR disables the Nagle algorithm. .IP "\fBunix options: path=\fR\fIpath\fR" 4 .IX Item "unix options: path=path" \&\fBpath\fR specifies the local path of the unix socket. \fBpath\fR is required. .RE .RS 4 .RE .IP "\fB\-chardev udp,id=\fR\fIid\fR\fB[,host=\fR\fIhost\fR\fB],port=\fR\fIport\fR\fB[,localaddr=\fR\fIlocaladdr\fR\fB][,localport=\fR\fIlocalport\fR\fB][,ipv4][,ipv6]\fR" 4 .IX Item "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]" Sends all traffic from the guest to a remote host over \s-1UDP.\s0 .Sp \&\fBhost\fR specifies the remote host to connect to. If not specified it defaults to \f(CW\*(C`localhost\*(C'\fR. .Sp \&\fBport\fR specifies the port on the remote host to connect to. \fBport\fR is required. .Sp \&\fBlocaladdr\fR specifies the local address to bind to. If not specified it defaults to \f(CW0.0.0.0\fR. .Sp \&\fBlocalport\fR specifies the local port to bind to. If not specified any available local port will be used. .Sp \&\fBipv4\fR and \fBipv6\fR specify that either IPv4 or IPv6 must be used. If neither is specified the device may use either protocol. .IP "\fB\-chardev msmouse,id=\fR\fIid\fR" 4 .IX Item "-chardev msmouse,id=id" Forward \s-1QEMU\s0's emulated msmouse events to the guest. \fBmsmouse\fR does not take any options. .IP "\fB\-chardev vc,id=\fR\fIid\fR\fB[[,width=\fR\fIwidth\fR\fB][,height=\fR\fIheight\fR\fB]][[,cols=\fR\fIcols\fR\fB][,rows=\fR\fIrows\fR\fB]]\fR" 4 .IX Item "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]" Connect to a \s-1QEMU\s0 text console. \fBvc\fR may optionally be given a specific size. .Sp \&\fBwidth\fR and \fBheight\fR specify the width and height respectively of the console, in pixels. .Sp \&\fBcols\fR and \fBrows\fR specify that the console be sized to fit a text console with the given dimensions. .IP "\fB\-chardev ringbuf,id=\fR\fIid\fR\fB[,size=\fR\fIsize\fR\fB]\fR" 4 .IX Item "-chardev ringbuf,id=id[,size=size]" Create a ring buffer with fixed size \fBsize\fR. \&\fIsize\fR must be a power of two and defaults to \f(CW\*(C`64K\*(C'\fR. .IP "\fB\-chardev file,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR" 4 .IX Item "-chardev file,id=id,path=path" Log all traffic received from the guest to a file. .Sp \&\fBpath\fR specifies the path of the file to be opened. This file will be created if it does not already exist, and overwritten if it does. \fBpath\fR is required. .IP "\fB\-chardev pipe,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR" 4 .IX Item "-chardev pipe,id=id,path=path" Create a two-way connection to the guest. The behaviour differs slightly between Windows hosts and other hosts: .Sp On Windows, a single duplex pipe will be created at \&\fI\e\e.pipe\e\f(BIpath\fI\fR. .Sp On other hosts, 2 pipes will be created called \fI\f(BIpath\fI.in\fR and \&\fI\f(BIpath\fI.out\fR. Data written to \fI\f(BIpath\fI.in\fR will be received by the guest. Data written by the guest can be read from \&\fI\f(BIpath\fI.out\fR. \s-1QEMU\s0 will not create these fifos, and requires them to be present. .Sp \&\fBpath\fR forms part of the pipe path as described above. \fBpath\fR is required. .IP "\fB\-chardev console,id=\fR\fIid\fR" 4 .IX Item "-chardev console,id=id" Send traffic from the guest to \s-1QEMU\s0's standard output. \fBconsole\fR does not take any options. .Sp \&\fBconsole\fR is only available on Windows hosts. .IP "\fB\-chardev serial,id=\fR\fIid\fR\fB,path=\fR\fBpath\fR" 4 .IX Item "-chardev serial,id=id,path=path" Send traffic from the guest to a serial device on the host. .Sp On Unix hosts serial will actually accept any tty device, not only serial lines. .Sp \&\fBpath\fR specifies the name of the serial device to open. .IP "\fB\-chardev pty,id=\fR\fIid\fR" 4 .IX Item "-chardev pty,id=id" Create a new pseudo-terminal on the host and connect to it. \fBpty\fR does not take any options. .Sp \&\fBpty\fR is not available on Windows hosts. .IP "\fB\-chardev stdio,id=\fR\fIid\fR\fB[,signal=on|off]\fR" 4 .IX Item "-chardev stdio,id=id[,signal=on|off]" Connect to standard input and standard output of the \s-1QEMU\s0 process. .Sp \&\fBsignal\fR controls if signals are enabled on the terminal, that includes exiting \s-1QEMU\s0 with the key sequence \fBControl-c\fR. This option is enabled by default, use \fBsignal=off\fR to disable it. .IP "\fB\-chardev braille,id=\fR\fIid\fR" 4 .IX Item "-chardev braille,id=id" Connect to a local BrlAPI server. \fBbraille\fR does not take any options. .IP "\fB\-chardev tty,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR" 4 .IX Item "-chardev tty,id=id,path=path" \&\fBtty\fR is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and DragonFlyBSD hosts. It is an alias for \fBserial\fR. .Sp \&\fBpath\fR specifies the path to the tty. \fBpath\fR is required. .IP "\fB\-chardev parallel,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR" 4 .IX Item "-chardev parallel,id=id,path=path" .PD 0 .IP "\fB\-chardev parport,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR" 4 .IX Item "-chardev parport,id=id,path=path" .PD \&\fBparallel\fR is only available on Linux, FreeBSD and DragonFlyBSD hosts. .Sp Connect to a local parallel port. .Sp \&\fBpath\fR specifies the path to the parallel port device. \fBpath\fR is required. .IP "\fB\-chardev spicevmc,id=\fR\fIid\fR\fB,debug=\fR\fIdebug\fR\fB,name=\fR\fIname\fR" 4 .IX Item "-chardev spicevmc,id=id,debug=debug,name=name" \&\fBspicevmc\fR is only available when spice support is built in. .Sp \&\fBdebug\fR debug level for spicevmc .Sp \&\fBname\fR name of spice channel to connect to .Sp Connect to a spice virtual machine channel, such as vdiport. .IP "\fB\-chardev spiceport,id=\fR\fIid\fR\fB,debug=\fR\fIdebug\fR\fB,name=\fR\fIname\fR" 4 .IX Item "-chardev spiceport,id=id,debug=debug,name=name" \&\fBspiceport\fR is only available when spice support is built in. .Sp \&\fBdebug\fR debug level for spicevmc .Sp \&\fBname\fR name of spice port to connect to .Sp Connect to a spice port, allowing a Spice client to handle the traffic identified by a name (preferably a fqdn). .PP \fIBluetooth(R) options\fR .IX Subsection "Bluetooth(R) options" .IP "\fB\-bt hci[...]\fR" 4 .IX Item "-bt hci[...]" Defines the function of the corresponding Bluetooth \s-1HCI.\s0 \-bt options are matched with the HCIs present in the chosen machine type. For example when emulating a machine with only one \s-1HCI\s0 built into it, only the first \f(CW\*(C`\-bt hci[...]\*(C'\fR option is valid and defines the \s-1HCI\s0's logic. The Transport Layer is decided by the machine type. Currently the machines \f(CW\*(C`n800\*(C'\fR and \f(CW\*(C`n810\*(C'\fR have one \s-1HCI\s0 and all other machines have none. .Sp Note: This option and the whole bluetooth subsystem is considered as deprecated. If you still use it, please send a mail to <\fBqemu\-devel@nongnu.org\fR> where you describe your usecase. .Sp The following three types are recognized: .RS 4 .IP "\fB\-bt hci,null\fR" 4 .IX Item "-bt hci,null" (default) The corresponding Bluetooth \s-1HCI\s0 assumes no internal logic and will not respond to any \s-1HCI\s0 commands or emit events. .IP "\fB\-bt hci,host[:\fR\fIid\fR\fB]\fR" 4 .IX Item "-bt hci,host[:id]" (\f(CW\*(C`bluez\*(C'\fR only) The corresponding \s-1HCI\s0 passes commands / events to / from the physical \s-1HCI\s0 identified by the name \fIid\fR (default: \&\f(CW\*(C`hci0\*(C'\fR) on the computer running \s-1QEMU.\s0 Only available on \f(CW\*(C`bluez\*(C'\fR capable systems like Linux. .IP "\fB\-bt hci[,vlan=\fR\fIn\fR\fB]\fR" 4 .IX Item "-bt hci[,vlan=n]" Add a virtual, standard \s-1HCI\s0 that will participate in the Bluetooth scatternet \fIn\fR (default \f(CW0\fR). Similarly to \fB\-net\fR VLANs, devices inside a bluetooth network \fIn\fR can only communicate with other devices in the same network (scatternet). .RE .RS 4 .RE .IP "\fB\-bt vhci[,vlan=\fR\fIn\fR\fB]\fR" 4 .IX Item "-bt vhci[,vlan=n]" (Linux-host only) Create a \s-1HCI\s0 in scatternet \fIn\fR (default 0) attached to the host bluetooth stack instead of to the emulated target. This allows the host and target machines to participate in a common scatternet and communicate. Requires the Linux \f(CW\*(C`vhci\*(C'\fR driver installed. Can be used as following: .Sp .Vb 1 \& qemu\-system\-i386 [...OPTIONS...] \-bt hci,vlan=5 \-bt vhci,vlan=5 .Ve .IP "\fB\-bt device:\fR\fIdev\fR\fB[,vlan=\fR\fIn\fR\fB]\fR" 4 .IX Item "-bt device:dev[,vlan=n]" Emulate a bluetooth device \fIdev\fR and place it in network \fIn\fR (default \f(CW0\fR). \s-1QEMU\s0 can only emulate one type of bluetooth devices currently: .RS 4 .IP "\fBkeyboard\fR" 4 .IX Item "keyboard" Virtual wireless keyboard implementing the \s-1HIDP\s0 bluetooth profile. .RE .RS 4 .RE .PP \fI\s-1TPM\s0 device options\fR .IX Subsection "TPM device options" .PP The general form of a \s-1TPM\s0 device option is: .IP "\fB\-tpmdev\fR \fIbackend\fR\fB,id=\fR\fIid\fR\fB[,\fR\fIoptions\fR\fB]\fR" 4 .IX Item "-tpmdev backend,id=id[,options]" The specific backend type will determine the applicable options. The \f(CW\*(C`\-tpmdev\*(C'\fR option creates the \s-1TPM\s0 backend and requires a \&\f(CW\*(C`\-device\*(C'\fR option that specifies the \s-1TPM\s0 frontend interface model. .Sp Use \f(CW\*(C`\-tpmdev help\*(C'\fR to print all available \s-1TPM\s0 backend types. .PP The available backends are: .IP "\fB\-tpmdev passthrough,id=\fR\fIid\fR\fB,path=\fR\fIpath\fR\fB,cancel\-path=\fR\fIcancel-path\fR" 4 .IX Item "-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path" (Linux-host only) Enable access to the host's \s-1TPM\s0 using the passthrough driver. .Sp \&\fBpath\fR specifies the path to the host's \s-1TPM\s0 device, i.e., on a Linux host this would be \f(CW\*(C`/dev/tpm0\*(C'\fR. \&\fBpath\fR is optional and by default \f(CW\*(C`/dev/tpm0\*(C'\fR is used. .Sp \&\fBcancel-path\fR specifies the path to the host \s-1TPM\s0 device's sysfs entry allowing for cancellation of an ongoing \s-1TPM\s0 command. \&\fBcancel-path\fR is optional and by default \s-1QEMU\s0 will search for the sysfs entry to use. .Sp Some notes about using the host's \s-1TPM\s0 with the passthrough driver: .Sp The \s-1TPM\s0 device accessed by the passthrough driver must not be used by any other application on the host. .Sp Since the host's firmware (\s-1BIOS/UEFI\s0) has already initialized the \s-1TPM,\s0 the \s-1VM\s0's firmware (\s-1BIOS/UEFI\s0) will not be able to initialize the \&\s-1TPM\s0 again and may therefore not show a TPM-specific menu that would otherwise allow the user to configure the \s-1TPM,\s0 e.g., allow the user to enable/disable or activate/deactivate the \s-1TPM.\s0 Further, if \s-1TPM\s0 ownership is released from within a \s-1VM\s0 then the host's \s-1TPM\s0 will get disabled and deactivated. To enable and activate the \&\s-1TPM\s0 again afterwards, the host has to be rebooted and the user is required to enter the firmware's menu to enable and activate the \s-1TPM.\s0 If the \s-1TPM\s0 is left disabled and/or deactivated most \s-1TPM\s0 commands will fail. .Sp To create a passthrough \s-1TPM\s0 use the following two options: .Sp .Vb 1 \& \-tpmdev passthrough,id=tpm0 \-device tpm\-tis,tpmdev=tpm0 .Ve .Sp Note that the \f(CW\*(C`\-tpmdev\*(C'\fR id is \f(CW\*(C`tpm0\*(C'\fR and is referenced by \&\f(CW\*(C`tpmdev=tpm0\*(C'\fR in the device option. .IP "\fB\-tpmdev emulator,id=\fR\fIid\fR\fB,chardev=\fR\fIdev\fR" 4 .IX Item "-tpmdev emulator,id=id,chardev=dev" (Linux-host only) Enable access to a \s-1TPM\s0 emulator using Unix domain socket based chardev backend. .Sp \&\fBchardev\fR specifies the unique \s-1ID\s0 of a character device backend that provides connection to the software \s-1TPM\s0 server. .Sp To create a \s-1TPM\s0 emulator backend device with chardev socket backend: .Sp .Vb 1 \& \-chardev socket,id=chrtpm,path=/tmp/swtpm\-sock \-tpmdev emulator,id=tpm0,chardev=chrtpm \-device tpm\-tis,tpmdev=tpm0 .Ve .PP \fILinux/Multiboot boot specific\fR .IX Subsection "Linux/Multiboot boot specific" .PP When using these options, you can use a given Linux or Multiboot kernel without installing it in the disk image. It can be useful for easier testing of various kernels. .IP "\fB\-kernel\fR \fIbzImage\fR" 4 .IX Item "-kernel bzImage" Use \fIbzImage\fR as kernel image. The kernel can be either a Linux kernel or in multiboot format. .IP "\fB\-append\fR \fIcmdline\fR" 4 .IX Item "-append cmdline" Use \fIcmdline\fR as kernel command line .IP "\fB\-initrd\fR \fIfile\fR" 4 .IX Item "-initrd file" Use \fIfile\fR as initial ram disk. .ie n .IP "\fB\-initrd ""\fR\fIfile1\fR \fBarg=foo,\fR\fIfile2\fR\fB""\fR" 4 .el .IP "\fB\-initrd ``\fR\fIfile1\fR \fBarg=foo,\fR\fIfile2\fR\fB''\fR" 4 .IX Item "-initrd ""file1 arg=foo,file2""" This syntax is only available with multiboot. .Sp Use \fIfile1\fR and \fIfile2\fR as modules and pass arg=foo as parameter to the first module. .IP "\fB\-dtb\fR \fIfile\fR" 4 .IX Item "-dtb file" Use \fIfile\fR as a device tree binary (dtb) image and pass it to the kernel on boot. .PP \fIDebug/Expert options\fR .IX Subsection "Debug/Expert options" .IP "\fB\-fw_cfg [name=]\fR\fIname\fR\fB,file=\fR\fIfile\fR" 4 .IX Item "-fw_cfg [name=]name,file=file" Add named fw_cfg entry with contents from file \fIfile\fR. .IP "\fB\-fw_cfg [name=]\fR\fIname\fR\fB,string=\fR\fIstr\fR" 4 .IX Item "-fw_cfg [name=]name,string=str" Add named fw_cfg entry with contents from string \fIstr\fR. .Sp The terminating \s-1NUL\s0 character of the contents of \fIstr\fR will not be included as part of the fw_cfg item data. To insert contents with embedded \s-1NUL\s0 characters, you have to use the \fIfile\fR parameter. .Sp The fw_cfg entries are passed by \s-1QEMU\s0 through to the guest. .Sp Example: .Sp .Vb 1 \& \-fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin .Ve .Sp creates an fw_cfg entry named opt/com.mycompany/blob with contents from ./my_blob.bin. .IP "\fB\-serial\fR \fIdev\fR" 4 .IX Item "-serial dev" Redirect the virtual serial port to host character device \&\fIdev\fR. The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \&\f(CW\*(C`stdio\*(C'\fR in non graphical mode. .Sp This option can be used several times to simulate up to 4 serial ports. .Sp Use \f(CW\*(C`\-serial none\*(C'\fR to disable all serial ports. .Sp Available character devices are: .RS 4 .IP "\fBvc[:\fR\fIW\fR\fBx\fR\fIH\fR\fB]\fR" 4 .IX Item "vc[:WxH]" Virtual console. Optionally, a width and height can be given in pixel with .Sp .Vb 1 \& vc:800x600 .Ve .Sp It is also possible to specify width or height in characters: .Sp .Vb 1 \& vc:80Cx24C .Ve .IP "\fBpty\fR" 4 .IX Item "pty" [Linux only] Pseudo \s-1TTY\s0 (a new \s-1PTY\s0 is automatically allocated) .IP "\fBnone\fR" 4 .IX Item "none" No device is allocated. .IP "\fBnull\fR" 4 .IX Item "null" void device .IP "\fBchardev:\fR\fIid\fR" 4 .IX Item "chardev:id" Use a named character device defined with the \f(CW\*(C`\-chardev\*(C'\fR option. .IP "\fB/dev/XXX\fR" 4 .IX Item "/dev/XXX" [Linux only] Use host tty, e.g. \fI/dev/ttyS0\fR. The host serial port parameters are set according to the emulated ones. .IP "\fB/dev/parport\fR\fIN\fR" 4 .IX Item "/dev/parportN" [Linux only, parallel port only] Use host parallel port \&\fIN\fR. Currently \s-1SPP\s0 and \s-1EPP\s0 parallel port features can be used. .IP "\fBfile:\fR\fIfilename\fR" 4 .IX Item "file:filename" Write output to \fIfilename\fR. No character can be read. .IP "\fBstdio\fR" 4 .IX Item "stdio" [Unix only] standard input/output .IP "\fBpipe:\fR\fIfilename\fR" 4 .IX Item "pipe:filename" name pipe \fIfilename\fR .IP "\fB\s-1COM\s0\fR\fIn\fR" 4 .IX Item "COMn" [Windows only] Use host serial port \fIn\fR .IP "\fBudp:[\fR\fIremote_host\fR\fB]:\fR\fIremote_port\fR\fB[@[\fR\fIsrc_ip\fR\fB]:\fR\fIsrc_port\fR\fB]\fR" 4 .IX Item "udp:[remote_host]:remote_port[@[src_ip]:src_port]" This implements \s-1UDP\s0 Net Console. When \fIremote_host\fR or \fIsrc_ip\fR are not specified they default to \f(CW0.0.0.0\fR. When not using a specified \fIsrc_port\fR a random port is automatically chosen. .Sp If you just want a simple readonly console you can use \f(CW\*(C`netcat\*(C'\fR or \&\f(CW\*(C`nc\*(C'\fR, by starting \s-1QEMU\s0 with: \f(CW\*(C`\-serial udp::4555\*(C'\fR and nc as: \&\f(CW\*(C`nc \-u \-l \-p 4555\*(C'\fR. Any time \s-1QEMU\s0 writes something to that port it will appear in the netconsole session. .Sp If you plan to send characters back via netconsole or you want to stop and start \s-1QEMU\s0 a lot of times, you should have \s-1QEMU\s0 use the same source port each time by using something like \f(CW\*(C`\-serial udp::4555@4556\*(C'\fR to \s-1QEMU.\s0 Another approach is to use a patched version of netcat which can listen to a \s-1TCP\s0 port and send and receive characters via udp. If you have a patched version of netcat which activates telnet remote echo and single char transfer, then you can use the following options to set up a netcat redirector to allow telnet on port 5555 to access the \s-1QEMU\s0 port. .RS 4 .ie n .IP """QEMU Options:""" 4 .el .IP "\f(CWQEMU Options:\fR" 4 .IX Item "QEMU Options:" \&\-serial udp::4555@4556 .ie n .IP """netcat options:""" 4 .el .IP "\f(CWnetcat options:\fR" 4 .IX Item "netcat options:" \&\-u \-P 4555 \-L 0.0.0.0:4556 \-t \-p 5555 \-I \-T .ie n .IP """telnet options:""" 4 .el .IP "\f(CWtelnet options:\fR" 4 .IX Item "telnet options:" localhost 5555 .RE .RS 4 .RE .IP "\fBtcp:[\fR\fIhost\fR\fB]:\fR\fIport\fR\fB[,\fR\fIserver\fR\fB][,nowait][,nodelay][,reconnect=\fR\fIseconds\fR\fB]\fR" 4 .IX Item "tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]" The \s-1TCP\s0 Net Console has two modes of operation. It can send the serial I/O to a location or wait for a connection from a location. By default the \s-1TCP\s0 Net Console is sent to \fIhost\fR at the \fIport\fR. If you use the \fIserver\fR option \s-1QEMU\s0 will wait for a client socket application to connect to the port before continuing, unless the \f(CW\*(C`nowait\*(C'\fR option was specified. The \f(CW\*(C`nodelay\*(C'\fR option disables the Nagle buffering algorithm. The \f(CW\*(C`reconnect\*(C'\fR option only applies if \fInoserver\fR is set, if the connection goes down it will attempt to reconnect at the given interval. If \fIhost\fR is omitted, 0.0.0.0 is assumed. Only one \s-1TCP\s0 connection at a time is accepted. You can use \f(CW\*(C`telnet\*(C'\fR to connect to the corresponding character device. .RS 4 .ie n .IP """Example to send tcp console to 192.168.0.2 port 4444""" 4 .el .IP "\f(CWExample to send tcp console to 192.168.0.2 port 4444\fR" 4 .IX Item "Example to send tcp console to 192.168.0.2 port 4444" \&\-serial tcp:192.168.0.2:4444 .ie n .IP """Example to listen and wait on port 4444 for connection""" 4 .el .IP "\f(CWExample to listen and wait on port 4444 for connection\fR" 4 .IX Item "Example to listen and wait on port 4444 for connection" \&\-serial tcp::4444,server .ie n .IP """Example to not wait and listen on ip 192.168.0.100 port 4444""" 4 .el .IP "\f(CWExample to not wait and listen on ip 192.168.0.100 port 4444\fR" 4 .IX Item "Example to not wait and listen on ip 192.168.0.100 port 4444" \&\-serial tcp:192.168.0.100:4444,server,nowait .RE .RS 4 .RE .IP "\fBtelnet:\fR\fIhost\fR\fB:\fR\fIport\fR\fB[,server][,nowait][,nodelay]\fR" 4 .IX Item "telnet:host:port[,server][,nowait][,nodelay]" The telnet protocol is used instead of raw tcp sockets. The options work the same as if you had specified \f(CW\*(C`\-serial tcp\*(C'\fR. The difference is that the port acts like a telnet server or client using telnet option negotiation. This will also allow you to send the \&\s-1MAGIC_SYSRQ\s0 sequence if you use a telnet that supports sending the break sequence. Typically in unix telnet you do it with Control\-] and then type \*(L"send break\*(R" followed by pressing the enter key. .IP "\fBwebsocket:\fR\fIhost\fR\fB:\fR\fIport\fR\fB,server[,nowait][,nodelay]\fR" 4 .IX Item "websocket:host:port,server[,nowait][,nodelay]" The WebSocket protocol is used instead of raw tcp socket. The port acts as a WebSocket server. Client mode is not supported. .IP "\fBunix:\fR\fIpath\fR\fB[,server][,nowait][,reconnect=\fR\fIseconds\fR\fB]\fR" 4 .IX Item "unix:path[,server][,nowait][,reconnect=seconds]" A unix domain socket is used instead of a tcp socket. The option works the same as if you had specified \f(CW\*(C`\-serial tcp\*(C'\fR except the unix domain socket \&\fIpath\fR is used for connections. .IP "\fBmon:\fR\fIdev_string\fR" 4 .IX Item "mon:dev_string" This is a special option to allow the monitor to be multiplexed onto another serial port. The monitor is accessed with key sequence of \&\fBControl-a\fR and then pressing \fBc\fR. \&\fIdev_string\fR should be any one of the serial devices specified above. An example to multiplex the monitor onto a telnet server listening on port 4444 would be: .RS 4 .ie n .IP """\-serial mon:telnet::4444,server,nowait""" 4 .el .IP "\f(CW\-serial mon:telnet::4444,server,nowait\fR" 4 .IX Item "-serial mon:telnet::4444,server,nowait" .RE .RS 4 .Sp When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate \&\s-1QEMU\s0 any more but will be passed to the guest instead. .RE .IP "\fBbraille\fR" 4 .IX Item "braille" Braille device. This will use BrlAPI to display the braille output on a real or fake device. .IP "\fBmsmouse\fR" 4 .IX Item "msmouse" Three button serial mouse. Configure the guest to use Microsoft protocol. .RE .RS 4 .RE .IP "\fB\-parallel\fR \fIdev\fR" 4 .IX Item "-parallel dev" Redirect the virtual parallel port to host device \fIdev\fR (same devices as the serial port). On Linux hosts, \fI/dev/parportN\fR can be used to use hardware devices connected on the corresponding host parallel port. .Sp This option can be used several times to simulate up to 3 parallel ports. .Sp Use \f(CW\*(C`\-parallel none\*(C'\fR to disable all parallel ports. .IP "\fB\-monitor\fR \fIdev\fR" 4 .IX Item "-monitor dev" Redirect the monitor to host device \fIdev\fR (same devices as the serial port). The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR in non graphical mode. Use \f(CW\*(C`\-monitor none\*(C'\fR to disable the default monitor. .IP "\fB\-qmp\fR \fIdev\fR" 4 .IX Item "-qmp dev" Like \-monitor but opens in 'control' mode. .IP "\fB\-qmp\-pretty\fR \fIdev\fR" 4 .IX Item "-qmp-pretty dev" Like \-qmp but uses pretty \s-1JSON\s0 formatting. .IP "\fB\-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\fR" 4 .IX Item "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]" Setup monitor on chardev \fIname\fR. \f(CW\*(C`pretty\*(C'\fR turns on \s-1JSON\s0 pretty printing easing human reading and debugging. .IP "\fB\-debugcon\fR \fIdev\fR" 4 .IX Item "-debugcon dev" Redirect the debug console to host device \fIdev\fR (same devices as the serial port). The debug console is an I/O port which is typically port 0xe9; writing to that I/O port sends output to this device. The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR in non graphical mode. .IP "\fB\-pidfile\fR \fIfile\fR" 4 .IX Item "-pidfile file" Store the \s-1QEMU\s0 process \s-1PID\s0 in \fIfile\fR. It is useful if you launch \s-1QEMU\s0 from a script. .IP "\fB\-singlestep\fR" 4 .IX Item "-singlestep" Run the emulation in single step mode. .IP "\fB\-\-preconfig\fR" 4 .IX Item "--preconfig" Pause \s-1QEMU\s0 for interactive configuration before the machine is created, which allows querying and configuring properties that will affect machine initialization. Use \s-1QMP\s0 command 'x\-exit\-preconfig' to exit the preconfig state and move to the next state (i.e. run guest if \-S isn't used or pause the second time if \-S is used). This option is experimental. .IP "\fB\-S\fR" 4 .IX Item "-S" Do not start \s-1CPU\s0 at startup (you must type 'c' in the monitor). .IP "\fB\-realtime mlock=on|off\fR" 4 .IX Item "-realtime mlock=on|off" Run qemu with realtime features. mlocking qemu and guest memory can be enabled via \fBmlock=on\fR (enabled by default). .IP "\fB\-overcommit mem\-lock=on|off\fR" 4 .IX Item "-overcommit mem-lock=on|off" .PD 0 .IP "\fB\-overcommit cpu\-pm=on|off\fR" 4 .IX Item "-overcommit cpu-pm=on|off" .PD Run qemu with hints about host resource overcommit. The default is to assume that host overcommits all resources. .Sp Locking qemu and guest memory can be enabled via \fBmem\-lock=on\fR (disabled by default). This works when host memory is not overcommitted and reduces the worst-case latency for guest. This is equivalent to \fBrealtime\fR. .Sp Guest ability to manage power state of host cpus (increasing latency for other processes on the same host cpu, but decreasing latency for guest) can be enabled via \fBcpu\-pm=on\fR (disabled by default). This works best when host \s-1CPU\s0 is not overcommitted. When used, host estimates of \s-1CPU\s0 cycle and power utilization will be incorrect, not taking into account guest idle time. .IP "\fB\-gdb\fR \fIdev\fR" 4 .IX Item "-gdb dev" Wait for gdb connection on device \fIdev\fR. Typical connections will likely be TCP-based, but also \s-1UDP,\s0 pseudo \s-1TTY,\s0 or even stdio are reasonable use case. The latter is allowing to start \s-1QEMU\s0 from within gdb and establish the connection via a pipe: .Sp .Vb 1 \& (gdb) target remote | exec qemu\-system\-i386 \-gdb stdio ... .Ve .IP "\fB\-s\fR" 4 .IX Item "-s" Shorthand for \-gdb tcp::1234, i.e. open a gdbserver on \s-1TCP\s0 port 1234. .IP "\fB\-d\fR \fIitem1\fR\fB[,...]\fR" 4 .IX Item "-d item1[,...]" Enable logging of specified items. Use '\-d help' for a list of log items. .IP "\fB\-D\fR \fIlogfile\fR" 4 .IX Item "-D logfile" Output log in \fIlogfile\fR instead of to stderr .IP "\fB\-dfilter\fR \fIrange1\fR\fB[,...]\fR" 4 .IX Item "-dfilter range1[,...]" Filter debug output to that relevant to a range of target addresses. The filter spec can be either \fIstart\fR+\fIsize\fR, \fIstart\fR\-\fIsize\fR or \&\fIstart\fR..\fIend\fR where \fIstart\fR \fIend\fR and \fIsize\fR are the addresses and sizes required. For example: .Sp .Vb 1 \& \-dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000\-0x1000 .Ve .Sp Will dump output for any code in the 0x1000 sized block starting at 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized block starting at 0xffffffc00005f000. .IP "\fB\-L\fR \fIpath\fR" 4 .IX Item "-L path" Set the directory for the \s-1BIOS, VGA BIOS\s0 and keymaps. .Sp To list all the data directories, use \f(CW\*(C`\-L help\*(C'\fR. .IP "\fB\-bios\fR \fIfile\fR" 4 .IX Item "-bios file" Set the filename for the \s-1BIOS.\s0 .IP "\fB\-enable\-kvm\fR" 4 .IX Item "-enable-kvm" Enable \s-1KVM\s0 full virtualization support. This option is only available if \s-1KVM\s0 support is enabled when compiling. .IP "\fB\-enable\-hax\fR" 4 .IX Item "-enable-hax" Enable \s-1HAX\s0 (Hardware-based Acceleration eXecution) support. This option is only available if \s-1HAX\s0 support is enabled when compiling. \s-1HAX\s0 is only applicable to \s-1MAC\s0 and Windows platform, and thus does not conflict with \&\s-1KVM.\s0 This option is deprecated, use \fB\-accel hax\fR instead. .IP "\fB\-xen\-domid\fR \fIid\fR" 4 .IX Item "-xen-domid id" Specify xen guest domain \fIid\fR (\s-1XEN\s0 only). .IP "\fB\-xen\-create\fR" 4 .IX Item "-xen-create" Create domain using xen hypercalls, bypassing xend. Warning: should not be used when xend is in use (\s-1XEN\s0 only). .IP "\fB\-xen\-attach\fR" 4 .IX Item "-xen-attach" Attach to existing xen domain. xend will use this when starting \s-1QEMU\s0 (\s-1XEN\s0 only). Restrict set of available xen operations to specified domain id (\s-1XEN\s0 only). .IP "\fB\-no\-reboot\fR" 4 .IX Item "-no-reboot" Exit instead of rebooting. .IP "\fB\-no\-shutdown\fR" 4 .IX Item "-no-shutdown" Don't exit \s-1QEMU\s0 on guest shutdown, but instead only stop the emulation. This allows for instance switching to monitor to commit changes to the disk image. .IP "\fB\-loadvm\fR \fIfile\fR" 4 .IX Item "-loadvm file" Start right away with a saved state (\f(CW\*(C`loadvm\*(C'\fR in monitor) .IP "\fB\-daemonize\fR" 4 .IX Item "-daemonize" Daemonize the \s-1QEMU\s0 process after initialization. \s-1QEMU\s0 will not detach from standard \s-1IO\s0 until it is ready to receive connections on any of its devices. This option is a useful way for external programs to launch \s-1QEMU\s0 without having to cope with initialization race conditions. .IP "\fB\-option\-rom\fR \fIfile\fR" 4 .IX Item "-option-rom file" Load the contents of \fIfile\fR as an option \s-1ROM.\s0 This option is useful to load things like EtherBoot. .IP "\fB\-rtc [base=utc|localtime|\fR\fIdatetime\fR\fB][,clock=host|rt|vm][,driftfix=none|slew]\fR" 4 .IX Item "-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]" Specify \fBbase\fR as \f(CW\*(C`utc\*(C'\fR or \f(CW\*(C`localtime\*(C'\fR to let the \s-1RTC\s0 start at the current \&\s-1UTC\s0 or local time, respectively. \f(CW\*(C`localtime\*(C'\fR is required for correct date in MS-DOS or Windows. To start at a specific point in time, provide \fIdatetime\fR in the format \f(CW\*(C`2006\-06\-17T16:01:21\*(C'\fR or \f(CW\*(C`2006\-06\-17\*(C'\fR. The default base is \s-1UTC.\s0 .Sp By default the \s-1RTC\s0 is driven by the host system time. This allows using of the \&\s-1RTC\s0 as accurate reference clock inside the guest, specifically if the host time is smoothly following an accurate external reference clock, e.g. via \s-1NTP.\s0 If you want to isolate the guest time from the host, you can set \fBclock\fR to \f(CW\*(C`rt\*(C'\fR instead, which provides a host monotonic clock if host support it. To even prevent the \s-1RTC\s0 from progressing during suspension, you can set \fBclock\fR to \f(CW\*(C`vm\*(C'\fR (virtual clock). \fBclock=vm\fR is recommended especially in icount mode in order to preserve determinism; however, note that in icount mode the speed of the virtual clock is variable and can in general differ from the host clock. .Sp Enable \fBdriftfix\fR (i386 targets only) if you experience time drift problems, specifically with Windows' \s-1ACPI HAL.\s0 This option will try to figure out how many timer interrupts were not processed by the Windows guest and will re-inject them. .IP "\fB\-icount [shift=\fR\fIN\fR\fB|auto][,rr=record|replay,rrfile=\fR\fIfilename\fR\fB,rrsnapshot=\fR\fIsnapshot\fR\fB]\fR" 4 .IX Item "-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]" Enable virtual instruction counter. The virtual cpu will execute one instruction every 2^\fIN\fR ns of virtual time. If \f(CW\*(C`auto\*(C'\fR is specified then the virtual cpu speed will be automatically adjusted to keep virtual time within a few seconds of real time. .Sp When the virtual cpu is sleeping, the virtual time will advance at default speed unless \fBsleep=on|off\fR is specified. With \fBsleep=on|off\fR, the virtual time will jump to the next timer deadline instantly whenever the virtual cpu goes to sleep mode and will not advance if no timer is enabled. This behavior give deterministic execution times from the guest point of view. .Sp Note that while this option can give deterministic behavior, it does not provide cycle accurate emulation. Modern CPUs contain superscalar out of order cores with complex cache hierarchies. The number of instructions executed often has little or no correlation with actual performance. .Sp \&\fBalign=on\fR will activate the delay algorithm which will try to synchronise the host clock and the virtual clock. The goal is to have a guest running at the real frequency imposed by the shift option. Whenever the guest clock is behind the host clock and if \&\fBalign=on\fR is specified then we print a message to the user to inform about the delay. Currently this option does not work when \fBshift\fR is \f(CW\*(C`auto\*(C'\fR. Note: The sync algorithm will work for those shift values for which the guest clock runs ahead of the host clock. Typically this happens when the shift value is high (how high depends on the host machine). .Sp When \fBrr\fR option is specified deterministic record/replay is enabled. Replay log is written into \fIfilename\fR file in record mode and read from this file in replay mode. .Sp Option rrsnapshot is used to create new vm snapshot named \fIsnapshot\fR at the start of execution recording. In replay mode this option is used to load the initial \s-1VM\s0 state. .IP "\fB\-watchdog\fR \fImodel\fR" 4 .IX Item "-watchdog model" Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the guest will be restarted. Choose a model for which your guest has drivers. .Sp The \fImodel\fR is the model of hardware watchdog to emulate. Use \&\f(CW\*(C`\-watchdog help\*(C'\fR to list available hardware models. Only one watchdog can be enabled for a guest. .Sp The following models may be available: .RS 4 .IP "\fBib700\fR" 4 .IX Item "ib700" iBASE 700 is a very simple \s-1ISA\s0 watchdog with a single timer. .IP "\fBi6300esb\fR" 4 .IX Item "i6300esb" Intel 6300ESB I/O controller hub is a much more featureful PCI-based dual-timer watchdog. .IP "\fBdiag288\fR" 4 .IX Item "diag288" A virtual watchdog for s390x backed by the diagnose 288 hypercall (currently \s-1KVM\s0 only). .RE .RS 4 .RE .IP "\fB\-watchdog\-action\fR \fIaction\fR" 4 .IX Item "-watchdog-action action" The \fIaction\fR controls what \s-1QEMU\s0 will do when the watchdog timer expires. The default is \&\f(CW\*(C`reset\*(C'\fR (forcefully reset the guest). Other possible actions are: \&\f(CW\*(C`shutdown\*(C'\fR (attempt to gracefully shutdown the guest), \&\f(CW\*(C`poweroff\*(C'\fR (forcefully poweroff the guest), \&\f(CW\*(C`inject\-nmi\*(C'\fR (inject a \s-1NMI\s0 into the guest), \&\f(CW\*(C`pause\*(C'\fR (pause the guest), \&\f(CW\*(C`debug\*(C'\fR (print a debug message and continue), or \&\f(CW\*(C`none\*(C'\fR (do nothing). .Sp Note that the \f(CW\*(C`shutdown\*(C'\fR action requires that the guest responds to \s-1ACPI\s0 signals, which it may not be able to do in the sort of situations where the watchdog would have expired, and thus \&\f(CW\*(C`\-watchdog\-action shutdown\*(C'\fR is not recommended for production use. .Sp Examples: .RS 4 .ie n .IP """\-watchdog i6300esb \-watchdog\-action pause""" 4 .el .IP "\f(CW\-watchdog i6300esb \-watchdog\-action pause\fR" 4 .IX Item "-watchdog i6300esb -watchdog-action pause" .PD 0 .ie n .IP """\-watchdog ib700""" 4 .el .IP "\f(CW\-watchdog ib700\fR" 4 .IX Item "-watchdog ib700" .RE .RS 4 .RE .IP "\fB\-echr\fR \fInumeric_ascii_value\fR" 4 .IX Item "-echr numeric_ascii_value" .PD Change the escape character used for switching to the monitor when using monitor and serial sharing. The default is \f(CW0x01\fR when using the \&\f(CW\*(C`\-nographic\*(C'\fR option. \f(CW0x01\fR is equal to pressing \&\f(CW\*(C`Control\-a\*(C'\fR. You can select a different character from the ascii control keys where 1 through 26 map to Control-a through Control-z. For instance you could use the either of the following to change the escape character to Control-t. .RS 4 .ie n .IP """\-echr 0x14""" 4 .el .IP "\f(CW\-echr 0x14\fR" 4 .IX Item "-echr 0x14" .PD 0 .ie n .IP """\-echr 20""" 4 .el .IP "\f(CW\-echr 20\fR" 4 .IX Item "-echr 20" .RE .RS 4 .RE .IP "\fB\-virtioconsole\fR \fIc\fR" 4 .IX Item "-virtioconsole c" .PD Set virtio console. This option is deprecated, please use \fB\-device virtconsole\fR instead. .IP "\fB\-show\-cursor\fR" 4 .IX Item "-show-cursor" Show cursor. .IP "\fB\-tb\-size\fR \fIn\fR" 4 .IX Item "-tb-size n" Set \s-1TB\s0 size. .IP "\fB\-incoming tcp:[\fR\fIhost\fR\fB]:\fR\fIport\fR\fB[,to=\fR\fImaxport\fR\fB][,ipv4][,ipv6]\fR" 4 .IX Item "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]" .PD 0 .IP "\fB\-incoming rdma:\fR\fIhost\fR\fB:\fR\fIport\fR\fB[,ipv4][,ipv6]\fR" 4 .IX Item "-incoming rdma:host:port[,ipv4][,ipv6]" .PD Prepare for incoming migration, listen on a given tcp port. .IP "\fB\-incoming unix:\fR\fIsocketpath\fR" 4 .IX Item "-incoming unix:socketpath" Prepare for incoming migration, listen on a given unix socket. .IP "\fB\-incoming fd:\fR\fIfd\fR" 4 .IX Item "-incoming fd:fd" Accept incoming migration from a given filedescriptor. .IP "\fB\-incoming exec:\fR\fIcmdline\fR" 4 .IX Item "-incoming exec:cmdline" Accept incoming migration as an output from specified external command. .IP "\fB\-incoming defer\fR" 4 .IX Item "-incoming defer" Wait for the \s-1URI\s0 to be specified via migrate_incoming. The monitor can be used to change settings (such as migration parameters) prior to issuing the migrate_incoming to allow the migration to begin. .IP "\fB\-only\-migratable\fR" 4 .IX Item "-only-migratable" Only allow migratable devices. Devices will not be allowed to enter an unmigratable state. .IP "\fB\-nodefaults\fR" 4 .IX Item "-nodefaults" Don't create default devices. Normally, \s-1QEMU\s0 sets the default devices like serial port, parallel port, virtual console, monitor device, \s-1VGA\s0 adapter, floppy and CD-ROM drive and others. The \f(CW\*(C`\-nodefaults\*(C'\fR option will disable all those default devices. .IP "\fB\-chroot\fR \fIdir\fR" 4 .IX Item "-chroot dir" Immediately before starting guest execution, chroot to the specified directory. Especially useful in combination with \-runas. .IP "\fB\-runas\fR \fIuser\fR" 4 .IX Item "-runas user" Immediately before starting guest execution, drop root privileges, switching to the specified user. .IP "\fB\-prom\-env\fR \fIvariable\fR\fB=\fR\fIvalue\fR" 4 .IX Item "-prom-env variable=value" Set OpenBIOS nvram \fIvariable\fR to given \fIvalue\fR (\s-1PPC, SPARC\s0 only). .IP "\fB\-semihosting\fR" 4 .IX Item "-semihosting" Enable semihosting mode (\s-1ARM, M68K,\s0 Xtensa, \s-1MIPS\s0 only). .IP "\fB\-semihosting\-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\fR" 4 .IX Item "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]" Enable and configure semihosting (\s-1ARM, M68K,\s0 Xtensa, \s-1MIPS\s0 only). .RS 4 .ie n .IP "\fBtarget=\f(CB""native|gdb|auto""\fB\fR" 4 .el .IP "\fBtarget=\f(CBnative|gdb|auto\fB\fR" 4 .IX Item "target=native|gdb|auto" Defines where the semihosting calls will be addressed, to \s-1QEMU\s0 (\f(CW\*(C`native\*(C'\fR) or to \s-1GDB\s0 (\f(CW\*(C`gdb\*(C'\fR). The default is \f(CW\*(C`auto\*(C'\fR, which means \f(CW\*(C`gdb\*(C'\fR during debug sessions and \f(CW\*(C`native\*(C'\fR otherwise. .IP "\fBarg=\fR\fIstr1\fR\fB,arg=\fR\fIstr2\fR\fB,...\fR" 4 .IX Item "arg=str1,arg=str2,..." Allows the user to pass input arguments, and can be used multiple times to build up a list. The old-style \f(CW\*(C`\-kernel\*(C'\fR/\f(CW\*(C`\-append\*(C'\fR method of passing a command line is still supported for backward compatibility. If both the \&\f(CW\*(C`\-\-semihosting\-config arg\*(C'\fR and the \f(CW\*(C`\-kernel\*(C'\fR/\f(CW\*(C`\-append\*(C'\fR are specified, the former is passed to semihosting as it always takes precedence. .RE .RS 4 .RE .IP "\fB\-old\-param\fR" 4 .IX Item "-old-param" Old param mode (\s-1ARM\s0 only). .IP "\fB\-sandbox\fR \fIarg\fR\fB[,obsolete=\fR\fIstring\fR\fB][,elevateprivileges=\fR\fIstring\fR\fB][,spawn=\fR\fIstring\fR\fB][,resourcecontrol=\fR\fIstring\fR\fB]\fR" 4 .IX Item "-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]" Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will disable it. The default is 'off'. .RS 4 .IP "\fBobsolete=\fR\fIstring\fR" 4 .IX Item "obsolete=string" Enable Obsolete system calls .IP "\fBelevateprivileges=\fR\fIstring\fR" 4 .IX Item "elevateprivileges=string" Disable set*uid|gid system calls .IP "\fBspawn=\fR\fIstring\fR" 4 .IX Item "spawn=string" Disable *fork and execve .IP "\fBresourcecontrol=\fR\fIstring\fR" 4 .IX Item "resourcecontrol=string" Disable process affinity and schedular priority .RE .RS 4 .RE .IP "\fB\-readconfig\fR \fIfile\fR" 4 .IX Item "-readconfig file" Read device configuration from \fIfile\fR. This approach is useful when you want to spawn \&\s-1QEMU\s0 process with many command line options but you don't want to exceed the command line character limit. .IP "\fB\-writeconfig\fR \fIfile\fR" 4 .IX Item "-writeconfig file" Write device configuration to \fIfile\fR. The \fIfile\fR can be either filename to save command line and device configuration into file or dash \f(CW\*(C`\-\*(C'\fR) character to print the output to stdout. This can be later used as input file for \f(CW\*(C`\-readconfig\*(C'\fR option. .IP "\fB\-no\-user\-config\fR" 4 .IX Item "-no-user-config" The \f(CW\*(C`\-no\-user\-config\*(C'\fR option makes \s-1QEMU\s0 not load any of the user-provided config files on \fIsysconfdir\fR. .IP "\fB\-trace [[enable=]\fR\fIpattern\fR\fB][,events=\fR\fIfile\fR\fB][,file=\fR\fIfile\fR\fB]\fR" 4 .IX Item "-trace [[enable=]pattern][,events=file][,file=file]" Specify tracing options. .RS 4 .IP "\fB[enable=]\fR\fIpattern\fR" 4 .IX Item "[enable=]pattern" Immediately enable events matching \fIpattern\fR (either event name or a globbing pattern). This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR, \fIlog\fR or \fIftrace\fR tracing backend. To specify multiple events or patterns, specify the \fB\-trace\fR option multiple times. .Sp Use \f(CW\*(C`\-trace help\*(C'\fR to print a list of names of trace points. .IP "\fBevents=\fR\fIfile\fR" 4 .IX Item "events=file" Immediately enable events listed in \fIfile\fR. The file must contain one event name (as listed in the \fItrace-events-all\fR file) per line; globbing patterns are accepted too. This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR, \fIlog\fR or \&\fIftrace\fR tracing backend. .IP "\fBfile=\fR\fIfile\fR" 4 .IX Item "file=file" Log output traces to \fIfile\fR. This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR tracing backend. .RE .RS 4 .RE .IP "\fB\-enable\-fips\fR" 4 .IX Item "-enable-fips" Enable \s-1FIPS 140\-2\s0 compliance mode. .IP "\fB\-msg timestamp[=on|off]\fR" 4 .IX Item "-msg timestamp[=on|off]" prepend a timestamp to each log message.(default:on) .IP "\fB\-dump\-vmstate\fR \fIfile\fR" 4 .IX Item "-dump-vmstate file" Dump json-encoded vmstate information for current machine type to file in \fIfile\fR .IP "\fB\-enable\-sync\-profile\fR" 4 .IX Item "-enable-sync-profile" Enable synchronization profiling. .PP \fIGeneric object creation\fR .IX Subsection "Generic object creation" .IP "\fB\-object\fR \fItypename\fR\fB[,\fR\fIprop1\fR\fB=\fR\fIvalue1\fR\fB,...]\fR" 4 .IX Item "-object typename[,prop1=value1,...]" Create a new object of type \fItypename\fR setting properties in the order they are specified. Note that the 'id' property must be set. These objects are placed in the \&'/objects' path. .RS 4 .IP "\fB\-object memory\-backend\-file,id=\fR\fIid\fR\fB,size=\fR\fIsize\fR\fB,mem\-path=\fR\fIdir\fR\fB,share=\fR\fIon|off\fR\fB,discard\-data=\fR\fIon|off\fR\fB,merge=\fR\fIon|off\fR\fB,dump=\fR\fIon|off\fR\fB,prealloc=\fR\fIon|off\fR\fB,host\-nodes=\fR\fIhost-nodes\fR\fB,policy=\fR\fIdefault|preferred|bind|interleave\fR\fB,align=\fR\fIalign\fR" 4 .IX Item "-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align" Creates a memory file backend object, which can be used to back the guest \s-1RAM\s0 with huge pages. .Sp The \fBid\fR parameter is a unique \s-1ID\s0 that will be used to reference this memory region when configuring the \fB\-numa\fR argument. .Sp The \fBsize\fR option provides the size of the memory region, and accepts common suffixes, eg \fB500M\fR. .Sp The \fBmem-path\fR provides the path to either a shared memory or huge page filesystem mount. .Sp The \fBshare\fR boolean option determines whether the memory region is marked as private to \s-1QEMU,\s0 or shared. The latter allows a co-operating external process to access the \s-1QEMU\s0 memory region. .Sp The \fBshare\fR is also required for pvrdma devices due to limitations in the \s-1RDMA API\s0 provided by Linux. .Sp Setting share=on might affect the ability to configure \s-1NUMA\s0 bindings for the memory backend under some circumstances, see Documentation/vm/numa_memory_policy.txt on the Linux kernel source tree for additional details. .Sp Setting the \fBdiscard-data\fR boolean option to \fIon\fR indicates that file contents can be destroyed when \s-1QEMU\s0 exits, to avoid unnecessarily flushing data to the backing file. Note that \fBdiscard-data\fR is only an optimization, and \s-1QEMU\s0 might not discard file contents if it aborts unexpectedly or is terminated using \s-1SIGKILL.\s0 .Sp The \fBmerge\fR boolean option enables memory merge, also known as \&\s-1MADV_MERGEABLE,\s0 so that Kernel Samepage Merging will consider the pages for memory deduplication. .Sp Setting the \fBdump\fR boolean option to \fIoff\fR excludes the memory from core dumps. This feature is also known as \s-1MADV_DONTDUMP.\s0 .Sp The \fBprealloc\fR boolean option enables memory preallocation. .Sp The \fBhost-nodes\fR option binds the memory range to a list of \s-1NUMA\s0 host nodes. .Sp The \fBpolicy\fR option sets the \s-1NUMA\s0 policy to one of the following values: .RS 4 .IP "\fIdefault\fR" 4 .IX Item "default" default host policy .IP "\fIpreferred\fR" 4 .IX Item "preferred" prefer the given host node list for allocation .IP "\fIbind\fR" 4 .IX Item "bind" restrict memory allocation to the given host node list .IP "\fIinterleave\fR" 4 .IX Item "interleave" interleave memory allocations across the given host node list .RE .RS 4 .Sp The \fBalign\fR option specifies the base address alignment when \&\s-1QEMU\s0 \fBmmap\fR\|(2) \fBmem-path\fR, and accepts common suffixes, eg \&\fB2M\fR. Some backend store specified by \fBmem-path\fR requires an alignment different than the default one used by \s-1QEMU,\s0 eg the device \s-1DAX\s0 /dev/dax0.0 requires 2M alignment rather than 4K. In such cases, users can specify the required alignment via this option. .Sp The \fBpmem\fR option specifies whether the backing file specified by \fBmem-path\fR is in host persistent memory that can be accessed using the \s-1SNIA NVM\s0 programming model (e.g. Intel \s-1NVDIMM\s0). If \fBpmem\fR is set to 'on', \s-1QEMU\s0 will take necessary operations to guarantee the persistence of its own writes to \fBmem-path\fR (e.g. in vNVDIMM label emulation and live migration). .RE .IP "\fB\-object memory\-backend\-ram,id=\fR\fIid\fR\fB,merge=\fR\fIon|off\fR\fB,dump=\fR\fIon|off\fR\fB,share=\fR\fIon|off\fR\fB,prealloc=\fR\fIon|off\fR\fB,size=\fR\fIsize\fR\fB,host\-nodes=\fR\fIhost-nodes\fR\fB,policy=\fR\fIdefault|preferred|bind|interleave\fR" 4 .IX Item "-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave" Creates a memory backend object, which can be used to back the guest \s-1RAM.\s0 Memory backend objects offer more control than the \fB\-m\fR option that is traditionally used to define guest \s-1RAM.\s0 Please refer to \&\fBmemory-backend-file\fR for a description of the options. .IP "\fB\-object memory\-backend\-memfd,id=\fR\fIid\fR\fB,merge=\fR\fIon|off\fR\fB,dump=\fR\fIon|off\fR\fB,share=\fR\fIon|off\fR\fB,prealloc=\fR\fIon|off\fR\fB,size=\fR\fIsize\fR\fB,host\-nodes=\fR\fIhost-nodes\fR\fB,policy=\fR\fIdefault|preferred|bind|interleave\fR\fB,seal=\fR\fIon|off\fR\fB,hugetlb=\fR\fIon|off\fR\fB,hugetlbsize=\fR\fIsize\fR" 4 .IX Item "-object memory-backend-memfd,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave,seal=on|off,hugetlb=on|off,hugetlbsize=size" Creates an anonymous memory file backend object, which allows \s-1QEMU\s0 to share the memory with an external process (e.g. when using vhost-user). The memory is allocated with memfd and optional sealing. (Linux only) .Sp The \fBseal\fR option creates a sealed-file, that will block further resizing the memory ('on' by default). .Sp The \fBhugetlb\fR option specify the file to be created resides in the hugetlbfs filesystem (since Linux 4.14). Used in conjunction with the \fBhugetlb\fR option, the \fBhugetlbsize\fR option specify the hugetlb page size on systems that support multiple hugetlb page sizes (it must be a power of 2 value supported by the system). .Sp In some versions of Linux, the \fBhugetlb\fR option is incompatible with the \fBseal\fR option (requires at least Linux 4.16). .Sp Please refer to \fBmemory-backend-file\fR for a description of the other options. .Sp The \fBshare\fR boolean option is \fIon\fR by default with memfd. .IP "\fB\-object rng\-random,id=\fR\fIid\fR\fB,filename=\fR\fI/dev/random\fR" 4 .IX Item "-object rng-random,id=id,filename=/dev/random" Creates a random number generator backend which obtains entropy from a device on the host. The \fBid\fR parameter is a unique \s-1ID\s0 that will be used to reference this entropy backend from the \fBvirtio-rng\fR device. The \fBfilename\fR parameter specifies which file to obtain entropy from and if omitted defaults to \fB/dev/random\fR. .IP "\fB\-object rng\-egd,id=\fR\fIid\fR\fB,chardev=\fR\fIchardevid\fR" 4 .IX Item "-object rng-egd,id=id,chardev=chardevid" Creates a random number generator backend which obtains entropy from an external daemon running on the host. The \fBid\fR parameter is a unique \s-1ID\s0 that will be used to reference this entropy backend from the \fBvirtio-rng\fR device. The \fBchardev\fR parameter is the unique \s-1ID\s0 of a character device backend that provides the connection to the \s-1RNG\s0 daemon. .IP "\fB\-object tls\-creds\-anon,id=\fR\fIid\fR\fB,endpoint=\fR\fIendpoint\fR\fB,dir=\fR\fI/path/to/cred/dir\fR\fB,verify\-peer=\fR\fIon|off\fR" 4 .IX Item "-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off" Creates a \s-1TLS\s0 anonymous credentials object, which can be used to provide \&\s-1TLS\s0 support on network backends. The \fBid\fR parameter is a unique \&\s-1ID\s0 which network backends will use to access the credentials. The \&\fBendpoint\fR is either \fBserver\fR or \fBclient\fR depending on whether the \s-1QEMU\s0 network backend that uses the credentials will be acting as a client or as a server. If \fBverify-peer\fR is enabled (the default) then once the handshake is completed, the peer credentials will be verified, though this is a no-op for anonymous credentials. .Sp The \fIdir\fR parameter tells \s-1QEMU\s0 where to find the credential files. For server endpoints, this directory may contain a file \&\fIdh\-params.pem\fR providing diffie-hellman parameters to use for the \s-1TLS\s0 server. If the file is missing, \s-1QEMU\s0 will generate a set of \s-1DH\s0 parameters at startup. This is a computationally expensive operation that consumes random pool entropy, so it is recommended that a persistent set of parameters be generated upfront and saved. .IP "\fB\-object tls\-creds\-psk,id=\fR\fIid\fR\fB,endpoint=\fR\fIendpoint\fR\fB,dir=\fR\fI/path/to/keys/dir\fR\fB[,username=\fR\fIusername\fR\fB]\fR" 4 .IX Item "-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]" Creates a \s-1TLS\s0 Pre-Shared Keys (\s-1PSK\s0) credentials object, which can be used to provide \&\s-1TLS\s0 support on network backends. The \fBid\fR parameter is a unique \&\s-1ID\s0 which network backends will use to access the credentials. The \&\fBendpoint\fR is either \fBserver\fR or \fBclient\fR depending on whether the \s-1QEMU\s0 network backend that uses the credentials will be acting as a client or as a server. For clients only, \fBusername\fR is the username which will be sent to the server. If omitted it defaults to \*(L"qemu\*(R". .Sp The \fIdir\fR parameter tells \s-1QEMU\s0 where to find the keys file. It is called "\fIdir\fR/keys.psk\*(L" and contains \*(R"username:key" pairs. This file can most easily be created using the GnuTLS \&\f(CW\*(C`psktool\*(C'\fR program. .Sp For server endpoints, \fIdir\fR may also contain a file \&\fIdh\-params.pem\fR providing diffie-hellman parameters to use for the \s-1TLS\s0 server. If the file is missing, \s-1QEMU\s0 will generate a set of \s-1DH\s0 parameters at startup. This is a computationally expensive operation that consumes random pool entropy, so it is recommended that a persistent set of parameters be generated up front and saved. .IP "\fB\-object tls\-creds\-x509,id=\fR\fIid\fR\fB,endpoint=\fR\fIendpoint\fR\fB,dir=\fR\fI/path/to/cred/dir\fR\fB,priority=\fR\fIpriority\fR\fB,verify\-peer=\fR\fIon|off\fR\fB,passwordid=\fR\fIid\fR" 4 .IX Item "-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id" Creates a \s-1TLS\s0 anonymous credentials object, which can be used to provide \&\s-1TLS\s0 support on network backends. The \fBid\fR parameter is a unique \&\s-1ID\s0 which network backends will use to access the credentials. The \&\fBendpoint\fR is either \fBserver\fR or \fBclient\fR depending on whether the \s-1QEMU\s0 network backend that uses the credentials will be acting as a client or as a server. If \fBverify-peer\fR is enabled (the default) then once the handshake is completed, the peer credentials will be verified. With x509 certificates, this implies that the clients must be provided with valid client certificates too. .Sp The \fIdir\fR parameter tells \s-1QEMU\s0 where to find the credential files. For server endpoints, this directory may contain a file \&\fIdh\-params.pem\fR providing diffie-hellman parameters to use for the \s-1TLS\s0 server. If the file is missing, \s-1QEMU\s0 will generate a set of \s-1DH\s0 parameters at startup. This is a computationally expensive operation that consumes random pool entropy, so it is recommended that a persistent set of parameters be generated upfront and saved. .Sp For x509 certificate credentials the directory will contain further files providing the x509 certificates. The certificates must be stored in \s-1PEM\s0 format, in filenames \fIca\-cert.pem\fR, \fIca\-crl.pem\fR (optional), \&\fIserver\-cert.pem\fR (only servers), \fIserver\-key.pem\fR (only servers), \&\fIclient\-cert.pem\fR (only clients), and \fIclient\-key.pem\fR (only clients). .Sp For the \fIserver\-key.pem\fR and \fIclient\-key.pem\fR files which contain sensitive private keys, it is possible to use an encrypted version by providing the \fIpasswordid\fR parameter. This provides the \s-1ID\s0 of a previously created \f(CW\*(C`secret\*(C'\fR object containing the password for decryption. .Sp The \fIpriority\fR parameter allows to override the global default priority used by gnutls. This can be useful if the system administrator needs to use a weaker set of crypto priorities for \s-1QEMU\s0 without potentially forcing the weakness onto all applications. Or conversely if one wants wants a stronger default for \s-1QEMU\s0 than for all other applications, they can do this through this parameter. Its format is a gnutls priority string as described at <\fBhttps://gnutls.org/manual/html_node/Priority\-Strings.html\fR>. .IP "\fB\-object filter\-buffer,id=\fR\fIid\fR\fB,netdev=\fR\fInetdevid\fR\fB,interval=\fR\fIt\fR\fB[,queue=\fR\fIall|rx|tx\fR\fB][,status=\fR\fIon|off\fR\fB]\fR" 4 .IX Item "-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off]" Interval \fIt\fR can't be 0, this filter batches the packet delivery: all packets arriving in a given interval on netdev \fInetdevid\fR are delayed until the end of the interval. Interval is in microseconds. \&\fBstatus\fR is optional that indicate whether the netfilter is on (enabled) or off (disabled), the default status for netfilter will be 'on'. .Sp queue \fIall|rx|tx\fR is an option that can be applied to any netfilter. .Sp \&\fBall\fR: the filter is attached both to the receive and the transmit queue of the netdev (default). .Sp \&\fBrx\fR: the filter is attached to the receive queue of the netdev, where it will receive packets sent to the netdev. .Sp \&\fBtx\fR: the filter is attached to the transmit queue of the netdev, where it will receive packets sent by the netdev. .IP "\fB\-object filter\-mirror,id=\fR\fIid\fR\fB,netdev=\fR\fInetdevid\fR\fB,outdev=\fR\fIchardevid\fR\fB,queue=\fR\fIall|rx|tx\fR\fB[,vnet_hdr_support]\fR" 4 .IX Item "-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support]" filter-mirror on netdev \fInetdevid\fR,mirror net packet to chardev\fIchardevid\fR, if it has the vnet_hdr_support flag, filter-mirror will mirror packet with vnet_hdr_len. .IP "\fB\-object filter\-redirector,id=\fR\fIid\fR\fB,netdev=\fR\fInetdevid\fR\fB,indev=\fR\fIchardevid\fR\fB,outdev=\fR\fIchardevid\fR\fB,queue=\fR\fIall|rx|tx\fR\fB[,vnet_hdr_support]\fR" 4 .IX Item "-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support]" filter-redirector on netdev \fInetdevid\fR,redirect filter's net packet to chardev \&\fIchardevid\fR,and redirect indev's packet to filter.if it has the vnet_hdr_support flag, filter-redirector will redirect packet with vnet_hdr_len. Create a filter-redirector we need to differ outdev id from indev id, id can not be the same. we can just use indev or outdev, but at least one of indev or outdev need to be specified. .IP "\fB\-object filter\-rewriter,id=\fR\fIid\fR\fB,netdev=\fR\fInetdevid\fR\fB,queue=\fR\fIall|rx|tx\fR\fB,[vnet_hdr_support]\fR" 4 .IX Item "-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support]" Filter-rewriter is a part of \s-1COLO\s0 project.It will rewrite tcp packet to secondary from primary to keep secondary tcp connection,and rewrite tcp packet to primary from secondary make tcp packet can be handled by client.if it has the vnet_hdr_support flag, we can parse packet with vnet header. .Sp usage: colo secondary: \&\-object filter\-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 \&\-object filter\-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 \&\-object filter\-rewriter,id=rew0,netdev=hn0,queue=all .IP "\fB\-object filter\-dump,id=\fR\fIid\fR\fB,netdev=\fR\fIdev\fR\fB[,file=\fR\fIfilename\fR\fB][,maxlen=\fR\fIlen\fR\fB]\fR" 4 .IX Item "-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len]" Dump the network traffic on netdev \fIdev\fR to the file specified by \&\fIfilename\fR. At most \fIlen\fR bytes (64k by default) per packet are stored. The file format is libpcap, so it can be analyzed with tools such as tcpdump or Wireshark. .IP "\fB\-object colo\-compare,id=\fR\fIid\fR\fB,primary_in=\fR\fIchardevid\fR\fB,secondary_in=\fR\fIchardevid\fR\fB,outdev=\fR\fIchardevid\fR\fB[,vnet_hdr_support]\fR" 4 .IX Item "-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid[,vnet_hdr_support]" Colo-compare gets packet from primary_in\fIchardevid\fR and secondary_in\fIchardevid\fR, than compare primary packet with secondary packet. If the packets are same, we will output primary packet to outdev\fIchardevid\fR, else we will notify colo-frame do checkpoint and send primary packet to outdev\fIchardevid\fR. if it has the vnet_hdr_support flag, colo compare will send/recv packet with vnet_hdr_len. .Sp we must use it with the help of filter-mirror and filter-redirector. .Sp .Vb 10 \& primary: \& \-netdev tap,id=hn0,vhost=off,script=/etc/qemu\-ifup,downscript=/etc/qemu\-ifdown \& \-device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 \& \-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait \& \-chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait \& \-chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait \& \-chardev socket,id=compare0\-0,host=3.3.3.3,port=9001 \& \-chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait \& \-chardev socket,id=compare_out0,host=3.3.3.3,port=9005 \& \-object filter\-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 \& \-object filter\-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out \& \-object filter\-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 \& \-object colo\-compare,id=comp0,primary_in=compare0\-0,secondary_in=compare1,outdev=compare_out0 \& \& secondary: \& \-netdev tap,id=hn0,vhost=off,script=/etc/qemu\-ifup,down script=/etc/qemu\-ifdown \& \-device e1000,netdev=hn0,mac=52:a4:00:12:78:66 \& \-chardev socket,id=red0,host=3.3.3.3,port=9003 \& \-chardev socket,id=red1,host=3.3.3.3,port=9004 \& \-object filter\-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 \& \-object filter\-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 .Ve .Sp If you want to know the detail of above command line, you can read the colo-compare git log. .IP "\fB\-object cryptodev\-backend\-builtin,id=\fR\fIid\fR\fB[,queues=\fR\fIqueues\fR\fB]\fR" 4 .IX Item "-object cryptodev-backend-builtin,id=id[,queues=queues]" Creates a cryptodev backend which executes crypto opreation from the \s-1QEMU\s0 cipher \s-1APIS.\s0 The \fIid\fR parameter is a unique \s-1ID\s0 that will be used to reference this cryptodev backend from the \fBvirtio-crypto\fR device. The \fIqueues\fR parameter is optional, which specify the queue number of cryptodev backend, the default of \&\fIqueues\fR is 1. .Sp .Vb 5 \& # qemu\-system\-x86_64 \e \& [...] \e \& \-object cryptodev\-backend\-builtin,id=cryptodev0 \e \& \-device virtio\-crypto\-pci,id=crypto0,cryptodev=cryptodev0 \e \& [...] .Ve .IP "\fB\-object cryptodev\-vhost\-user,id=\fR\fIid\fR\fB,chardev=\fR\fIchardevid\fR\fB[,queues=\fR\fIqueues\fR\fB]\fR" 4 .IX Item "-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]" Creates a vhost-user cryptodev backend, backed by a chardev \fIchardevid\fR. The \fIid\fR parameter is a unique \s-1ID\s0 that will be used to reference this cryptodev backend from the \fBvirtio-crypto\fR device. The chardev should be a unix domain socket backed one. The vhost-user uses a specifically defined protocol to pass vhost ioctl replacement messages to an application on the other end of the socket. The \fIqueues\fR parameter is optional, which specify the queue number of cryptodev backend for multiqueue vhost-user, the default of \fIqueues\fR is 1. .Sp .Vb 6 \& # qemu\-system\-x86_64 \e \& [...] \e \& \-chardev socket,id=chardev0,path=/path/to/socket \e \& \-object cryptodev\-vhost\-user,id=cryptodev0,chardev=chardev0 \e \& \-device virtio\-crypto\-pci,id=crypto0,cryptodev=cryptodev0 \e \& [...] .Ve .IP "\fB\-object secret,id=\fR\fIid\fR\fB,data=\fR\fIstring\fR\fB,format=\fR\fIraw|base64\fR\fB[,keyid=\fR\fIsecretid\fR\fB,iv=\fR\fIstring\fR\fB]\fR" 4 .IX Item "-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]" .PD 0 .IP "\fB\-object secret,id=\fR\fIid\fR\fB,file=\fR\fIfilename\fR\fB,format=\fR\fIraw|base64\fR\fB[,keyid=\fR\fIsecretid\fR\fB,iv=\fR\fIstring\fR\fB]\fR" 4 .IX Item "-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]" .PD Defines a secret to store a password, encryption key, or some other sensitive data. The sensitive data can either be passed directly via the \fIdata\fR parameter, or indirectly via the \fIfile\fR parameter. Using the \fIdata\fR parameter is insecure unless the sensitive data is encrypted. .Sp The sensitive data can be provided in raw format (the default), or base64. When encoded as \s-1JSON,\s0 the raw format only supports valid \s-1UTF\-8\s0 characters, so base64 is recommended for sending binary data. \s-1QEMU\s0 will convert from which ever format is provided to the format it needs internally. eg, an \&\s-1RBD\s0 password can be provided in raw format, even though it will be base64 encoded when passed onto the \s-1RBD\s0 sever. .Sp For added protection, it is possible to encrypt the data associated with a secret using the \s-1AES\-256\-CBC\s0 cipher. Use of encryption is indicated by providing the \fIkeyid\fR and \fIiv\fR parameters. The \fIkeyid\fR parameter provides the \s-1ID\s0 of a previously defined secret that contains the \s-1AES\-256\s0 decryption key. This key should be 32\-bytes long and be base64 encoded. The \fIiv\fR parameter provides the random initialization vector used for encryption of this particular secret and should be a base64 encrypted string of the 16\-byte \s-1IV.\s0 .Sp The simplest (insecure) usage is to provide the secret inline .Sp .Vb 1 \& # $QEMU \-object secret,id=sec0,data=letmein,format=raw .Ve .Sp The simplest secure usage is to provide the secret via a file .Sp # printf \*(L"letmein\*(R" > mypasswd.txt # \f(CW$QEMU\fR \-object secret,id=sec0,file=mypasswd.txt,format=raw .Sp For greater security, \s-1AES\-256\-CBC\s0 should be used. To illustrate usage, consider the openssl command line tool which can encrypt the data. Note that when encrypting, the plaintext must be padded to the cipher block size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm. .Sp First a master key needs to be created in base64 encoding: .Sp .Vb 2 \& # openssl rand \-base64 32 > key.b64 \& # KEY=$(base64 \-d key.b64 | hexdump \-v \-e \*(Aq/1 "%02X"\*(Aq) .Ve .Sp Each secret to be encrypted needs to have a random initialization vector generated. These do not need to be kept secret .Sp .Vb 2 \& # openssl rand \-base64 16 > iv.b64 \& # IV=$(base64 \-d iv.b64 | hexdump \-v \-e \*(Aq/1 "%02X"\*(Aq) .Ve .Sp The secret to be defined can now be encrypted, in this case we're telling openssl to base64 encode the result, but it could be left as raw bytes if desired. .Sp .Vb 2 \& # SECRET=$(printf "letmein" | \& openssl enc \-aes\-256\-cbc \-a \-K $KEY \-iv $IV) .Ve .Sp When launching \s-1QEMU,\s0 create a master secret pointing to \f(CW\*(C`key.b64\*(C'\fR and specify that to be used to decrypt the user password. Pass the contents of \f(CW\*(C`iv.b64\*(C'\fR to the second secret .Sp .Vb 4 \& # $QEMU \e \& \-object secret,id=secmaster0,format=base64,file=key.b64 \e \& \-object secret,id=sec0,keyid=secmaster0,format=base64,\e \& data=$SECRET,iv=$([:]//\*(R" .Sp By default qemu will use the iSCSI initiator-name \&'iqn.2008\-11.org.linux\-kvm[:]' but this can also be set from the command line or a configuration file. .Sp Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect stalled requests and force a reestablishment of the session. The timeout is specified in seconds. The default is 0 which means no timeout. Libiscsi 1.15.0 or greater is required for this feature. .Sp Example (without authentication): .Sp .Vb 3 \& qemu\-system\-i386 \-iscsi initiator\-name=iqn.2001\-04.com.example:my\-initiator \e \& \-cdrom iscsi://192.0.2.1/iqn.2001\-04.com.example/2 \e \& \-drive file=iscsi://192.0.2.1/iqn.2001\-04.com.example/1 .Ve .Sp Example (\s-1CHAP\s0 username/password via \s-1URL\s0): .Sp .Vb 1 \& qemu\-system\-i386 \-drive file=iscsi://user%password@192.0.2.1/iqn.2001\-04.com.example/1 .Ve .Sp Example (\s-1CHAP\s0 username/password via environment variables): .Sp .Vb 3 \& LIBISCSI_CHAP_USERNAME="user" \e \& LIBISCSI_CHAP_PASSWORD="password" \e \& qemu\-system\-i386 \-drive file=iscsi://192.0.2.1/iqn.2001\-04.com.example/1 .Ve .IP "\fB\s-1NBD\s0\fR" 4 .IX Item "NBD" \&\s-1QEMU\s0 supports \s-1NBD\s0 (Network Block Devices) both using \s-1TCP\s0 protocol as well as Unix Domain Sockets. .Sp Syntax for specifying a \s-1NBD\s0 device using \s-1TCP\s0 \&\*(L"nbd::[:exportname=]\*(R" .Sp Syntax for specifying a \s-1NBD\s0 device using Unix Domain Sockets \&\*(L"nbd:unix:[:exportname=]\*(R" .Sp Example for \s-1TCP\s0 .Sp .Vb 1 \& qemu\-system\-i386 \-\-drive file=nbd:192.0.2.1:30000 .Ve .Sp Example for Unix Domain Sockets .Sp .Vb 1 \& qemu\-system\-i386 \-\-drive file=nbd:unix:/tmp/nbd\-socket .Ve .IP "\fB\s-1SSH\s0\fR" 4 .IX Item "SSH" \&\s-1QEMU\s0 supports \s-1SSH\s0 (Secure Shell) access to remote disks. .Sp Examples: .Sp .Vb 2 \& qemu\-system\-i386 \-drive file=ssh://user@host/path/to/disk.img \& qemu\-system\-i386 \-drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img .Ve .Sp Currently authentication must be done using ssh-agent. Other authentication methods may be supported in future. .IP "\fBSheepdog\fR" 4 .IX Item "Sheepdog" Sheepdog is a distributed storage system for \s-1QEMU. QEMU\s0 supports using either local sheepdog devices or remote networked devices. .Sp Syntax for specifying a sheepdog device .Sp .Vb 1 \& sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag] .Ve .Sp Example .Sp .Vb 1 \& qemu\-system\-i386 \-\-drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine .Ve .Sp See also <\fBhttps://sheepdog.github.io/sheepdog/\fR>. .IP "\fBGlusterFS\fR" 4 .IX Item "GlusterFS" GlusterFS is a user space distributed file system. \&\s-1QEMU\s0 supports the use of GlusterFS volumes for hosting \s-1VM\s0 disk images using \&\s-1TCP,\s0 Unix Domain Sockets and \s-1RDMA\s0 transport protocols. .Sp Syntax for specifying a \s-1VM\s0 disk image on GlusterFS volume is .Sp .Vb 2 \& URI: \& gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...] \& \& JSON: \& \*(Aqjson:{"driver":"qcow2","file":{"driver":"gluster","volume":"testvol","path":"a.img","debug":N,"logfile":"...", \& "server":[{"type":"tcp","host":"...","port":"..."}, \& {"type":"unix","socket":"..."}]}}\*(Aq .Ve .Sp Example .Sp .Vb 3 \& URI: \& qemu\-system\-x86_64 \-\-drive file=gluster://192.0.2.1/testvol/a.img, \& file.debug=9,file.logfile=/var/log/qemu\-gluster.log \& \& JSON: \& qemu\-system\-x86_64 \*(Aqjson:{"driver":"qcow2", \& "file":{"driver":"gluster", \& "volume":"testvol","path":"a.img", \& "debug":9,"logfile":"/var/log/qemu\-gluster.log", \& "server":[{"type":"tcp","host":"1.2.3.4","port":24007}, \& {"type":"unix","socket":"/var/run/glusterd.socket"}]}}\*(Aq \& qemu\-system\-x86_64 \-drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img, \& file.debug=9,file.logfile=/var/log/qemu\-gluster.log, \& file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007, \& file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket .Ve .Sp See also <\fBhttp://www.gluster.org\fR>. .IP "\fB\s-1HTTP/HTTPS/FTP/FTPS\s0\fR" 4 .IX Item "HTTP/HTTPS/FTP/FTPS" \&\s-1QEMU\s0 supports read-only access to files accessed over http(s) and ftp(s). .Sp Syntax using a single filename: .Sp .Vb 1 \& ://[[:]@]/ .Ve .Sp where: .RS 4 .IP "\fBprotocol\fR" 4 .IX Item "protocol" \&'http', 'https', 'ftp', or 'ftps'. .IP "\fBusername\fR" 4 .IX Item "username" Optional username for authentication to the remote server. .IP "\fBpassword\fR" 4 .IX Item "password" Optional password for authentication to the remote server. .IP "\fBhost\fR" 4 .IX Item "host" Address of the remote server. .IP "\fBpath\fR" 4 .IX Item "path" Path on the remote server, including any query string. .RE .RS 4 .Sp The following options are also supported: .IP "\fBurl\fR" 4 .IX Item "url" The full \s-1URL\s0 when passing options to the driver explicitly. .IP "\fBreadahead\fR" 4 .IX Item "readahead" The amount of data to read ahead with each range request to the remote server. This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it does not have a suffix, it will be assumed to be in bytes. The value must be a multiple of 512 bytes. It defaults to 256k. .IP "\fBsslverify\fR" 4 .IX Item "sslverify" Whether to verify the remote server's certificate when connecting over \s-1SSL.\s0 It can have the value 'on' or 'off'. It defaults to 'on'. .IP "\fBcookie\fR" 4 .IX Item "cookie" Send this cookie (it can also be a list of cookies separated by ';') with each outgoing request. Only supported when using protocols such as \s-1HTTP\s0 which support cookies, otherwise ignored. .IP "\fBtimeout\fR" 4 .IX Item "timeout" Set the timeout in seconds of the \s-1CURL\s0 connection. This timeout is the time that \s-1CURL\s0 waits for a response from the remote server to get the size of the image to be downloaded. If not set, the default timeout of 5 seconds is used. .RE .RS 4 .Sp Note that when passing options to qemu explicitly, \fBdriver\fR is the value of . .Sp Example: boot from a remote Fedora 20 live \s-1ISO\s0 image .Sp .Vb 1 \& qemu\-system\-x86_64 \-\-drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora\-Live\-Desktop\-x86_64\-20\-1.iso,readonly \& \& qemu\-system\-x86_64 \-\-drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora\-Live\-Desktop\-x86_64\-20\-1.iso,readonly .Ve .Sp Example: boot from a remote Fedora 20 cloud image using a local overlay for writes, copy-on-read, and a readahead of 64k .Sp .Vb 1 \& qemu\-img create \-f qcow2 \-o backing_file=\*(Aqjson:{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora\-x86_64\-20\-20131211.1\-sda.qcow2",, "file.readahead":"64k"}\*(Aq /tmp/Fedora\-x86_64\-20\-20131211.1\-sda.qcow2 \& \& qemu\-system\-x86_64 \-drive file=/tmp/Fedora\-x86_64\-20\-20131211.1\-sda.qcow2,copy\-on\-read=on .Ve .Sp Example: boot from an image stored on a VMware vSphere server with a self-signed certificate using a local overlay for writes, a readahead of 64k and a timeout of 10 seconds. .Sp .Vb 1 \& qemu\-img create \-f qcow2 \-o backing_file=\*(Aqjson:{"file.driver":"https",, "file.url":"https://user:password@vsphere.example.com/folder/test/test\-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10}\*(Aq /tmp/test.qcow2 \& \& qemu\-system\-x86_64 \-drive file=/tmp/test.qcow2 .Ve .RE .SH "SEE ALSO" .IX Header "SEE ALSO" The \s-1HTML\s0 documentation of \s-1QEMU\s0 for more precise information and Linux user mode emulator invocation. .SH "AUTHOR" .IX Header "AUTHOR" Fabrice Bellard