1QEMU(1)                                                                QEMU(1)
2
3
4

NAME

6       qemu-doc - QEMU Emulator User Documentation
7

SYNOPSIS

9       usage: qemu [options] [disk_image]
10

DESCRIPTION

12       The QEMU PC System emulator simulates the following peripherals:
13
14       -   i440FX host PCI bridge and PIIX3 PCI to ISA bridge
15
16       -   Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
17           extensions (hardware level, including all non standard modes).
18
19       -   PS/2 mouse and keyboard
20
21       -   2 PCI IDE interfaces with hard disk and CD-ROM support
22
23       -   Floppy disk
24
25       -   NE2000 PCI network adapters
26
27       -   Serial ports
28
29       -   Creative SoundBlaster 16 sound card
30
31       -   ENSONIQ AudioPCI ES1370 sound card
32
33       -   Adlib(OPL2) - Yamaha YM3812 compatible chip
34
35       -   PCI UHCI USB controller and a virtual USB hub.
36
37       SMP is supported with up to 255 CPUs.
38
39       Note that adlib is only available when QEMU was configured with
40       -enable-adlib
41
42       QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
43       VGA BIOS.
44
45       QEMU uses YM3812 emulation by Tatsuyuki Satoh.
46

OPTIONS

48       disk_image is a raw hard disk image for IDE hard disk 0.
49
50       General options:
51
52       -M machine
53           Select the emulated machine ("-M ?" for list)
54
55       -fda file
56       -fdb file
57           Use file as floppy disk 0/1 image. You can use the host floppy by
58           using /dev/fd0 as filename.
59
60       -hda file
61       -hdb file
62       -hdc file
63       -hdd file
64           Use file as hard disk 0, 1, 2 or 3 image.
65
66       -cdrom file
67           Use file as CD-ROM image (you cannot use -hdc and and -cdrom at the
68           same time). You can use the host CD-ROM by using /dev/cdrom as
69           filename.
70
71       -boot [a⎪c⎪d⎪n]
72           Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n).
73           Hard disk boot is the default.
74
75       -snapshot
76           Write to temporary files instead of disk image files. In this case,
77           the raw disk image you use is not written back. You can however
78           force the write back by pressing C-a s.
79
80       -no-fd-bootchk
81           Disable boot signature checking for floppy disks in Bochs BIOS. It
82           may be needed to boot from old floppy disks.
83
84       -m megs
85           Set virtual RAM size to megs megabytes. Default is 128 MB.
86
87       -smp n
88           Simulate an SMP system with n CPUs. On the PC target, up to 255
89           CPUs are supported.
90
91       -nographic
92           Normally, QEMU uses SDL to display the VGA output. With this
93           option, you can totally disable graphical output so that QEMU is a
94           simple command line application. The emulated serial port is redi‐
95           rected on the console. Therefore, you can still use QEMU to debug a
96           Linux kernel with a serial console.
97
98       -vnc display
99           Normally, QEMU uses SDL to display the VGA output.  With this
100           option, you can have QEMU listen on VNC display display and redi‐
101           rect the VGA display over the VNC session.  It is very useful to
102           enable the usb tablet device when using this option (option -usbde‐
103           vice tablet). When using the VNC display, you must use the -k
104           option to set the keyboard layout if you are not using en-us.
105
106           display may be in the form interface:d, in which case connections
107           will only be allowed from interface on display d. Optionally,
108           interface can be omitted.  display can also be in the form
109           unix:path where path is the location of a unix socket to listen for
110           connections on.
111
112       -k language
113           Use keyboard layout language (for example "fr" for French). This
114           option is only needed where it is not easy to get raw PC keycodes
115           (e.g. on Macs, with some X11 servers or with a VNC display). You
116           don't normally need to use it on PC/Linux or PC/Windows hosts.
117
118           The available layouts are:
119
120                   ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
121                   da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
122                   de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
123
124           The default is "en-us".
125
126       -audio-help
127           Will show the audio subsystem help: list of drivers, tunable param‐
128           eters.
129
130       -soundhw card1,card2,... or -soundhw all
131           Enable audio and selected sound hardware. Use ? to print all avail‐
132           able sound hardware.
133
134                   qemu -soundhw sb16,adlib hda
135                   qemu -soundhw es1370 hda
136                   qemu -soundhw all hda
137                   qemu -soundhw ?
138
139       -localtime
140           Set the real time clock to local time (the default is to UTC time).
141           This option is needed to have correct date in MS-DOS or Windows.
142
143       -full-screen
144           Start in full screen.
145
146       -pidfile file
147           Store the QEMU process PID in file. It is useful if you launch QEMU
148           from a script.
149
150       -daemonize
151           Daemonize the QEMU process after initialization.  QEMU will not
152           detach from standard IO until it is ready to receive connections on
153           any of its devices.  This option is a useful way for external pro‐
154           grams to launch QEMU without having to cope with initialization
155           race conditions.
156
157       -win2k-hack
158           Use it when installing Windows 2000 to avoid a disk full bug. After
159           Windows 2000 is installed, you no longer need this option (this
160           option slows down the IDE transfers).
161
162       -option-rom file
163           Load the contents of file as an option ROM.  This option is useful
164           to load things like EtherBoot.
165
166       USB options:
167
168       -usb
169           Enable the USB driver (will be the default soon)
170
171       -usbdevice devname
172           Add the USB device devname.
173
174       Network options:
175
176       -net nic[,vlan=n][,macaddr=addr][,model=type]
177           Create a new Network Interface Card and connect it to VLAN n (n = 0
178           is the default). The NIC is currently an NE2000 on the PC target.
179           Optionally, the MAC address can be changed. If no -net option is
180           specified, a single NIC is created.  Qemu can emulate several dif‐
181           ferent models of network card.  Valid values for type are
182           "ne2k_pci", "ne2k_isa", "rtl8139", "smc91c111" and "lance".  Not
183           all devices are supported on all targets.
184
185       -net user[,vlan=n][,hostname=name]
186           Use the user mode network stack which requires no administrator
187           priviledge to run.  hostname=name can be used to specify the client
188           hostname reported by the builtin DHCP server.
189
190       -net tap[,vlan=n][,fd=h][,ifname=name][,script=file]
191           Connect the host TAP network interface name to VLAN n and use the
192           network script file to configure it. The default network script is
193           /etc/qemu-ifup. Use script=no to disable script execution. If name
194           is not provided, the OS automatically provides one.  fd=h can be
195           used to specify the handle of an already opened host TAP interface.
196           Example:
197
198                   qemu linux.img -net nic -net tap
199
200           More complicated example (two NICs, each one connected to a TAP
201           device)
202
203                   qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
204                                  -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
205
206       -net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]
207           Connect the VLAN n to a remote VLAN in another QEMU virtual machine
208           using a TCP socket connection. If listen is specified, QEMU waits
209           for incoming connections on port (host is optional). connect is
210           used to connect to another QEMU instance using the listen option.
211           fd=h specifies an already opened TCP socket.
212
213           Example:
214
215                   # launch a first QEMU instance
216                   qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
217                                  -net socket,listen=:1234
218                   # connect the VLAN 0 of this instance to the VLAN 0
219                   # of the first instance
220                   qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
221                                  -net socket,connect=127.0.0.1:1234
222
223       -net socket[,vlan=n][,fd=h][,mcast=maddr:port]
224           Create a VLAN n shared with another QEMU virtual machines using a
225           UDP multicast socket, effectively making a bus for every QEMU with
226           same multicast address maddr and port.  NOTES:
227
228           1.  Several QEMU can be running on different hosts and share same
229               bus (assuming correct multicast setup for these hosts).
230
231           2.  mcast support is compatible with User Mode Linux (argument
232               ethN=mcast), see <http://user-mode-linux.sf.net>.
233
234           3.<Use fd=h to specify an already opened UDP multicast socket.>
235
236           Example:
237
238                   # launch one QEMU instance
239                   qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
240                                  -net socket,mcast=230.0.0.1:1234
241                   # launch another QEMU instance on same "bus"
242                   qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
243                                  -net socket,mcast=230.0.0.1:1234
244                   # launch yet another QEMU instance on same "bus"
245                   qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \
246                                  -net socket,mcast=230.0.0.1:1234
247
248           Example (User Mode Linux compat.):
249
250                   # launch QEMU instance (note mcast address selected
251                   # is UML's default)
252                   qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
253                                  -net socket,mcast=239.192.168.1:1102
254                   # launch UML
255                   /path/to/linux ubd0=/path/to/root_fs eth0=mcast
256
257       -net none
258           Indicate that no network devices should be configured. It is used
259           to override the default configuration (-net nic -net user) which is
260           activated if no -net options are provided.
261
262       -tftp prefix
263           When using the user mode network stack, activate a built-in TFTP
264           server. All filenames beginning with prefix can be downloaded from
265           the host to the guest using a TFTP client. The TFTP client on the
266           guest must be configured in binary mode (use the command "bin" of
267           the Unix TFTP client). The host IP address on the guest is as usual
268           10.0.2.2.
269
270       -smb dir
271           When using the user mode network stack, activate a built-in SMB
272           server so that Windows OSes can access to the host files in dir
273           transparently.
274
275           In the guest Windows OS, the line:
276
277                   10.0.2.4 smbserver
278
279           must be added in the file C:\WINDOWS\LMHOSTS (for windows 9x/Me) or
280           C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS (Windows NT/2000).
281
282           Then dir can be accessed in \\smbserver\qemu.
283
284           Note that a SAMBA server must be installed on the host OS in
285           /usr/sbin/smbd. QEMU was tested successfully with smbd version
286           2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core
287           3.
288
289       -redir [tcp⎪udp]:host-port:[guest-host]:guest-port
290           When using the user mode network stack, redirect incoming TCP or
291           UDP connections to the host port host-port to the guest guest-host
292           on guest port guest-port. If guest-host is not specified, its value
293           is 10.0.2.15 (default address given by the built-in DHCP server).
294
295           For example, to redirect host X11 connection from screen 1 to guest
296           screen 0, use the following:
297
298                   # on the host
299                   qemu -redir tcp:6001::6000 [...]
300                   # this host xterm should open in the guest X11 server
301                   xterm -display :1
302
303           To redirect telnet connections from host port 5555 to telnet port
304           on the guest, use the following:
305
306                   # on the host
307                   qemu -redir tcp:5555::23 [...]
308                   telnet localhost 5555
309
310           Then when you use on the host "telnet localhost 5555", you connect
311           to the guest telnet server.
312
313       Linux boot specific: When using these options, you can use a given
314       Linux kernel without installing it in the disk image. It can be useful
315       for easier testing of various kernels.
316
317       -kernel bzImage
318           Use bzImage as kernel image.
319
320       -append cmdline
321           Use cmdline as kernel command line
322
323       -initrd file
324           Use file as initial ram disk.
325
326       Debug/Expert options:
327
328       -serial dev
329           Redirect the virtual serial port to host character device dev. The
330           default device is "vc" in graphical mode and "stdio" in non graphi‐
331           cal mode.
332
333           This option can be used several times to simulate up to 4 serials
334           ports.
335
336           Use "-serial none" to disable all serial ports.
337
338           Available character devices are:
339
340           "vc"
341               Virtual console
342
343           "pty"
344               [Linux only] Pseudo TTY (a new PTY is automatically allocated)
345
346           "none"
347               No device is allocated.
348
349           "null"
350               void device
351
352           "/dev/XXX"
353               [Linux only] Use host tty, e.g. /dev/ttyS0. The host serial
354               port parameters are set according to the emulated ones.
355
356           "/dev/parportN"
357               [Linux only, parallel port only] Use host parallel port N. Cur‐
358               rently only SPP parallel port features can be used.
359
360           "file:filename"
361               Write output to filename. No character can be read.
362
363           "stdio"
364               [Unix only] standard input/output
365
366           "pipe:filename"
367               name pipe filename
368
369           "COMn"
370               [Windows only] Use host serial port n
371
372           "udp:[remote_host]:remote_port[@[src_ip]:src_port]"
373               This implements UDP Net Console.  When remote_host or src_ip
374               are not specified they default to 0.0.0.0.  When not using a
375               specifed src_port a random port is automatically chosen.
376
377               If you just want a simple readonly console you can use "netcat"
378               or "nc", by starting qemu with: "-serial udp::4555" and nc as:
379               "nc -u -l -p 4555". Any time qemu writes something to that port
380               it will appear in the netconsole session.
381
382               If you plan to send characters back via netconsole or you want
383               to stop and start qemu a lot of times, you should have qemu use
384               the same source port each time by using something like "-serial
385               udp::4555@4556" to qemu. Another approach is to use a patched
386               version of netcat which can listen to a TCP port and send and
387               receive characters via udp.  If you have a patched version of
388               netcat which activates telnet remote echo and single char
389               transfer, then you can use the following options to step up a
390               netcat redirector to allow telnet on port 5555 to access the
391               qemu port.
392
393               "Qemu Options:"
394                   -serial udp::4555@4556
395
396               "netcat options:"
397                   -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
398
399               "telnet options:"
400                   localhost 5555
401
402           "tcp:[host]:port[,server][,nowait][,nodelay]"
403               The TCP Net Console has two modes of operation.  It can send
404               the serial I/O to a location or wait for a connection from a
405               location.  By default the TCP Net Console is sent to host at
406               the port.  If you use the server option QEMU will wait for a
407               client socket application to connect to the port before contin‐
408               uing, unless the "nowait" option was specified.  The "nodelay"
409               option disables the Nagle buffering algoritm.  If host is omit‐
410               ted, 0.0.0.0 is assumed. Only one TCP connection at a time is
411               accepted. You can use "telnet" to connect to the corresponding
412               character device.
413
414               "Example to send tcp console to 192.168.0.2 port 4444"
415                   -serial tcp:192.168.0.2:4444
416
417               "Example to listen and wait on port 4444 for connection"
418                   -serial tcp::4444,server
419
420               "Example to not wait and listen on ip 192.168.0.100 port 4444"
421                   -serial tcp:192.168.0.100:4444,server,nowait
422
423           "telnet:host:port[,server][,nowait][,nodelay]"
424               The telnet protocol is used instead of raw tcp sockets.  The
425               options work the same as if you had specified "-serial tcp".
426               The difference is that the port acts like a telnet server or
427               client using telnet option negotiation.  This will also allow
428               you to send the MAGIC_SYSRQ sequence if you use a telnet that
429               supports sending the break sequence.  Typically in unix telnet
430               you do it with Control-] and then type "send break" followed by
431               pressing the enter key.
432
433           "unix:path[,server][,nowait]"
434               A unix domain socket is used instead of a tcp socket.  The
435               option works the same as if you had specified "-serial tcp"
436               except the unix domain socket path is used for connections.
437
438       -parallel dev
439           Redirect the virtual parallel port to host device dev (same devices
440           as the serial port). On Linux hosts, /dev/parportN can be used to
441           use hardware devices connected on the corresponding host parallel
442           port.
443
444           This option can be used several times to simulate up to 3 parallel
445           ports.
446
447           Use "-parallel none" to disable all parallel ports.
448
449       -monitor dev
450           Redirect the monitor to host device dev (same devices as the serial
451           port).  The default device is "vc" in graphical mode and "stdio" in
452           non graphical mode.
453
454       -s  Wait gdb connection to port 1234.
455
456       -p port
457           Change gdb connection port.  port can be either a decimal number to
458           specify a TCP port, or a host device (same devices as the serial
459           port).
460
461       -S  Do not start CPU at startup (you must type 'c' in the monitor).
462
463       -d  Output log in /tmp/qemu.log
464
465       -hdachs c,h,s,[,t]
466           Force hard disk 0 physical geometry (1 <= c <= 16383, 1 <= h <= 16,
467           1 <= s <= 63) and optionally force the BIOS translation mode
468           (t=none, lba or auto). Usually QEMU can guess all thoses parame‐
469           ters. This option is useful for old MS-DOS disk images.
470
471       -L path
472           Set the directory for the BIOS, VGA BIOS and keymaps.
473
474       -std-vga
475           Simulate a standard VGA card with Bochs VBE extensions (default is
476           Cirrus Logic GD5446 PCI VGA). If your guest OS supports the VESA
477           2.0 VBE extensions (e.g. Windows XP) and if you want to use high
478           resolution modes (>= 1280x1024x16) then you should use this option.
479
480       -no-acpi
481           Disable ACPI (Advanced Configuration and Power Interface) support.
482           Use it if your guest OS complains about ACPI problems (PC target
483           machine only).
484
485       -no-reboot
486           Exit instead of rebooting.
487
488       -loadvm file
489           Start right away with a saved state ("loadvm" in monitor)
490
491       -semihosting
492           Enable "Angel" semihosting interface (ARM target machines only).
493           Note that this allows guest direct access to the host filesystem,
494           so should only be used with trusted guest OS.
495
496       During the graphical emulation, you can use the following keys:
497
498       Ctrl-Alt-f
499           Toggle full screen
500
501       Ctrl-Alt-n
502           Switch to virtual console 'n'. Standard console mappings are:
503
504           1   Target system display
505
506           2   Monitor
507
508           3   Serial port
509
510       Ctrl-Alt
511           Toggle mouse and keyboard grab.
512
513       In the virtual consoles, you can use Ctrl-Up, Ctrl-Down, Ctrl-PageUp
514       and Ctrl-PageDown to move in the back log.
515
516       During emulation, if you are using the -nographic option, use Ctrl-a h
517       to get terminal commands:
518
519       Ctrl-a h
520           Print this help
521
522       Ctrl-a x
523           Exit emulator
524
525       Ctrl-a s
526           Save disk data back to file (if -snapshot)
527
528       Ctrl-a b
529           Send break (magic sysrq in Linux)
530
531       Ctrl-a c
532           Switch between console and monitor
533
534       Ctrl-a Ctrl-a
535           Send Ctrl-a
536
537       The following options are specific to the PowerPC emulation:
538
539       -g WxH[xDEPTH]
540           Set the initial VGA graphic mode. The default is 800x600x15.
541
542       The following options are specific to the Sparc emulation:
543
544       -g WxH
545           Set the initial TCX graphic mode. The default is 1024x768.
546

SEE ALSO

548       The HTML documentation of QEMU for more precise information and Linux
549       user mode emulator invocation.
550

AUTHOR

552       Fabrice Bellard
553
554
555
556                                  2008-02-27                           QEMU(1)
Impressum