.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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" .TH QEMU 1 "2024-11-18" " " " " .\" 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 Emulator 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 USB\s0 controller and a virtual \s-1USB\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 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. 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, 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. .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\-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\fIcpu[\-cpu]\fR\fB][,nodeid=\fR\fInode\fR\fB]\fR" 4 .IX Item "-numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node]" .PD 0 .IP "\fB\-numa node[,memdev=\fR\fIid\fR\fB][,cpus=\fR\fIcpu[\-cpu]\fR\fB][,nodeid=\fR\fInode\fR\fB]\fR" 4 .IX Item "-numa node[,memdev=id][,cpus=cpu[-cpu]][,nodeid=node]" .PD Simulate a multi node \s-1NUMA\s0 system. If \fBmem\fR, \fBmemdev\fR and \fBcpus\fR are omitted, resources are split equally. Also, note that the \-\fBnuma\fR option doesn't allocate any of the specified resources. That is, 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, and possibly \fB\-object\fR to specify the memory backend for the \fBmemdev\fR suboption. .Sp \&\fBmem\fR and \fBmemdev\fR are mutually exclusive. Furthermore, if one node uses \fBmemdev\fR, all of them have to use it. .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\-drive.physical_block_size=4096 \-drive file=file,if=ide,index=0,media=disk .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. .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 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\-balloon none\fR" 4 .IX Item "-balloon none" Disable balloon device. .IP "\fB\-balloon virtio[,addr=\fR\fIaddr\fR\fB]\fR" 4 .IX Item "-balloon virtio[,addr=addr]" Enable virtio balloon device (default), optionally with \s-1PCI\s0 address \&\fIaddr\fR. .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]\fR" 4 .IX Item "-device ipmi-bmc-sim,id=id[,slave_addr=val]" 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. .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 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\-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. Valid options are: .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. .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 "\fBcyls=\fR\fIc\fR\fB,heads=\fR\fIh\fR\fB,secs=\fR\fIs\fR\fB[,trans=\fR\fIt\fR\fB]\fR" 4 .IX Item "cyls=c,heads=h,secs=s[,trans=t]" These options have the same definition as they have in \fB\-hdachs\fR. .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. .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 "\fBdiscard=\fR\fIdiscard\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 \fIdiscard\fR (also known as \fItrim\fR or \fIunmap\fR) requests are ignored or passed to the filesystem. Some machine types may not support discard requests. .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 "\fBserial=\fR\fIserial\fR" 4 .IX Item "serial=serial" This option specifies the serial number to assign to the device. .IP "\fBaddr=\fR\fIaddr\fR" 4 .IX Item "addr=addr" Specify the controller's \s-1PCI\s0 address (if=virtio only). .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 "\fBreadonly\fR" 4 .IX Item "readonly" Open drive \fBfile\fR as read-only. Guest write attempts will fail. .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 "\fBdetect\-zeroes=\fR\fIdetect-zeroes\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 \s-1UNMAP\s0 operation. .RE .RS 4 .Sp By default, the \fBcache=writeback\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=writethrough\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 The host page cache can be avoided entirely with \fBcache=none\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. Note that this is considered a writeback mode and the guest \s-1OS\s0 must handle the disk write cache correctly in order to avoid data corruption on host crashes. .Sp The host page cache can be avoided while only sending write notifications to the guest when the data has been flushed to the disk using \&\fBcache=directsync\fR. .Sp In case you don't care about data integrity over host failures, use \&\fBcache=unsafe\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. 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 You can connect a \s-1SCSI\s0 disk with unit \s-1ID 6\s0 on the bus #0: .Sp .Vb 1 \& qemu\-system\-i386 \-drive file=file,if=scsi,bus=0,unit=6 .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\-hdachs\fR \fIc\fR\fB,\fR\fIh\fR\fB,\fR\fIs\fR\fB,[,\fR\fIt\fR\fB]\fR" 4 .IX Item "-hdachs c,h,s,[,t]" Force hard disk 0 physical geometry (1 <= \fIc\fR <= 16383, 1 <= \&\fIh\fR <= 16, 1 <= \fIs\fR <= 63) and optionally force the \s-1BIOS\s0 translation mode (\fIt\fR=none, lba or auto). Usually \s-1QEMU\s0 can guess all those parameters. This option is useful for old MS-DOS disk images. .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]\fR" 4 .IX Item "-fsdev fsdriver,id=id,path=path,[security_model=security_model][,writeout=writeout][,readonly][,socket=socket|sock_fd=sock_fd]" 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 .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]\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]" 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 .RE .RS 4 .RE .IP "\fB\-virtfs_synth\fR" 4 .IX Item "-virtfs_synth" Create synthetic file system image .PP \&\s-1USB\s0 options: .IP "\fB\-usb\fR" 4 .IX Item "-usb" Enable the \s-1USB\s0 driver (will be the default soon) .IP "\fB\-usbdevice\fR \fIdevname\fR" 4 .IX Item "-usbdevice devname" Add the \s-1USB\s0 device \fIdevname\fR. .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 "\fBdisk:[format=\fR\fIformat\fR\fB]:\fR\fIfile\fR" 4 .IX Item "disk:[format=format]:file" Mass storage device based on file. The optional \fIformat\fR argument will be used rather than detecting the format. Can be used to specify \&\f(CW\*(C`format=raw\*(C'\fR to avoid interpreting an untrusted format header. .IP "\fBhost:\fR\fIbus\fR\fB.\fR\fIaddr\fR" 4 .IX Item "host:bus.addr" Pass through the host device identified by \fIbus\fR.\fIaddr\fR (Linux only). .IP "\fBhost:\fR\fIvendor_id\fR\fB:\fR\fIproduct_id\fR" 4 .IX Item "host:vendor_id:product_id" Pass through the host device identified by \fIvendor_id\fR:\fIproduct_id\fR (Linux only). .IP "\fBserial:[vendorid=\fR\fIvendor_id\fR\fB][,productid=\fR\fIproduct_id\fR\fB]:\fR\fIdev\fR" 4 .IX Item "serial:[vendorid=vendor_id][,productid=product_id]:dev" Serial converter to host character device \fIdev\fR, see \f(CW\*(C`\-serial\*(C'\fR for the available devices. .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 "\fBnet:\fR\fIoptions\fR" 4 .IX Item "net:options" Network adapter that supports \s-1CDC\s0 ethernet and \s-1RNDIS\s0 protocols. .RE .RS 4 .RE .PP 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 .RE .RS 4 .RE .IP "\fB\-nographic\fR" 4 .IX Item "-nographic" Normally, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. 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, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. 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 filter. .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. .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 one is the default) .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. .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, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. 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\-usbdevice 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. By definition the Websocket port is 5700+\fIdisplay\fR. If \fIhost\fR is specified connections will only be allowed from this host. As an alternative the Websocket port could be specified by using \&\f(CW\*(C`websocket\*(C'\fR=\fIport\fR. 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. .Sp The \fBtls-creds\fR parameter obsoletes the \fBtls\fR, \&\fBx509\fR, and \fBx509verify\fR options, and as such it is not permitted to set both new and old type options at the same time. .IP "\fBtls\fR" 4 .IX Item "tls" Require that client use \s-1TLS\s0 when communicating with the \s-1VNC\s0 server. This uses anonymous \s-1TLS\s0 credentials so is susceptible to a man-in-the-middle attack. It is recommended that this option be combined with either the \&\fBx509\fR or \fBx509verify\fR options. .Sp This option is now deprecated in favor of using the \fBtls-creds\fR argument. .IP "\fBx509=\fR\fI/path/to/certificate/dir\fR" 4 .IX Item "x509=/path/to/certificate/dir" Valid if \fBtls\fR is specified. Require that x509 credentials are used for negotiating the \s-1TLS\s0 session. The server will send its x509 certificate to the client. It is recommended that a password be set on the \s-1VNC\s0 server to provide authentication of the client when this is used. The path following this option specifies where the x509 certificates are to be loaded from. See the \fBvnc_security\fR section for details on generating certificates. .Sp This option is now deprecated in favour of using the \fBtls-creds\fR argument. .IP "\fBx509verify=\fR\fI/path/to/certificate/dir\fR" 4 .IX Item "x509verify=/path/to/certificate/dir" Valid if \fBtls\fR is specified. Require that x509 credentials are used for negotiating the \s-1TLS\s0 session. The server will send its x509 certificate to the client, and request that the client send its own x509 certificate. The server will validate the client's certificate against the \s-1CA\s0 certificate, and reject clients when validation fails. If the certificate authority is trusted, this is a sufficient authentication mechanism. You may still wish to set a password on the \s-1VNC\s0 server as a second authentication layer. The path following this option specifies where the x509 certificates are to be loaded from. See the \fBvnc_security\fR section for details on generating certificates. .Sp This option is now deprecated in favour of using the \fBtls-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 1. 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 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 Network options: .IP "\fB\-net nic[,vlan=\fR\fIn\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[,vlan=n][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]" Create a new Network Interface Card and connect it to \s-1VLAN\s0 \fIn\fR (\fIn\fR = 0 is the default). 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. Valid values for \fItype\fR are \&\f(CW\*(C`virtio\*(C'\fR, \f(CW\*(C`i82551\*(C'\fR, \f(CW\*(C`i82557b\*(C'\fR, \f(CW\*(C`i82559er\*(C'\fR, \&\f(CW\*(C`ne2k_pci\*(C'\fR, \f(CW\*(C`ne2k_isa\*(C'\fR, \f(CW\*(C`pcnet\*(C'\fR, \f(CW\*(C`rtl8139\*(C'\fR, \&\f(CW\*(C`e1000\*(C'\fR, \f(CW\*(C`smc91c111\*(C'\fR, \f(CW\*(C`lance\*(C'\fR and \f(CW\*(C`mcf_fec\*(C'\fR. Not all devices are supported on all targets. Use \f(CW\*(C`\-net nic,model=help\*(C'\fR for a list of available devices for your target. .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][,...]" .PD 0 .IP "\fB\-net user[,\fR\fIoption\fR\fB][,\fR\fIoption\fR\fB][,...]\fR" 4 .IX Item "-net user[,option][,option][,...]" .PD Use the user mode network stack which requires no administrator privilege to run. Valid options are: .RS 4 .IP "\fBvlan=\fR\fIn\fR" 4 .IX Item "vlan=n" Connect user mode stack to \s-1VLAN\s0 \fIn\fR (\fIn\fR = 0 is the default). .IP "\fBid=\fR\fIid\fR" 4 .IX Item "id=id" .PD 0 .IP "\fBname=\fR\fIname\fR" 4 .IX Item "name=name" .PD Assign symbolic name for use in monitor commands. .Sp \&\fBipv4\fR and \fBipv6\fR 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 \-net user,dnssearch=mgmt.example.org,dnssearch=example.org [...] .Ve .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 "\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 1 \& qemu\-system\-i386 \-hda linux.img \-boot n \-net user,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\esmbserver\eqemu\fR. .Sp Note that a \s-1SAMBA\s0 server must be installed on the host \s-1OS. QEMU\s0 was tested successfully with smbd versions from Red Hat 9, Fedora Core 3 and OpenSUSE 11.x. .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 \-net 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 \-net 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 \-net 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 \-net \*(Aquser,guestfwd=tcp:10.0.2.100:1234\-cmd:netcat 10.10.1.1 4321\*(Aq .Ve .RE .RS 4 .Sp Note: Legacy stand-alone options \-tftp, \-bootp, \-smb and \-redir are still processed and applied to \-net user. Mixing them with the new configuration syntax gives undefined results. Their use for new applications is discouraged as they will be removed from future versions. .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][,helper=\fR\fIhelper\fR\fB]\fR" 4 .IX Item "-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,helper=helper]" .PD 0 .IP "\fB\-net tap[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,fd=\fR\fIh\fR\fB][,ifname=\fR\fIname\fR\fB][,script=\fR\fIfile\fR\fB][,downscript=\fR\fIdfile\fR\fB][,helper=\fR\fIhelper\fR\fB]\fR" 4 .IX Item "-net tap[,vlan=n][,name=name][,fd=h][,ifname=name][,script=file][,downscript=dfile][,helper=helper]" .PD Connect the host \s-1TAP\s0 network interface \fIname\fR to \s-1VLAN\s0 \fIn\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. The default network helper executable is \fI/path/to/qemu\-bridge\-helper\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 \-net nic \-net tap \& \& \& \& #launch a QEMU instance with two NICs, each one connected \& #to a TAP device \& qemu\-system\-i386 linux.img \e \& \-net nic,vlan=0 \-net tap,vlan=0,ifname=tap0 \e \& \-net nic,vlan=1 \-net tap,vlan=1,ifname=tap1 \& \& \& \& #launch a QEMU instance with the default network helper to \& #connect a TAP device to bridge br0 \& qemu\-system\-i386 linux.img \e \& \-net nic \-net tap,"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]" .PD 0 .IP "\fB\-net bridge[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,br=\fR\fIbridge\fR\fB][,helper=\fR\fIhelper\fR\fB]\fR" 4 .IX Item "-net bridge[,vlan=n][,name=name][,br=bridge][,helper=helper]" .PD 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 \-net bridge \-net nic,model=virtio \& \& \& \& #launch a QEMU instance with the default network helper to \& #connect a TAP device to bridge qemubr0 \& qemu\-system\-i386 linux.img \-net bridge,br=qemubr0 \-net nic,model=virtio .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]" .PD 0 .IP "\fB\-net socket[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\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 "-net socket[,vlan=n][,name=name][,fd=h] [,listen=[host]:port][,connect=host:port]" .PD Connect the \s-1VLAN\s0 \fIn\fR to a remote \s-1VLAN\s0 in 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 9 \& # launch a first QEMU instance \& qemu\-system\-i386 linux.img \e \& \-net nic,macaddr=52:54:00:12:34:56 \e \& \-net socket,listen=:1234 \& # connect the VLAN 0 of this instance to the VLAN 0 \& # of the first instance \& qemu\-system\-i386 linux.img \e \& \-net nic,macaddr=52:54:00:12:34:57 \e \& \-net socket,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]]" .PD 0 .IP "\fB\-net socket[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\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 "-net socket[,vlan=n][,name=name][,fd=h][,mcast=maddr:port[,localaddr=addr]]" .PD Create a \s-1VLAN\s0 \fIn\fR shared 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 \& \-net nic,macaddr=52:54:00:12:34:56 \e \& \-net socket,mcast=230.0.0.1:1234 \& # launch another QEMU instance on same "bus" \& qemu\-system\-i386 linux.img \e \& \-net nic,macaddr=52:54:00:12:34:57 \e \& \-net socket,mcast=230.0.0.1:1234 \& # launch yet another QEMU instance on same "bus" \& qemu\-system\-i386 linux.img \e \& \-net nic,macaddr=52:54:00:12:34:58 \e \& \-net socket,mcast=230.0.0.1:1234 .Ve .Sp Example (User Mode Linux compat.): .Sp .Vb 7 \& # launch QEMU instance (note mcast address selected \& # is UML\*(Aqs default) \& qemu\-system\-i386 linux.img \e \& \-net nic,macaddr=52:54:00:12:34:56 \e \& \-net socket,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 \& \-net nic,macaddr=52:54:00:12:34:56 \e \& \-net socket,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]" .PD 0 .IP "\fB\-net l2tpv3[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\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 "-net l2tpv3[,vlan=n][,name=name],src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]" .PD Connect \s-1VLAN\s0 \fIn\fR to L2TPv3 pseudowire. 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. .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 .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 \-net nic \-net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter .Ve .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]" .PD 0 .IP "\fB\-net vde[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\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 "-net vde[,vlan=n][,name=name][,sock=socketpath] [,port=n][,group=groupname][,mode=octalmode]" .PD Connect \s-1VLAN\s0 \fIn\fR 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 \-net nic \-net vde,sock=/tmp/myswitch .Ve .IP "\fB\-netdev hubport,id=\fR\fIid\fR\fB,hubid=\fR\fIhubid\fR" 4 .IX Item "-netdev hubport,id=id,hubid=hubid" Create a hub port on \s-1QEMU\s0 \*(L"vlan\*(R" \fIhubid\fR. .Sp The hubport netdev lets you connect a \s-1NIC\s0 to a \s-1QEMU\s0 \*(L"vlan\*(R" instead of a single netdev. \f(CW\*(C`\-net\*(C'\fR and \f(CW\*(C`\-device\*(C'\fR with parameter \fBvlan\fR create the required hub automatically. .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,path=/path/to/socket \e \& \-netdev type=vhost\-user,id=net0,chardev=chr0 \e \& \-device virtio\-net\-pci,netdev=net0 .Ve .IP "\fB\-net dump[,vlan=\fR\fIn\fR\fB][,file=\fR\fIfile\fR\fB][,len=\fR\fIlen\fR\fB]\fR" 4 .IX Item "-net dump[,vlan=n][,file=file][,len=len]" Dump network traffic on \s-1VLAN\s0 \fIn\fR to file \fIfile\fR (\fIqemu\-vlan0.pcap\fR by default). 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. Note: For devices created with '\-netdev', use '\-object filter\-dump,...' instead. .IP "\fB\-net none\fR" 4 .IX Item "-net none" Indicate that no network devices should be configured. It is used to override the default configuration (\fB\-net nic \-net user\fR) which is activated if no \fB\-net\fR options are provided. .PP 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 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,default \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,default \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. .Sp Further options to each backend are described below. .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] [,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] [,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 \&\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.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. .Sp \&\fBstdio\fR is not available on Windows hosts. .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 Device \s-1URL\s0 Syntax: .PP In addition to using normal file images for the emulated storage devices, \&\s-1QEMU\s0 can also use networked resources such as iSCSI devices. These are specified using a special \s-1URL\s0 syntax. .IP "\fBiSCSI\fR" 4 .IX Item "iSCSI" iSCSI support allows \s-1QEMU\s0 to access iSCSI resources directly and use as images for the guest storage. Both disk and cdrom images are supported. .Sp Syntax for specifying iSCSI LUNs is \&\*(L"iscsi://[:]//\*(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 .Sp iSCSI support is an optional feature of \s-1QEMU\s0 and only available when compiled and linked against libiscsi. .Sp iSCSI parameters such as username and password can also be specified via a configuration file. See qemu-doc for more information and examples. .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 <\fBhttp://http://www.osrg.net/sheepdog/\fR>. .IP "\fBGlusterFS\fR" 4 .IX Item "GlusterFS" GlusterFS is an 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 1 \& gluster[+transport]://[server[:port]]/volname/image[?socket=...] .Ve .Sp Example .Sp .Vb 1 \& qemu\-system\-x86_64 \-\-drive file=gluster://192.0.2.1/testvol/a.img .Ve .Sp See also <\fBhttp://www.gluster.org\fR>. .IP "\fB\s-1HTTP/HTTPS/FTP/FTPS/TFTP\s0\fR" 4 .IX Item "HTTP/HTTPS/FTP/FTPS/TFTP" \&\s-1QEMU\s0 supports read-only access to files accessed over http(s), ftp(s) and tftp. .Sp Syntax using a single filename: .Sp .Vb 1 \& ://[[:]@]/ .Ve .Sp where: .RS 4 .IP "\fBprotocol\fR" 4 .IX Item "protocol" \&'http', 'https', 'ftp', 'ftps', or 'tftp'. .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 .PP 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 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 \&\s-1TPM\s0 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]" Backend type must be: \&\fBpassthrough\fR. .Sp 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 Options to each backend are described below. .Sp Use 'help' to print all available \s-1TPM\s0 backend types. .Sp .Vb 1 \& qemu \-tpmdev help .Ve .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. .PP 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 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 step 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 "\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][,default]\fR" 4 .IX Item "-mon [chardev=]name[,mode=readline|control][,default]" Setup monitor on chardev \fIname\fR. .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\-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\-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\-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). .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\fIdate\fR\fB][,clock=host|vm][,driftfix=none|slew]\fR" 4 .IX Item "-rtc [base=utc|localtime|date][,clock=host|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 \fIdate\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. To even prevent it from progressing during suspension, you can set it to \f(CW\*(C`vm\*(C'\fR. .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]\fR" 4 .IX Item "-icount [shift=N|auto][,rr=record|replay,rrfile=filename]" 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. .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`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. .Sp This option is maintained for backward compatibility. .Sp Please use \f(CW\*(C`\-device virtconsole\*(C'\fR for the new way of invocation. .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\-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" 4 .IX Item "-sandbox arg" Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will disable it. The default is 'off'. .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\-nodefconfig\fR" 4 .IX Item "-nodefconfig" Normally \s-1QEMU\s0 loads configuration files from \fIsysconfdir\fR and \fIdatadir\fR at startup. The \f(CW\*(C`\-nodefconfig\*(C'\fR option will prevent \s-1QEMU\s0 from loading any of those config files. .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, but won't make it skip the QEMU-provided config files from \fIdatadir\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. 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, \fIstderr\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, \fIstderr\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 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" 4 .IX Item "-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off" Creates a memory file backend object, which can be used to back the guest \s-1RAM\s0 with huge pages. 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. The \fBsize\fR option provides the size of the memory region, and accepts common suffixes, eg \fB500M\fR. The \fBmem-path\fR provides the path to either a shared memory or huge page filesystem mount. 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. .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\-x509,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\fB,passwordid=\fR\fIid\fR" 4 .IX Item "-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,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. .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]\fR" 4 .IX Item "-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid[,queue=all|rx|tx]" filter-mirror on netdev \fInetdevid\fR,mirror net packet to chardev \&\fIchardevid\fR .IP "\fB\-object filter\-redirector,id=\fR\fIid\fR\fB,netdev=\fR\fInetdevid\fR\fB,indev=\fR\fIchardevid\fR\fB,\fR" 4 .IX Item "-object filter-redirector,id=id,netdev=netdevid,indev=chardevid," outdev=\fIchardevid\fR[,queue=\fIall|rx|tx\fR] .Sp filter-redirector on netdev \fInetdevid\fR,redirect filter's net packet to chardev \&\fIchardevid\fR,and redirect indev's packet to filter. 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\-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 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 # echo \-n \*(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=$(echo \-n "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=$(