SMP is supported with up to 255 CPUs.
Note that adlib, gus and cs4231a are only available when QEMU was configured with --audio-card-list option containing the name(s) of required card(s).
QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL VGA BIOS.
QEMU uses YM3812 emulation by Tatsuyuki Satoh.
QEMU uses GUS emulation(GUSEMU32 <http://www.deinmeister.de/gusemu/>) by Tibor ``TS'' SchA~Xtz.
Not that, by default, GUS shares IRQ(7) with parallel ports and so qemu must be told to not have parallel ports to have working GUS
qemu dos.img -soundhw gus -parallel none
Alternatively:
qemu dos.img -device gus,irq=5
Or some other unclaimed IRQ.
CS4231A is the chip used in Windows Sound System and GUSMAX products
Standard options:
By default, writethrough caching is used for all block device. 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 when the data has been reported as written by the storage subsystem.
Writeback caching will report data writes as completed as soon as the data is present in the host page cache. This is safe as long as you trust your host. If your host crashes or loses power, then the guest may experience data corruption. When using the -snapshot option, writeback caching is used by default.
The host page cache can be avoided entirely with cache=none. This will attempt to do disk IO directly to the guests memory. QEMU may still perform an internal copy of the data.
Some block drivers perform badly with cache=writethrough, most notably, qcow2. If performance is more important than correctness, cache=writeback should be used with qcow2.
Instead of -cdrom you can use:
qemu -drive file=file,index=2,media=cdrom
Instead of -hda, -hdb, -hdc, -hdd, you can use:
qemu -drive file=file,index=0,media=disk qemu -drive file=file,index=1,media=disk qemu -drive file=file,index=2,media=disk qemu -drive file=file,index=3,media=disk
You can connect a CDROM to the slave of ide0:
qemu -drive file=file,if=ide,index=1,media=cdrom
If you don't specify the ``file='' argument, you define an empty drive:
qemu -drive if=ide,index=1,media=cdrom
You can connect a SCSI disk with unit ID 6 on the bus #0:
qemu -drive file=file,if=scsi,bus=0,unit=6
Instead of -fda, -fdb, you can use:
qemu -drive file=file,index=0,if=floppy qemu -drive file=file,index=1,if=floppy
By default, interface is ``ide'' and index is automatically incremented:
qemu -drive file=a -drive file=b"
is interpreted like:
qemu -hda a -hdb b
Interactive boot menus/prompts can be enabled via menu=on as far as firmware/BIOS supports them. The default is non-interactive boot.
# try to boot from network first, then from hard disk qemu -boot order=nc # boot from CD-ROM first, switch back to default order after reboot qemu -boot once=d
Note: The legacy format '-boot drives' is still supported but its use is discouraged as it may be removed from future versions.
The available layouts are:
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
The default is "en-us".
qemu -soundhw sb16,adlib disk.img qemu -soundhw es1370 disk.img qemu -soundhw ac97 disk.img qemu -soundhw all disk.img qemu -soundhw ?
Note that Linux's i810_audio OSS kernel (for AC97) module might require manually specifying clocking.
modprobe i810_audio clocking=48000
USB options:
Display options:
Following the display value there may be one or more option flags separated by commas. Valid options are
i386 target only:
Network options:
Example (using pxelinux):
qemu -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
In the guest Windows OS, the line:
10.0.2.4 smbserver
must be added in the file C:\WINDOWS\LMHOSTS (for windows 9x/Me) or C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS (Windows NT/2000).
Then dir can be accessed in \smbserver\qemu.
Note that a SAMBA server must be installed on the host OS in /usr/sbin/smbd. QEMU was tested successfully with smbd versions from Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
For example, to redirect host X11 connection from screen 1 to guest screen 0, use the following:
# on the host qemu -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...] # this host xterm should open in the guest X11 server xterm -display :1
To redirect telnet connections from host port 5555 to telnet port on the guest, use the following:
# on the host qemu -net user,hostfwd=tcp::5555-:23 [...] telnet localhost 5555
Then when you use on the host "telnet localhost 5555", you connect to the guest telnet server.
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.
qemu linux.img -net nic -net tap
More complicated example (two NICs, each one connected to a TAP device)
qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
Example:
# launch a first QEMU instance qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,listen=:1234 # connect the VLAN 0 of this instance to the VLAN 0 # of the first instance qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ -net socket,connect=127.0.0.1:1234
Example:
# launch one QEMU instance qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,mcast=230.0.0.1:1234 # launch another QEMU instance on same "bus" qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ -net socket,mcast=230.0.0.1:1234 # launch yet another QEMU instance on same "bus" qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \ -net socket,mcast=230.0.0.1:1234
Example (User Mode Linux compat.):
# launch QEMU instance (note mcast address selected # is UML's default) qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,mcast=239.192.168.1:1102 # launch UML /path/to/linux ubd0=/path/to/root_fs eth0=mcast
Example:
# launch vde switch vde_switch -F -sock /tmp/myswitch # launch QEMU instance qemu linux.img -net nic -net vde,sock=/tmp/myswitch
Character device options:
The general form of a character device option is:
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.
Options to each backend are described below.
server specifies that the socket shall be a listening socket.
nowait specifies that QEMU should not block waiting for a client to connect to a listening socket.
telnet specifies that traffic on the socket should interpret telnet escape sequences.
TCP and unix socket options are given below:
port 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. port can be given as either a port number or a service name. port is required.
to is only relevant to listening sockets. If it is specified, and port cannot be bound, QEMU will attempt to bind to subsequent ports up to and including to until it succeeds. to must be specified as a port number.
ipv4 and ipv6 specify that either IPv4 or IPv6 must be used. If neither is specified the socket may use either protocol.
nodelay disables the Nagle algorithm.
host specifies the remote host to connect to. If not specified it defaults to "localhost".
port specifies the port on the remote host to connect to. port is required.
localaddr specifies the local address to bind to. If not specified it defaults to 0.0.0.0.
localport specifies the local port to bind to. If not specified any available local port will be used.
ipv4 and ipv6 specify that either IPv4 or IPv6 must be used. If neither is specified the device may use either protocol.
width and height specify the width and height respectively of the console, in pixels.
cols and rows specify that the console be sized to fit a text console with the given dimensions.
path 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. path is required.
On Windows, a single duplex pipe will be created at \.pipe\path.
On other hosts, 2 pipes will be created called path.in and path.out. Data written to path.in will be received by the guest. Data written by the guest can be read from path.out. QEMU will not create these fifos, and requires them to be present.
path forms part of the pipe path as described above. path is required.
console is only available on Windows hosts.
serial is only available on Windows hosts.
path specifies the name of the serial device to open.
pty is not available on Windows hosts.
signal controls if signals are enabled on the terminal, that includes exiting QEMU with the key sequence Control-c. This option is enabled by default, use signal=off to disable it.
stdio is not available on Windows hosts.
tty is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and DragonFlyBSD hosts.
path specifies the path to the tty. path is required.
Connect to a local parallel port.
path specifies the path to the parallel port device. path is required.
Bluetooth(R) options:
The following three types are recognized:
qemu [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
Linux/Multiboot boot specific:
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.
Use file1 and file2 as modules and pass arg=foo as parameter to the first module.
Debug/Expert options:
This option can be used several times to simulate up to 4 serial ports.
Use "-serial none" to disable all serial ports.
Available character devices are:
vc:800x600
It is also possible to specify width or height in characters:
vc:80Cx24C
If you just want a simple readonly console you can use "netcat" or "nc", by starting qemu with: "-serial udp::4555" and nc as: "nc -u -l -p 4555". Any time qemu writes something to that port it will appear in the netconsole session.
If you plan to send characters back via netconsole or you want to stop and start qemu a lot of times, you should have qemu use the same source port each time by using something like "-serial udp::4555@4556" to qemu. Another approach is to use a patched version of netcat which can listen to a TCP 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 qemu port.
This option can be used several times to simulate up to 3 parallel ports.
Use "-parallel none" to disable all parallel ports.
(gdb) target remote | exec qemu -gdb stdio ...
By default the RTC is driven by the host system time. This allows to use the RTC as accurate reference clock inside the guest, specifically if the host time is smoothly following an accurate external reference clock, e.g. via NTP. If you want to isolate the guest time from the host, even prevent it from progressing during suspension, you can set clock to "vm" instead.
Enable driftfix (i386 targets only) if you experience time drift problems, specifically with Windows' ACPI HAL. This option will try to figure out how many timer interrupts were not processed by the Windows guest and will re-inject them.
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.
The model is the model of hardware watchdog to emulate. Choices for model are: "ib700" (iBASE 700) which is a very simple ISA watchdog with a single timer, or "i6300esb" (Intel 6300ESB I/O controller hub) which is a much more featureful PCI-based dual-timer watchdog. Choose a model for which your guest has drivers.
Use "-watchdog ?" to list available hardware models. Only one watchdog can be enabled for a guest.
Note that the "shutdown" action requires that the guest responds to ACPI signals, which it may not be able to do in the sort of situations where the watchdog would have expired, and thus "-watchdog-action shutdown" is not recommended for production use.
Examples:
During the graphical emulation, you can use the following keys:
In the virtual consoles, you can use Ctrl-Up, Ctrl-Down, Ctrl-PageUp and Ctrl-PageDown to move in the back log.
During emulation, if you are using the -nographic option, use Ctrl-a h to get terminal commands:
The following options are specific to the PowerPC emulation:
qemu-system-ppc -prom-env 'auto-boot?=false' \ -prom-env 'boot-device=hd:2,\yaboot' \ -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
These variables are not used by Open Hack'Ware.
The following options are specific to the Sparc32 emulation:
qemu-system-sparc -prom-env 'auto-boot?=false' \ -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
The following options are specific to the Sparc64 emulation:
qemu-system-sparc64 -prom-env 'auto-boot?=false'