blob: 39f950471f2805481335cd0555da5454feca4c05 [file] [log] [blame]
bellard386405f2003-03-23 21:28:45 +00001\input texinfo @c -*- texinfo -*-
bellarddebc7062006-04-30 21:58:41 +00002@c %**start of header
3@setfilename qemu-doc.info
Paolo Bonzini44cb2802017-06-06 16:59:37 +02004@include version.texi
Stefan Weile080e782010-02-05 23:52:00 +01005
6@documentlanguage en
7@documentencoding UTF-8
8
Paolo Bonzini44cb2802017-06-06 16:59:37 +02009@settitle QEMU version @value{VERSION} User Documentation
bellarddebc7062006-04-30 21:58:41 +000010@exampleindent 0
11@paragraphindent 0
12@c %**end of header
bellard386405f2003-03-23 21:28:45 +000013
Thomas Huth664785a2019-07-30 17:08:26 +020014@set qemu_system qemu-system-x86_64
15@set qemu_system_x86 qemu-system-x86_64
16
Stefan Weila1a32b02010-02-05 23:51:59 +010017@ifinfo
18@direntry
19* QEMU: (qemu-doc). The QEMU Emulator User Documentation.
20@end direntry
21@end ifinfo
22
bellard0806e3f2003-10-01 00:15:32 +000023@iftex
bellard386405f2003-03-23 21:28:45 +000024@titlepage
25@sp 7
Paolo Bonzini44cb2802017-06-06 16:59:37 +020026@center @titlefont{QEMU version @value{VERSION}}
bellarddebc7062006-04-30 21:58:41 +000027@sp 1
28@center @titlefont{User Documentation}
bellard386405f2003-03-23 21:28:45 +000029@sp 3
30@end titlepage
bellard0806e3f2003-10-01 00:15:32 +000031@end iftex
bellard386405f2003-03-23 21:28:45 +000032
bellarddebc7062006-04-30 21:58:41 +000033@ifnottex
34@node Top
35@top
36
37@menu
38* Introduction::
bellarddebc7062006-04-30 21:58:41 +000039* QEMU PC System emulator::
40* QEMU System emulator for non PC targets::
bellard83195232007-02-05 19:42:07 +000041* QEMU User space emulator::
Borislav Petkov483c6ad2018-12-20 10:07:32 -020042* System requirements::
Stefan Hajnoczie8412572019-05-09 13:18:20 +010043* Security::
Paolo Bonzini78e87792016-10-06 16:12:11 +020044* Implementation notes::
Daniel P. Berrangeeb22aec2017-07-25 12:36:38 +010045* Deprecated features::
Gerd Hoffmann369e8f52019-10-23 12:19:56 +020046* Recently removed features::
Daniel P. Berrangé45b47132018-05-04 17:00:24 +010047* Supported build platforms::
Stefan Weil7544a042010-02-05 23:52:03 +010048* License::
bellarddebc7062006-04-30 21:58:41 +000049* Index::
50@end menu
51@end ifnottex
52
53@contents
54
55@node Introduction
bellard386405f2003-03-23 21:28:45 +000056@chapter Introduction
57
bellarddebc7062006-04-30 21:58:41 +000058@menu
59* intro_features:: Features
60@end menu
61
62@node intro_features
bellard322d0c62003-06-15 23:29:28 +000063@section Features
bellard386405f2003-03-23 21:28:45 +000064
bellard1f673132004-04-04 15:21:17 +000065QEMU is a FAST! processor emulator using dynamic translation to
66achieve good emulation speed.
bellard1eb20522003-06-25 16:21:49 +000067
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020068@cindex operating modes
bellard1eb20522003-06-25 16:21:49 +000069QEMU has two operating modes:
bellard0806e3f2003-10-01 00:15:32 +000070
Stefan Weild7e5edc2010-02-05 23:52:02 +010071@itemize
Stefan Weil7544a042010-02-05 23:52:03 +010072@cindex system emulation
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020073@item Full system emulation. In this mode, QEMU emulates a full system (for
bellard3f9f3aa2005-12-18 20:11:37 +000074example a PC), including one or several processors and various
75peripherals. It can be used to launch different Operating Systems
76without rebooting the PC or to debug system code.
bellard1eb20522003-06-25 16:21:49 +000077
Stefan Weil7544a042010-02-05 23:52:03 +010078@cindex user mode emulation
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020079@item User mode emulation. In this mode, QEMU can launch
bellard83195232007-02-05 19:42:07 +000080processes compiled for one CPU on another CPU. It can be used to
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +000081launch the Wine Windows API emulator (@url{https://www.winehq.org}) or
bellard1f673132004-04-04 15:21:17 +000082to ease cross-compilation and cross-debugging.
bellard1eb20522003-06-25 16:21:49 +000083
84@end itemize
85
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020086QEMU has the following features:
bellard322d0c62003-06-15 23:29:28 +000087
bellard52c00a52004-04-25 21:27:03 +000088@itemize
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020089@item QEMU can run without a host kernel driver and yet gives acceptable
90performance. It uses dynamic translation to native code for reasonable speed,
91with support for self-modifying code and precise exceptions.
92
93@item It is portable to several operating systems (GNU/Linux, *BSD, Mac OS X,
94Windows) and architectures.
95
96@item It performs accurate software emulation of the FPU.
bellard52c00a52004-04-25 21:27:03 +000097@end itemize
bellard386405f2003-03-23 21:28:45 +000098
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +020099QEMU user mode emulation has the following features:
100@itemize
101@item Generic Linux system call converter, including most ioctls.
102
103@item clone() emulation using native CPU clone() to use Linux scheduler for threads.
104
105@item Accurate signal handling by remapping host signals to target signals.
106@end itemize
107
108QEMU full system emulation has the following features:
109@itemize
110@item
111QEMU uses a full software MMU for maximum portability.
112
113@item
Michael Tokarev326c4c32017-09-26 09:03:31 +0300114QEMU can optionally use an in-kernel accelerator, like kvm. The accelerators
Paolo Bonzini1f3e7e42016-10-06 14:59:26 +0200115execute most of the guest code natively, while
116continuing to emulate the rest of the machine.
117
118@item
119Various hardware devices can be emulated and in some cases, host
120devices (e.g. serial and parallel ports, USB, drives) can be used
121transparently by the guest Operating System. Host device passthrough
122can be used for talking to external physical peripherals (e.g. a
123webcam, modem or tape drive).
124
125@item
126Symmetric multiprocessing (SMP) support. Currently, an in-kernel
127accelerator is required to use more than one host CPU for emulation.
128
129@end itemize
130
bellard0806e3f2003-10-01 00:15:32 +0000131
bellarddebc7062006-04-30 21:58:41 +0000132@node QEMU PC System emulator
bellard3f9f3aa2005-12-18 20:11:37 +0000133@chapter QEMU PC System emulator
Stefan Weil7544a042010-02-05 23:52:03 +0100134@cindex system emulation (PC)
bellard1eb20522003-06-25 16:21:49 +0000135
bellarddebc7062006-04-30 21:58:41 +0000136@menu
137* pcsys_introduction:: Introduction
138* pcsys_quickstart:: Quick Start
139* sec_invocation:: Invocation
Peter Maydella40db1b2016-02-16 17:28:58 +0000140* pcsys_keys:: Keys in the graphical frontends
141* mux_keys:: Keys in the character backend multiplexer
bellarddebc7062006-04-30 21:58:41 +0000142* pcsys_monitor:: QEMU Monitor
Daniel P. Berrangé2544e9e2018-06-27 17:01:03 +0100143* cpu_models:: CPU models
bellarddebc7062006-04-30 21:58:41 +0000144* disk_images:: Disk Images
145* pcsys_network:: Network emulation
Stefan Weil576fd0a2011-01-07 18:59:14 +0100146* pcsys_other_devs:: Other Devices
bellarddebc7062006-04-30 21:58:41 +0000147* direct_linux_boot:: Direct Linux Boot
148* pcsys_usb:: USB emulation
thsf858dca2007-08-25 01:40:37 +0000149* vnc_security:: VNC security
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +0000150* network_tls:: TLS setup for network services
bellarddebc7062006-04-30 21:58:41 +0000151* gdb_usage:: GDB usage
152* pcsys_os_specific:: Target OS specific information
153@end menu
154
155@node pcsys_introduction
bellard0806e3f2003-10-01 00:15:32 +0000156@section Introduction
157
158@c man begin DESCRIPTION
159
bellard3f9f3aa2005-12-18 20:11:37 +0000160The QEMU PC System emulator simulates the
161following peripherals:
bellard0806e3f2003-10-01 00:15:32 +0000162
163@itemize @minus
ths5fafdf22007-09-16 21:08:06 +0000164@item
bellard15a34c62004-07-08 21:26:26 +0000165i440FX host PCI bridge and PIIX3 PCI to ISA bridge
bellard0806e3f2003-10-01 00:15:32 +0000166@item
bellard15a34c62004-07-08 21:26:26 +0000167Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
168extensions (hardware level, including all non standard modes).
bellard0806e3f2003-10-01 00:15:32 +0000169@item
170PS/2 mouse and keyboard
ths5fafdf22007-09-16 21:08:06 +0000171@item
bellard15a34c62004-07-08 21:26:26 +00001722 PCI IDE interfaces with hard disk and CD-ROM support
bellard1f673132004-04-04 15:21:17 +0000173@item
174Floppy disk
ths5fafdf22007-09-16 21:08:06 +0000175@item
Stefan Weil3a2eeac2009-06-06 18:05:58 +0200176PCI and ISA network adapters
bellard0806e3f2003-10-01 00:15:32 +0000177@item
bellard05d58182004-08-24 21:12:04 +0000178Serial ports
179@item
Corey Minyard23076bb2015-12-17 12:50:04 -0600180IPMI BMC, either and internal or external one
181@item
bellardc0fe3822005-11-05 18:55:28 +0000182Creative SoundBlaster 16 sound card
183@item
184ENSONIQ AudioPCI ES1370 sound card
185@item
balroge5c9a132008-01-14 04:27:55 +0000186Intel 82801AA AC97 Audio compatible sound card
187@item
Gerd Hoffmann7d72e762010-11-01 16:57:48 +0100188Intel HD Audio Controller and HDA codec
189@item
Stefan Weil2d983442011-01-07 18:59:15 +0100190Adlib (OPL2) - Yamaha YM3812 compatible chip
bellardb389dbf2005-11-06 16:49:55 +0000191@item
balrog26463db2008-01-17 21:47:25 +0000192Gravis Ultrasound GF1 sound card
193@item
malccc53d262008-06-13 10:48:22 +0000194CS4231A compatible sound card
195@item
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200196PCI UHCI, OHCI, EHCI or XHCI USB controller and a virtual USB-1.1 hub.
bellard0806e3f2003-10-01 00:15:32 +0000197@end itemize
198
bellard3f9f3aa2005-12-18 20:11:37 +0000199SMP is supported with up to 255 CPUs.
200
Michael Tokareva8ad4152013-06-28 10:08:16 +0400201QEMU uses the PC BIOS from the Seabios project and the Plex86/Bochs LGPL
bellard15a34c62004-07-08 21:26:26 +0000202VGA BIOS.
203
bellardc0fe3822005-11-05 18:55:28 +0000204QEMU uses YM3812 emulation by Tatsuyuki Satoh.
205
Stefan Weil2d983442011-01-07 18:59:15 +0100206QEMU uses GUS emulation (GUSEMU32 @url{http://www.deinmeister.de/gusemu/})
balrog26463db2008-01-17 21:47:25 +0000207by Tibor "TS" Schütz.
balrog423d65f2008-01-14 22:09:11 +0000208
Bernhard Reutner-Fischer1a1a0e22011-10-25 10:22:18 +0200209Note that, by default, GUS shares IRQ(7) with parallel ports and so
Stefan Weilb65ee4f2012-05-11 22:25:50 +0200210QEMU must be told to not have parallel ports to have working GUS.
malc720036a2009-09-10 20:05:59 +0400211
212@example
Thomas Huth664785a2019-07-30 17:08:26 +0200213@value{qemu_system_x86} dos.img -soundhw gus -parallel none
malc720036a2009-09-10 20:05:59 +0400214@end example
215
216Alternatively:
217@example
Thomas Huth664785a2019-07-30 17:08:26 +0200218@value{qemu_system_x86} dos.img -device gus,irq=5
malc720036a2009-09-10 20:05:59 +0400219@end example
220
221Or some other unclaimed IRQ.
222
malccc53d262008-06-13 10:48:22 +0000223CS4231A is the chip used in Windows Sound System and GUSMAX products
224
bellard0806e3f2003-10-01 00:15:32 +0000225@c man end
226
bellarddebc7062006-04-30 21:58:41 +0000227@node pcsys_quickstart
bellard1eb20522003-06-25 16:21:49 +0000228@section Quick Start
Stefan Weil7544a042010-02-05 23:52:03 +0100229@cindex quick start
bellard1eb20522003-06-25 16:21:49 +0000230
Thomas Huth664785a2019-07-30 17:08:26 +0200231Download and uncompress a hard disk image with Linux installed (e.g.
232@file{linux.img}) and type:
bellard0806e3f2003-10-01 00:15:32 +0000233
234@example
Thomas Huth664785a2019-07-30 17:08:26 +0200235@value{qemu_system} linux.img
bellard0806e3f2003-10-01 00:15:32 +0000236@end example
237
238Linux should boot and give you a prompt.
239
bellard6cc721c2005-07-28 22:27:28 +0000240@node sec_invocation
bellard1f673132004-04-04 15:21:17 +0000241@section Invocation
242
243@example
244@c man begin SYNOPSIS
Thomas Huth664785a2019-07-30 17:08:26 +0200245@command{@value{qemu_system}} [@var{options}] [@var{disk_image}]
bellard1f673132004-04-04 15:21:17 +0000246@c man end
247@end example
248
249@c man begin OPTIONS
blueswir1d2c639d2009-01-24 18:19:25 +0000250@var{disk_image} is a raw hard disk image for IDE hard disk 0. Some
251targets do not need a disk image.
bellard1f673132004-04-04 15:21:17 +0000252
blueswir15824d652009-03-28 06:44:27 +0000253@include qemu-options.texi
bellard1f673132004-04-04 15:21:17 +0000254
bellard3e11db92004-07-14 17:47:14 +0000255@c man end
256
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200257@subsection Device URL Syntax
258@c TODO merge this with section Disk Images
259
260@c man begin NOTES
261
262In addition to using normal file images for the emulated storage devices,
263QEMU can also use networked resources such as iSCSI devices. These are
264specified using a special URL syntax.
265
266@table @option
267@item iSCSI
268iSCSI support allows QEMU to access iSCSI resources directly and use as
269images for the guest storage. Both disk and cdrom images are supported.
270
271Syntax for specifying iSCSI LUNs is
272``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
273
274By default qemu will use the iSCSI initiator-name
275'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command
276line or a configuration file.
277
278Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect
279stalled requests and force a reestablishment of the session. The timeout
280is specified in seconds. The default is 0 which means no timeout. Libiscsi
2811.15.0 or greater is required for this feature.
282
283Example (without authentication):
284@example
Thomas Huth664785a2019-07-30 17:08:26 +0200285@value{qemu_system} -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200286 -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
287 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
288@end example
289
290Example (CHAP username/password via URL):
291@example
Thomas Huth664785a2019-07-30 17:08:26 +0200292@value{qemu_system} -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200293@end example
294
295Example (CHAP username/password via environment variables):
296@example
297LIBISCSI_CHAP_USERNAME="user" \
298LIBISCSI_CHAP_PASSWORD="password" \
Thomas Huth664785a2019-07-30 17:08:26 +0200299@value{qemu_system} -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200300@end example
301
302@item NBD
303QEMU supports NBD (Network Block Devices) both using TCP protocol as well
Eric Blake0c61ebb2019-09-03 09:56:34 -0500304as Unix Domain Sockets. With TCP, the default port is 10809.
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200305
Eric Blake0c61ebb2019-09-03 09:56:34 -0500306Syntax for specifying a NBD device using TCP, in preferred URI form:
307``nbd://<server-ip>[:<port>]/[<export>]''
308
309Syntax for specifying a NBD device using Unix Domain Sockets; remember
310that '?' is a shell glob character and may need quoting:
311``nbd+unix:///[<export>]?socket=<domain-socket>''
312
313Older syntax that is also recognized:
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200314``nbd:<server-ip>:<port>[:exportname=<export>]''
315
316Syntax for specifying a NBD device using Unix Domain Sockets
317``nbd:unix:<domain-socket>[:exportname=<export>]''
318
319Example for TCP
320@example
Thomas Huth664785a2019-07-30 17:08:26 +0200321@value{qemu_system} --drive file=nbd:192.0.2.1:30000
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200322@end example
323
324Example for Unix Domain Sockets
325@example
Thomas Huth664785a2019-07-30 17:08:26 +0200326@value{qemu_system} --drive file=nbd:unix:/tmp/nbd-socket
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200327@end example
328
329@item SSH
330QEMU supports SSH (Secure Shell) access to remote disks.
331
332Examples:
333@example
Thomas Huth664785a2019-07-30 17:08:26 +0200334@value{qemu_system} -drive file=ssh://user@@host/path/to/disk.img
335@value{qemu_system} -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200336@end example
337
338Currently authentication must be done using ssh-agent. Other
339authentication methods may be supported in future.
340
341@item Sheepdog
342Sheepdog is a distributed storage system for QEMU.
343QEMU supports using either local sheepdog devices or remote networked
344devices.
345
346Syntax for specifying a sheepdog device
347@example
348sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
349@end example
350
351Example
352@example
Thomas Huth664785a2019-07-30 17:08:26 +0200353@value{qemu_system} --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200354@end example
355
356See also @url{https://sheepdog.github.io/sheepdog/}.
357
358@item GlusterFS
359GlusterFS is a user space distributed file system.
360QEMU supports the use of GlusterFS volumes for hosting VM disk images using
361TCP, Unix Domain Sockets and RDMA transport protocols.
362
363Syntax for specifying a VM disk image on GlusterFS volume is
364@example
365
366URI:
367gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
368
369JSON:
370'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":N,"logfile":"...",
371@ "server":[@{"type":"tcp","host":"...","port":"..."@},
372@ @{"type":"unix","socket":"..."@}]@}@}'
373@end example
374
375
376Example
377@example
378URI:
Thomas Huth664785a2019-07-30 17:08:26 +0200379@value{qemu_system} --drive file=gluster://192.0.2.1/testvol/a.img,
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200380@ file.debug=9,file.logfile=/var/log/qemu-gluster.log
381
382JSON:
Thomas Huth664785a2019-07-30 17:08:26 +0200383@value{qemu_system} 'json:@{"driver":"qcow2",
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200384@ "file":@{"driver":"gluster",
385@ "volume":"testvol","path":"a.img",
386@ "debug":9,"logfile":"/var/log/qemu-gluster.log",
387@ "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},
388@ @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}'
Thomas Huth664785a2019-07-30 17:08:26 +0200389@value{qemu_system} -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200390@ file.debug=9,file.logfile=/var/log/qemu-gluster.log,
391@ file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
392@ file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
393@end example
394
395See also @url{http://www.gluster.org}.
396
397@item HTTP/HTTPS/FTP/FTPS
398QEMU supports read-only access to files accessed over http(s) and ftp(s).
399
400Syntax using a single filename:
401@example
402<protocol>://[<username>[:<password>]@@]<host>/<path>
403@end example
404
405where:
406@table @option
407@item protocol
408'http', 'https', 'ftp', or 'ftps'.
409
410@item username
411Optional username for authentication to the remote server.
412
413@item password
414Optional password for authentication to the remote server.
415
416@item host
417Address of the remote server.
418
419@item path
420Path on the remote server, including any query string.
421@end table
422
423The following options are also supported:
424@table @option
425@item url
426The full URL when passing options to the driver explicitly.
427
428@item readahead
429The amount of data to read ahead with each range request to the remote server.
430This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
431does not have a suffix, it will be assumed to be in bytes. The value must be a
432multiple of 512 bytes. It defaults to 256k.
433
434@item sslverify
435Whether to verify the remote server's certificate when connecting over SSL. It
436can have the value 'on' or 'off'. It defaults to 'on'.
437
438@item cookie
439Send this cookie (it can also be a list of cookies separated by ';') with
440each outgoing request. Only supported when using protocols such as HTTP
441which support cookies, otherwise ignored.
442
443@item timeout
444Set the timeout in seconds of the CURL connection. This timeout is the time
445that CURL waits for a response from the remote server to get the size of the
446image to be downloaded. If not set, the default timeout of 5 seconds is used.
447@end table
448
449Note that when passing options to qemu explicitly, @option{driver} is the value
450of <protocol>.
451
452Example: boot from a remote Fedora 20 live ISO image
453@example
Cleber Rosa93bbbdf2019-09-03 20:52:18 -0400454@value{qemu_system_x86} --drive media=cdrom,file=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200455
Cleber Rosa93bbbdf2019-09-03 20:52:18 -0400456@value{qemu_system_x86} --drive media=cdrom,file.driver=http,file.url=http://archives.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200457@end example
458
459Example: boot from a remote Fedora 20 cloud image using a local overlay for
460writes, copy-on-read, and a readahead of 64k
461@example
Cleber Rosa93bbbdf2019-09-03 20:52:18 -0400462qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200463
Thomas Huth664785a2019-07-30 17:08:26 +0200464@value{qemu_system_x86} -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200465@end example
466
467Example: boot from an image stored on a VMware vSphere server with a self-signed
468certificate using a local overlay for writes, a readahead of 64k and a timeout
469of 10 seconds.
470@example
471qemu-img create -f qcow2 -o backing_file='json:@{"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@}' /tmp/test.qcow2
472
Thomas Huth664785a2019-07-30 17:08:26 +0200473@value{qemu_system_x86} -drive file=/tmp/test.qcow2
Markus Armbrustere896d0f2017-10-02 16:03:02 +0200474@end example
475
476@end table
477
478@c man end
479
bellarddebc7062006-04-30 21:58:41 +0000480@node pcsys_keys
Peter Maydella40db1b2016-02-16 17:28:58 +0000481@section Keys in the graphical frontends
bellard3e11db92004-07-14 17:47:14 +0000482
483@c man begin OPTIONS
484
Brad Hardsde1db2a2011-04-29 21:46:12 +1000485During the graphical emulation, you can use special key combinations to change
486modes. The default key mappings are shown below, but if you use @code{-alt-grab}
487then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt) and if you use
488@code{-ctrl-grab} then the modifier is the right Ctrl key (instead of Ctrl-Alt):
489
bellarda1b74fe2004-05-08 13:26:35 +0000490@table @key
bellardf9859312004-10-03 14:33:10 +0000491@item Ctrl-Alt-f
Stefan Weil7544a042010-02-05 23:52:03 +0100492@kindex Ctrl-Alt-f
bellarda1b74fe2004-05-08 13:26:35 +0000493Toggle full screen
bellarda0a821a2004-07-14 17:38:57 +0000494
Jan Kiszkad6a65ba2011-07-30 11:39:16 +0200495@item Ctrl-Alt-+
496@kindex Ctrl-Alt-+
497Enlarge the screen
498
499@item Ctrl-Alt--
500@kindex Ctrl-Alt--
501Shrink the screen
502
malcc4a735f2009-09-10 05:15:07 +0400503@item Ctrl-Alt-u
Stefan Weil7544a042010-02-05 23:52:03 +0100504@kindex Ctrl-Alt-u
malcc4a735f2009-09-10 05:15:07 +0400505Restore the screen's un-scaled dimensions
506
bellardf9859312004-10-03 14:33:10 +0000507@item Ctrl-Alt-n
Stefan Weil7544a042010-02-05 23:52:03 +0100508@kindex Ctrl-Alt-n
bellarda0a821a2004-07-14 17:38:57 +0000509Switch to virtual console 'n'. Standard console mappings are:
510@table @emph
511@item 1
512Target system display
513@item 2
514Monitor
515@item 3
516Serial port
bellarda1b74fe2004-05-08 13:26:35 +0000517@end table
518
bellardf9859312004-10-03 14:33:10 +0000519@item Ctrl-Alt
Stefan Weil7544a042010-02-05 23:52:03 +0100520@kindex Ctrl-Alt
bellarda0a821a2004-07-14 17:38:57 +0000521Toggle mouse and keyboard grab.
522@end table
523
Stefan Weil7544a042010-02-05 23:52:03 +0100524@kindex Ctrl-Up
525@kindex Ctrl-Down
526@kindex Ctrl-PageUp
527@kindex Ctrl-PageDown
bellard3e11db92004-07-14 17:47:14 +0000528In the virtual consoles, you can use @key{Ctrl-Up}, @key{Ctrl-Down},
529@key{Ctrl-PageUp} and @key{Ctrl-PageDown} to move in the back log.
530
Peter Maydella40db1b2016-02-16 17:28:58 +0000531@c man end
532
533@node mux_keys
534@section Keys in the character backend multiplexer
535
536@c man begin OPTIONS
537
538During emulation, if you are using a character backend multiplexer
539(which is the default if you are using @option{-nographic}) then
540several commands are available via an escape sequence. These
541key sequences all start with an escape character, which is @key{Ctrl-a}
542by default, but can be changed with @option{-echr}. The list below assumes
543you're using the default.
bellard1f673132004-04-04 15:21:17 +0000544
545@table @key
bellarda1b74fe2004-05-08 13:26:35 +0000546@item Ctrl-a h
Stefan Weil7544a042010-02-05 23:52:03 +0100547@kindex Ctrl-a h
bellard1f673132004-04-04 15:21:17 +0000548Print this help
ths3b46e622007-09-17 08:09:54 +0000549@item Ctrl-a x
Stefan Weil7544a042010-02-05 23:52:03 +0100550@kindex Ctrl-a x
ths366dfc52006-12-11 18:35:08 +0000551Exit emulator
ths3b46e622007-09-17 08:09:54 +0000552@item Ctrl-a s
Stefan Weil7544a042010-02-05 23:52:03 +0100553@kindex Ctrl-a s
bellard1f673132004-04-04 15:21:17 +0000554Save disk data back to file (if -snapshot)
ths20d8a3e2007-02-18 17:04:49 +0000555@item Ctrl-a t
Stefan Weil7544a042010-02-05 23:52:03 +0100556@kindex Ctrl-a t
blueswir1d2c639d2009-01-24 18:19:25 +0000557Toggle console timestamps
bellarda1b74fe2004-05-08 13:26:35 +0000558@item Ctrl-a b
Stefan Weil7544a042010-02-05 23:52:03 +0100559@kindex Ctrl-a b
bellard1f673132004-04-04 15:21:17 +0000560Send break (magic sysrq in Linux)
bellarda1b74fe2004-05-08 13:26:35 +0000561@item Ctrl-a c
Stefan Weil7544a042010-02-05 23:52:03 +0100562@kindex Ctrl-a c
Peter Maydella40db1b2016-02-16 17:28:58 +0000563Rotate between the frontends connected to the multiplexer (usually
564this switches between the monitor and the console)
bellarda1b74fe2004-05-08 13:26:35 +0000565@item Ctrl-a Ctrl-a
Peter Maydella40db1b2016-02-16 17:28:58 +0000566@kindex Ctrl-a Ctrl-a
567Send the escape character to the frontend
bellard1f673132004-04-04 15:21:17 +0000568@end table
569@c man end
570
571@ignore
572
bellard1f673132004-04-04 15:21:17 +0000573@c man begin SEEALSO
574The HTML documentation of QEMU for more precise information and Linux
575user mode emulator invocation.
576@c man end
577
578@c man begin AUTHOR
579Fabrice Bellard
580@c man end
581
582@end ignore
583
bellarddebc7062006-04-30 21:58:41 +0000584@node pcsys_monitor
bellard1f673132004-04-04 15:21:17 +0000585@section QEMU Monitor
Stefan Weil7544a042010-02-05 23:52:03 +0100586@cindex QEMU monitor
bellard1f673132004-04-04 15:21:17 +0000587
588The QEMU monitor is used to give complex commands to the QEMU
589emulator. You can use it to:
590
591@itemize @minus
592
593@item
thse5987522007-03-30 18:58:01 +0000594Remove or insert removable media images
ths89dfe892007-11-21 22:38:37 +0000595(such as CD-ROM or floppies).
bellard1f673132004-04-04 15:21:17 +0000596
ths5fafdf22007-09-16 21:08:06 +0000597@item
bellard1f673132004-04-04 15:21:17 +0000598Freeze/unfreeze the Virtual Machine (VM) and save or restore its state
599from a disk file.
600
601@item Inspect the VM state without an external debugger.
602
603@end itemize
604
605@subsection Commands
606
607The following commands are available:
608
Blue Swirl23130862009-06-06 08:22:04 +0000609@include qemu-monitor.texi
bellard1f673132004-04-04 15:21:17 +0000610
Pavel Butsykin2cd8af22015-09-10 18:39:01 +0300611@include qemu-monitor-info.texi
612
bellard1f673132004-04-04 15:21:17 +0000613@subsection Integer expressions
614
615The monitor understands integers expressions for every integer
616argument. You can use register names to get the value of specifics
617CPU registers by prefixing them with @emph{$}.
618
Daniel P. Berrangé2544e9e2018-06-27 17:01:03 +0100619@node cpu_models
620@section CPU models
621
622@include docs/qemu-cpu-models.texi
623
bellard1f673132004-04-04 15:21:17 +0000624@node disk_images
625@section Disk Images
626
Paolo Bonziniee29bdb2017-06-06 16:59:55 +0200627QEMU supports many disk image formats, including growable disk images
628(their size increase as non empty sectors are written), compressed and
629encrypted disk images.
bellard1f673132004-04-04 15:21:17 +0000630
bellarddebc7062006-04-30 21:58:41 +0000631@menu
632* disk_images_quickstart:: Quick start for disk image creation
633* disk_images_snapshot_mode:: Snapshot mode
bellard13a2e802006-08-06 14:50:31 +0000634* vm_snapshots:: VM snapshots
bellarddebc7062006-04-30 21:58:41 +0000635* qemu_img_invocation:: qemu-img Invocation
ths975b0922008-07-02 21:18:00 +0000636* qemu_nbd_invocation:: qemu-nbd Invocation
Kevin Wolfd3067b02012-11-21 14:21:47 +0100637* disk_images_formats:: Disk image file formats
bellard19cb3732006-08-19 11:45:59 +0000638* host_drives:: Using host drives
bellarddebc7062006-04-30 21:58:41 +0000639* disk_images_fat_images:: Virtual FAT disk images
ths75818252008-07-03 13:41:03 +0000640* disk_images_nbd:: NBD access
MORITA Kazutaka42af9c32011-02-07 16:04:04 +0900641* disk_images_sheepdog:: Sheepdog disk images
Ronnie Sahlberg00984e32011-11-12 11:06:30 +1100642* disk_images_iscsi:: iSCSI LUNs
Bharata B Rao8809e282012-10-24 17:17:53 +0530643* disk_images_gluster:: GlusterFS disk images
Richard W.M. Jones0a12ec82013-04-09 15:30:53 +0100644* disk_images_ssh:: Secure Shell (ssh) disk images
Fam Zhenge86de5e2018-01-16 14:09:00 +0800645* disk_images_nvme:: NVMe userspace driver
Fam Zhengb1d1cb22017-11-24 16:53:50 +0800646* disk_image_locking:: Disk image file locking
bellarddebc7062006-04-30 21:58:41 +0000647@end menu
648
649@node disk_images_quickstart
bellardacd935e2004-11-15 22:57:26 +0000650@subsection Quick start for disk image creation
651
652You can create a disk image with the command:
bellard1f673132004-04-04 15:21:17 +0000653@example
bellardacd935e2004-11-15 22:57:26 +0000654qemu-img create myimage.img mysize
bellard1f673132004-04-04 15:21:17 +0000655@end example
bellardacd935e2004-11-15 22:57:26 +0000656where @var{myimage.img} is the disk image filename and @var{mysize} is its
657size in kilobytes. You can add an @code{M} suffix to give the size in
658megabytes and a @code{G} suffix for gigabytes.
659
bellarddebc7062006-04-30 21:58:41 +0000660See @ref{qemu_img_invocation} for more information.
bellard1f673132004-04-04 15:21:17 +0000661
bellarddebc7062006-04-30 21:58:41 +0000662@node disk_images_snapshot_mode
bellard1f673132004-04-04 15:21:17 +0000663@subsection Snapshot mode
664
665If you use the option @option{-snapshot}, all disk images are
666considered as read only. When sectors in written, they are written in
667a temporary file created in @file{/tmp}. You can however force the
bellardacd935e2004-11-15 22:57:26 +0000668write back to the raw disk images by using the @code{commit} monitor
669command (or @key{C-a s} in the serial console).
bellard1f673132004-04-04 15:21:17 +0000670
bellard13a2e802006-08-06 14:50:31 +0000671@node vm_snapshots
672@subsection VM snapshots
673
674VM snapshots are snapshots of the complete virtual machine including
675CPU state, RAM, device state and the content of all the writable
676disks. In order to use VM snapshots, you must have at least one non
677removable and writable block device using the @code{qcow2} disk image
678format. Normally this device is the first virtual hard drive.
679
680Use the monitor command @code{savevm} to create a new VM snapshot or
681replace an existing one. A human readable name can be assigned to each
bellard19d36792006-08-07 21:34:34 +0000682snapshot in addition to its numerical ID.
bellard13a2e802006-08-06 14:50:31 +0000683
684Use @code{loadvm} to restore a VM snapshot and @code{delvm} to remove
685a VM snapshot. @code{info snapshots} lists the available snapshots
686with their associated information:
687
688@example
689(qemu) info snapshots
690Snapshot devices: hda
691Snapshot list (from hda):
692ID TAG VM SIZE DATE VM CLOCK
6931 start 41M 2006-08-06 12:38:02 00:00:14.954
6942 40M 2006-08-06 12:43:29 00:00:18.633
6953 msys 40M 2006-08-06 12:44:04 00:00:23.514
696@end example
697
698A VM snapshot is made of a VM state info (its size is shown in
699@code{info snapshots}) and a snapshot of every writable disk image.
700The VM state info is stored in the first @code{qcow2} non removable
701and writable block device. The disk image snapshots are stored in
702every disk image. The size of a snapshot in a disk image is difficult
703to evaluate and is not shown by @code{info snapshots} because the
704associated disk sectors are shared among all the snapshots to save
bellard19d36792006-08-07 21:34:34 +0000705disk space (otherwise each snapshot would need a full copy of all the
706disk images).
bellard13a2e802006-08-06 14:50:31 +0000707
708When using the (unrelated) @code{-snapshot} option
709(@ref{disk_images_snapshot_mode}), you can always make VM snapshots,
710but they are deleted as soon as you exit QEMU.
711
712VM snapshots currently have the following known limitations:
713@itemize
ths5fafdf22007-09-16 21:08:06 +0000714@item
bellard13a2e802006-08-06 14:50:31 +0000715They cannot cope with removable devices if they are removed or
716inserted after a snapshot is done.
ths5fafdf22007-09-16 21:08:06 +0000717@item
bellard13a2e802006-08-06 14:50:31 +0000718A few device drivers still have incomplete snapshot support so their
719state is not saved or restored properly (in particular USB).
720@end itemize
721
bellardacd935e2004-11-15 22:57:26 +0000722@node qemu_img_invocation
723@subsection @code{qemu-img} Invocation
bellard1f673132004-04-04 15:21:17 +0000724
bellardacd935e2004-11-15 22:57:26 +0000725@include qemu-img.texi
bellard05efe462004-06-16 20:34:33 +0000726
ths975b0922008-07-02 21:18:00 +0000727@node qemu_nbd_invocation
728@subsection @code{qemu-nbd} Invocation
729
730@include qemu-nbd.texi
731
Stefan Hajnoczi78aa8aa2017-09-08 09:39:41 +0100732@include docs/qemu-block-drivers.texi
Richard W.M. Jones0a12ec82013-04-09 15:30:53 +0100733
bellarddebc7062006-04-30 21:58:41 +0000734@node pcsys_network
bellard9d4fb822004-04-26 20:55:38 +0000735@section Network emulation
736
Thomas Huth0e0266c2018-04-30 20:02:25 +0200737QEMU can simulate several network cards (e.g. PCI or ISA cards on the PC
738target) and can connect them to a network backend on the host or an emulated
739hub. The various host network backends can either be used to connect the NIC of
740the guest to a real network (e.g. by using a TAP devices or the non-privileged
741user mode network stack), or to other guest instances running in another QEMU
742process (e.g. by using the socket host network backend).
bellard41d03942005-11-15 23:02:53 +0000743
744@subsection Using TAP network interfaces
745
746This is the standard way to connect QEMU to a real network. QEMU adds
747a virtual network device on your host (called @code{tapN}), and you
748can then configure it as if it was a real ethernet card.
bellard9d4fb822004-04-26 20:55:38 +0000749
bellard8f40c382006-09-20 20:28:05 +0000750@subsubsection Linux host
751
bellard9d4fb822004-04-26 20:55:38 +0000752As an example, you can download the @file{linux-test-xxx.tar.gz}
753archive and copy the script @file{qemu-ifup} in @file{/etc} and
754configure properly @code{sudo} so that the command @code{ifconfig}
755contained in @file{qemu-ifup} can be executed as root. You must verify
bellard41d03942005-11-15 23:02:53 +0000756that your host kernel supports the TAP network interfaces: the
bellard9d4fb822004-04-26 20:55:38 +0000757device @file{/dev/net/tun} must be present.
758
bellardee0f4752006-08-19 16:56:18 +0000759See @ref{sec_invocation} to have examples of command lines using the
760TAP network interfaces.
bellard9d4fb822004-04-26 20:55:38 +0000761
bellard8f40c382006-09-20 20:28:05 +0000762@subsubsection Windows host
763
764There is a virtual ethernet driver for Windows 2000/XP systems, called
765TAP-Win32. But it is not included in standard QEMU for Windows,
766so you will need to get it separately. It is part of OpenVPN package,
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +0000767so download OpenVPN from : @url{https://openvpn.net/}.
bellard8f40c382006-09-20 20:28:05 +0000768
bellard9d4fb822004-04-26 20:55:38 +0000769@subsection Using the user mode network stack
770
bellard41d03942005-11-15 23:02:53 +0000771By using the option @option{-net user} (default configuration if no
772@option{-net} option is specified), QEMU uses a completely user mode
ths4be456f2007-06-03 13:41:28 +0000773network stack (you don't need root privilege to use the virtual
bellard41d03942005-11-15 23:02:53 +0000774network). The virtual network configuration is the following:
bellard9d4fb822004-04-26 20:55:38 +0000775
776@example
777
Thomas Huth0e0266c2018-04-30 20:02:25 +0200778 guest (10.0.2.15) <------> Firewall/DHCP server <-----> Internet
bellard41d03942005-11-15 23:02:53 +0000779 | (10.0.2.2)
bellard9d4fb822004-04-26 20:55:38 +0000780 |
bellard2518bd02004-09-30 22:35:13 +0000781 ----> DNS server (10.0.2.3)
ths3b46e622007-09-17 08:09:54 +0000782 |
bellard2518bd02004-09-30 22:35:13 +0000783 ----> SMB server (10.0.2.4)
bellard9d4fb822004-04-26 20:55:38 +0000784@end example
785
786The QEMU VM behaves as if it was behind a firewall which blocks all
787incoming connections. You can use a DHCP client to automatically
bellard41d03942005-11-15 23:02:53 +0000788configure the network in the QEMU VM. The DHCP server assign addresses
789to the hosts starting from 10.0.2.15.
bellard9d4fb822004-04-26 20:55:38 +0000790
791In order to check that the user mode network is working, you can ping
792the address 10.0.2.2 and verify that you got an address in the range
79310.0.2.x from the QEMU virtual DHCP server.
794
Gernot Hillier37cbfcc2014-07-10 16:01:25 +0200795Note that ICMP traffic in general does not work with user mode networking.
796@code{ping}, aka. ICMP echo, to the local router (10.0.2.2) shall work,
797however. If you're using QEMU on Linux >= 3.0, it can use unprivileged ICMP
798ping sockets to allow @code{ping} to the Internet. The host admin has to set
799the ping_group_range in order to grant access to those sockets. To allow ping
800for GID 100 (usually users group):
801
802@example
803echo 100 100 > /proc/sys/net/ipv4/ping_group_range
804@end example
bellardb415a402004-05-23 21:04:06 +0000805
bellard9bf05442004-08-25 22:12:49 +0000806When using the built-in TFTP server, the router is also the TFTP
807server.
808
Thomas Huthc8c6afa2016-01-13 09:21:02 +0100809When using the @option{'-netdev user,hostfwd=...'} option, TCP or UDP
810connections can be redirected from the host to the guest. It allows for
811example to redirect X11, telnet or SSH connections.
bellard443f1372004-06-04 11:13:20 +0000812
Thomas Huth0e0266c2018-04-30 20:02:25 +0200813@subsection Hubs
bellard41d03942005-11-15 23:02:53 +0000814
Thomas Huth0e0266c2018-04-30 20:02:25 +0200815QEMU can simulate several hubs. A hub can be thought of as a virtual connection
816between several network devices. These devices can be for example QEMU virtual
817ethernet cards or virtual Host ethernet devices (TAP devices). You can connect
818guest NICs or host network backends to such a hub using the @option{-netdev
819hubport} or @option{-nic hubport} options. The legacy @option{-net} option
820also connects the given device to the emulated hub with ID 0 (i.e. the default
821hub) unless you specify a netdev with @option{-net nic,netdev=xxx} here.
822
823@subsection Connecting emulated networks between QEMU instances
824
825Using the @option{-netdev socket} (or @option{-nic socket} or
826@option{-net socket}) option, it is possible to create emulated
827networks that span several QEMU instances.
828See the description of the @option{-netdev socket} option in the
829@ref{sec_invocation,,Invocation chapter} to have a basic example.
bellard41d03942005-11-15 23:02:53 +0000830
Stefan Weil576fd0a2011-01-07 18:59:14 +0100831@node pcsys_other_devs
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600832@section Other Devices
833
834@subsection Inter-VM Shared Memory device
835
Markus Armbruster5400c022016-03-15 19:34:51 +0100836On Linux hosts, a shared memory device is available. The basic syntax
837is:
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600838
839@example
Thomas Huth664785a2019-07-30 17:08:26 +0200840@value{qemu_system_x86} -device ivshmem-plain,memdev=@var{hostmem}
Markus Armbruster5400c022016-03-15 19:34:51 +0100841@end example
842
843where @var{hostmem} names a host memory backend. For a POSIX shared
844memory backend, use something like
845
846@example
847-object memory-backend-file,size=1M,share,mem-path=/dev/shm/ivshmem,id=@var{hostmem}
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600848@end example
849
850If desired, interrupts can be sent between guest VMs accessing the same shared
851memory region. Interrupt support requires using a shared memory server and
852using a chardev socket to connect to it. The code for the shared memory server
853is qemu.git/contrib/ivshmem-server. An example syntax when using the shared
854memory server is:
855
856@example
David Marchanda75eb032014-09-08 11:17:48 +0200857# First start the ivshmem server once and for all
Markus Armbruster50d34c42015-11-24 18:06:25 +0100858ivshmem-server -p @var{pidfile} -S @var{path} -m @var{shm-name} -l @var{shm-size} -n @var{vectors}
David Marchanda75eb032014-09-08 11:17:48 +0200859
860# Then start your qemu instances with matching arguments
Thomas Huth664785a2019-07-30 17:08:26 +0200861@value{qemu_system_x86} -device ivshmem-doorbell,vectors=@var{vectors},chardev=@var{id}
Markus Armbruster50d34c42015-11-24 18:06:25 +0100862 -chardev socket,path=@var{path},id=@var{id}
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600863@end example
864
865When using the server, the guest will be assigned a VM ID (>=0) that allows guests
866using the same server to communicate via interrupts. Guests can read their
Markus Armbruster1309cf42016-03-15 19:34:41 +0100867VM ID from a device register (see ivshmem-spec.txt).
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600868
Markus Armbruster62a830b2016-03-15 19:34:54 +0100869@subsubsection Migration with ivshmem
870
Markus Armbruster5400c022016-03-15 19:34:51 +0100871With device property @option{master=on}, the guest will copy the shared
872memory on migration to the destination host. With @option{master=off},
873the guest will not be able to migrate with the device attached. In the
874latter case, the device should be detached and then reattached after
875migration using the PCI hotplug support.
Cam Macdonell6cbf4c82010-07-27 10:54:13 -0600876
Markus Armbruster62a830b2016-03-15 19:34:54 +0100877At most one of the devices sharing the same memory can be master. The
878master must complete migration before you plug back the other devices.
879
Marc-André Lureau7d4f4bd2015-10-07 16:31:47 +0200880@subsubsection ivshmem and hugepages
881
882Instead of specifying the <shm size> using POSIX shm, you may specify
883a memory backend that has hugepage support:
884
885@example
Thomas Huth664785a2019-07-30 17:08:26 +0200886@value{qemu_system_x86} -object memory-backend-file,size=1G,mem-path=/dev/hugepages/my-shmem-file,share,id=mb1
Markus Armbruster5400c022016-03-15 19:34:51 +0100887 -device ivshmem-plain,memdev=mb1
Marc-André Lureau7d4f4bd2015-10-07 16:31:47 +0200888@end example
889
890ivshmem-server also supports hugepages mount points with the
891@option{-m} memory path argument.
892
bellard9d4fb822004-04-26 20:55:38 +0000893@node direct_linux_boot
894@section Direct Linux Boot
bellard0806e3f2003-10-01 00:15:32 +0000895
896This section explains how to launch a Linux kernel inside QEMU without
897having to make a full bootable image. It is very useful for fast Linux
bellardee0f4752006-08-19 16:56:18 +0000898kernel testing.
bellard1eb20522003-06-25 16:21:49 +0000899
bellardee0f4752006-08-19 16:56:18 +0000900The syntax is:
bellard1eb20522003-06-25 16:21:49 +0000901@example
Thomas Huth664785a2019-07-30 17:08:26 +0200902@value{qemu_system} -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
bellard1eb20522003-06-25 16:21:49 +0000903@end example
904
bellardee0f4752006-08-19 16:56:18 +0000905Use @option{-kernel} to provide the Linux kernel image and
906@option{-append} to give the kernel command line arguments. The
907@option{-initrd} option can be used to provide an INITRD image.
908
bellardee0f4752006-08-19 16:56:18 +0000909If you do not need graphical output, you can disable it and redirect
910the virtual serial port and the QEMU monitor to the console with the
911@option{-nographic} option. The typical command line is:
bellard1eb20522003-06-25 16:21:49 +0000912@example
Thomas Huth664785a2019-07-30 17:08:26 +0200913@value{qemu_system} -kernel bzImage -hda rootdisk.img \
Stefan Weil3804da92012-05-11 22:21:50 +0200914 -append "root=/dev/hda console=ttyS0" -nographic
bellard1eb20522003-06-25 16:21:49 +0000915@end example
916
bellardee0f4752006-08-19 16:56:18 +0000917Use @key{Ctrl-a c} to switch between the serial console and the
918monitor (@pxref{pcsys_keys}).
bellardd5a0b502003-06-27 12:02:03 +0000919
bellarddebc7062006-04-30 21:58:41 +0000920@node pcsys_usb
bellardb389dbf2005-11-06 16:49:55 +0000921@section USB emulation
922
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200923QEMU can emulate a PCI UHCI, OHCI, EHCI or XHCI USB controller. You can
924plug virtual USB devices or real host USB devices (only works with certain
925host operating systems). QEMU will automatically create and connect virtual
926USB hubs as necessary to connect multiple USB devices.
bellardb389dbf2005-11-06 16:49:55 +0000927
pbrook0aff66b2006-05-26 00:49:52 +0000928@menu
929* usb_devices::
930* host_usb_devices::
931@end menu
932@node usb_devices
933@subsection Connecting USB devices
bellardb389dbf2005-11-06 16:49:55 +0000934
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200935USB devices can be connected with the @option{-device usb-...} command line
936option or the @code{device_add} monitor command. Available devices are:
bellardb389dbf2005-11-06 16:49:55 +0000937
balrogdb380c02008-01-17 22:22:45 +0000938@table @code
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200939@item usb-mouse
pbrook0aff66b2006-05-26 00:49:52 +0000940Virtual Mouse. This will override the PS/2 mouse emulation when activated.
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200941@item usb-tablet
bellardc6d46c22006-09-03 17:10:41 +0000942Pointer device that uses absolute coordinates (like a touchscreen).
Stefan Weilb65ee4f2012-05-11 22:25:50 +0200943This means QEMU is able to report the mouse position without having
pbrook0aff66b2006-05-26 00:49:52 +0000944to grab the mouse. Also overrides the PS/2 mouse emulation when activated.
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200945@item usb-storage,drive=@var{drive_id}
946Mass storage device backed by @var{drive_id} (@pxref{disk_images})
947@item usb-uas
948USB attached SCSI device, see
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +0000949@url{https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/usb-storage.txt,usb-storage.txt}
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200950for details
951@item usb-bot
952Bulk-only transport storage device, see
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +0000953@url{https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/usb-storage.txt,usb-storage.txt}
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200954for details here, too
Bandan1ee53062018-09-07 18:08:50 -0400955@item usb-mtp,rootdir=@var{dir}
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200956Media transfer protocol device, using @var{dir} as root of the file tree
957that is presented to the guest.
958@item usb-host,hostbus=@var{bus},hostaddr=@var{addr}
959Pass through the host device identified by @var{bus} and @var{addr}
960@item usb-host,vendorid=@var{vendor},productid=@var{product}
961Pass through the host device identified by @var{vendor} and @var{product} ID
962@item usb-wacom-tablet
balrogf6d2a312007-06-10 19:21:04 +0000963Virtual Wacom PenPartner tablet. This device is similar to the @code{tablet}
964above but it can be used with the tslib library because in addition to touch
965coordinates it reports touch pressure.
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200966@item usb-kbd
balrog47b2d332007-06-22 08:16:00 +0000967Standard USB keyboard. Will override the PS/2 keyboard (if present).
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200968@item usb-serial,chardev=@var{id}
balrogdb380c02008-01-17 22:22:45 +0000969Serial converter. This emulates an FTDI FT232BM chip connected to host character
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200970device @var{id}.
971@item usb-braille,chardev=@var{id}
aurel322e4d9fb2008-04-08 06:01:02 +0000972Braille device. This will use BrlAPI to display the braille output on a real
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200973or fake device referenced by @var{id}.
974@item usb-net[,netdev=@var{id}]
975Network adapter that supports CDC ethernet and RNDIS protocols. @var{id}
976specifies a netdev defined with @code{-netdev @dots{},id=@var{id}}.
balrog9ad97e62008-07-29 13:16:31 +0000977For instance, user-mode networking can be used with
balrog6c9f8862008-07-17 20:47:13 +0000978@example
Thomas Huth664785a2019-07-30 17:08:26 +0200979@value{qemu_system} [...] -netdev user,id=net0 -device usb-net,netdev=net0
balrog6c9f8862008-07-17 20:47:13 +0000980@end example
Thomas Hutha92ff8c2017-05-08 17:13:49 +0200981@item usb-ccid
982Smartcard reader device
983@item usb-audio
984USB audio device
pbrook0aff66b2006-05-26 00:49:52 +0000985@end table
bellardb389dbf2005-11-06 16:49:55 +0000986
pbrook0aff66b2006-05-26 00:49:52 +0000987@node host_usb_devices
bellardb389dbf2005-11-06 16:49:55 +0000988@subsection Using host USB devices on a Linux host
989
990WARNING: this is an experimental feature. QEMU will slow down when
991using it. USB devices requiring real time streaming (i.e. USB Video
992Cameras) are not supported yet.
993
994@enumerate
ths5fafdf22007-09-16 21:08:06 +0000995@item If you use an early Linux 2.4 kernel, verify that no Linux driver
bellardb389dbf2005-11-06 16:49:55 +0000996is actually using the USB device. A simple way to do that is simply to
997disable the corresponding kernel module by renaming it from @file{mydriver.o}
998to @file{mydriver.o.disabled}.
999
1000@item Verify that @file{/proc/bus/usb} is working (most Linux distributions should enable it by default). You should see something like that:
1001@example
1002ls /proc/bus/usb
1003001 devices drivers
1004@end example
1005
1006@item Since only root can access to the USB devices directly, you can either launch QEMU as root or change the permissions of the USB devices you want to use. For testing, the following suffices:
1007@example
1008chown -R myuid /proc/bus/usb
1009@end example
1010
1011@item Launch QEMU and do in the monitor:
ths5fafdf22007-09-16 21:08:06 +00001012@example
bellardb389dbf2005-11-06 16:49:55 +00001013info usbhost
1014 Device 1.2, speed 480 Mb/s
1015 Class 00: USB device 1234:5678, USB DISK
1016@end example
1017You should see the list of the devices you can use (Never try to use
1018hubs, it won't work).
1019
1020@item Add the device in QEMU by using:
ths5fafdf22007-09-16 21:08:06 +00001021@example
Thomas Hutha92ff8c2017-05-08 17:13:49 +02001022device_add usb-host,vendorid=0x1234,productid=0x5678
bellardb389dbf2005-11-06 16:49:55 +00001023@end example
1024
Thomas Hutha92ff8c2017-05-08 17:13:49 +02001025Normally the guest OS should report that a new USB device is plugged.
1026You can use the option @option{-device usb-host,...} to do the same.
bellardb389dbf2005-11-06 16:49:55 +00001027
1028@item Now you can try to use the host USB device in QEMU.
1029
1030@end enumerate
1031
1032When relaunching QEMU, you may have to unplug and plug again the USB
1033device to make it work again (this is a bug).
1034
thsf858dca2007-08-25 01:40:37 +00001035@node vnc_security
1036@section VNC security
1037
1038The VNC server capability provides access to the graphical console
1039of the guest VM across the network. This has a number of security
1040considerations depending on the deployment scenarios.
1041
1042@menu
1043* vnc_sec_none::
1044* vnc_sec_password::
1045* vnc_sec_certificate::
1046* vnc_sec_certificate_verify::
1047* vnc_sec_certificate_pw::
aliguori2f9606b2009-03-06 20:27:28 +00001048* vnc_sec_sasl::
1049* vnc_sec_certificate_sasl::
aliguori2f9606b2009-03-06 20:27:28 +00001050* vnc_setup_sasl::
thsf858dca2007-08-25 01:40:37 +00001051@end menu
1052@node vnc_sec_none
1053@subsection Without passwords
1054
1055The simplest VNC server setup does not include any form of authentication.
1056For this setup it is recommended to restrict it to listen on a UNIX domain
1057socket only. For example
1058
1059@example
Thomas Huth664785a2019-07-30 17:08:26 +02001060@value{qemu_system} [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
thsf858dca2007-08-25 01:40:37 +00001061@end example
1062
1063This ensures that only users on local box with read/write access to that
1064path can access the VNC server. To securely access the VNC server from a
1065remote machine, a combination of netcat+ssh can be used to provide a secure
1066tunnel.
1067
1068@node vnc_sec_password
1069@subsection With passwords
1070
1071The VNC protocol has limited support for password based authentication. Since
1072the protocol limits passwords to 8 characters it should not be considered
1073to provide high security. The password can be fairly easily brute-forced by
1074a client making repeat connections. For this reason, a VNC server using password
1075authentication should be restricted to only listen on the loopback interface
Paul Moore0f669982012-08-03 14:39:21 -04001076or UNIX domain sockets. Password authentication is not supported when operating
1077in FIPS 140-2 compliance mode as it requires the use of the DES cipher. Password
1078authentication is requested with the @code{password} option, and then once QEMU
1079is running the password is set with the monitor. Until the monitor is used to
1080set the password all clients will be rejected.
thsf858dca2007-08-25 01:40:37 +00001081
1082@example
Thomas Huth664785a2019-07-30 17:08:26 +02001083@value{qemu_system} [...OPTIONS...] -vnc :1,password -monitor stdio
thsf858dca2007-08-25 01:40:37 +00001084(qemu) change vnc password
1085Password: ********
1086(qemu)
1087@end example
1088
1089@node vnc_sec_certificate
1090@subsection With x509 certificates
1091
1092The QEMU VNC server also implements the VeNCrypt extension allowing use of
1093TLS for encryption of the session, and x509 certificates for authentication.
1094The use of x509 certificates is strongly recommended, because TLS on its
1095own is susceptible to man-in-the-middle attacks. Basic x509 certificate
1096support provides a secure session, but no authentication. This allows any
1097client to connect, and provides an encrypted session.
1098
1099@example
Thomas Huth664785a2019-07-30 17:08:26 +02001100@value{qemu_system} [...OPTIONS...] \
Daniel P. Berrangé756b9da2018-07-25 10:27:50 +01001101 -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=no \
1102 -vnc :1,tls-creds=tls0 -monitor stdio
thsf858dca2007-08-25 01:40:37 +00001103@end example
1104
1105In the above example @code{/etc/pki/qemu} should contain at least three files,
1106@code{ca-cert.pem}, @code{server-cert.pem} and @code{server-key.pem}. Unprivileged
1107users will want to use a private directory, for example @code{$HOME/.pki/qemu}.
1108NB the @code{server-key.pem} file should be protected with file mode 0600 to
1109only be readable by the user owning it.
1110
1111@node vnc_sec_certificate_verify
1112@subsection With x509 certificates and client verification
1113
1114Certificates can also provide a means to authenticate the client connecting.
1115The server will request that the client provide a certificate, which it will
1116then validate against the CA certificate. This is a good choice if deploying
Daniel P. Berrangé756b9da2018-07-25 10:27:50 +01001117in an environment with a private internal certificate authority. It uses the
1118same syntax as previously, but with @code{verify-peer} set to @code{yes}
1119instead.
thsf858dca2007-08-25 01:40:37 +00001120
1121@example
Thomas Huth664785a2019-07-30 17:08:26 +02001122@value{qemu_system} [...OPTIONS...] \
Daniel P. Berrangé756b9da2018-07-25 10:27:50 +01001123 -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
1124 -vnc :1,tls-creds=tls0 -monitor stdio
thsf858dca2007-08-25 01:40:37 +00001125@end example
1126
1127
1128@node vnc_sec_certificate_pw
1129@subsection With x509 certificates, client verification and passwords
1130
1131Finally, the previous method can be combined with VNC password authentication
1132to provide two layers of authentication for clients.
1133
1134@example
Thomas Huth664785a2019-07-30 17:08:26 +02001135@value{qemu_system} [...OPTIONS...] \
Daniel P. Berrangé756b9da2018-07-25 10:27:50 +01001136 -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
1137 -vnc :1,tls-creds=tls0,password -monitor stdio
thsf858dca2007-08-25 01:40:37 +00001138(qemu) change vnc password
1139Password: ********
1140(qemu)
1141@end example
1142
aliguori2f9606b2009-03-06 20:27:28 +00001143
1144@node vnc_sec_sasl
1145@subsection With SASL authentication
1146
1147The SASL authentication method is a VNC extension, that provides an
1148easily extendable, pluggable authentication method. This allows for
1149integration with a wide range of authentication mechanisms, such as
1150PAM, GSSAPI/Kerberos, LDAP, SQL databases, one-time keys and more.
1151The strength of the authentication depends on the exact mechanism
1152configured. If the chosen mechanism also provides a SSF layer, then
1153it will encrypt the datastream as well.
1154
1155Refer to the later docs on how to choose the exact SASL mechanism
1156used for authentication, but assuming use of one supporting SSF,
1157then QEMU can be launched with:
1158
1159@example
Thomas Huth664785a2019-07-30 17:08:26 +02001160@value{qemu_system} [...OPTIONS...] -vnc :1,sasl -monitor stdio
aliguori2f9606b2009-03-06 20:27:28 +00001161@end example
1162
1163@node vnc_sec_certificate_sasl
1164@subsection With x509 certificates and SASL authentication
1165
1166If the desired SASL authentication mechanism does not supported
1167SSF layers, then it is strongly advised to run it in combination
1168with TLS and x509 certificates. This provides securely encrypted
1169data stream, avoiding risk of compromising of the security
1170credentials. This can be enabled, by combining the 'sasl' option
1171with the aforementioned TLS + x509 options:
1172
1173@example
Thomas Huth664785a2019-07-30 17:08:26 +02001174@value{qemu_system} [...OPTIONS...] \
Daniel P. Berrangé756b9da2018-07-25 10:27:50 +01001175 -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
1176 -vnc :1,tls-creds=tls0,sasl -monitor stdio
aliguori2f9606b2009-03-06 20:27:28 +00001177@end example
1178
aliguori2f9606b2009-03-06 20:27:28 +00001179@node vnc_setup_sasl
1180
1181@subsection Configuring SASL mechanisms
1182
1183The following documentation assumes use of the Cyrus SASL implementation on a
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001184Linux host, but the principles should apply to any other SASL implementation
1185or host. When SASL is enabled, the mechanism configuration will be loaded from
1186system default SASL service config /etc/sasl2/qemu.conf. If running QEMU as an
1187unprivileged user, an environment variable SASL_CONF_PATH can be used to make
1188it search alternate locations for the service config file.
aliguori2f9606b2009-03-06 20:27:28 +00001189
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001190If the TLS option is enabled for VNC, then it will provide session encryption,
1191otherwise the SASL mechanism will have to provide encryption. In the latter
1192case the list of possible plugins that can be used is drastically reduced. In
1193fact only the GSSAPI SASL mechanism provides an acceptable level of security
1194by modern standards. Previous versions of QEMU referred to the DIGEST-MD5
1195mechanism, however, it has multiple serious flaws described in detail in
1196RFC 6331 and thus should never be used any more. The SCRAM-SHA-1 mechanism
1197provides a simple username/password auth facility similar to DIGEST-MD5, but
1198does not support session encryption, so can only be used in combination with
1199TLS.
aliguori2f9606b2009-03-06 20:27:28 +00001200
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001201When not using TLS the recommended configuration is
aliguori2f9606b2009-03-06 20:27:28 +00001202
1203@example
1204mech_list: gssapi
1205keytab: /etc/qemu/krb5.tab
1206@end example
1207
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001208This says to use the 'GSSAPI' mechanism with the Kerberos v5 protocol, with
1209the server principal stored in /etc/qemu/krb5.tab. For this to work the
1210administrator of your KDC must generate a Kerberos principal for the server,
1211with a name of 'qemu/somehost.example.com@@EXAMPLE.COM' replacing
1212'somehost.example.com' with the fully qualified host name of the machine
1213running QEMU, and 'EXAMPLE.COM' with the Kerberos Realm.
aliguori2f9606b2009-03-06 20:27:28 +00001214
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001215When using TLS, if username+password authentication is desired, then a
1216reasonable configuration is
1217
1218@example
1219mech_list: scram-sha-1
1220sasldb_path: /etc/qemu/passwd.db
1221@end example
1222
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001223The @code{saslpasswd2} program can be used to populate the @code{passwd.db}
1224file with accounts.
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001225
1226Other SASL configurations will be left as an exercise for the reader. Note that
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001227all mechanisms, except GSSAPI, should be combined with use of TLS to ensure a
Daniel P. Berrangec6a9a9f2017-03-15 11:53:22 +00001228secure data channel.
aliguori2f9606b2009-03-06 20:27:28 +00001229
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001230
1231@node network_tls
1232@section TLS setup for network services
1233
1234Almost all network services in QEMU have the ability to use TLS for
1235session data encryption, along with x509 certificates for simple
1236client authentication. What follows is a description of how to
1237generate certificates suitable for usage with QEMU, and applies to
1238the VNC server, character devices with the TCP backend, NBD server
1239and client, and migration server and client.
1240
1241At a high level, QEMU requires certificates and private keys to be
1242provided in PEM format. Aside from the core fields, the certificates
1243should include various extension data sets, including v3 basic
1244constraints data, key purpose, key usage and subject alt name.
1245
1246The GnuTLS package includes a command called @code{certtool} which can
1247be used to easily generate certificates and keys in the required format
1248with expected data present. Alternatively a certificate management
1249service may be used.
1250
1251At a minimum it is necessary to setup a certificate authority, and
1252issue certificates to each server. If using x509 certificates for
1253authentication, then each client will also need to be issued a
1254certificate.
1255
1256Assuming that the QEMU network services will only ever be exposed to
1257clients on a private intranet, there is no need to use a commercial
1258certificate authority to create certificates. A self-signed CA is
1259sufficient, and in fact likely to be more secure since it removes
1260the ability of malicious 3rd parties to trick the CA into mis-issuing
1261certs for impersonating your services. The only likely exception
1262where a commercial CA might be desirable is if enabling the VNC
1263websockets server and exposing it directly to remote browser clients.
1264In such a case it might be useful to use a commercial CA to avoid
1265needing to install custom CA certs in the web browsers.
1266
1267The recommendation is for the server to keep its certificates in either
1268@code{/etc/pki/qemu} or for unprivileged users in @code{$HOME/.pki/qemu}.
1269
1270@menu
1271* tls_generate_ca::
1272* tls_generate_server::
1273* tls_generate_client::
1274* tls_creds_setup::
Richard W.M. Jonese1a6dc92018-07-03 09:03:03 +01001275* tls_psk::
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001276@end menu
1277@node tls_generate_ca
1278@subsection Setup the Certificate Authority
1279
1280This step only needs to be performed once per organization / organizational
1281unit. First the CA needs a private key. This key must be kept VERY secret
1282and secure. If this key is compromised the entire trust chain of the certificates
1283issued with it is lost.
1284
1285@example
1286# certtool --generate-privkey > ca-key.pem
1287@end example
1288
1289To generate a self-signed certificate requires one core piece of information,
1290the name of the organization. A template file @code{ca.info} should be
1291populated with the desired data to avoid having to deal with interactive
1292prompts from certtool:
1293@example
1294# cat > ca.info <<EOF
1295cn = Name of your organization
1296ca
1297cert_signing_key
1298EOF
1299# certtool --generate-self-signed \
1300 --load-privkey ca-key.pem
1301 --template ca.info \
1302 --outfile ca-cert.pem
1303@end example
1304
1305The @code{ca} keyword in the template sets the v3 basic constraints extension
1306to indicate this certificate is for a CA, while @code{cert_signing_key} sets
1307the key usage extension to indicate this will be used for signing other keys.
1308The generated @code{ca-cert.pem} file should be copied to all servers and
1309clients wishing to utilize TLS support in the VNC server. The @code{ca-key.pem}
1310must not be disclosed/copied anywhere except the host responsible for issuing
1311certificates.
1312
1313@node tls_generate_server
1314@subsection Issuing server certificates
1315
1316Each server (or host) needs to be issued with a key and certificate. When connecting
1317the certificate is sent to the client which validates it against the CA certificate.
1318The core pieces of information for a server certificate are the hostnames and/or IP
1319addresses that will be used by clients when connecting. The hostname / IP address
1320that the client specifies when connecting will be validated against the hostname(s)
1321and IP address(es) recorded in the server certificate, and if no match is found
1322the client will close the connection.
1323
1324Thus it is recommended that the server certificate include both the fully qualified
1325and unqualified hostnames. If the server will have permanently assigned IP address(es),
1326and clients are likely to use them when connecting, they may also be included in the
1327certificate. Both IPv4 and IPv6 addresses are supported. Historically certificates
1328only included 1 hostname in the @code{CN} field, however, usage of this field for
1329validation is now deprecated. Instead modern TLS clients will validate against the
1330Subject Alt Name extension data, which allows for multiple entries. In the future
1331usage of the @code{CN} field may be discontinued entirely, so providing SAN
1332extension data is strongly recommended.
1333
1334On the host holding the CA, create template files containing the information
1335for each server, and use it to issue server certificates.
1336
1337@example
1338# cat > server-hostNNN.info <<EOF
1339organization = Name of your organization
1340cn = hostNNN.foo.example.com
1341dns_name = hostNNN
1342dns_name = hostNNN.foo.example.com
1343ip_address = 10.0.1.87
1344ip_address = 192.8.0.92
1345ip_address = 2620:0:cafe::87
1346ip_address = 2001:24::92
1347tls_www_server
1348encryption_key
1349signing_key
1350EOF
1351# certtool --generate-privkey > server-hostNNN-key.pem
1352# certtool --generate-certificate \
1353 --load-ca-certificate ca-cert.pem \
1354 --load-ca-privkey ca-key.pem \
1355 --load-privkey server-hostNNN-key.pem \
1356 --template server-hostNNN.info \
1357 --outfile server-hostNNN-cert.pem
1358@end example
1359
1360The @code{dns_name} and @code{ip_address} fields in the template are setting
1361the subject alt name extension data. The @code{tls_www_server} keyword is the
1362key purpose extension to indicate this certificate is intended for usage in
1363a web server. Although QEMU network services are not in fact HTTP servers
1364(except for VNC websockets), setting this key purpose is still recommended.
1365The @code{encryption_key} and @code{signing_key} keyword is the key usage
1366extension to indicate this certificate is intended for usage in the data
1367session.
1368
1369The @code{server-hostNNN-key.pem} and @code{server-hostNNN-cert.pem} files
1370should now be securely copied to the server for which they were generated,
1371and renamed to @code{server-key.pem} and @code{server-cert.pem} when added
1372to the @code{/etc/pki/qemu} directory on the target host. The @code{server-key.pem}
1373file is security sensitive and should be kept protected with file mode 0600
1374to prevent disclosure.
1375
1376@node tls_generate_client
1377@subsection Issuing client certificates
1378
1379The QEMU x509 TLS credential setup defaults to enabling client verification
1380using certificates, providing a simple authentication mechanism. If this
1381default is used, each client also needs to be issued a certificate. The client
1382certificate contains enough metadata to uniquely identify the client with the
1383scope of the certificate authority. The client certificate would typically
1384include fields for organization, state, city, building, etc.
1385
1386Once again on the host holding the CA, create template files containing the
1387information for each client, and use it to issue client certificates.
1388
1389
1390@example
1391# cat > client-hostNNN.info <<EOF
1392country = GB
1393state = London
1394locality = City Of London
1395organization = Name of your organization
1396cn = hostNNN.foo.example.com
1397tls_www_client
1398encryption_key
1399signing_key
1400EOF
1401# certtool --generate-privkey > client-hostNNN-key.pem
1402# certtool --generate-certificate \
1403 --load-ca-certificate ca-cert.pem \
1404 --load-ca-privkey ca-key.pem \
1405 --load-privkey client-hostNNN-key.pem \
1406 --template client-hostNNN.info \
1407 --outfile client-hostNNN-cert.pem
1408@end example
1409
1410The subject alt name extension data is not required for clients, so the
1411the @code{dns_name} and @code{ip_address} fields are not included.
1412The @code{tls_www_client} keyword is the key purpose extension to indicate
1413this certificate is intended for usage in a web client. Although QEMU
1414network clients are not in fact HTTP clients, setting this key purpose is
1415still recommended. The @code{encryption_key} and @code{signing_key} keyword
1416is the key usage extension to indicate this certificate is intended for
1417usage in the data session.
1418
1419The @code{client-hostNNN-key.pem} and @code{client-hostNNN-cert.pem} files
1420should now be securely copied to the client for which they were generated,
1421and renamed to @code{client-key.pem} and @code{client-cert.pem} when added
1422to the @code{/etc/pki/qemu} directory on the target host. The @code{client-key.pem}
1423file is security sensitive and should be kept protected with file mode 0600
1424to prevent disclosure.
1425
1426If a single host is going to be using TLS in both a client and server
1427role, it is possible to create a single certificate to cover both roles.
1428This would be quite common for the migration and NBD services, where a
1429QEMU process will be started by accepting a TLS protected incoming migration,
1430and later itself be migrated out to another host. To generate a single
1431certificate, simply include the template data from both the client and server
1432instructions in one.
1433
1434@example
1435# cat > both-hostNNN.info <<EOF
1436country = GB
1437state = London
1438locality = City Of London
1439organization = Name of your organization
1440cn = hostNNN.foo.example.com
1441dns_name = hostNNN
1442dns_name = hostNNN.foo.example.com
1443ip_address = 10.0.1.87
1444ip_address = 192.8.0.92
1445ip_address = 2620:0:cafe::87
1446ip_address = 2001:24::92
1447tls_www_server
1448tls_www_client
1449encryption_key
1450signing_key
1451EOF
1452# certtool --generate-privkey > both-hostNNN-key.pem
1453# certtool --generate-certificate \
1454 --load-ca-certificate ca-cert.pem \
1455 --load-ca-privkey ca-key.pem \
1456 --load-privkey both-hostNNN-key.pem \
1457 --template both-hostNNN.info \
1458 --outfile both-hostNNN-cert.pem
1459@end example
1460
1461When copying the PEM files to the target host, save them twice,
1462once as @code{server-cert.pem} and @code{server-key.pem}, and
1463again as @code{client-cert.pem} and @code{client-key.pem}.
1464
1465@node tls_creds_setup
1466@subsection TLS x509 credential configuration
1467
1468QEMU has a standard mechanism for loading x509 credentials that will be
1469used for network services and clients. It requires specifying the
1470@code{tls-creds-x509} class name to the @code{--object} command line
1471argument for the system emulators. Each set of credentials loaded should
1472be given a unique string identifier via the @code{id} parameter. A single
1473set of TLS credentials can be used for multiple network backends, so VNC,
1474migration, NBD, character devices can all share the same credentials. Note,
1475however, that credentials for use in a client endpoint must be loaded
1476separately from those used in a server endpoint.
1477
1478When specifying the object, the @code{dir} parameters specifies which
1479directory contains the credential files. This directory is expected to
1480contain files with the names mentioned previously, @code{ca-cert.pem},
1481@code{server-key.pem}, @code{server-cert.pem}, @code{client-key.pem}
1482and @code{client-cert.pem} as appropriate. It is also possible to
1483include a set of pre-generated Diffie-Hellman (DH) parameters in a file
1484@code{dh-params.pem}, which can be created using the
1485@code{certtool --generate-dh-params} command. If omitted, QEMU will
1486dynamically generate DH parameters when loading the credentials.
1487
1488The @code{endpoint} parameter indicates whether the credentials will
1489be used for a network client or server, and determines which PEM
1490files are loaded.
1491
1492The @code{verify} parameter determines whether x509 certificate
1493validation should be performed. This defaults to enabled, meaning
1494clients will always validate the server hostname against the
1495certificate subject alt name fields and/or CN field. It also
1496means that servers will request that clients provide a certificate
1497and validate them. Verification should never be turned off for
1498client endpoints, however, it may be turned off for server endpoints
1499if an alternative mechanism is used to authenticate clients. For
1500example, the VNC server can use SASL to authenticate clients
1501instead.
1502
1503To load server credentials with client certificate validation
1504enabled
1505
1506@example
Thomas Huth664785a2019-07-30 17:08:26 +02001507@value{qemu_system} -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001508@end example
1509
1510while to load client credentials use
1511
1512@example
Thomas Huth664785a2019-07-30 17:08:26 +02001513@value{qemu_system} -object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=client
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001514@end example
1515
1516Network services which support TLS will all have a @code{tls-creds}
1517parameter which expects the ID of the TLS credentials object. For
1518example with VNC:
1519
1520@example
Thomas Huth664785a2019-07-30 17:08:26 +02001521@value{qemu_system} -vnc 0.0.0.0:0,tls-creds=tls0
Daniel P. Berrange5d19a6e2017-12-08 11:28:55 +00001522@end example
1523
Richard W.M. Jonese1a6dc92018-07-03 09:03:03 +01001524@node tls_psk
1525@subsection TLS Pre-Shared Keys (PSK)
1526
1527Instead of using certificates, you may also use TLS Pre-Shared Keys
1528(TLS-PSK). This can be simpler to set up than certificates but is
1529less scalable.
1530
1531Use the GnuTLS @code{psktool} program to generate a @code{keys.psk}
1532file containing one or more usernames and random keys:
1533
1534@example
1535mkdir -m 0700 /tmp/keys
1536psktool -u rich -p /tmp/keys/keys.psk
1537@end example
1538
1539TLS-enabled servers such as qemu-nbd can use this directory like so:
1540
1541@example
1542qemu-nbd \
1543 -t -x / \
1544 --object tls-creds-psk,id=tls0,endpoint=server,dir=/tmp/keys \
1545 --tls-creds tls0 \
1546 image.qcow2
1547@end example
1548
1549When connecting from a qemu-based client you must specify the
1550directory containing @code{keys.psk} and an optional @var{username}
1551(defaults to ``qemu''):
1552
1553@example
1554qemu-img info \
1555 --object tls-creds-psk,id=tls0,dir=/tmp/keys,username=rich,endpoint=client \
1556 --image-opts \
1557 file.driver=nbd,file.host=localhost,file.port=10809,file.tls-creds=tls0,file.export=/
1558@end example
1559
bellard0806e3f2003-10-01 00:15:32 +00001560@node gdb_usage
bellardda415d52003-06-27 18:50:50 +00001561@section GDB usage
1562
1563QEMU has a primitive support to work with gdb, so that you can do
bellard0806e3f2003-10-01 00:15:32 +00001564'Ctrl-C' while the virtual machine is running and inspect its state.
bellardda415d52003-06-27 18:50:50 +00001565
Stefan Weilb65ee4f2012-05-11 22:25:50 +02001566In order to use gdb, launch QEMU with the '-s' option. It will wait for a
bellardda415d52003-06-27 18:50:50 +00001567gdb connection:
1568@example
Thomas Huth664785a2019-07-30 17:08:26 +02001569@value{qemu_system} -s -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
bellardda415d52003-06-27 18:50:50 +00001570Connected to host network interface: tun0
1571Waiting gdb connection on port 1234
1572@end example
1573
1574Then launch gdb on the 'vmlinux' executable:
1575@example
1576> gdb vmlinux
1577@end example
1578
1579In gdb, connect to QEMU:
1580@example
bellard6c9bf892004-01-24 13:46:56 +00001581(gdb) target remote localhost:1234
bellardda415d52003-06-27 18:50:50 +00001582@end example
1583
1584Then you can use gdb normally. For example, type 'c' to launch the kernel:
1585@example
1586(gdb) c
1587@end example
1588
bellard0806e3f2003-10-01 00:15:32 +00001589Here are some useful tips in order to use gdb on system code:
1590
1591@enumerate
1592@item
1593Use @code{info reg} to display all the CPU registers.
1594@item
1595Use @code{x/10i $eip} to display the code at the PC position.
1596@item
1597Use @code{set architecture i8086} to dump 16 bit code. Then use
bellard294e8632006-05-06 14:23:06 +00001598@code{x/10i $cs*16+$eip} to dump the code at the PC position.
bellard0806e3f2003-10-01 00:15:32 +00001599@end enumerate
1600
edgar_igl60897d32008-05-09 08:25:14 +00001601Advanced debugging options:
1602
Daniel P. Berrangeb6af0972015-08-26 12:17:13 +01001603The default single stepping behavior is step with the IRQs and timer service routines off. It is set this way because when gdb executes a single step it expects to advance beyond the current instruction. With the IRQs and timer service routines on, a single step might jump into the one of the interrupt or exception vectors instead of executing the current instruction. This means you may hit the same breakpoint a number of times before executing the instruction gdb wants to have executed. Because there are rare circumstances where you want to single step into an interrupt vector the behavior can be controlled from GDB. There are three commands you can query and set the single step behavior:
edgar_igl94d45e42008-05-10 19:37:44 +00001604@table @code
edgar_igl60897d32008-05-09 08:25:14 +00001605@item maintenance packet qqemu.sstepbits
1606
1607This will display the MASK bits used to control the single stepping IE:
1608@example
1609(gdb) maintenance packet qqemu.sstepbits
1610sending: "qqemu.sstepbits"
1611received: "ENABLE=1,NOIRQ=2,NOTIMER=4"
1612@end example
1613@item maintenance packet qqemu.sstep
1614
1615This will display the current value of the mask used when single stepping IE:
1616@example
1617(gdb) maintenance packet qqemu.sstep
1618sending: "qqemu.sstep"
1619received: "0x7"
1620@end example
1621@item maintenance packet Qqemu.sstep=HEX_VALUE
1622
1623This will change the single step mask, so if wanted to enable IRQs on the single step, but not timers, you would use:
1624@example
1625(gdb) maintenance packet Qqemu.sstep=0x5
1626sending: "qemu.sstep=0x5"
1627received: "OK"
1628@end example
edgar_igl94d45e42008-05-10 19:37:44 +00001629@end table
edgar_igl60897d32008-05-09 08:25:14 +00001630
bellarddebc7062006-04-30 21:58:41 +00001631@node pcsys_os_specific
bellard1a084f32004-05-13 22:34:49 +00001632@section Target OS specific information
1633
1634@subsection Linux
1635
bellard15a34c62004-07-08 21:26:26 +00001636To have access to SVGA graphic modes under X11, use the @code{vesa} or
1637the @code{cirrus} X11 driver. For optimal performances, use 16 bit
1638color depth in the guest and the host OS.
bellard1a084f32004-05-13 22:34:49 +00001639
bellarde3371e62004-07-10 16:26:02 +00001640When using a 2.6 guest Linux kernel, you should add the option
1641@code{clock=pit} on the kernel command line because the 2.6 Linux
1642kernels make very strict real time clock checks by default that QEMU
1643cannot simulate exactly.
1644
bellard7c3fc842005-02-10 21:46:47 +00001645When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is
1646not activated because QEMU is slower with this patch. The QEMU
1647Accelerator Module is also much slower in this case. Earlier Fedora
ths4be456f2007-06-03 13:41:28 +00001648Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate this
bellard7c3fc842005-02-10 21:46:47 +00001649patch by default. Newer kernels don't have it.
1650
bellard1a084f32004-05-13 22:34:49 +00001651@subsection Windows
1652
1653If you have a slow host, using Windows 95 is better as it gives the
1654best speed. Windows 2000 is also a good choice.
1655
bellarde3371e62004-07-10 16:26:02 +00001656@subsubsection SVGA graphic modes support
1657
1658QEMU emulates a Cirrus Logic GD5446 Video
bellard15a34c62004-07-08 21:26:26 +00001659card. All Windows versions starting from Windows 95 should recognize
1660and use this graphic card. For optimal performances, use 16 bit color
1661depth in the guest and the host OS.
bellard1a084f32004-05-13 22:34:49 +00001662
bellard3cb08532006-06-21 21:19:50 +00001663If you are using Windows XP as guest OS and if you want to use high
1664resolution modes which the Cirrus Logic BIOS does not support (i.e. >=
16651280x1024x16), then you should use the VESA VBE virtual graphic card
1666(option @option{-std-vga}).
1667
bellarde3371e62004-07-10 16:26:02 +00001668@subsubsection CPU usage reduction
1669
1670Windows 9x does not correctly use the CPU HLT
bellard15a34c62004-07-08 21:26:26 +00001671instruction. The result is that it takes host CPU cycles even when
1672idle. You can install the utility from
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +00001673@url{https://web.archive.org/web/20060212132151/http://www.user.cityline.ru/~maxamn/amnhltm.zip}
Thomas Huth3ba34a72017-03-08 13:13:25 +01001674to solve this problem. Note that no such tool is needed for NT, 2000 or XP.
bellard1a084f32004-05-13 22:34:49 +00001675
bellard9d0a8e62005-07-03 17:34:05 +00001676@subsubsection Windows 2000 disk full problem
bellarde3371e62004-07-10 16:26:02 +00001677
bellard9d0a8e62005-07-03 17:34:05 +00001678Windows 2000 has a bug which gives a disk full problem during its
1679installation. When installing it, use the @option{-win2k-hack} QEMU
1680option to enable a specific workaround. After Windows 2000 is
1681installed, you no longer need this option (this option slows down the
1682IDE transfers).
bellarde3371e62004-07-10 16:26:02 +00001683
bellard6cc721c2005-07-28 22:27:28 +00001684@subsubsection Windows 2000 shutdown
1685
1686Windows 2000 cannot automatically shutdown in QEMU although Windows 98
1687can. It comes from the fact that Windows 2000 does not automatically
1688use the APM driver provided by the BIOS.
1689
1690In order to correct that, do the following (thanks to Struan
1691Bartlett): go to the Control Panel => Add/Remove Hardware & Next =>
1692Add/Troubleshoot a device => Add a new device & Next => No, select the
1693hardware from a list & Next => NT Apm/Legacy Support & Next => Next
1694(again) a few times. Now the driver is installed and Windows 2000 now
ths5fafdf22007-09-16 21:08:06 +00001695correctly instructs QEMU to shutdown at the appropriate moment.
bellard6cc721c2005-07-28 22:27:28 +00001696
1697@subsubsection Share a directory between Unix and Windows
1698
Thomas Huthc8c6afa2016-01-13 09:21:02 +01001699See @ref{sec_invocation} about the help of the option
1700@option{'-netdev user,smb=...'}.
bellard6cc721c2005-07-28 22:27:28 +00001701
bellard2192c332006-08-21 20:28:18 +00001702@subsubsection Windows XP security problem
bellarde3371e62004-07-10 16:26:02 +00001703
1704Some releases of Windows XP install correctly but give a security
1705error when booting:
1706@example
1707A problem is preventing Windows from accurately checking the
1708license for this computer. Error code: 0x800703e6.
1709@end example
bellarde3371e62004-07-10 16:26:02 +00001710
bellard2192c332006-08-21 20:28:18 +00001711The workaround is to install a service pack for XP after a boot in safe
1712mode. Then reboot, and the problem should go away. Since there is no
1713network while in safe mode, its recommended to download the full
1714installation of SP1 or SP2 and transfer that via an ISO or using the
1715vvfat block device ("-hdb fat:directory_which_holds_the_SP").
bellarde3371e62004-07-10 16:26:02 +00001716
bellarda0a821a2004-07-14 17:38:57 +00001717@subsection MS-DOS and FreeDOS
1718
1719@subsubsection CPU usage reduction
1720
1721DOS does not correctly use the CPU HLT instruction. The result is that
Thomas Huth3ba34a72017-03-08 13:13:25 +01001722it takes host CPU cycles even when idle. You can install the utility from
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +00001723@url{https://web.archive.org/web/20051222085335/http://www.vmware.com/software/dosidle210.zip}
Thomas Huth3ba34a72017-03-08 13:13:25 +01001724to solve this problem.
bellarda0a821a2004-07-14 17:38:57 +00001725
bellarddebc7062006-04-30 21:58:41 +00001726@node QEMU System emulator for non PC targets
bellard3f9f3aa2005-12-18 20:11:37 +00001727@chapter QEMU System emulator for non PC targets
1728
1729QEMU is a generic emulator and it emulates many non PC
1730machines. Most of the options are similar to the PC emulator. The
ths4be456f2007-06-03 13:41:28 +00001731differences are mentioned in the following sections.
bellard3f9f3aa2005-12-18 20:11:37 +00001732
bellarddebc7062006-04-30 21:58:41 +00001733@menu
Stefan Weil7544a042010-02-05 23:52:03 +01001734* PowerPC System emulator::
ths24d4de42007-07-11 10:24:28 +00001735* Sparc32 System emulator::
1736* Sparc64 System emulator::
1737* MIPS System emulator::
1738* ARM System emulator::
1739* ColdFire System emulator::
Stefan Weil7544a042010-02-05 23:52:03 +01001740* Cris System emulator::
1741* Microblaze System emulator::
1742* SH4 System emulator::
Max Filippov3aeaea62011-10-10 14:48:23 +04001743* Xtensa System emulator::
bellarddebc7062006-04-30 21:58:41 +00001744@end menu
1745
Stefan Weil7544a042010-02-05 23:52:03 +01001746@node PowerPC System emulator
1747@section PowerPC System emulator
1748@cindex system emulation (PowerPC)
bellard52c00a52004-04-25 21:27:03 +00001749
1750Use the executable @file{qemu-system-ppc} to simulate a complete PREP
bellard15a34c62004-07-08 21:26:26 +00001751or PowerMac PowerPC system.
1752
bellardb671f9e2005-04-30 15:08:33 +00001753QEMU emulates the following PowerMac peripherals:
bellard15a34c62004-07-08 21:26:26 +00001754
1755@itemize @minus
ths5fafdf22007-09-16 21:08:06 +00001756@item
blueswir1006f3a42009-02-08 15:59:36 +00001757UniNorth or Grackle PCI Bridge
bellard15a34c62004-07-08 21:26:26 +00001758@item
1759PCI VGA compatible card with VESA Bochs Extensions
ths5fafdf22007-09-16 21:08:06 +00001760@item
bellard15a34c62004-07-08 21:26:26 +000017612 PMAC IDE interfaces with hard disk and CD-ROM support
ths5fafdf22007-09-16 21:08:06 +00001762@item
bellard15a34c62004-07-08 21:26:26 +00001763NE2000 PCI adapters
1764@item
1765Non Volatile RAM
1766@item
1767VIA-CUDA with ADB keyboard and mouse.
1768@end itemize
bellard52c00a52004-04-25 21:27:03 +00001769
bellardb671f9e2005-04-30 15:08:33 +00001770QEMU emulates the following PREP peripherals:
bellard52c00a52004-04-25 21:27:03 +00001771
1772@itemize @minus
ths5fafdf22007-09-16 21:08:06 +00001773@item
bellard15a34c62004-07-08 21:26:26 +00001774PCI Bridge
1775@item
1776PCI VGA compatible card with VESA Bochs Extensions
ths5fafdf22007-09-16 21:08:06 +00001777@item
bellard52c00a52004-04-25 21:27:03 +000017782 IDE interfaces with hard disk and CD-ROM support
1779@item
1780Floppy disk
ths5fafdf22007-09-16 21:08:06 +00001781@item
bellard15a34c62004-07-08 21:26:26 +00001782NE2000 network adapters
bellard52c00a52004-04-25 21:27:03 +00001783@item
1784Serial port
1785@item
1786PREP Non Volatile RAM
bellard15a34c62004-07-08 21:26:26 +00001787@item
1788PC compatible keyboard and mouse.
bellard52c00a52004-04-25 21:27:03 +00001789@end itemize
1790
bellard15a34c62004-07-08 21:26:26 +00001791QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at
bellard3f9f3aa2005-12-18 20:11:37 +00001792@url{http://perso.magic.fr/l_indien/OpenHackWare/index.htm}.
bellard52c00a52004-04-25 21:27:03 +00001793
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +00001794Since version 0.9.1, QEMU uses OpenBIOS @url{https://www.openbios.org/}
blueswir1006f3a42009-02-08 15:59:36 +00001795for the g3beige and mac99 PowerMac machines. OpenBIOS is a free (GPL
1796v2) portable firmware implementation. The goal is to implement a 100%
1797IEEE 1275-1994 (referred to as Open Firmware) compliant firmware.
blueswir1992e5ac2008-12-24 20:23:51 +00001798
bellard15a34c62004-07-08 21:26:26 +00001799@c man begin OPTIONS
1800
1801The following options are specific to the PowerPC emulation:
1802
1803@table @option
1804
Kevin Wolf4e257e52009-10-09 10:58:36 +02001805@item -g @var{W}x@var{H}[x@var{DEPTH}]
bellard15a34c62004-07-08 21:26:26 +00001806
Mark Cave-Ayland340fb412014-03-17 21:46:26 +00001807Set the initial VGA graphic mode. The default is 800x600x32.
bellard15a34c62004-07-08 21:26:26 +00001808
Kevin Wolf4e257e52009-10-09 10:58:36 +02001809@item -prom-env @var{string}
blueswir195efd112008-12-24 20:26:14 +00001810
1811Set OpenBIOS variables in NVRAM, for example:
1812
1813@example
1814qemu-system-ppc -prom-env 'auto-boot?=false' \
1815 -prom-env 'boot-device=hd:2,\yaboot' \
1816 -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
1817@end example
1818
1819These variables are not used by Open Hack'Ware.
1820
bellard15a34c62004-07-08 21:26:26 +00001821@end table
1822
ths5fafdf22007-09-16 21:08:06 +00001823@c man end
bellard15a34c62004-07-08 21:26:26 +00001824
1825
bellard52c00a52004-04-25 21:27:03 +00001826More information is available at
bellard3f9f3aa2005-12-18 20:11:37 +00001827@url{http://perso.magic.fr/l_indien/qemu-ppc/}.
bellard52c00a52004-04-25 21:27:03 +00001828
ths24d4de42007-07-11 10:24:28 +00001829@node Sparc32 System emulator
1830@section Sparc32 System emulator
Stefan Weil7544a042010-02-05 23:52:03 +01001831@cindex system emulation (Sparc32)
bellarde80cfcf2004-12-19 23:18:01 +00001832
blueswir134a3d232008-10-04 20:43:39 +00001833Use the executable @file{qemu-system-sparc} to simulate the following
1834Sun4m architecture machines:
1835@itemize @minus
1836@item
1837SPARCstation 4
1838@item
1839SPARCstation 5
1840@item
1841SPARCstation 10
1842@item
1843SPARCstation 20
1844@item
1845SPARCserver 600MP
1846@item
1847SPARCstation LX
1848@item
1849SPARCstation Voyager
1850@item
1851SPARCclassic
1852@item
1853SPARCbook
1854@end itemize
bellarde80cfcf2004-12-19 23:18:01 +00001855
blueswir134a3d232008-10-04 20:43:39 +00001856The emulation is somewhat complete. SMP up to 16 CPUs is supported,
1857but Linux limits the number of usable CPUs to 4.
1858
Blue Swirl6a4e1772013-04-14 18:10:28 +00001859QEMU emulates the following sun4m peripherals:
bellarde80cfcf2004-12-19 23:18:01 +00001860
1861@itemize @minus
bellard34751872005-07-02 14:31:34 +00001862@item
Blue Swirl6a4e1772013-04-14 18:10:28 +00001863IOMMU
bellarde80cfcf2004-12-19 23:18:01 +00001864@item
Mark Cave-Ayland33632782014-03-17 21:46:25 +00001865TCX or cgthree Frame buffer
ths5fafdf22007-09-16 21:08:06 +00001866@item
bellarde80cfcf2004-12-19 23:18:01 +00001867Lance (Am7990) Ethernet
1868@item
blueswir134a3d232008-10-04 20:43:39 +00001869Non Volatile RAM M48T02/M48T08
bellarde80cfcf2004-12-19 23:18:01 +00001870@item
bellard34751872005-07-02 14:31:34 +00001871Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard
1872and power/reset logic
1873@item
1874ESP SCSI controller with hard disk and CD-ROM support
1875@item
blueswir16a3b9cc2007-11-11 17:56:38 +00001876Floppy drive (not on SS-600MP)
blueswir1a2502b52007-06-10 17:01:00 +00001877@item
1878CS4231 sound device (only on SS-5, not working yet)
bellarde80cfcf2004-12-19 23:18:01 +00001879@end itemize
1880
blueswir16a3b9cc2007-11-11 17:56:38 +00001881The number of peripherals is fixed in the architecture. Maximum
1882memory size depends on the machine type, for SS-5 it is 256MB and for
blueswir17d858922007-12-28 20:57:43 +00001883others 2047MB.
bellarde80cfcf2004-12-19 23:18:01 +00001884
bellard30a604f2006-06-14 18:35:18 +00001885Since version 0.8.2, QEMU uses OpenBIOS
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +00001886@url{https://www.openbios.org/}. OpenBIOS is a free (GPL v2) portable
bellard0986ac32006-06-14 12:36:32 +00001887firmware implementation. The goal is to implement a 100% IEEE
18881275-1994 (referred to as Open Firmware) compliant firmware.
bellard34751872005-07-02 14:31:34 +00001889
1890A sample Linux 2.6 series kernel and ram disk image are available on
blueswir134a3d232008-10-04 20:43:39 +00001891the QEMU web site. There are still issues with NetBSD and OpenBSD, but
Mark Cave-Ayland9bb9f212015-03-02 22:23:27 +00001892most kernel versions work. Please note that currently older Solaris kernels
blueswir134a3d232008-10-04 20:43:39 +00001893don't work probably due to interface issues between OpenBIOS and
1894Solaris.
bellard34751872005-07-02 14:31:34 +00001895
1896@c man begin OPTIONS
1897
blueswir1a2502b52007-06-10 17:01:00 +00001898The following options are specific to the Sparc32 emulation:
bellard34751872005-07-02 14:31:34 +00001899
1900@table @option
1901
Kevin Wolf4e257e52009-10-09 10:58:36 +02001902@item -g @var{W}x@var{H}x[x@var{DEPTH}]
bellard34751872005-07-02 14:31:34 +00001903
Mark Cave-Ayland33632782014-03-17 21:46:25 +00001904Set the initial graphics mode. For TCX, the default is 1024x768x8 with the
1905option of 1024x768x24. For cgthree, the default is 1024x768x8 with the option
1906of 1152x900x8 for people who wish to use OBP.
bellard34751872005-07-02 14:31:34 +00001907
Kevin Wolf4e257e52009-10-09 10:58:36 +02001908@item -prom-env @var{string}
blueswir166508602007-05-01 14:16:52 +00001909
1910Set OpenBIOS variables in NVRAM, for example:
1911
1912@example
1913qemu-system-sparc -prom-env 'auto-boot?=false' \
1914 -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
1915@end example
1916
Blue Swirl6a4e1772013-04-14 18:10:28 +00001917@item -M [SS-4|SS-5|SS-10|SS-20|SS-600MP|LX|Voyager|SPARCClassic] [|SPARCbook]
blueswir1a2502b52007-06-10 17:01:00 +00001918
1919Set the emulated machine type. Default is SS-5.
1920
bellard34751872005-07-02 14:31:34 +00001921@end table
1922
ths5fafdf22007-09-16 21:08:06 +00001923@c man end
bellard34751872005-07-02 14:31:34 +00001924
ths24d4de42007-07-11 10:24:28 +00001925@node Sparc64 System emulator
1926@section Sparc64 System emulator
Stefan Weil7544a042010-02-05 23:52:03 +01001927@cindex system emulation (Sparc64)
bellard34751872005-07-02 14:31:34 +00001928
blueswir134a3d232008-10-04 20:43:39 +00001929Use the executable @file{qemu-system-sparc64} to simulate a Sun4u
1930(UltraSPARC PC-like machine), Sun4v (T1 PC-like machine), or generic
Mark Cave-Ayland9bb9f212015-03-02 22:23:27 +00001931Niagara (T1) machine. The Sun4u emulator is mostly complete, being
1932able to run Linux, NetBSD and OpenBSD in headless (-nographic) mode. The
Artyom Tarasenkoa2664ca2016-09-29 14:46:45 +02001933Sun4v emulator is still a work in progress.
1934
1935The Niagara T1 emulator makes use of firmware and OS binaries supplied in the S10image/ directory
1936of the OpenSPARC T1 project @url{http://download.oracle.com/technetwork/systems/opensparc/OpenSPARCT1_Arch.1.5.tar.bz2}
1937and is able to boot the disk.s10hw2 Solaris image.
1938@example
1939qemu-system-sparc64 -M niagara -L /path-to/S10image/ \
1940 -nographic -m 256 \
1941 -drive if=pflash,readonly=on,file=/S10image/disk.s10hw2
1942@end example
1943
bellardb7569212005-03-13 09:43:05 +00001944
blueswir1c7ba2182008-07-22 07:07:34 +00001945QEMU emulates the following peripherals:
bellard83469012005-07-23 14:27:54 +00001946
1947@itemize @minus
1948@item
ths5fafdf22007-09-16 21:08:06 +00001949UltraSparc IIi APB PCI Bridge
bellard83469012005-07-23 14:27:54 +00001950@item
1951PCI VGA compatible card with VESA Bochs Extensions
1952@item
blueswir134a3d232008-10-04 20:43:39 +00001953PS/2 mouse and keyboard
1954@item
bellard83469012005-07-23 14:27:54 +00001955Non Volatile RAM M48T59
1956@item
1957PC-compatible serial ports
blueswir1c7ba2182008-07-22 07:07:34 +00001958@item
19592 PCI IDE interfaces with hard disk and CD-ROM support
blueswir134a3d232008-10-04 20:43:39 +00001960@item
1961Floppy disk
bellard83469012005-07-23 14:27:54 +00001962@end itemize
1963
blueswir1c7ba2182008-07-22 07:07:34 +00001964@c man begin OPTIONS
1965
1966The following options are specific to the Sparc64 emulation:
1967
1968@table @option
1969
Kevin Wolf4e257e52009-10-09 10:58:36 +02001970@item -prom-env @var{string}
blueswir134a3d232008-10-04 20:43:39 +00001971
1972Set OpenBIOS variables in NVRAM, for example:
1973
1974@example
1975qemu-system-sparc64 -prom-env 'auto-boot?=false'
1976@end example
1977
Artyom Tarasenkoa2664ca2016-09-29 14:46:45 +02001978@item -M [sun4u|sun4v|niagara]
blueswir1c7ba2182008-07-22 07:07:34 +00001979
1980Set the emulated machine type. The default is sun4u.
1981
1982@end table
1983
1984@c man end
1985
ths24d4de42007-07-11 10:24:28 +00001986@node MIPS System emulator
1987@section MIPS System emulator
Stefan Weil7544a042010-02-05 23:52:03 +01001988@cindex system emulation (MIPS)
bellard9d0a8e62005-07-03 17:34:05 +00001989
Stefan Markovicf7d257c2019-01-24 16:53:55 +01001990@menu
1991* nanoMIPS System emulator ::
1992@end menu
1993
thsd9aedc32007-12-17 03:47:55 +00001994Four executables cover simulation of 32 and 64-bit MIPS systems in
1995both endian options, @file{qemu-system-mips}, @file{qemu-system-mipsel}
1996@file{qemu-system-mips64} and @file{qemu-system-mips64el}.
aurel3288cb0a02008-04-08 05:57:37 +00001997Five different machine types are emulated:
ths24d4de42007-07-11 10:24:28 +00001998
1999@itemize @minus
2000@item
2001A generic ISA PC-like machine "mips"
2002@item
2003The MIPS Malta prototype board "malta"
2004@item
thsd9aedc32007-12-17 03:47:55 +00002005An ACER Pica "pica61". This machine needs the 64-bit emulator.
ths6bf5b4e2007-10-17 13:08:32 +00002006@item
thsf0fc6f82007-10-17 13:39:42 +00002007MIPS emulator pseudo board "mipssim"
aurel3288cb0a02008-04-08 05:57:37 +00002008@item
2009A MIPS Magnum R4000 machine "magnum". This machine needs the 64-bit emulator.
ths24d4de42007-07-11 10:24:28 +00002010@end itemize
2011
2012The generic emulation is supported by Debian 'Etch' and is able to
2013install Debian into a virtual disk image. The following devices are
2014emulated:
bellard9d0a8e62005-07-03 17:34:05 +00002015
bellard3f9f3aa2005-12-18 20:11:37 +00002016@itemize @minus
ths5fafdf22007-09-16 21:08:06 +00002017@item
ths6bf5b4e2007-10-17 13:08:32 +00002018A range of MIPS CPUs, default is the 24Kf
bellard3f9f3aa2005-12-18 20:11:37 +00002019@item
2020PC style serial port
2021@item
ths24d4de42007-07-11 10:24:28 +00002022PC style IDE disk
2023@item
bellard3f9f3aa2005-12-18 20:11:37 +00002024NE2000 network card
2025@end itemize
2026
ths24d4de42007-07-11 10:24:28 +00002027The Malta emulation supports the following devices:
bellard3f9f3aa2005-12-18 20:11:37 +00002028
ths24d4de42007-07-11 10:24:28 +00002029@itemize @minus
2030@item
ths0b64d002007-07-11 21:43:14 +00002031Core board with MIPS 24Kf CPU and Galileo system controller
ths24d4de42007-07-11 10:24:28 +00002032@item
2033PIIX4 PCI/USB/SMbus controller
2034@item
2035The Multi-I/O chip's serial device
2036@item
Stefan Weil3a2eeac2009-06-06 18:05:58 +02002037PCI network cards (PCnet32 and others)
ths24d4de42007-07-11 10:24:28 +00002038@item
2039Malta FPGA serial device
2040@item
aurel321f605a72009-02-08 14:51:19 +00002041Cirrus (default) or any other PCI VGA graphics card
ths24d4de42007-07-11 10:24:28 +00002042@end itemize
2043
Aleksandar Markovicba182a12019-02-26 13:55:31 +01002044The Boston board emulation supports the following devices:
2045
2046@itemize @minus
2047@item
2048Xilinx FPGA, which includes a PCIe root port and an UART
2049@item
2050Intel EG20T PCH connects the I/O peripherals, but only the SATA bus is emulated
2051@end itemize
2052
ths24d4de42007-07-11 10:24:28 +00002053The ACER Pica emulation supports:
2054
2055@itemize @minus
2056@item
2057MIPS R4000 CPU
2058@item
2059PC-style IRQ and DMA controllers
2060@item
2061PC Keyboard
2062@item
2063IDE controller
2064@end itemize
2065
aurel3288cb0a02008-04-08 05:57:37 +00002066The MIPS Magnum R4000 emulation supports:
2067
2068@itemize @minus
2069@item
2070MIPS R4000 CPU
2071@item
2072PC-style IRQ controller
2073@item
2074PC Keyboard
2075@item
2076SCSI controller
2077@item
2078G364 framebuffer
2079@end itemize
2080
Aleksandar Markovic3a1b94d2019-02-26 13:55:30 +01002081The Fulong 2E emulation supports:
2082
2083@itemize @minus
2084@item
2085Loongson 2E CPU
2086@item
2087Bonito64 system controller as North Bridge
2088@item
2089VT82C686 chipset as South Bridge
2090@item
2091RTL8139D as a network card chipset
2092@end itemize
2093
Aleksandar Markovic53d21e72019-02-26 13:55:29 +01002094The mipssim pseudo board emulation provides an environment similar
2095to what the proprietary MIPS emulator uses for running Linux.
2096It supports:
2097
2098@itemize @minus
2099@item
2100A range of MIPS CPUs, default is the 24Kf
2101@item
2102PC style serial port
2103@item
2104MIPSnet network emulation
2105@end itemize
2106
Stefan Markovicf7d257c2019-01-24 16:53:55 +01002107@node nanoMIPS System emulator
2108@subsection nanoMIPS System emulator
2109@cindex system emulation (nanoMIPS)
2110
2111Executable @file{qemu-system-mipsel} also covers simulation of
211232-bit nanoMIPS system in little endian mode:
2113
2114@itemize @minus
2115@item
2116nanoMIPS I7200 CPU
2117@end itemize
2118
2119Example of @file{qemu-system-mipsel} usage for nanoMIPS is shown below:
2120
2121Download @code{<disk_image_file>} from @url{https://mipsdistros.mips.com/LinuxDistro/nanomips/buildroot/index.html}.
2122
2123Download @code{<kernel_image_file>} from @url{https://mipsdistros.mips.com/LinuxDistro/nanomips/kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/index.html}.
2124
2125Start system emulation of Malta board with nanoMIPS I7200 CPU:
2126@example
2127qemu-system-mipsel -cpu I7200 -kernel @code{<kernel_image_file>} \
2128 -M malta -serial stdio -m @code{<memory_size>} -hda @code{<disk_image_file>} \
2129 -append "mem=256m@@0x0 rw console=ttyS0 vga=cirrus vesa=0x111 root=/dev/sda"
2130@end example
2131
aurel3288cb0a02008-04-08 05:57:37 +00002132
ths24d4de42007-07-11 10:24:28 +00002133@node ARM System emulator
2134@section ARM System emulator
Stefan Weil7544a042010-02-05 23:52:03 +01002135@cindex system emulation (ARM)
bellard3f9f3aa2005-12-18 20:11:37 +00002136
2137Use the executable @file{qemu-system-arm} to simulate a ARM
2138machine. The ARM Integrator/CP board is emulated with the following
2139devices:
2140
2141@itemize @minus
2142@item
pbrook9ee6e8b2007-11-11 00:04:49 +00002143ARM926E, ARM1026E, ARM946E, ARM1136 or Cortex-A8 CPU
bellard3f9f3aa2005-12-18 20:11:37 +00002144@item
2145Two PL011 UARTs
ths5fafdf22007-09-16 21:08:06 +00002146@item
bellard3f9f3aa2005-12-18 20:11:37 +00002147SMC 91c111 Ethernet adapter
pbrook00a9bf12006-05-13 16:55:46 +00002148@item
2149PL110 LCD controller
2150@item
2151PL050 KMI with PS/2 keyboard and mouse.
pbrooka1bb27b2007-04-06 16:49:48 +00002152@item
2153PL181 MultiMedia Card Interface with SD card.
pbrook00a9bf12006-05-13 16:55:46 +00002154@end itemize
2155
2156The ARM Versatile baseboard is emulated with the following devices:
2157
2158@itemize @minus
2159@item
pbrook9ee6e8b2007-11-11 00:04:49 +00002160ARM926E, ARM1136 or Cortex-A8 CPU
pbrook00a9bf12006-05-13 16:55:46 +00002161@item
2162PL190 Vectored Interrupt Controller
2163@item
2164Four PL011 UARTs
ths5fafdf22007-09-16 21:08:06 +00002165@item
pbrook00a9bf12006-05-13 16:55:46 +00002166SMC 91c111 Ethernet adapter
2167@item
2168PL110 LCD controller
2169@item
2170PL050 KMI with PS/2 keyboard and mouse.
2171@item
2172PCI host bridge. Note the emulated PCI bridge only provides access to
2173PCI memory space. It does not provide access to PCI IO space.
ths4be456f2007-06-03 13:41:28 +00002174This means some devices (eg. ne2k_pci NIC) are not usable, and others
2175(eg. rtl8139 NIC) are only usable when the guest drivers use the memory
pbrook00a9bf12006-05-13 16:55:46 +00002176mapped control registers.
pbrooke6de1ba2006-06-16 21:48:48 +00002177@item
2178PCI OHCI USB controller.
2179@item
2180LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices.
pbrooka1bb27b2007-04-06 16:49:48 +00002181@item
2182PL181 MultiMedia Card Interface with SD card.
bellard3f9f3aa2005-12-18 20:11:37 +00002183@end itemize
2184
Paul Brook21a88942009-12-21 20:19:12 +00002185Several variants of the ARM RealView baseboard are emulated,
2186including the EB, PB-A8 and PBX-A9. Due to interactions with the
2187bootloader, only certain Linux kernel configurations work out
2188of the box on these boards.
2189
2190Kernels for the PB-A8 board should have CONFIG_REALVIEW_HIGH_PHYS_OFFSET
2191enabled in the kernel, and expect 512M RAM. Kernels for The PBX-A9 board
2192should have CONFIG_SPARSEMEM enabled, CONFIG_REALVIEW_HIGH_PHYS_OFFSET
2193disabled and expect 1024M RAM.
2194
Stefan Weil40c5c6c2011-01-07 18:59:16 +01002195The following devices are emulated:
pbrookd7739d72007-02-28 16:25:17 +00002196
2197@itemize @minus
2198@item
Paul Brookf7c70322009-11-19 16:45:21 +00002199ARM926E, ARM1136, ARM11MPCore, Cortex-A8 or Cortex-A9 MPCore CPU
pbrookd7739d72007-02-28 16:25:17 +00002200@item
2201ARM AMBA Generic/Distributed Interrupt Controller
2202@item
2203Four PL011 UARTs
ths5fafdf22007-09-16 21:08:06 +00002204@item
Paul Brook0ef849d2009-11-16 17:06:43 +00002205SMC 91c111 or SMSC LAN9118 Ethernet adapter
pbrookd7739d72007-02-28 16:25:17 +00002206@item
2207PL110 LCD controller
2208@item
2209PL050 KMI with PS/2 keyboard and mouse
2210@item
2211PCI host bridge
2212@item
2213PCI OHCI USB controller
2214@item
2215LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices
pbrooka1bb27b2007-04-06 16:49:48 +00002216@item
2217PL181 MultiMedia Card Interface with SD card.
pbrookd7739d72007-02-28 16:25:17 +00002218@end itemize
2219
balrogb00052e2007-04-30 02:22:06 +00002220The XScale-based clamshell PDA models ("Spitz", "Akita", "Borzoi"
2221and "Terrier") emulation includes the following peripherals:
2222
2223@itemize @minus
2224@item
2225Intel PXA270 System-on-chip (ARM V5TE core)
2226@item
2227NAND Flash memory
2228@item
2229IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in "Akita"
2230@item
2231On-chip OHCI USB controller
2232@item
2233On-chip LCD controller
2234@item
2235On-chip Real Time Clock
2236@item
2237TI ADS7846 touchscreen controller on SSP bus
2238@item
2239Maxim MAX1111 analog-digital converter on I@math{^2}C bus
2240@item
2241GPIO-connected keyboard controller and LEDs
2242@item
balrog549444e2007-05-01 17:53:37 +00002243Secure Digital card connected to PXA MMC/SD host
balrogb00052e2007-04-30 02:22:06 +00002244@item
2245Three on-chip UARTs
2246@item
2247WM8750 audio CODEC on I@math{^2}C and I@math{^2}S busses
2248@end itemize
2249
balrog02645922007-11-03 12:50:46 +00002250The Palm Tungsten|E PDA (codename "Cheetah") emulation includes the
2251following elements:
2252
2253@itemize @minus
2254@item
2255Texas Instruments OMAP310 System-on-chip (ARM 925T core)
2256@item
2257ROM and RAM memories (ROM firmware image can be loaded with -option-rom)
2258@item
2259On-chip LCD controller
2260@item
2261On-chip Real Time Clock
2262@item
2263TI TSC2102i touchscreen controller / analog-digital converter / Audio
2264CODEC, connected through MicroWire and I@math{^2}S busses
2265@item
2266GPIO-connected matrix keypad
2267@item
2268Secure Digital card connected to OMAP MMC/SD host
2269@item
2270Three on-chip UARTs
2271@end itemize
2272
balrogc30bb262008-05-18 13:01:40 +00002273Nokia N800 and N810 internet tablets (known also as RX-34 and RX-44 / 48)
2274emulation supports the following elements:
2275
2276@itemize @minus
2277@item
2278Texas Instruments OMAP2420 System-on-chip (ARM 1136 core)
2279@item
2280RAM and non-volatile OneNAND Flash memories
2281@item
2282Display connected to EPSON remote framebuffer chip and OMAP on-chip
2283display controller and a LS041y3 MIPI DBI-C controller
2284@item
2285TI TSC2301 (in N800) and TI TSC2005 (in N810) touchscreen controllers
2286driven through SPI bus
2287@item
2288National Semiconductor LM8323-controlled qwerty keyboard driven
2289through I@math{^2}C bus
2290@item
2291Secure Digital card connected to OMAP MMC/SD host
2292@item
2293Three OMAP on-chip UARTs and on-chip STI debugging console
2294@item
2295Mentor Graphics "Inventra" dual-role USB controller embedded in a TI
2296TUSB6010 chip - only USB host mode is supported
2297@item
2298TI TMP105 temperature sensor driven through I@math{^2}C bus
2299@item
2300TI TWL92230C power management companion with an RTC on I@math{^2}C bus
2301@item
2302Nokia RETU and TAHVO multi-purpose chips with an RTC, connected
2303through CBUS
2304@end itemize
2305
pbrook9ee6e8b2007-11-11 00:04:49 +00002306The Luminary Micro Stellaris LM3S811EVB emulation includes the following
2307devices:
2308
2309@itemize @minus
2310@item
2311Cortex-M3 CPU core.
2312@item
231364k Flash and 8k SRAM.
2314@item
2315Timers, UARTs, ADC and I@math{^2}C interface.
2316@item
2317OSRAM Pictiva 96x16 OLED with SSD0303 controller on I@math{^2}C bus.
2318@end itemize
2319
2320The Luminary Micro Stellaris LM3S6965EVB emulation includes the following
2321devices:
2322
2323@itemize @minus
2324@item
2325Cortex-M3 CPU core.
2326@item
2327256k Flash and 64k SRAM.
2328@item
2329Timers, UARTs, ADC, I@math{^2}C and SSI interfaces.
2330@item
2331OSRAM Pictiva 128x64 OLED with SSD0323 controller connected via SSI.
2332@end itemize
2333
balrog57cd6e92008-05-07 12:23:32 +00002334The Freecom MusicPal internet radio emulation includes the following
2335elements:
2336
2337@itemize @minus
2338@item
2339Marvell MV88W8618 ARM core.
2340@item
234132 MB RAM, 256 KB SRAM, 8 MB flash.
2342@item
2343Up to 2 16550 UARTs
2344@item
2345MV88W8xx8 Ethernet controller
2346@item
2347MV88W8618 audio controller, WM8750 CODEC and mixer
2348@item
Stefan Weile080e782010-02-05 23:52:00 +01002349128×64 display with brightness control
balrog57cd6e92008-05-07 12:23:32 +00002350@item
23512 buttons, 2 navigation wheels with button function
2352@end itemize
2353
balrog997641a2008-12-15 02:05:00 +00002354The Siemens SX1 models v1 and v2 (default) basic emulation.
Stefan Weil40c5c6c2011-01-07 18:59:16 +01002355The emulation includes the following elements:
balrog997641a2008-12-15 02:05:00 +00002356
2357@itemize @minus
2358@item
2359Texas Instruments OMAP310 System-on-chip (ARM 925T core)
2360@item
2361ROM and RAM memories (ROM firmware image can be loaded with -pflash)
2362V1
23631 Flash of 16MB and 1 Flash of 8MB
2364V2
23651 Flash of 32MB
2366@item
2367On-chip LCD controller
2368@item
2369On-chip Real Time Clock
2370@item
2371Secure Digital card connected to OMAP MMC/SD host
2372@item
2373Three on-chip UARTs
2374@end itemize
2375
bellard3f9f3aa2005-12-18 20:11:37 +00002376A Linux 2.6 test image is available on the QEMU web site. More
2377information is available in the QEMU mailing-list archive.
2378
blueswir1d2c639d2009-01-24 18:19:25 +00002379@c man begin OPTIONS
2380
2381The following options are specific to the ARM emulation:
2382
2383@table @option
2384
2385@item -semihosting
2386Enable semihosting syscall emulation.
2387
2388On ARM this implements the "Angel" interface.
2389
2390Note that this allows guest direct access to the host filesystem,
2391so should only be used with trusted guest OS.
2392
2393@end table
2394
Thomas Huthabc67eb2017-06-19 11:16:11 +02002395@c man end
2396
ths24d4de42007-07-11 10:24:28 +00002397@node ColdFire System emulator
2398@section ColdFire System emulator
Stefan Weil7544a042010-02-05 23:52:03 +01002399@cindex system emulation (ColdFire)
2400@cindex system emulation (M68K)
pbrook209a4e62007-05-23 20:16:15 +00002401
2402Use the executable @file{qemu-system-m68k} to simulate a ColdFire machine.
2403The emulator is able to boot a uClinux kernel.
pbrook707e0112007-06-04 00:50:06 +00002404
2405The M5208EVB emulation includes the following devices:
2406
2407@itemize @minus
ths5fafdf22007-09-16 21:08:06 +00002408@item
pbrook707e0112007-06-04 00:50:06 +00002409MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC).
2410@item
2411Three Two on-chip UARTs.
2412@item
2413Fast Ethernet Controller (FEC)
2414@end itemize
2415
2416The AN5206 emulation includes the following devices:
pbrook209a4e62007-05-23 20:16:15 +00002417
2418@itemize @minus
ths5fafdf22007-09-16 21:08:06 +00002419@item
pbrook209a4e62007-05-23 20:16:15 +00002420MCF5206 ColdFire V2 Microprocessor.
2421@item
2422Two on-chip UARTs.
2423@end itemize
2424
blueswir1d2c639d2009-01-24 18:19:25 +00002425@c man begin OPTIONS
2426
Stefan Weil7544a042010-02-05 23:52:03 +01002427The following options are specific to the ColdFire emulation:
blueswir1d2c639d2009-01-24 18:19:25 +00002428
2429@table @option
2430
2431@item -semihosting
2432Enable semihosting syscall emulation.
2433
2434On M68K this implements the "ColdFire GDB" interface used by libgloss.
2435
2436Note that this allows guest direct access to the host filesystem,
2437so should only be used with trusted guest OS.
2438
2439@end table
2440
Thomas Huthabc67eb2017-06-19 11:16:11 +02002441@c man end
2442
Stefan Weil7544a042010-02-05 23:52:03 +01002443@node Cris System emulator
2444@section Cris System emulator
2445@cindex system emulation (Cris)
2446
2447TODO
2448
2449@node Microblaze System emulator
2450@section Microblaze System emulator
2451@cindex system emulation (Microblaze)
2452
2453TODO
2454
2455@node SH4 System emulator
2456@section SH4 System emulator
2457@cindex system emulation (SH4)
2458
2459TODO
2460
Max Filippov3aeaea62011-10-10 14:48:23 +04002461@node Xtensa System emulator
2462@section Xtensa System emulator
2463@cindex system emulation (Xtensa)
2464
2465Two executables cover simulation of both Xtensa endian options,
2466@file{qemu-system-xtensa} and @file{qemu-system-xtensaeb}.
2467Two different machine types are emulated:
2468
2469@itemize @minus
2470@item
2471Xtensa emulator pseudo board "sim"
2472@item
2473Avnet LX60/LX110/LX200 board
2474@end itemize
2475
Stefan Weilb5e49462011-11-13 22:24:26 +01002476The sim pseudo board emulation provides an environment similar
Max Filippov3aeaea62011-10-10 14:48:23 +04002477to one provided by the proprietary Tensilica ISS.
2478It supports:
2479
2480@itemize @minus
2481@item
2482A range of Xtensa CPUs, default is the DC232B
2483@item
2484Console and filesystem access via semihosting calls
2485@end itemize
2486
2487The Avnet LX60/LX110/LX200 emulation supports:
2488
2489@itemize @minus
2490@item
2491A range of Xtensa CPUs, default is the DC232B
2492@item
249316550 UART
2494@item
2495OpenCores 10/100 Mbps Ethernet MAC
2496@end itemize
2497
2498@c man begin OPTIONS
2499
2500The following options are specific to the Xtensa emulation:
2501
2502@table @option
2503
2504@item -semihosting
2505Enable semihosting syscall emulation.
2506
2507Xtensa semihosting provides basic file IO calls, such as open/read/write/seek/select.
2508Tensilica baremetal libc for ISS and linux platform "sim" use this interface.
2509
2510Note that this allows guest direct access to the host filesystem,
2511so should only be used with trusted guest OS.
2512
2513@end table
Thomas Huth3f2ce722017-05-22 22:53:29 +02002514
Thomas Huthabc67eb2017-06-19 11:16:11 +02002515@c man end
2516
ths5fafdf22007-09-16 21:08:06 +00002517@node QEMU User space emulator
2518@chapter QEMU User space emulator
bellard83195232007-02-05 19:42:07 +00002519
2520@menu
2521* Supported Operating Systems ::
Paolo Bonzini0722cc42016-10-06 15:22:05 +02002522* Features::
bellard83195232007-02-05 19:42:07 +00002523* Linux User space emulator::
blueswir184778502008-10-26 20:33:16 +00002524* BSD User space emulator ::
bellard83195232007-02-05 19:42:07 +00002525@end menu
2526
2527@node Supported Operating Systems
2528@section Supported Operating Systems
2529
2530The following OS are supported in user space emulation:
2531
2532@itemize @minus
2533@item
ths4be456f2007-06-03 13:41:28 +00002534Linux (referred as qemu-linux-user)
bellard83195232007-02-05 19:42:07 +00002535@item
blueswir184778502008-10-26 20:33:16 +00002536BSD (referred as qemu-bsd-user)
bellard83195232007-02-05 19:42:07 +00002537@end itemize
2538
Paolo Bonzini0722cc42016-10-06 15:22:05 +02002539@node Features
2540@section Features
2541
2542QEMU user space emulation has the following notable features:
2543
2544@table @strong
2545@item System call translation:
2546QEMU includes a generic system call translator. This means that
2547the parameters of the system calls can be converted to fix
2548endianness and 32/64-bit mismatches between hosts and targets.
2549IOCTLs can be converted too.
2550
2551@item POSIX signal handling:
2552QEMU can redirect to the running program all signals coming from
2553the host (such as @code{SIGALRM}), as well as synthesize signals from
2554virtual CPU exceptions (for example @code{SIGFPE} when the program
2555executes a division by zero).
2556
2557QEMU relies on the host kernel to emulate most signal system
2558calls, for example to emulate the signal mask. On Linux, QEMU
2559supports both normal and real-time signals.
2560
2561@item Threading:
2562On Linux, QEMU can emulate the @code{clone} syscall and create a real
2563host thread (with a separate virtual CPU) for each emulated thread.
2564Note that not all targets currently emulate atomic operations correctly.
2565x86 and ARM use a global lock in order to preserve their semantics.
2566@end table
2567
2568QEMU was conceived so that ultimately it can emulate itself. Although
2569it is not very useful, it is an important test to show the power of the
2570emulator.
2571
bellard83195232007-02-05 19:42:07 +00002572@node Linux User space emulator
2573@section Linux User space emulator
bellard386405f2003-03-23 21:28:45 +00002574
bellarddebc7062006-04-30 21:58:41 +00002575@menu
2576* Quick Start::
2577* Wine launch::
2578* Command line options::
pbrook79737e42006-06-11 16:28:41 +00002579* Other binaries::
bellarddebc7062006-04-30 21:58:41 +00002580@end menu
2581
2582@node Quick Start
bellard83195232007-02-05 19:42:07 +00002583@subsection Quick Start
bellard386405f2003-03-23 21:28:45 +00002584
bellard1f673132004-04-04 15:21:17 +00002585In order to launch a Linux process, QEMU needs the process executable
ths5fafdf22007-09-16 21:08:06 +00002586itself and all the target (x86) dynamic libraries used by it.
bellard386405f2003-03-23 21:28:45 +00002587
bellard1f673132004-04-04 15:21:17 +00002588@itemize
bellard386405f2003-03-23 21:28:45 +00002589
bellard1f673132004-04-04 15:21:17 +00002590@item On x86, you can just try to launch any process by using the native
2591libraries:
bellard386405f2003-03-23 21:28:45 +00002592
ths5fafdf22007-09-16 21:08:06 +00002593@example
bellard1f673132004-04-04 15:21:17 +00002594qemu-i386 -L / /bin/ls
2595@end example
bellardfd429f22003-03-30 20:59:46 +00002596
bellard1f673132004-04-04 15:21:17 +00002597@code{-L /} tells that the x86 dynamic linker must be searched with a
2598@file{/} prefix.
bellard1eb20522003-06-25 16:21:49 +00002599
Stefan Weilb65ee4f2012-05-11 22:25:50 +02002600@item Since QEMU is also a linux process, you can launch QEMU with
2601QEMU (NOTE: you can only do that if you compiled QEMU from the sources):
bellard1eb20522003-06-25 16:21:49 +00002602
ths5fafdf22007-09-16 21:08:06 +00002603@example
bellard1f673132004-04-04 15:21:17 +00002604qemu-i386 -L / qemu-i386 -L / /bin/ls
2605@end example
bellard386405f2003-03-23 21:28:45 +00002606
bellard1f673132004-04-04 15:21:17 +00002607@item On non x86 CPUs, you need first to download at least an x86 glibc
2608(@file{qemu-runtime-i386-XXX-.tar.gz} on the QEMU web page). Ensure that
2609@code{LD_LIBRARY_PATH} is not set:
bellard386405f2003-03-23 21:28:45 +00002610
bellard1f673132004-04-04 15:21:17 +00002611@example
ths5fafdf22007-09-16 21:08:06 +00002612unset LD_LIBRARY_PATH
bellard1f673132004-04-04 15:21:17 +00002613@end example
bellard386405f2003-03-23 21:28:45 +00002614
bellard1f673132004-04-04 15:21:17 +00002615Then you can launch the precompiled @file{ls} x86 executable:
bellard386405f2003-03-23 21:28:45 +00002616
bellard1f673132004-04-04 15:21:17 +00002617@example
2618qemu-i386 tests/i386/ls
2619@end example
Blue Swirl4c3b5a42011-01-20 20:54:21 +00002620You can look at @file{scripts/qemu-binfmt-conf.sh} so that
bellard1f673132004-04-04 15:21:17 +00002621QEMU is automatically launched by the Linux kernel when you try to
2622launch x86 executables. It requires the @code{binfmt_misc} module in the
2623Linux kernel.
bellard386405f2003-03-23 21:28:45 +00002624
bellard1f673132004-04-04 15:21:17 +00002625@item The x86 version of QEMU is also included. You can try weird things such as:
2626@example
bellarddebc7062006-04-30 21:58:41 +00002627qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \
2628 /usr/local/qemu-i386/bin/ls-i386
bellard1f673132004-04-04 15:21:17 +00002629@end example
bellard386405f2003-03-23 21:28:45 +00002630
bellard1f673132004-04-04 15:21:17 +00002631@end itemize
bellard386405f2003-03-23 21:28:45 +00002632
bellarddebc7062006-04-30 21:58:41 +00002633@node Wine launch
bellard83195232007-02-05 19:42:07 +00002634@subsection Wine launch
bellard386405f2003-03-23 21:28:45 +00002635
bellard1f673132004-04-04 15:21:17 +00002636@itemize
bellard386405f2003-03-23 21:28:45 +00002637
bellard1f673132004-04-04 15:21:17 +00002638@item Ensure that you have a working QEMU with the x86 glibc
2639distribution (see previous section). In order to verify it, you must be
2640able to do:
bellard386405f2003-03-23 21:28:45 +00002641
bellard1f673132004-04-04 15:21:17 +00002642@example
2643qemu-i386 /usr/local/qemu-i386/bin/ls-i386
2644@end example
bellard386405f2003-03-23 21:28:45 +00002645
bellard1f673132004-04-04 15:21:17 +00002646@item Download the binary x86 Wine install
ths5fafdf22007-09-16 21:08:06 +00002647(@file{qemu-XXX-i386-wine.tar.gz} on the QEMU web page).
bellard386405f2003-03-23 21:28:45 +00002648
bellard1f673132004-04-04 15:21:17 +00002649@item Configure Wine on your account. Look at the provided script
bellarddebc7062006-04-30 21:58:41 +00002650@file{/usr/local/qemu-i386/@/bin/wine-conf.sh}. Your previous
bellard1f673132004-04-04 15:21:17 +00002651@code{$@{HOME@}/.wine} directory is saved to @code{$@{HOME@}/.wine.org}.
bellard386405f2003-03-23 21:28:45 +00002652
bellard1f673132004-04-04 15:21:17 +00002653@item Then you can try the example @file{putty.exe}:
bellard386405f2003-03-23 21:28:45 +00002654
bellard1f673132004-04-04 15:21:17 +00002655@example
bellarddebc7062006-04-30 21:58:41 +00002656qemu-i386 /usr/local/qemu-i386/wine/bin/wine \
2657 /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe
bellard1f673132004-04-04 15:21:17 +00002658@end example
bellard386405f2003-03-23 21:28:45 +00002659
bellard1f673132004-04-04 15:21:17 +00002660@end itemize
bellard386405f2003-03-23 21:28:45 +00002661
bellarddebc7062006-04-30 21:58:41 +00002662@node Command line options
bellard83195232007-02-05 19:42:07 +00002663@subsection Command line options
bellard386405f2003-03-23 21:28:45 +00002664
bellard1f673132004-04-04 15:21:17 +00002665@example
Sitsofe Wheeler84851402016-01-13 20:50:26 +00002666@command{qemu-i386} [@option{-h]} [@option{-d]} [@option{-L} @var{path}] [@option{-s} @var{size}] [@option{-cpu} @var{model}] [@option{-g} @var{port}] [@option{-B} @var{offset}] [@option{-R} @var{size}] @var{program} [@var{arguments}...]
bellard1f673132004-04-04 15:21:17 +00002667@end example
bellard386405f2003-03-23 21:28:45 +00002668
bellard1f673132004-04-04 15:21:17 +00002669@table @option
2670@item -h
2671Print the help
ths3b46e622007-09-17 08:09:54 +00002672@item -L path
bellard1f673132004-04-04 15:21:17 +00002673Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
2674@item -s size
2675Set the x86 stack size in bytes (default=524288)
blueswir134a3d232008-10-04 20:43:39 +00002676@item -cpu model
Peter Maydellc8057f92012-08-02 13:45:54 +01002677Select CPU model (-cpu help for list and additional feature selection)
Stefan Weilf66724c2010-07-15 22:28:02 +02002678@item -E @var{var}=@var{value}
2679Set environment @var{var} to @var{value}.
2680@item -U @var{var}
2681Remove @var{var} from the environment.
Paul Brook379f6692009-07-17 12:48:08 +01002682@item -B offset
2683Offset guest address by the specified number of bytes. This is useful when
Stefan Weil1f5c3f82010-07-11 18:34:28 +02002684the address region required by guest applications is reserved on the host.
2685This option is currently only supported on some hosts.
Paul Brook68a1c812010-05-29 02:27:35 +01002686@item -R size
2687Pre-allocate a guest virtual address space of the given size (in bytes).
Stefan Weil0d6753e2011-01-07 18:59:13 +01002688"G", "M", and "k" suffixes may be used when specifying the size.
bellard386405f2003-03-23 21:28:45 +00002689@end table
2690
bellard1f673132004-04-04 15:21:17 +00002691Debug options:
bellard386405f2003-03-23 21:28:45 +00002692
bellard1f673132004-04-04 15:21:17 +00002693@table @option
Peter Maydell989b6972013-02-26 17:52:40 +00002694@item -d item1,...
2695Activate logging of the specified items (use '-d help' for a list of log items)
bellard1f673132004-04-04 15:21:17 +00002696@item -p pagesize
2697Act as if the host page size was 'pagesize' bytes
blueswir134a3d232008-10-04 20:43:39 +00002698@item -g port
2699Wait gdb connection to port
aurel321b530a62009-04-05 20:08:59 +00002700@item -singlestep
2701Run the emulation in single step mode.
bellard1f673132004-04-04 15:21:17 +00002702@end table
bellard386405f2003-03-23 21:28:45 +00002703
balrogb01bcae2007-12-16 13:05:59 +00002704Environment variables:
2705
2706@table @env
2707@item QEMU_STRACE
2708Print system calls and arguments similar to the 'strace' program
2709(NOTE: the actual 'strace' program will not work because the user
2710space emulator hasn't implemented ptrace). At the moment this is
2711incomplete. All system calls that don't have a specific argument
2712format are printed with information for six arguments. Many
2713flag-style arguments don't have decoders and will show up as numbers.
ths5cfdf932007-12-17 03:38:26 +00002714@end table
balrogb01bcae2007-12-16 13:05:59 +00002715
pbrook79737e42006-06-11 16:28:41 +00002716@node Other binaries
bellard83195232007-02-05 19:42:07 +00002717@subsection Other binaries
pbrook79737e42006-06-11 16:28:41 +00002718
Stefan Weil7544a042010-02-05 23:52:03 +01002719@cindex user mode (Alpha)
2720@command{qemu-alpha} TODO.
2721
2722@cindex user mode (ARM)
2723@command{qemu-armeb} TODO.
2724
2725@cindex user mode (ARM)
pbrook79737e42006-06-11 16:28:41 +00002726@command{qemu-arm} is also capable of running ARM "Angel" semihosted ELF
2727binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
2728configurations), and arm-uclinux bFLT format binaries.
2729
Stefan Weil7544a042010-02-05 23:52:03 +01002730@cindex user mode (ColdFire)
2731@cindex user mode (M68K)
pbrooke6e59062006-10-22 00:18:54 +00002732@command{qemu-m68k} is capable of running semihosted binaries using the BDM
2733(m5xxx-ram-hosted.ld) or m68k-sim (sim.ld) syscall interfaces, and
2734coldfire uClinux bFLT format binaries.
2735
pbrook79737e42006-06-11 16:28:41 +00002736The binary format is detected automatically.
2737
Stefan Weil7544a042010-02-05 23:52:03 +01002738@cindex user mode (Cris)
2739@command{qemu-cris} TODO.
2740
2741@cindex user mode (i386)
2742@command{qemu-i386} TODO.
2743@command{qemu-x86_64} TODO.
2744
2745@cindex user mode (Microblaze)
2746@command{qemu-microblaze} TODO.
2747
2748@cindex user mode (MIPS)
Aleksandar Markovic8639c5c2018-08-06 13:25:07 +02002749@command{qemu-mips} executes 32-bit big endian MIPS binaries (MIPS O32 ABI).
2750
2751@command{qemu-mipsel} executes 32-bit little endian MIPS binaries (MIPS O32 ABI).
2752
2753@command{qemu-mips64} executes 64-bit big endian MIPS binaries (MIPS N64 ABI).
2754
2755@command{qemu-mips64el} executes 64-bit little endian MIPS binaries (MIPS N64 ABI).
2756
2757@command{qemu-mipsn32} executes 32-bit big endian MIPS binaries (MIPS N32 ABI).
2758
2759@command{qemu-mipsn32el} executes 32-bit little endian MIPS binaries (MIPS N32 ABI).
Stefan Weil7544a042010-02-05 23:52:03 +01002760
Marek Vasute6717112017-01-18 23:01:46 +01002761@cindex user mode (NiosII)
2762@command{qemu-nios2} TODO.
2763
Stefan Weil7544a042010-02-05 23:52:03 +01002764@cindex user mode (PowerPC)
2765@command{qemu-ppc64abi32} TODO.
2766@command{qemu-ppc64} TODO.
2767@command{qemu-ppc} TODO.
2768
2769@cindex user mode (SH4)
2770@command{qemu-sh4eb} TODO.
2771@command{qemu-sh4} TODO.
2772
2773@cindex user mode (SPARC)
blueswir134a3d232008-10-04 20:43:39 +00002774@command{qemu-sparc} can execute Sparc32 binaries (Sparc32 CPU, 32 bit ABI).
2775
blueswir1a785e422007-10-20 08:09:05 +00002776@command{qemu-sparc32plus} can execute Sparc32 and SPARC32PLUS binaries
2777(Sparc64 CPU, 32 bit ABI).
2778
2779@command{qemu-sparc64} can execute some Sparc64 (Sparc64 CPU, 64 bit ABI) and
2780SPARC32PLUS binaries (Sparc64 CPU, 32 bit ABI).
2781
blueswir184778502008-10-26 20:33:16 +00002782@node BSD User space emulator
2783@section BSD User space emulator
2784
2785@menu
2786* BSD Status::
2787* BSD Quick Start::
2788* BSD Command line options::
2789@end menu
2790
2791@node BSD Status
2792@subsection BSD Status
2793
2794@itemize @minus
2795@item
2796target Sparc64 on Sparc64: Some trivial programs work.
2797@end itemize
2798
2799@node BSD Quick Start
2800@subsection Quick Start
2801
2802In order to launch a BSD process, QEMU needs the process executable
2803itself and all the target dynamic libraries used by it.
2804
2805@itemize
2806
2807@item On Sparc64, you can just try to launch any process by using the native
2808libraries:
2809
2810@example
2811qemu-sparc64 /bin/ls
2812@end example
2813
2814@end itemize
2815
2816@node BSD Command line options
2817@subsection Command line options
2818
2819@example
Sitsofe Wheeler84851402016-01-13 20:50:26 +00002820@command{qemu-sparc64} [@option{-h]} [@option{-d]} [@option{-L} @var{path}] [@option{-s} @var{size}] [@option{-bsd} @var{type}] @var{program} [@var{arguments}...]
blueswir184778502008-10-26 20:33:16 +00002821@end example
2822
2823@table @option
2824@item -h
2825Print the help
2826@item -L path
2827Set the library root path (default=/)
2828@item -s size
2829Set the stack size in bytes (default=524288)
Stefan Weilf66724c2010-07-15 22:28:02 +02002830@item -ignore-environment
2831Start with an empty environment. Without this option,
Stefan Weil40c5c6c2011-01-07 18:59:16 +01002832the initial environment is a copy of the caller's environment.
Stefan Weilf66724c2010-07-15 22:28:02 +02002833@item -E @var{var}=@var{value}
2834Set environment @var{var} to @var{value}.
2835@item -U @var{var}
2836Remove @var{var} from the environment.
blueswir184778502008-10-26 20:33:16 +00002837@item -bsd type
2838Set the type of the emulated BSD Operating system. Valid values are
2839FreeBSD, NetBSD and OpenBSD (default).
2840@end table
2841
2842Debug options:
2843
2844@table @option
Peter Maydell989b6972013-02-26 17:52:40 +00002845@item -d item1,...
2846Activate logging of the specified items (use '-d help' for a list of log items)
blueswir184778502008-10-26 20:33:16 +00002847@item -p pagesize
2848Act as if the host page size was 'pagesize' bytes
aurel321b530a62009-04-05 20:08:59 +00002849@item -singlestep
2850Run the emulation in single step mode.
blueswir184778502008-10-26 20:33:16 +00002851@end table
2852
Borislav Petkov483c6ad2018-12-20 10:07:32 -02002853@node System requirements
2854@chapter System requirements
2855
2856@section KVM kernel module
2857
2858On x86_64 hosts, the default set of CPU features enabled by the KVM accelerator
2859require the host to be running Linux v4.5 or newer.
2860
2861The OpteronG[345] CPU models require KVM support for RDTSCP, which was
2862added with Linux 4.5 which is supported by the major distros. And even
2863if RHEL7 has kernel 3.10, KVM there has the required functionality there
2864to make it close to a 4.5 or newer kernel.
Stefan Weil47eacb42010-02-05 23:52:01 +01002865
Stefan Hajnoczie8412572019-05-09 13:18:20 +01002866@include docs/security.texi
2867
Paolo Bonzini78e87792016-10-06 16:12:11 +02002868@include qemu-tech.texi
2869
Markus Armbruster44c67842018-07-16 09:32:25 +02002870@include qemu-deprecated.texi
Cédric Le Goaterefe2add2018-06-05 08:56:26 +02002871
Daniel P. Berrangé45b47132018-05-04 17:00:24 +01002872@node Supported build platforms
2873@appendix Supported build platforms
2874
2875QEMU aims to support building and executing on multiple host OS platforms.
2876This appendix outlines which platforms are the major build targets. These
2877platforms are used as the basis for deciding upon the minimum required
2878versions of 3rd party software QEMU depends on. The supported platforms
2879are the targets for automated testing performed by the project when patches
2880are submitted for review, and tested before and after merge.
2881
2882If a platform is not listed here, it does not imply that QEMU won't work.
2883If an unlisted platform has comparable software versions to a listed platform,
2884there is every expectation that it will work. Bug reports are welcome for
2885problems encountered on unlisted platforms unless they are clearly older
2886vintage than what is described here.
2887
2888Note that when considering software versions shipped in distros as support
2889targets, QEMU considers only the version number, and assumes the features in
2890that distro match the upstream release with the same version. In other words,
2891if a distro backports extra features to the software in their distro, QEMU
2892upstream code will not add explicit support for those backports, unless the
2893feature is auto-detectable in a manner that works for the upstream releases
2894too.
2895
2896The Repology site @url{https://repology.org} is a useful resource to identify
2897currently shipped versions of software in various operating systems, though
2898it does not cover all distros listed below.
2899
2900@section Linux OS
2901
2902For distributions with frequent, short-lifetime releases, the project will
2903aim to support all versions that are not end of life by their respective
2904vendors. For the purposes of identifying supported software versions, the
2905project will look at Fedora, Ubuntu, and openSUSE distros. Other short-
2906lifetime distros will be assumed to ship similar software versions.
2907
2908For distributions with long-lifetime releases, the project will aim to support
2909the most recent major version at all times. Support for the previous major
2910version will be dropped 2 years after the new major version is released. For
2911the purposes of identifying supported software versions, the project will look
2912at RHEL, Debian, Ubuntu LTS, and SLES distros. Other long-lifetime distros will
2913be assumed to ship similar software versions.
2914
2915@section Windows
2916
2917The project supports building with current versions of the MinGW toolchain,
2918hosted on Linux.
2919
2920@section macOS
2921
2922The project supports building with the two most recent versions of macOS, with
2923the current homebrew package set available.
2924
2925@section FreeBSD
2926
2927The project aims to support the all the versions which are not end of life.
2928
2929@section NetBSD
2930
2931The project aims to support the most recent major version at all times. Support
2932for the previous major version will be dropped 2 years after the new major
2933version is released.
2934
2935@section OpenBSD
2936
2937The project aims to support the all the versions which are not end of life.
2938
Stefan Weil7544a042010-02-05 23:52:03 +01002939@node License
2940@appendix License
2941
2942QEMU is a trademark of Fabrice Bellard.
2943
Thomas Huth2f8d8f02017-05-22 22:26:45 +02002944QEMU is released under the
2945@url{https://www.gnu.org/licenses/gpl-2.0.txt,GNU General Public License},
2946version 2. Parts of QEMU have specific licenses, see file
Stefan Hajnoczi70b7fba2017-11-21 12:04:35 +00002947@url{https://git.qemu.org/?p=qemu.git;a=blob_plain;f=LICENSE,LICENSE}.
Stefan Weil7544a042010-02-05 23:52:03 +01002948
bellarddebc7062006-04-30 21:58:41 +00002949@node Index
Stefan Weil7544a042010-02-05 23:52:03 +01002950@appendix Index
2951@menu
2952* Concept Index::
2953* Function Index::
2954* Keystroke Index::
2955* Program Index::
2956* Data Type Index::
2957* Variable Index::
2958@end menu
2959
2960@node Concept Index
2961@section Concept Index
2962This is the main index. Should we combine all keywords in one index? TODO
bellarddebc7062006-04-30 21:58:41 +00002963@printindex cp
2964
Stefan Weil7544a042010-02-05 23:52:03 +01002965@node Function Index
2966@section Function Index
2967This index could be used for command line options and monitor functions.
2968@printindex fn
2969
2970@node Keystroke Index
2971@section Keystroke Index
2972
2973This is a list of all keystrokes which have a special function
2974in system emulation.
2975
2976@printindex ky
2977
2978@node Program Index
2979@section Program Index
2980@printindex pg
2981
2982@node Data Type Index
2983@section Data Type Index
2984
2985This index could be used for qdev device names and options.
2986
2987@printindex tp
2988
2989@node Variable Index
2990@section Variable Index
2991@printindex vr
2992
bellarddebc7062006-04-30 21:58:41 +00002993@bye