1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3
<!-- Created on December, 4 2007 by texi2html 1.78 -->
5
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6
Karl Berry <karl@freefriends.org>
7
Olaf Bachmann <obachman@mathematik.uni-kl.de>
9
Maintained by: Many creative people.
10
Send bugs and suggestions to <texi2html-bug@nongnu.org>
14
<title>QEMU Emulator User Documentation</title>
16
<meta name="description" content="QEMU Emulator User Documentation">
17
<meta name="keywords" content="QEMU Emulator User Documentation">
18
<meta name="resource-type" content="document">
19
<meta name="distribution" content="global">
20
<meta name="Generator" content="texi2html 1.78">
21
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22
<style type="text/css">
24
a.summary-letter {text-decoration: none}
25
pre.display {font-family: serif}
26
pre.format {font-family: serif}
27
pre.menu-comment {font-family: serif}
28
pre.menu-preformatted {font-family: serif}
29
pre.smalldisplay {font-family: serif; font-size: smaller}
30
pre.smallexample {font-size: smaller}
31
pre.smallformat {font-family: serif; font-size: smaller}
32
pre.smalllisp {font-size: smaller}
33
span.roman {font-family:serif; font-weight:normal;}
34
span.sansserif {font-family:sans-serif; font-weight:normal;}
35
ul.toc {list-style: none}
42
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
45
<a name="SEC_Top"></a>
46
<table cellpadding="1" cellspacing="1" border="0">
47
<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
48
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
49
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
50
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
52
<h1 class="settitle">QEMU Emulator User Documentation
55
<table class="menu" border="0" cellspacing="0">
56
<tr><td align="left" valign="top"><a href="#SEC1">1. Introduction</a></td><td> </td><td align="left" valign="top">
58
<tr><td align="left" valign="top"><a href="#SEC3">2. Installation</a></td><td> </td><td align="left" valign="top">
60
<tr><td align="left" valign="top"><a href="#SEC7">3. QEMU PC System emulator</a></td><td> </td><td align="left" valign="top">
62
<tr><td align="left" valign="top"><a href="#SEC58">4. QEMU System emulator for non PC targets</a></td><td> </td><td align="left" valign="top">
64
<tr><td align="left" valign="top"><a href="#SEC65">5. QEMU User space emulator</a></td><td> </td><td align="left" valign="top">
66
<tr><td align="left" valign="top"><a href="#SEC76">6. Compilation from the sources</a></td><td> </td><td align="left" valign="top"></td></tr>
67
<tr><td align="left" valign="top"><a href="#SEC83">7. Index</a></td><td> </td><td align="left" valign="top">
73
<a name="Introduction"></a>
75
<table cellpadding="1" cellspacing="1" border="0">
76
<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Previous section in reading order"> < </a>]</td>
77
<td valign="middle" align="left">[<a href="#SEC2" title="Next section in reading order"> > </a>]</td>
78
<td valign="middle" align="left"> </td>
79
<td valign="middle" align="left">[ << ]</td>
80
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
81
<td valign="middle" align="left">[<a href="#SEC3" title="Next chapter"> >> </a>]</td>
82
<td valign="middle" align="left"> </td>
83
<td valign="middle" align="left"> </td>
84
<td valign="middle" align="left"> </td>
85
<td valign="middle" align="left"> </td>
86
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
87
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
88
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
89
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
91
<h1 class="chapter"> 1. Introduction </h1>
93
<table class="menu" border="0" cellspacing="0">
94
<tr><td align="left" valign="top"><a href="#SEC2">1.1 Features</a></td><td> </td><td align="left" valign="top"></td></tr>
98
<a name="intro_005ffeatures"></a>
100
<table cellpadding="1" cellspacing="1" border="0">
101
<tr><td valign="middle" align="left">[<a href="#SEC1" title="Previous section in reading order"> < </a>]</td>
102
<td valign="middle" align="left">[<a href="#SEC3" title="Next section in reading order"> > </a>]</td>
103
<td valign="middle" align="left"> </td>
104
<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td>
105
<td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
106
<td valign="middle" align="left">[<a href="#SEC3" title="Next chapter"> >> </a>]</td>
107
<td valign="middle" align="left"> </td>
108
<td valign="middle" align="left"> </td>
109
<td valign="middle" align="left"> </td>
110
<td valign="middle" align="left"> </td>
111
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
112
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
113
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
114
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
116
<h2 class="section"> 1.1 Features </h2>
118
<p>QEMU is a FAST! processor emulator using dynamic translation to
119
achieve good emulation speed.
121
<p>QEMU has two operating modes:
125
Full system emulation. In this mode, QEMU emulates a full system (for
126
example a PC), including one or several processors and various
127
peripherals. It can be used to launch different Operating Systems
128
without rebooting the PC or to debug system code.
131
User mode emulation. In this mode, QEMU can launch
132
processes compiled for one CPU on another CPU. It can be used to
133
launch the Wine Windows API emulator (<a href="http://www.winehq.org">http://www.winehq.org</a>) or
134
to ease cross-compilation and cross-debugging.
138
<p>QEMU can run without an host kernel driver and yet gives acceptable
141
<p>For system emulation, the following hardware targets are supported:
143
<li> PC (x86 or x86_64 processor)
144
</li><li> ISA PC (old style PC without PCI bus)
145
</li><li> PREP (PowerPC processor)
146
</li><li> G3 BW PowerMac (PowerPC processor)
147
</li><li> Mac99 PowerMac (PowerPC processor, in progress)
148
</li><li> Sun4m (32-bit Sparc processor)
149
</li><li> Sun4u (64-bit Sparc processor, in progress)
150
</li><li> Malta board (32-bit MIPS processor)
151
</li><li> ARM Integrator/CP (ARM926E, 1026E or 946E processor)
152
</li><li> ARM Versatile baseboard (ARM926E)
153
</li><li> ARM RealView Emulation baseboard (ARM926EJ-S)
154
</li><li> Spitz, Akita, Borzoi and Terrier PDAs (PXA270 processor)
155
</li><li> Freescale MCF5208EVB (ColdFire V2).
156
</li><li> Arnewsh MCF5206 evaluation board (ColdFire V2).
159
<p>For user emulation, x86, PowerPC, ARM, MIPS, Sparc32/64 and ColdFire(m68k) CPUs are supported.
162
<a name="Installation"></a>
164
<table cellpadding="1" cellspacing="1" border="0">
165
<tr><td valign="middle" align="left">[<a href="#SEC2" title="Previous section in reading order"> < </a>]</td>
166
<td valign="middle" align="left">[<a href="#SEC4" title="Next section in reading order"> > </a>]</td>
167
<td valign="middle" align="left"> </td>
168
<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td>
169
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
170
<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
171
<td valign="middle" align="left"> </td>
172
<td valign="middle" align="left"> </td>
173
<td valign="middle" align="left"> </td>
174
<td valign="middle" align="left"> </td>
175
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
176
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
177
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
178
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
180
<h1 class="chapter"> 2. Installation </h1>
182
<p>If you want to compile QEMU yourself, see <a href="#SEC76">Compilation from the sources</a>.
184
<table class="menu" border="0" cellspacing="0">
185
<tr><td align="left" valign="top"><a href="#SEC4">2.1 Linux</a></td><td> </td><td align="left" valign="top"></td></tr>
186
<tr><td align="left" valign="top"><a href="#SEC5">2.2 Windows</a></td><td> </td><td align="left" valign="top"></td></tr>
187
<tr><td align="left" valign="top"><a href="#SEC6">2.3 Mac OS X</a></td><td> </td><td align="left" valign="top"> Macintosh
192
<a name="install_005flinux"></a>
194
<table cellpadding="1" cellspacing="1" border="0">
195
<tr><td valign="middle" align="left">[<a href="#SEC3" title="Previous section in reading order"> < </a>]</td>
196
<td valign="middle" align="left">[<a href="#SEC5" title="Next section in reading order"> > </a>]</td>
197
<td valign="middle" align="left"> </td>
198
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
199
<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
200
<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
201
<td valign="middle" align="left"> </td>
202
<td valign="middle" align="left"> </td>
203
<td valign="middle" align="left"> </td>
204
<td valign="middle" align="left"> </td>
205
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
206
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
207
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
208
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
210
<h2 class="section"> 2.1 Linux </h2>
212
<p>If a precompiled package is available for your distribution - you just
213
have to install it. Otherwise, see <a href="#SEC76">Compilation from the sources</a>.
216
<a name="install_005fwindows"></a>
218
<table cellpadding="1" cellspacing="1" border="0">
219
<tr><td valign="middle" align="left">[<a href="#SEC4" title="Previous section in reading order"> < </a>]</td>
220
<td valign="middle" align="left">[<a href="#SEC6" title="Next section in reading order"> > </a>]</td>
221
<td valign="middle" align="left"> </td>
222
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
223
<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
224
<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
225
<td valign="middle" align="left"> </td>
226
<td valign="middle" align="left"> </td>
227
<td valign="middle" align="left"> </td>
228
<td valign="middle" align="left"> </td>
229
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
230
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
231
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
232
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
234
<h2 class="section"> 2.2 Windows </h2>
236
<p>Download the experimental binary installer at
237
<a href="http://www.free.oszoo.org/download.html">http://www.free.oszoo.org/download.html</a>.
240
<a name="install_005fmac"></a>
242
<table cellpadding="1" cellspacing="1" border="0">
243
<tr><td valign="middle" align="left">[<a href="#SEC5" title="Previous section in reading order"> < </a>]</td>
244
<td valign="middle" align="left">[<a href="#SEC7" title="Next section in reading order"> > </a>]</td>
245
<td valign="middle" align="left"> </td>
246
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
247
<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
248
<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
249
<td valign="middle" align="left"> </td>
250
<td valign="middle" align="left"> </td>
251
<td valign="middle" align="left"> </td>
252
<td valign="middle" align="left"> </td>
253
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
254
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
255
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
256
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
258
<h2 class="section"> 2.3 Mac OS X </h2>
260
<p>Download the experimental binary installer at
261
<a href="http://www.free.oszoo.org/download.html">http://www.free.oszoo.org/download.html</a>.
264
<a name="QEMU-PC-System-emulator"></a>
266
<table cellpadding="1" cellspacing="1" border="0">
267
<tr><td valign="middle" align="left">[<a href="#SEC6" title="Previous section in reading order"> < </a>]</td>
268
<td valign="middle" align="left">[<a href="#SEC8" title="Next section in reading order"> > </a>]</td>
269
<td valign="middle" align="left"> </td>
270
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
271
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
272
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
273
<td valign="middle" align="left"> </td>
274
<td valign="middle" align="left"> </td>
275
<td valign="middle" align="left"> </td>
276
<td valign="middle" align="left"> </td>
277
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
278
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
279
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
280
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
282
<h1 class="chapter"> 3. QEMU PC System emulator </h1>
284
<table class="menu" border="0" cellspacing="0">
285
<tr><td align="left" valign="top"><a href="#SEC8">3.1 Introduction</a></td><td> </td><td align="left" valign="top"></td></tr>
286
<tr><td align="left" valign="top"><a href="#SEC9">3.2 Quick Start</a></td><td> </td><td align="left" valign="top"></td></tr>
287
<tr><td align="left" valign="top"><a href="#SEC10">3.3 Invocation</a></td><td> </td><td align="left" valign="top"></td></tr>
288
<tr><td align="left" valign="top"><a href="#SEC11">3.4 Keys</a></td><td> </td><td align="left" valign="top"></td></tr>
289
<tr><td align="left" valign="top"><a href="#SEC12">3.5 QEMU Monitor</a></td><td> </td><td align="left" valign="top"></td></tr>
290
<tr><td align="left" valign="top"><a href="#SEC15">3.6 Disk Images</a></td><td> </td><td align="left" valign="top"></td></tr>
291
<tr><td align="left" valign="top"><a href="#SEC25">3.7 Network emulation</a></td><td> </td><td align="left" valign="top"></td></tr>
292
<tr><td align="left" valign="top"><a href="#SEC32">3.8 Direct Linux Boot</a></td><td> </td><td align="left" valign="top"></td></tr>
293
<tr><td align="left" valign="top"><a href="#SEC33">3.9 USB emulation</a></td><td> </td><td align="left" valign="top"></td></tr>
294
<tr><td align="left" valign="top"><a href="#SEC36">3.10 VNC security</a></td><td> </td><td align="left" valign="top"></td></tr>
295
<tr><td align="left" valign="top"><a href="#SEC46">3.11 GDB usage</a></td><td> </td><td align="left" valign="top"></td></tr>
296
<tr><td align="left" valign="top"><a href="#SEC47">3.12 Target OS specific information</a></td><td> </td><td align="left" valign="top"></td></tr>
300
<a name="pcsys_005fintroduction"></a>
302
<table cellpadding="1" cellspacing="1" border="0">
303
<tr><td valign="middle" align="left">[<a href="#SEC7" title="Previous section in reading order"> < </a>]</td>
304
<td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> > </a>]</td>
305
<td valign="middle" align="left"> </td>
306
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
307
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
308
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
309
<td valign="middle" align="left"> </td>
310
<td valign="middle" align="left"> </td>
311
<td valign="middle" align="left"> </td>
312
<td valign="middle" align="left"> </td>
313
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
314
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
315
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
316
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
318
<h2 class="section"> 3.1 Introduction </h2>
321
<p>The QEMU PC System emulator simulates the
322
following peripherals:
326
i440FX host PCI bridge and PIIX3 PCI to ISA bridge
328
Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
329
extensions (hardware level, including all non standard modes).
331
PS/2 mouse and keyboard
333
2 PCI IDE interfaces with hard disk and CD-ROM support
337
PCI/ISA PCI network adapters
341
Creative SoundBlaster 16 sound card
343
ENSONIQ AudioPCI ES1370 sound card
345
Adlib(OPL2) - Yamaha YM3812 compatible chip
347
PCI UHCI USB controller and a virtual USB hub.
350
<p>SMP is supported with up to 255 CPUs.
352
<p>Note that adlib is only available when QEMU was configured with
355
<p>QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
358
<p>QEMU uses YM3812 emulation by Tatsuyuki Satoh.
362
<a name="pcsys_005fquickstart"></a>
364
<table cellpadding="1" cellspacing="1" border="0">
365
<tr><td valign="middle" align="left">[<a href="#SEC8" title="Previous section in reading order"> < </a>]</td>
366
<td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> > </a>]</td>
367
<td valign="middle" align="left"> </td>
368
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
369
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
370
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
371
<td valign="middle" align="left"> </td>
372
<td valign="middle" align="left"> </td>
373
<td valign="middle" align="left"> </td>
374
<td valign="middle" align="left"> </td>
375
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
376
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
377
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
378
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
380
<h2 class="section"> 3.2 Quick Start </h2>
382
<p>Download and uncompress the linux image (‘<tt>linux.img</tt>’) and type:
384
<table><tr><td> </td><td><pre class="example">qemu linux.img
385
</pre></td></tr></table>
387
<p>Linux should boot and give you a prompt.
390
<a name="sec_005finvocation"></a>
392
<table cellpadding="1" cellspacing="1" border="0">
393
<tr><td valign="middle" align="left">[<a href="#SEC9" title="Previous section in reading order"> < </a>]</td>
394
<td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> > </a>]</td>
395
<td valign="middle" align="left"> </td>
396
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
397
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
398
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
399
<td valign="middle" align="left"> </td>
400
<td valign="middle" align="left"> </td>
401
<td valign="middle" align="left"> </td>
402
<td valign="middle" align="left"> </td>
403
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
404
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
405
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
406
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
408
<h2 class="section"> 3.3 Invocation </h2>
410
<table><tr><td> </td><td><pre class="example">usage: qemu [options] [disk_image]
411
</pre></td></tr></table>
413
<p><var>disk_image</var> is a raw hard disk image for IDE hard disk 0.
416
</p><dl compact="compact">
417
<dt> ‘<samp>-M machine</samp>’</dt>
418
<dd><p>Select the emulated machine (<code>-M ?</code> for list)
421
<dt> ‘<samp>-fda file</samp>’</dt>
422
<dt> ‘<samp>-fdb file</samp>’</dt>
423
<dd><p>Use <var>file</var> as floppy disk 0/1 image (see section <a href="#SEC15">Disk Images</a>). You can
424
use the host floppy by using ‘<tt>/dev/fd0</tt>’ as filename (see section <a href="#SEC20">Using host drives</a>).
427
<dt> ‘<samp>-hda file</samp>’</dt>
428
<dt> ‘<samp>-hdb file</samp>’</dt>
429
<dt> ‘<samp>-hdc file</samp>’</dt>
430
<dt> ‘<samp>-hdd file</samp>’</dt>
431
<dd><p>Use <var>file</var> as hard disk 0, 1, 2 or 3 image (see section <a href="#SEC15">Disk Images</a>).
434
<dt> ‘<samp>-cdrom file</samp>’</dt>
435
<dd><p>Use <var>file</var> as CD-ROM image (you cannot use ‘<samp>-hdc</samp>’ and and
436
‘<samp>-cdrom</samp>’ at the same time). You can use the host CD-ROM by
437
using ‘<tt>/dev/cdrom</tt>’ as filename (see section <a href="#SEC20">Using host drives</a>).
440
<dt> ‘<samp>-boot [a|c|d|n]</samp>’</dt>
441
<dd><p>Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n). Hard disk boot
445
<dt> ‘<samp>-snapshot</samp>’</dt>
446
<dd><p>Write to temporary files instead of disk image files. In this case,
447
the raw disk image you use is not written back. You can however force
448
the write back by pressing <C-a s> (see section <a href="#SEC15">Disk Images</a>).
451
<dt> ‘<samp>-no-fd-bootchk</samp>’</dt>
452
<dd><p>Disable boot signature checking for floppy disks in Bochs BIOS. It may
453
be needed to boot from old floppy disks.
456
<dt> ‘<samp>-m megs</samp>’</dt>
457
<dd><p>Set virtual RAM size to <var>megs</var> megabytes. Default is 128 MB.
460
<dt> ‘<samp>-smp n</samp>’</dt>
461
<dd><p>Simulate an SMP system with <var>n</var> CPUs. On the PC target, up to 255
465
<dt> ‘<samp>-audio-help</samp>’</dt>
467
<p>Will show the audio subsystem help: list of drivers, tunable
471
<dt> ‘<samp>-soundhw card1,card2,... or -soundhw all</samp>’</dt>
473
<p>Enable audio and selected sound hardware. Use ? to print all
474
available sound hardware.
476
<table><tr><td> </td><td><pre class="example">qemu -soundhw sb16,adlib hda
477
qemu -soundhw es1370 hda
478
qemu -soundhw all hda
480
</pre></td></tr></table>
483
<dt> ‘<samp>-localtime</samp>’</dt>
484
<dd><p>Set the real time clock to local time (the default is to UTC
485
time). This option is needed to have correct date in MS-DOS or
489
<dt> ‘<samp>-pidfile file</samp>’</dt>
490
<dd><p>Store the QEMU process PID in <var>file</var>. It is useful if you launch QEMU
494
<dt> ‘<samp>-daemonize</samp>’</dt>
495
<dd><p>Daemonize the QEMU process after initialization. QEMU will not detach from
496
standard IO until it is ready to receive connections on any of its devices.
497
This option is a useful way for external programs to launch QEMU without having
498
to cope with initialization race conditions.
501
<dt> ‘<samp>-win2k-hack</samp>’</dt>
502
<dd><p>Use it when installing Windows 2000 to avoid a disk full bug. After
503
Windows 2000 is installed, you no longer need this option (this option
504
slows down the IDE transfers).
507
<dt> ‘<samp>-option-rom file</samp>’</dt>
508
<dd><p>Load the contents of file as an option ROM. This option is useful to load
509
things like EtherBoot.
512
<dt> ‘<samp>-name string</samp>’</dt>
513
<dd><p>Sets the name of the guest. This name will be display in the SDL window
514
caption. The name will also be used for the VNC server.
520
</p><dl compact="compact">
521
<dt> ‘<samp>-nographic</samp>’</dt>
523
<p>Normally, QEMU uses SDL to display the VGA output. With this option,
524
you can totally disable graphical output so that QEMU is a simple
525
command line application. The emulated serial port is redirected on
526
the console. Therefore, you can still use QEMU to debug a Linux kernel
527
with a serial console.
530
<dt> ‘<samp>-no-frame</samp>’</dt>
532
<p>Do not use decorations for SDL windows and start them using the whole
533
available screen space. This makes the using QEMU in a dedicated desktop
534
workspace more convenient.
537
<dt> ‘<samp>-full-screen</samp>’</dt>
538
<dd><p>Start in full screen.
541
<dt> ‘<samp>-vnc display[,option[,option[,...]]]</samp>’</dt>
543
<p>Normally, QEMU uses SDL to display the VGA output. With this option,
544
you can have QEMU listen on VNC display <var>display</var> and redirect the VGA
545
display over the VNC session. It is very useful to enable the usb
546
tablet device when using this option (option ‘<samp>-usbdevice
547
tablet</samp>’). When using the VNC display, you must use the ‘<samp>-k</samp>’
548
parameter to set the keyboard layout if you are not using en-us. Valid
549
syntax for the <var>display</var> is
551
<dl compact="compact">
552
<dt> <code><var>interface:d</var></code></dt>
554
<p>TCP connections will only be allowed from <var>interface</var> on display <var>d</var>.
555
By convention the TCP port is 5900+<var>d</var>. Optionally, <var>interface</var> can
556
be omitted in which case the server will bind to all interfaces.
559
<dt> <code><var>unix:path</var></code></dt>
561
<p>Connections will be allowed over UNIX domain sockets where <var>path</var> is the
562
location of a unix socket to listen for connections on.
565
<dt> <code><var>none</var></code></dt>
567
<p>VNC is initialized by not started. The monitor <code>change</code> command can be used
568
to later start the VNC server.
573
<p>Following the <var>display</var> value there may be one or more <var>option</var> flags
574
separated by commas. Valid options are
576
<dl compact="compact">
577
<dt> <code><var>password</var></code></dt>
579
<p>Require that password based authentication is used for client connections.
580
The password must be set separately using the <code>change</code> command in the
581
<a href="#SEC12">QEMU Monitor</a>
584
<dt> <code><var>tls</var></code></dt>
586
<p>Require that client use TLS when communicating with the VNC server. This
587
uses anonymous TLS credentials so is susceptible to a man-in-the-middle
588
attack. It is recommended that this option be combined with either the
589
<var>x509</var> or <var>x509verify</var> options.
592
<dt> <code><var>x509=/path/to/certificate/dir</var></code></dt>
594
<p>Valid if <var>tls</var> is specified. Require that x509 credentials are used
595
for negotiating the TLS session. The server will send its x509 certificate
596
to the client. It is recommended that a password be set on the VNC server
597
to provide authentication of the client when this is used. The path following
598
this option specifies where the x509 certificates are to be loaded from.
599
See the <a href="#SEC36">VNC security</a> section for details on generating certificates.
602
<dt> <code><var>x509verify=/path/to/certificate/dir</var></code></dt>
604
<p>Valid if <var>tls</var> is specified. Require that x509 credentials are used
605
for negotiating the TLS session. The server will send its x509 certificate
606
to the client, and request that the client send its own x509 certificate.
607
The server will validate the client's certificate against the CA certificate,
608
and reject clients when validation fails. If the certificate authority is
609
trusted, this is a sufficient authentication mechanism. You may still wish
610
to set a password on the VNC server as a second authentication layer. The
611
path following this option specifies where the x509 certificates are to
612
be loaded from. See the <a href="#SEC36">VNC security</a> section for details on generating
619
<dt> ‘<samp>-k language</samp>’</dt>
621
<p>Use keyboard layout <var>language</var> (for example <code>fr</code> for
622
French). This option is only needed where it is not easy to get raw PC
623
keycodes (e.g. on Macs, with some X11 servers or with a VNC
624
display). You don't normally need to use it on PC/Linux or PC/Windows
627
<p>The available layouts are:
628
</p><table><tr><td> </td><td><pre class="example">ar de-ch es fo fr-ca hu ja mk no pt-br sv
629
da en-gb et fr fr-ch is lt nl pl ru th
630
de en-us fi fr-be hr it lv nl-be pt sl tr
631
</pre></td></tr></table>
633
<p>The default is <code>en-us</code>.
639
</p><dl compact="compact">
640
<dt> ‘<samp>-usb</samp>’</dt>
641
<dd><p>Enable the USB driver (will be the default soon)
644
<dt> ‘<samp>-usbdevice devname</samp>’</dt>
645
<dd><p>Add the USB device <var>devname</var>. See section <a href="#SEC34">Connecting USB devices</a>.
651
<dl compact="compact">
652
<dt> ‘<samp>-net nic[,vlan=n][,macaddr=addr][,model=type]</samp>’</dt>
653
<dd><p>Create a new Network Interface Card and connect it to VLAN <var>n</var> (<var>n</var>
654
= 0 is the default). The NIC is an ne2k_pci by default on the PC
655
target. Optionally, the MAC address can be changed. If no
656
‘<samp>-net</samp>’ option is specified, a single NIC is created.
657
Qemu can emulate several different models of network card.
658
Valid values for <var>type</var> are
659
<code>i82551</code>, <code>i82557b</code>, <code>i82559er</code>,
660
<code>ne2k_pci</code>, <code>ne2k_isa</code>, <code>pcnet</code>, <code>rtl8139</code>,
661
<code>smc91c111</code>, <code>lance</code> and <code>mcf_fec</code>.
662
Not all devices are supported on all targets. Use -net nic,model=?
663
for a list of available devices for your target.
666
<dt> ‘<samp>-net user[,vlan=n][,hostname=name]</samp>’</dt>
667
<dd><p>Use the user mode network stack which requires no administrator
668
privilege to run. ‘<samp>hostname=name</samp>’ can be used to specify the client
669
hostname reported by the builtin DHCP server.
672
<dt> ‘<samp>-net tap[,vlan=n][,fd=h][,ifname=name][,script=file]</samp>’</dt>
673
<dd><p>Connect the host TAP network interface <var>name</var> to VLAN <var>n</var> and
674
use the network script <var>file</var> to configure it. The default
675
network script is ‘<tt>/etc/qemu-ifup</tt>’. Use ‘<samp>script=no</samp>’ to
676
disable script execution. If <var>name</var> is not
677
provided, the OS automatically provides one. ‘<samp>fd=h</samp>’ can be
678
used to specify the handle of an already opened host TAP interface. Example:
680
<table><tr><td> </td><td><pre class="example">qemu linux.img -net nic -net tap
681
</pre></td></tr></table>
683
<p>More complicated example (two NICs, each one connected to a TAP device)
684
</p><table><tr><td> </td><td><pre class="example">qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
685
-net nic,vlan=1 -net tap,vlan=1,ifname=tap1
686
</pre></td></tr></table>
690
<dt> ‘<samp>-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]</samp>’</dt>
692
<p>Connect the VLAN <var>n</var> to a remote VLAN in another QEMU virtual
693
machine using a TCP socket connection. If ‘<samp>listen</samp>’ is
694
specified, QEMU waits for incoming connections on <var>port</var>
695
(<var>host</var> is optional). ‘<samp>connect</samp>’ is used to connect to
696
another QEMU instance using the ‘<samp>listen</samp>’ option. ‘<samp>fd=h</samp>’
697
specifies an already opened TCP socket.
700
</p><table><tr><td> </td><td><pre class="example"># launch a first QEMU instance
701
qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
702
-net socket,listen=:1234
703
# connect the VLAN 0 of this instance to the VLAN 0
704
# of the first instance
705
qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
706
-net socket,connect=127.0.0.1:1234
707
</pre></td></tr></table>
710
<dt> ‘<samp>-net socket[,vlan=n][,fd=h][,mcast=maddr:port]</samp>’</dt>
712
<p>Create a VLAN <var>n</var> shared with another QEMU virtual
713
machines using a UDP multicast socket, effectively making a bus for
714
every QEMU with same multicast address <var>maddr</var> and <var>port</var>.
718
Several QEMU can be running on different hosts and share same bus (assuming
719
correct multicast setup for these hosts).
721
mcast support is compatible with User Mode Linux (argument ‘<samp>eth<var>N</var>=mcast</samp>’), see
722
<a href="http://user-mode-linux.sf.net">http://user-mode-linux.sf.net</a>.
724
Use ‘<samp>fd=h</samp>’ to specify an already opened UDP multicast socket.
728
</p><table><tr><td> </td><td><pre class="example"># launch one QEMU instance
729
qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
730
-net socket,mcast=230.0.0.1:1234
731
# launch another QEMU instance on same "bus"
732
qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
733
-net socket,mcast=230.0.0.1:1234
734
# launch yet another QEMU instance on same "bus"
735
qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \
736
-net socket,mcast=230.0.0.1:1234
737
</pre></td></tr></table>
739
<p>Example (User Mode Linux compat.):
740
</p><table><tr><td> </td><td><pre class="example"># launch QEMU instance (note mcast address selected
742
qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
743
-net socket,mcast=239.192.168.1:1102
745
/path/to/linux ubd0=/path/to/root_fs eth0=mcast
746
</pre></td></tr></table>
749
<dt> ‘<samp>-net none</samp>’</dt>
750
<dd><p>Indicate that no network devices should be configured. It is used to
751
override the default configuration (‘<samp>-net nic -net user</samp>’) which
752
is activated if no ‘<samp>-net</samp>’ options are provided.
755
<dt> ‘<samp>-tftp dir</samp>’</dt>
756
<dd><p>When using the user mode network stack, activate a built-in TFTP
757
server. The files in <var>dir</var> will be exposed as the root of a TFTP server.
758
The TFTP client on the guest must be configured in binary mode (use the command
759
<code>bin</code> of the Unix TFTP client). The host IP address on the guest is as
763
<dt> ‘<samp>-bootp file</samp>’</dt>
764
<dd><p>When using the user mode network stack, broadcast <var>file</var> as the BOOTP
765
filename. In conjunction with ‘<samp>-tftp</samp>’, this can be used to network boot
766
a guest from a local directory.
768
<p>Example (using pxelinux):
769
</p><table><tr><td> </td><td><pre class="example">qemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0
770
</pre></td></tr></table>
773
<dt> ‘<samp>-smb dir</samp>’</dt>
774
<dd><p>When using the user mode network stack, activate a built-in SMB
775
server so that Windows OSes can access to the host files in ‘<tt>dir</tt>’
778
<p>In the guest Windows OS, the line:
779
</p><table><tr><td> </td><td><pre class="example">10.0.2.4 smbserver
780
</pre></td></tr></table>
781
<p>must be added in the file ‘<tt>C:\WINDOWS\LMHOSTS</tt>’ (for windows 9x/Me)
782
or ‘<tt>C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS</tt>’ (Windows NT/2000).
784
<p>Then ‘<tt>dir</tt>’ can be accessed in ‘<tt>\\smbserver\qemu</tt>’.
786
<p>Note that a SAMBA server must be installed on the host OS in
787
‘<tt>/usr/sbin/smbd</tt>’. QEMU was tested successfully with smbd version
788
2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3.
791
<dt> ‘<samp>-redir [tcp|udp]:host-port:[guest-host]:guest-port</samp>’</dt>
793
<p>When using the user mode network stack, redirect incoming TCP or UDP
794
connections to the host port <var>host-port</var> to the guest
795
<var>guest-host</var> on guest port <var>guest-port</var>. If <var>guest-host</var>
796
is not specified, its value is 10.0.2.15 (default address given by the
797
built-in DHCP server).
799
<p>For example, to redirect host X11 connection from screen 1 to guest
800
screen 0, use the following:
802
<table><tr><td> </td><td><pre class="example"># on the host
803
qemu -redir tcp:6001::6000 [...]
804
# this host xterm should open in the guest X11 server
806
</pre></td></tr></table>
808
<p>To redirect telnet connections from host port 5555 to telnet port on
809
the guest, use the following:
811
<table><tr><td> </td><td><pre class="example"># on the host
812
qemu -redir tcp:5555::23 [...]
813
telnet localhost 5555
814
</pre></td></tr></table>
816
<p>Then when you use on the host <code>telnet localhost 5555</code>, you
817
connect to the guest telnet server.
822
<p>Linux boot specific: When using these options, you can use a given
823
Linux kernel without installing it in the disk image. It can be useful
824
for easier testing of various kernels.
826
<dl compact="compact">
827
<dt> ‘<samp>-kernel bzImage</samp>’</dt>
828
<dd><p>Use <var>bzImage</var> as kernel image.
831
<dt> ‘<samp>-append cmdline</samp>’</dt>
832
<dd><p>Use <var>cmdline</var> as kernel command line
835
<dt> ‘<samp>-initrd file</samp>’</dt>
836
<dd><p>Use <var>file</var> as initial ram disk.
841
<p>Debug/Expert options:
842
</p><dl compact="compact">
843
<dt> ‘<samp>-serial dev</samp>’</dt>
844
<dd><p>Redirect the virtual serial port to host character device
845
<var>dev</var>. The default device is <code>vc</code> in graphical mode and
846
<code>stdio</code> in non graphical mode.
848
<p>This option can be used several times to simulate up to 4 serials
851
<p>Use <code>-serial none</code> to disable all serial ports.
853
<p>Available character devices are:
854
</p><dl compact="compact">
855
<dt> <code>vc[:WxH]</code></dt>
856
<dd><p>Virtual console. Optionally, a width and height can be given in pixel with
857
</p><table><tr><td> </td><td><pre class="example">vc:800x600
858
</pre></td></tr></table>
859
<p>It is also possible to specify width or height in characters:
860
</p><table><tr><td> </td><td><pre class="example">vc:80Cx24C
861
</pre></td></tr></table>
863
<dt> <code>pty</code></dt>
864
<dd><p>[Linux only] Pseudo TTY (a new PTY is automatically allocated)
866
<dt> <code>none</code></dt>
867
<dd><p>No device is allocated.
869
<dt> <code>null</code></dt>
872
<dt> <code>/dev/XXX</code></dt>
873
<dd><p>[Linux only] Use host tty, e.g. ‘<tt>/dev/ttyS0</tt>’. The host serial port
874
parameters are set according to the emulated ones.
876
<dt> <code>/dev/parportN</code></dt>
877
<dd><p>[Linux only, parallel port only] Use host parallel port
878
<var>N</var>. Currently SPP and EPP parallel port features can be used.
880
<dt> <code>file:filename</code></dt>
881
<dd><p>Write output to filename. No character can be read.
883
<dt> <code>stdio</code></dt>
884
<dd><p>[Unix only] standard input/output
886
<dt> <code>pipe:filename</code></dt>
887
<dd><p>name pipe <var>filename</var>
889
<dt> <code>COMn</code></dt>
890
<dd><p>[Windows only] Use host serial port <var>n</var>
892
<dt> <code>udp:[remote_host]:remote_port[@[src_ip]:src_port]</code></dt>
893
<dd><p>This implements UDP Net Console. When <var>remote_host</var> or <var>src_ip</var> are not specified they default to <code>0.0.0.0</code>. When not using a specified <var>src_port</var> a random port is automatically chosen.
895
<p>If you just want a simple readonly console you can use <code>netcat</code> or
896
<code>nc</code>, by starting qemu with: <code>-serial udp::4555</code> and nc as:
897
<code>nc -u -l -p 4555</code>. Any time qemu writes something to that port it
898
will appear in the netconsole session.
900
<p>If you plan to send characters back via netconsole or you want to stop
901
and start qemu a lot of times, you should have qemu use the same
902
source port each time by using something like <code>-serial
903
udp::4555@:4556</code> to qemu. Another approach is to use a patched
904
version of netcat which can listen to a TCP port and send and receive
905
characters via udp. If you have a patched version of netcat which
906
activates telnet remote echo and single char transfer, then you can
907
use the following options to step up a netcat redirector to allow
908
telnet on port 5555 to access the qemu port.
909
</p><dl compact="compact">
910
<dt> <code>Qemu Options:</code></dt>
911
<dd><p>-serial udp::4555@:4556
913
<dt> <code>netcat options:</code></dt>
914
<dd><p>-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
916
<dt> <code>telnet options:</code></dt>
917
<dd><p>localhost 5555
923
<dt> <code>tcp:[host]:port[,server][,nowait][,nodelay]</code></dt>
924
<dd><p>The TCP Net Console has two modes of operation. It can send the serial
925
I/O to a location or wait for a connection from a location. By default
926
the TCP Net Console is sent to <var>host</var> at the <var>port</var>. If you use
927
the <var>server</var> option QEMU will wait for a client socket application
928
to connect to the port before continuing, unless the <code>nowait</code>
929
option was specified. The <code>nodelay</code> option disables the Nagle buffering
930
algorithm. If <var>host</var> is omitted, 0.0.0.0 is assumed. Only
931
one TCP connection at a time is accepted. You can use <code>telnet</code> to
932
connect to the corresponding character device.
933
</p><dl compact="compact">
934
<dt> <code>Example to send tcp console to 192.168.0.2 port 4444</code></dt>
935
<dd><p>-serial tcp:192.168.0.2:4444
937
<dt> <code>Example to listen and wait on port 4444 for connection</code></dt>
938
<dd><p>-serial tcp::4444,server
940
<dt> <code>Example to not wait and listen on ip 192.168.0.100 port 4444</code></dt>
941
<dd><p>-serial tcp:192.168.0.100:4444,server,nowait
946
<dt> <code>telnet:host:port[,server][,nowait][,nodelay]</code></dt>
947
<dd><p>The telnet protocol is used instead of raw tcp sockets. The options
948
work the same as if you had specified <code>-serial tcp</code>. The
949
difference is that the port acts like a telnet server or client using
950
telnet option negotiation. This will also allow you to send the
951
MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
952
sequence. Typically in unix telnet you do it with Control-] and then
953
type "send break" followed by pressing the enter key.
956
<dt> <code>unix:path[,server][,nowait]</code></dt>
957
<dd><p>A unix domain socket is used instead of a tcp socket. The option works the
958
same as if you had specified <code>-serial tcp</code> except the unix domain socket
959
<var>path</var> is used for connections.
962
<dt> <code>mon:dev_string</code></dt>
963
<dd><p>This is a special option to allow the monitor to be multiplexed onto
964
another serial port. The monitor is accessed with key sequence of
965
<Control-a> and then pressing <c>. See monitor access
966
<a href="#SEC11">Keys</a> in the -nographic section for more keys.
967
<var>dev_string</var> should be any one of the serial devices specified
968
above. An example to multiplex the monitor onto a telnet server
969
listening on port 4444 would be:
970
</p><dl compact="compact">
971
<dt> <code>-serial mon:telnet::4444,server,nowait</code></dt>
978
<dt> ‘<samp>-parallel dev</samp>’</dt>
979
<dd><p>Redirect the virtual parallel port to host device <var>dev</var> (same
980
devices as the serial port). On Linux hosts, ‘<tt>/dev/parportN</tt>’ can
981
be used to use hardware devices connected on the corresponding host
984
<p>This option can be used several times to simulate up to 3 parallel
987
<p>Use <code>-parallel none</code> to disable all parallel ports.
990
<dt> ‘<samp>-monitor dev</samp>’</dt>
991
<dd><p>Redirect the monitor to host device <var>dev</var> (same devices as the
993
The default device is <code>vc</code> in graphical mode and <code>stdio</code> in
997
<dt> ‘<samp>-echr numeric_ascii_value</samp>’</dt>
998
<dd><p>Change the escape character used for switching to the monitor when using
999
monitor and serial sharing. The default is <code>0x01</code> when using the
1000
<code>-nographic</code> option. <code>0x01</code> is equal to pressing
1001
<code>Control-a</code>. You can select a different character from the ascii
1002
control keys where 1 through 26 map to Control-a through Control-z. For
1003
instance you could use the either of the following to change the escape
1004
character to Control-t.
1005
</p><dl compact="compact">
1006
<dt> <code>-echr 0x14</code></dt>
1007
<dt> <code>-echr 20</code></dt>
1011
<dt> ‘<samp>-s</samp>’</dt>
1012
<dd><p>Wait gdb connection to port 1234 (see section <a href="#SEC46">GDB usage</a>).
1014
<dt> ‘<samp>-p port</samp>’</dt>
1015
<dd><p>Change gdb connection port. <var>port</var> can be either a decimal number
1016
to specify a TCP port, or a host device (same devices as the serial port).
1018
<dt> ‘<samp>-S</samp>’</dt>
1019
<dd><p>Do not start CPU at startup (you must type 'c' in the monitor).
1021
<dt> ‘<samp>-d</samp>’</dt>
1022
<dd><p>Output log in /tmp/qemu.log
1024
<dt> ‘<samp>-hdachs c,h,s,[,t]</samp>’</dt>
1025
<dd><p>Force hard disk 0 physical geometry (1 <= <var>c</var> <= 16383, 1 <=
1026
<var>h</var> <= 16, 1 <= <var>s</var> <= 63) and optionally force the BIOS
1027
translation mode (<var>t</var>=none, lba or auto). Usually QEMU can guess
1028
all those parameters. This option is useful for old MS-DOS disk
1032
<dt> ‘<samp>-L path</samp>’</dt>
1033
<dd><p>Set the directory for the BIOS, VGA BIOS and keymaps.
1036
<dt> ‘<samp>-std-vga</samp>’</dt>
1037
<dd><p>Simulate a standard VGA card with Bochs VBE extensions (default is
1038
Cirrus Logic GD5446 PCI VGA). If your guest OS supports the VESA 2.0
1039
VBE extensions (e.g. Windows XP) and if you want to use high
1040
resolution modes (>= 1280x1024x16) then you should use this option.
1043
<dt> ‘<samp>-no-acpi</samp>’</dt>
1044
<dd><p>Disable ACPI (Advanced Configuration and Power Interface) support. Use
1045
it if your guest OS complains about ACPI problems (PC target machine
1049
<dt> ‘<samp>-no-reboot</samp>’</dt>
1050
<dd><p>Exit instead of rebooting.
1053
<dt> ‘<samp>-loadvm file</samp>’</dt>
1054
<dd><p>Start right away with a saved state (<code>loadvm</code> in monitor)
1057
<dt> ‘<samp>-semihosting</samp>’</dt>
1058
<dd><p>Enable semihosting syscall emulation (ARM and M68K target machines only).
1060
<p>On ARM this implements the "Angel" interface.
1061
On M68K this implements the "ColdFire GDB" interface used by libgloss.
1063
<p>Note that this allows guest direct access to the host filesystem,
1064
so should only be used with trusted guest OS.
1070
<a name="pcsys_005fkeys"></a>
1071
<a name="SEC11"></a>
1072
<table cellpadding="1" cellspacing="1" border="0">
1073
<tr><td valign="middle" align="left">[<a href="#SEC10" title="Previous section in reading order"> < </a>]</td>
1074
<td valign="middle" align="left">[<a href="#SEC12" title="Next section in reading order"> > </a>]</td>
1075
<td valign="middle" align="left"> </td>
1076
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1077
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
1078
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1079
<td valign="middle" align="left"> </td>
1080
<td valign="middle" align="left"> </td>
1081
<td valign="middle" align="left"> </td>
1082
<td valign="middle" align="left"> </td>
1083
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1084
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1085
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1086
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1088
<h2 class="section"> 3.4 Keys </h2>
1091
<p>During the graphical emulation, you can use the following keys:
1092
</p><dl compact="compact">
1093
<dt> <Ctrl-Alt-f></dt>
1094
<dd><p>Toggle full screen
1097
<dt> <Ctrl-Alt-n></dt>
1098
<dd><p>Switch to virtual console 'n'. Standard console mappings are:
1099
</p><dl compact="compact">
1100
<dt> <em>1</em></dt>
1101
<dd><p>Target system display
1103
<dt> <em>2</em></dt>
1106
<dt> <em>3</em></dt>
1112
<dt> <Ctrl-Alt></dt>
1113
<dd><p>Toggle mouse and keyboard grab.
1117
<p>In the virtual consoles, you can use <Ctrl-Up>, <Ctrl-Down>,
1118
<Ctrl-PageUp> and <Ctrl-PageDown> to move in the back log.
1120
<p>During emulation, if you are using the ‘<samp>-nographic</samp>’ option, use
1121
<Ctrl-a h> to get terminal commands:
1123
<dl compact="compact">
1124
<dt> <Ctrl-a h></dt>
1125
<dd><p>Print this help
1127
<dt> <Ctrl-a x></dt>
1128
<dd><p>Exit emulator
1130
<dt> <Ctrl-a s></dt>
1131
<dd><p>Save disk data back to file (if -snapshot)
1133
<dt> <Ctrl-a t></dt>
1134
<dd><p>toggle console timestamps
1136
<dt> <Ctrl-a b></dt>
1137
<dd><p>Send break (magic sysrq in Linux)
1139
<dt> <Ctrl-a c></dt>
1140
<dd><p>Switch between console and monitor
1142
<dt> <Ctrl-a Ctrl-a></dt>
1149
<a name="pcsys_005fmonitor"></a>
1150
<a name="SEC12"></a>
1151
<table cellpadding="1" cellspacing="1" border="0">
1152
<tr><td valign="middle" align="left">[<a href="#SEC11" title="Previous section in reading order"> < </a>]</td>
1153
<td valign="middle" align="left">[<a href="#SEC13" title="Next section in reading order"> > </a>]</td>
1154
<td valign="middle" align="left"> </td>
1155
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1156
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
1157
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1158
<td valign="middle" align="left"> </td>
1159
<td valign="middle" align="left"> </td>
1160
<td valign="middle" align="left"> </td>
1161
<td valign="middle" align="left"> </td>
1162
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1163
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1164
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1165
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1167
<h2 class="section"> 3.5 QEMU Monitor </h2>
1169
<p>The QEMU monitor is used to give complex commands to the QEMU
1170
emulator. You can use it to:
1174
Remove or insert removable media images
1175
(such as CD-ROM or floppies)
1178
Freeze/unfreeze the Virtual Machine (VM) and save or restore its state
1181
</li><li>- Inspect the VM state without an external debugger.
1186
<a name="SEC13"></a>
1187
<table cellpadding="1" cellspacing="1" border="0">
1188
<tr><td valign="middle" align="left">[<a href="#SEC12" title="Previous section in reading order"> < </a>]</td>
1189
<td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> > </a>]</td>
1190
<td valign="middle" align="left"> </td>
1191
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1192
<td valign="middle" align="left">[<a href="#SEC12" title="Up section"> Up </a>]</td>
1193
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1194
<td valign="middle" align="left"> </td>
1195
<td valign="middle" align="left"> </td>
1196
<td valign="middle" align="left"> </td>
1197
<td valign="middle" align="left"> </td>
1198
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1199
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1200
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1201
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1203
<h3 class="subsection"> 3.5.1 Commands </h3>
1205
<p>The following commands are available:
1207
<dl compact="compact">
1208
<dt> ‘<samp>help or ? [cmd]</samp>’</dt>
1209
<dd><p>Show the help for all commands or just for command <var>cmd</var>.
1212
<dt> ‘<samp>commit</samp>’</dt>
1213
<dd><p>Commit changes to the disk images (if -snapshot is used)
1216
<dt> ‘<samp>info subcommand</samp>’</dt>
1217
<dd><p>show various information about the system state
1219
<dl compact="compact">
1220
<dt> ‘<samp>info network</samp>’</dt>
1221
<dd><p>show the various VLANs and the associated devices
1223
<dt> ‘<samp>info block</samp>’</dt>
1224
<dd><p>show the block devices
1226
<dt> ‘<samp>info registers</samp>’</dt>
1227
<dd><p>show the cpu registers
1229
<dt> ‘<samp>info history</samp>’</dt>
1230
<dd><p>show the command line history
1232
<dt> ‘<samp>info pci</samp>’</dt>
1233
<dd><p>show emulated PCI device
1235
<dt> ‘<samp>info usb</samp>’</dt>
1236
<dd><p>show USB devices plugged on the virtual USB hub
1238
<dt> ‘<samp>info usbhost</samp>’</dt>
1239
<dd><p>show all USB host devices
1241
<dt> ‘<samp>info capture</samp>’</dt>
1242
<dd><p>show information about active capturing
1244
<dt> ‘<samp>info snapshots</samp>’</dt>
1245
<dd><p>show list of VM snapshots
1247
<dt> ‘<samp>info mice</samp>’</dt>
1248
<dd><p>show which guest mouse is receiving events
1253
<dt> ‘<samp>q or quit</samp>’</dt>
1254
<dd><p>Quit the emulator.
1257
<dt> ‘<samp>eject [-f] device</samp>’</dt>
1258
<dd><p>Eject a removable medium (use -f to force it).
1261
<dt> ‘<samp>change device setting</samp>’</dt>
1263
<p>Change the configuration of a device
1265
<dl compact="compact">
1266
<dt> ‘<samp>change <var>diskdevice</var> <var>filename</var></samp>’</dt>
1267
<dd><p>Change the medium for a removable disk device to point to <var>filename</var>. eg
1269
<table><tr><td> </td><td><pre class="example">(qemu) change cdrom /path/to/some.iso
1270
</pre></td></tr></table>
1273
<dt> ‘<samp>change vnc <var>display,options</var></samp>’</dt>
1274
<dd><p>Change the configuration of the VNC server. The valid syntax for <var>display</var>
1275
and <var>options</var> are described at <a href="#SEC10">Invocation</a>. eg
1277
<table><tr><td> </td><td><pre class="example">(qemu) change vnc localhost:1
1278
</pre></td></tr></table>
1281
<dt> ‘<samp>change vnc password</samp>’</dt>
1283
<p>Change the password associated with the VNC server. The monitor will prompt for
1284
the new password to be entered. VNC passwords are only significant upto 8 letters.
1287
<table><tr><td> </td><td><pre class="example">(qemu) change vnc password
1289
</pre></td></tr></table>
1295
<dt> ‘<samp>screendump filename</samp>’</dt>
1296
<dd><p>Save screen into PPM image <var>filename</var>.
1299
<dt> ‘<samp>mouse_move dx dy [dz]</samp>’</dt>
1300
<dd><p>Move the active mouse to the specified coordinates <var>dx</var> <var>dy</var>
1301
with optional scroll axis <var>dz</var>.
1304
<dt> ‘<samp>mouse_button val</samp>’</dt>
1305
<dd><p>Change the active mouse button state <var>val</var> (1=L, 2=M, 4=R).
1308
<dt> ‘<samp>mouse_set index</samp>’</dt>
1309
<dd><p>Set which mouse device receives events at given <var>index</var>, index
1310
can be obtained with
1311
</p><table><tr><td> </td><td><pre class="example">info mice
1312
</pre></td></tr></table>
1315
<dt> ‘<samp>wavcapture filename [frequency [bits [channels]]]</samp>’</dt>
1316
<dd><p>Capture audio into <var>filename</var>. Using sample rate <var>frequency</var>
1317
bits per sample <var>bits</var> and number of channels <var>channels</var>.
1320
</p><ul class="toc">
1321
<li>- Sample rate = 44100 Hz - CD quality
1322
</li><li>- Bits = 16
1323
</li><li>- Number of channels = 2 - Stereo
1327
<dt> ‘<samp>stopcapture index</samp>’</dt>
1328
<dd><p>Stop capture with a given <var>index</var>, index can be obtained with
1329
</p><table><tr><td> </td><td><pre class="example">info capture
1330
</pre></td></tr></table>
1333
<dt> ‘<samp>log item1[,...]</samp>’</dt>
1334
<dd><p>Activate logging of the specified items to ‘<tt>/tmp/qemu.log</tt>’.
1337
<dt> ‘<samp>savevm [tag|id]</samp>’</dt>
1338
<dd><p>Create a snapshot of the whole virtual machine. If <var>tag</var> is
1339
provided, it is used as human readable identifier. If there is already
1340
a snapshot with the same tag or ID, it is replaced. More info at
1341
<a href="#SEC18">VM snapshots</a>.
1344
<dt> ‘<samp>loadvm tag|id</samp>’</dt>
1345
<dd><p>Set the whole virtual machine to the snapshot identified by the tag
1346
<var>tag</var> or the unique snapshot ID <var>id</var>.
1349
<dt> ‘<samp>delvm tag|id</samp>’</dt>
1350
<dd><p>Delete the snapshot identified by <var>tag</var> or <var>id</var>.
1353
<dt> ‘<samp>stop</samp>’</dt>
1354
<dd><p>Stop emulation.
1357
<dt> ‘<samp>c or cont</samp>’</dt>
1358
<dd><p>Resume emulation.
1361
<dt> ‘<samp>gdbserver [port]</samp>’</dt>
1362
<dd><p>Start gdbserver session (default port=1234)
1365
<dt> ‘<samp>x/fmt addr</samp>’</dt>
1366
<dd><p>Virtual memory dump starting at <var>addr</var>.
1369
<dt> ‘<samp>xp /fmt addr</samp>’</dt>
1370
<dd><p>Physical memory dump starting at <var>addr</var>.
1372
<p><var>fmt</var> is a format which tells the command how to format the
1373
data. Its syntax is: ‘<samp>/{count}{format}{size}</samp>’
1375
<dl compact="compact">
1376
<dt> <var>count</var></dt>
1377
<dd><p>is the number of items to be dumped.
1380
<dt> <var>format</var></dt>
1381
<dd><p>can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
1382
c (char) or i (asm instruction).
1385
<dt> <var>size</var></dt>
1386
<dd><p>can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
1387
<code>h</code> or <code>w</code> can be specified with the <code>i</code> format to
1388
respectively select 16 or 32 bit code instruction size.
1394
</p><ul class="toc">
1396
Dump 10 instructions at the current instruction pointer:
1397
<table><tr><td> </td><td><pre class="example">(qemu) x/10i $eip
1400
0x90107065: lea 0x0(%esi,1),%esi
1401
0x90107069: lea 0x0(%edi,1),%edi
1403
0x90107071: jmp 0x90107080
1408
</pre></td></tr></table>
1411
Dump 80 16 bit values at the start of the video memory.
1412
<table><tr><td> </td><td><pre class="smallexample">(qemu) xp/80hx 0xb8000
1413
0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
1414
0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
1415
0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
1416
0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
1417
0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
1418
0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
1419
0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1420
0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1421
0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1422
0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1423
</pre></td></tr></table>
1427
<dt> ‘<samp>p or print/fmt expr</samp>’</dt>
1429
<p>Print expression value. Only the <var>format</var> part of <var>fmt</var> is
1433
<dt> ‘<samp>sendkey keys</samp>’</dt>
1435
<p>Send <var>keys</var> to the emulator. Use <code>-</code> to press several keys
1436
simultaneously. Example:
1437
</p><table><tr><td> </td><td><pre class="example">sendkey ctrl-alt-f1
1438
</pre></td></tr></table>
1440
<p>This command is useful to send keys that your graphical user interface
1441
intercepts at low level, such as <code>ctrl-alt-f1</code> in X Window.
1444
<dt> ‘<samp>system_reset</samp>’</dt>
1446
<p>Reset the system.
1449
<dt> ‘<samp>usb_add devname</samp>’</dt>
1451
<p>Add the USB device <var>devname</var>. For details of available devices see
1452
<a href="#SEC34">Connecting USB devices</a>
1455
<dt> ‘<samp>usb_del devname</samp>’</dt>
1457
<p>Remove the USB device <var>devname</var> from the QEMU virtual USB
1458
hub. <var>devname</var> has the syntax <code>bus.addr</code>. Use the monitor
1459
command <code>info usb</code> to see the devices you can remove.
1465
<a name="SEC14"></a>
1466
<table cellpadding="1" cellspacing="1" border="0">
1467
<tr><td valign="middle" align="left">[<a href="#SEC13" title="Previous section in reading order"> < </a>]</td>
1468
<td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> > </a>]</td>
1469
<td valign="middle" align="left"> </td>
1470
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1471
<td valign="middle" align="left">[<a href="#SEC12" title="Up section"> Up </a>]</td>
1472
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1473
<td valign="middle" align="left"> </td>
1474
<td valign="middle" align="left"> </td>
1475
<td valign="middle" align="left"> </td>
1476
<td valign="middle" align="left"> </td>
1477
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1478
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1479
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1480
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1482
<h3 class="subsection"> 3.5.2 Integer expressions </h3>
1484
<p>The monitor understands integers expressions for every integer
1485
argument. You can use register names to get the value of specifics
1486
CPU registers by prefixing them with <em>$</em>.
1489
<a name="disk_005fimages"></a>
1490
<a name="SEC15"></a>
1491
<table cellpadding="1" cellspacing="1" border="0">
1492
<tr><td valign="middle" align="left">[<a href="#SEC14" title="Previous section in reading order"> < </a>]</td>
1493
<td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> > </a>]</td>
1494
<td valign="middle" align="left"> </td>
1495
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1496
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
1497
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1498
<td valign="middle" align="left"> </td>
1499
<td valign="middle" align="left"> </td>
1500
<td valign="middle" align="left"> </td>
1501
<td valign="middle" align="left"> </td>
1502
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1503
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1504
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1505
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1507
<h2 class="section"> 3.6 Disk Images </h2>
1509
<p>Since version 0.6.1, QEMU supports many disk image formats, including
1510
growable disk images (their size increase as non empty sectors are
1511
written), compressed and encrypted disk images. Version 0.8.3 added
1512
the new qcow2 disk image format which is essential to support VM
1515
<table class="menu" border="0" cellspacing="0">
1516
<tr><td align="left" valign="top"><a href="#SEC16">3.6.1 Quick start for disk image creation</a></td><td> </td><td align="left" valign="top"></td></tr>
1517
<tr><td align="left" valign="top"><a href="#SEC17">3.6.2 Snapshot mode</a></td><td> </td><td align="left" valign="top"></td></tr>
1518
<tr><td align="left" valign="top"><a href="#SEC18">3.6.3 VM snapshots</a></td><td> </td><td align="left" valign="top"></td></tr>
1519
<tr><td align="left" valign="top"><a href="#SEC19">3.6.4 <code>qemu-img</code> Invocation</a></td><td> </td><td align="left" valign="top"> qemu-img Invocation
1521
<tr><td align="left" valign="top"><a href="#SEC20">3.6.5 Using host drives</a></td><td> </td><td align="left" valign="top"></td></tr>
1522
<tr><td align="left" valign="top"><a href="#SEC24">3.6.6 Virtual FAT disk images</a></td><td> </td><td align="left" valign="top"></td></tr>
1526
<a name="disk_005fimages_005fquickstart"></a>
1527
<a name="SEC16"></a>
1528
<table cellpadding="1" cellspacing="1" border="0">
1529
<tr><td valign="middle" align="left">[<a href="#SEC15" title="Previous section in reading order"> < </a>]</td>
1530
<td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> > </a>]</td>
1531
<td valign="middle" align="left"> </td>
1532
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1533
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1534
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1535
<td valign="middle" align="left"> </td>
1536
<td valign="middle" align="left"> </td>
1537
<td valign="middle" align="left"> </td>
1538
<td valign="middle" align="left"> </td>
1539
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1540
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1541
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1542
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1544
<h3 class="subsection"> 3.6.1 Quick start for disk image creation </h3>
1546
<p>You can create a disk image with the command:
1547
</p><table><tr><td> </td><td><pre class="example">qemu-img create myimage.img mysize
1548
</pre></td></tr></table>
1549
<p>where <var>myimage.img</var> is the disk image filename and <var>mysize</var> is its
1550
size in kilobytes. You can add an <code>M</code> suffix to give the size in
1551
megabytes and a <code>G</code> suffix for gigabytes.
1553
<p>See <a href="#SEC19"><code>qemu-img</code> Invocation</a> for more information.
1556
<a name="disk_005fimages_005fsnapshot_005fmode"></a>
1557
<a name="SEC17"></a>
1558
<table cellpadding="1" cellspacing="1" border="0">
1559
<tr><td valign="middle" align="left">[<a href="#SEC16" title="Previous section in reading order"> < </a>]</td>
1560
<td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> > </a>]</td>
1561
<td valign="middle" align="left"> </td>
1562
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1563
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1564
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1565
<td valign="middle" align="left"> </td>
1566
<td valign="middle" align="left"> </td>
1567
<td valign="middle" align="left"> </td>
1568
<td valign="middle" align="left"> </td>
1569
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1570
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1571
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1572
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1574
<h3 class="subsection"> 3.6.2 Snapshot mode </h3>
1576
<p>If you use the option ‘<samp>-snapshot</samp>’, all disk images are
1577
considered as read only. When sectors in written, they are written in
1578
a temporary file created in ‘<tt>/tmp</tt>’. You can however force the
1579
write back to the raw disk images by using the <code>commit</code> monitor
1580
command (or <C-a s> in the serial console).
1583
<a name="vm_005fsnapshots"></a>
1584
<a name="SEC18"></a>
1585
<table cellpadding="1" cellspacing="1" border="0">
1586
<tr><td valign="middle" align="left">[<a href="#SEC17" title="Previous section in reading order"> < </a>]</td>
1587
<td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> > </a>]</td>
1588
<td valign="middle" align="left"> </td>
1589
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1590
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1591
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1592
<td valign="middle" align="left"> </td>
1593
<td valign="middle" align="left"> </td>
1594
<td valign="middle" align="left"> </td>
1595
<td valign="middle" align="left"> </td>
1596
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1597
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1598
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1599
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1601
<h3 class="subsection"> 3.6.3 VM snapshots </h3>
1603
<p>VM snapshots are snapshots of the complete virtual machine including
1604
CPU state, RAM, device state and the content of all the writable
1605
disks. In order to use VM snapshots, you must have at least one non
1606
removable and writable block device using the <code>qcow2</code> disk image
1607
format. Normally this device is the first virtual hard drive.
1609
<p>Use the monitor command <code>savevm</code> to create a new VM snapshot or
1610
replace an existing one. A human readable name can be assigned to each
1611
snapshot in addition to its numerical ID.
1613
<p>Use <code>loadvm</code> to restore a VM snapshot and <code>delvm</code> to remove
1614
a VM snapshot. <code>info snapshots</code> lists the available snapshots
1615
with their associated information:
1617
<table><tr><td> </td><td><pre class="example">(qemu) info snapshots
1618
Snapshot devices: hda
1619
Snapshot list (from hda):
1620
ID TAG VM SIZE DATE VM CLOCK
1621
1 start 41M 2006-08-06 12:38:02 00:00:14.954
1622
2 40M 2006-08-06 12:43:29 00:00:18.633
1623
3 msys 40M 2006-08-06 12:44:04 00:00:23.514
1624
</pre></td></tr></table>
1626
<p>A VM snapshot is made of a VM state info (its size is shown in
1627
<code>info snapshots</code>) and a snapshot of every writable disk image.
1628
The VM state info is stored in the first <code>qcow2</code> non removable
1629
and writable block device. The disk image snapshots are stored in
1630
every disk image. The size of a snapshot in a disk image is difficult
1631
to evaluate and is not shown by <code>info snapshots</code> because the
1632
associated disk sectors are shared among all the snapshots to save
1633
disk space (otherwise each snapshot would need a full copy of all the
1636
<p>When using the (unrelated) <code>-snapshot</code> option
1637
(<a href="#SEC17">Snapshot mode</a>), you can always make VM snapshots,
1638
but they are deleted as soon as you exit QEMU.
1640
<p>VM snapshots currently have the following known limitations:
1641
</p><ul class="toc">
1643
They cannot cope with removable devices if they are removed or
1644
inserted after a snapshot is done.
1646
A few device drivers still have incomplete snapshot support so their
1647
state is not saved or restored properly (in particular USB).
1651
<a name="qemu_005fimg_005finvocation"></a>
1652
<a name="SEC19"></a>
1653
<table cellpadding="1" cellspacing="1" border="0">
1654
<tr><td valign="middle" align="left">[<a href="#SEC18" title="Previous section in reading order"> < </a>]</td>
1655
<td valign="middle" align="left">[<a href="#SEC20" title="Next section in reading order"> > </a>]</td>
1656
<td valign="middle" align="left"> </td>
1657
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1658
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1659
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1660
<td valign="middle" align="left"> </td>
1661
<td valign="middle" align="left"> </td>
1662
<td valign="middle" align="left"> </td>
1663
<td valign="middle" align="left"> </td>
1664
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1665
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1666
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1667
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1669
<h3 class="subsection"> 3.6.4 <code>qemu-img</code> Invocation </h3>
1671
<table><tr><td> </td><td><pre class="example">usage: qemu-img command [command options]
1672
</pre></td></tr></table>
1675
<p>The following commands are supported:
1676
</p><dl compact="compact">
1677
<dt> ‘<samp>create [-e] [-6] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>’</dt>
1678
<dt> ‘<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
1679
<dt> ‘<samp>convert [-c] [-e] [-6] [-f <var>fmt</var>] <var>filename</var> [-O <var>output_fmt</var>] <var>output_filename</var></samp>’</dt>
1680
<dt> ‘<samp>info [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
1683
<p>Command parameters:
1684
</p><dl compact="compact">
1685
<dt> <var>filename</var></dt>
1686
<dd><p> is a disk image filename
1688
<dt> <var>base_image</var></dt>
1689
<dd><p>is the read-only disk image which is used as base for a copy on
1690
write image; the copy on write image only stores the modified data
1693
<dt> <var>fmt</var></dt>
1694
<dd><p>is the disk image format. It is guessed automatically in most cases. The following formats are supported:
1696
<dl compact="compact">
1697
<dt> <code>raw</code></dt>
1699
<p>Raw disk image format (default). This format has the advantage of
1700
being simple and easily exportable to all other emulators. If your
1701
file system supports <em>holes</em> (for example in ext2 or ext3 on
1702
Linux or NTFS on Windows), then only the written sectors will reserve
1703
space. Use <code>qemu-img info</code> to know the real size used by the
1704
image or <code>ls -ls</code> on Unix/Linux.
1707
<dt> <code>qcow2</code></dt>
1708
<dd><p>QEMU image format, the most versatile format. Use it to have smaller
1709
images (useful if your filesystem does not supports holes, for example
1710
on Windows), optional AES encryption, zlib based compression and
1711
support of multiple VM snapshots.
1713
<dt> <code>qcow</code></dt>
1714
<dd><p>Old QEMU image format. Left for compatibility.
1716
<dt> <code>cow</code></dt>
1717
<dd><p>User Mode Linux Copy On Write image format. Used to be the only growable
1718
image format in QEMU. It is supported only for compatibility with
1719
previous versions. It does not work on win32.
1721
<dt> <code>vmdk</code></dt>
1722
<dd><p>VMware 3 and 4 compatible image format.
1724
<dt> <code>cloop</code></dt>
1725
<dd><p>Linux Compressed Loop image, useful only to reuse directly compressed
1726
CD-ROM images present for example in the Knoppix CD-ROMs.
1731
<dt> <var>size</var></dt>
1732
<dd><p>is the disk image size in kilobytes. Optional suffixes <code>M</code>
1733
(megabyte) and <code>G</code> (gigabyte) are supported
1736
<dt> <var>output_filename</var></dt>
1737
<dd><p>is the destination disk image filename
1740
<dt> <var>output_fmt</var></dt>
1741
<dd><p> is the destination format
1744
<dt> <var>-c</var></dt>
1745
<dd><p>indicates that target image must be compressed (qcow format only)
1747
<dt> <var>-e</var></dt>
1748
<dd><p>indicates that the target image must be encrypted (qcow format only)
1750
<dt> <var>-6</var></dt>
1751
<dd><p>indicates that the target image must use compatibility level 6 (vmdk format only)
1755
<p>Command description:
1757
<dl compact="compact">
1758
<dt> ‘<samp>create [-6] [-e] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>’</dt>
1760
<p>Create the new disk image <var>filename</var> of size <var>size</var> and format
1763
<p>If <var>base_image</var> is specified, then the image will record only the
1764
differences from <var>base_image</var>. No size needs to be specified in
1765
this case. <var>base_image</var> will never be modified unless you use the
1766
<code>commit</code> monitor command.
1769
<dt> ‘<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
1771
<p>Commit the changes recorded in <var>filename</var> in its base image.
1774
<dt> ‘<samp>convert [-c] [-e] [-f <var>fmt</var>] <var>filename</var> [-O <var>output_fmt</var>] <var>output_filename</var></samp>’</dt>
1776
<p>Convert the disk image <var>filename</var> to disk image <var>output_filename</var>
1777
using format <var>output_fmt</var>. It can be optionally encrypted
1778
(<code>-e</code> option) or compressed (<code>-c</code> option).
1780
<p>Only the format <code>qcow</code> supports encryption or compression. The
1781
compression is read-only. It means that if a compressed sector is
1782
rewritten, then it is rewritten as uncompressed data.
1784
<p>Encryption uses the AES format which is very secure (128 bit keys). Use
1785
a long password (16 characters) to get maximum protection.
1787
<p>Image conversion is also useful to get smaller image when using a
1788
growable format such as <code>qcow</code> or <code>cow</code>: the empty sectors
1789
are detected and suppressed from the destination image.
1792
<dt> ‘<samp>info [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
1794
<p>Give information about the disk image <var>filename</var>. Use it in
1795
particular to know the size reserved on disk which can be different
1796
from the displayed size. If VM snapshots are stored in the disk image,
1797
they are displayed too.
1804
<a name="host_005fdrives"></a>
1805
<a name="SEC20"></a>
1806
<table cellpadding="1" cellspacing="1" border="0">
1807
<tr><td valign="middle" align="left">[<a href="#SEC19" title="Previous section in reading order"> < </a>]</td>
1808
<td valign="middle" align="left">[<a href="#SEC21" title="Next section in reading order"> > </a>]</td>
1809
<td valign="middle" align="left"> </td>
1810
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1811
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1812
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1813
<td valign="middle" align="left"> </td>
1814
<td valign="middle" align="left"> </td>
1815
<td valign="middle" align="left"> </td>
1816
<td valign="middle" align="left"> </td>
1817
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1818
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1819
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1820
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1822
<h3 class="subsection"> 3.6.5 Using host drives </h3>
1824
<p>In addition to disk image files, QEMU can directly access host
1825
devices. We describe here the usage for QEMU version >= 0.8.3.
1828
<a name="SEC21"></a>
1829
<table cellpadding="1" cellspacing="1" border="0">
1830
<tr><td valign="middle" align="left">[<a href="#SEC20" title="Previous section in reading order"> < </a>]</td>
1831
<td valign="middle" align="left">[<a href="#SEC22" title="Next section in reading order"> > </a>]</td>
1832
<td valign="middle" align="left"> </td>
1833
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1834
<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1835
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1836
<td valign="middle" align="left"> </td>
1837
<td valign="middle" align="left"> </td>
1838
<td valign="middle" align="left"> </td>
1839
<td valign="middle" align="left"> </td>
1840
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1841
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1842
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1843
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1845
<h4 class="subsubsection"> 3.6.5.1 Linux </h4>
1847
<p>On Linux, you can directly use the host device filename instead of a
1848
disk image filename provided you have enough privileges to access
1849
it. For example, use ‘<tt>/dev/cdrom</tt>’ to access to the CDROM or
1850
‘<tt>/dev/fd0</tt>’ for the floppy.
1852
<dl compact="compact">
1853
<dt> <code>CD</code></dt>
1854
<dd><p>You can specify a CDROM device even if no CDROM is loaded. QEMU has
1855
specific code to detect CDROM insertion or removal. CDROM ejection by
1856
the guest OS is supported. Currently only data CDs are supported.
1858
<dt> <code>Floppy</code></dt>
1859
<dd><p>You can specify a floppy device even if no floppy is loaded. Floppy
1860
removal is currently not detected accurately (if you change floppy
1861
without doing floppy access while the floppy is not loaded, the guest
1862
OS will think that the same floppy is loaded).
1864
<dt> <code>Hard disks</code></dt>
1865
<dd><p>Hard disks can be used. Normally you must specify the whole disk
1866
(‘<tt>/dev/hdb</tt>’ instead of ‘<tt>/dev/hdb1</tt>’) so that the guest OS can
1867
see it as a partitioned disk. WARNING: unless you know what you do, it
1868
is better to only make READ-ONLY accesses to the hard disk otherwise
1869
you may corrupt your host data (use the ‘<samp>-snapshot</samp>’ command
1870
line option or modify the device permissions accordingly).
1875
<a name="SEC22"></a>
1876
<table cellpadding="1" cellspacing="1" border="0">
1877
<tr><td valign="middle" align="left">[<a href="#SEC21" title="Previous section in reading order"> < </a>]</td>
1878
<td valign="middle" align="left">[<a href="#SEC23" title="Next section in reading order"> > </a>]</td>
1879
<td valign="middle" align="left"> </td>
1880
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1881
<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1882
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1883
<td valign="middle" align="left"> </td>
1884
<td valign="middle" align="left"> </td>
1885
<td valign="middle" align="left"> </td>
1886
<td valign="middle" align="left"> </td>
1887
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1888
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1889
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1890
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1892
<h4 class="subsubsection"> 3.6.5.2 Windows </h4>
1894
<dl compact="compact">
1895
<dt> <code>CD</code></dt>
1896
<dd><p>The preferred syntax is the drive letter (e.g. ‘<tt>d:</tt>’). The
1897
alternate syntax ‘<tt>\\.\d:</tt>’ is supported. ‘<tt>/dev/cdrom</tt>’ is
1898
supported as an alias to the first CDROM drive.
1900
<p>Currently there is no specific code to handle removable media, so it
1901
is better to use the <code>change</code> or <code>eject</code> monitor commands to
1902
change or eject media.
1904
<dt> <code>Hard disks</code></dt>
1905
<dd><p>Hard disks can be used with the syntax: ‘<tt>\\.\PhysicalDriveN</tt>’
1906
where <var>N</var> is the drive number (0 is the first hard disk).
1908
<p>WARNING: unless you know what you do, it is better to only make
1909
READ-ONLY accesses to the hard disk otherwise you may corrupt your
1910
host data (use the ‘<samp>-snapshot</samp>’ command line so that the
1911
modifications are written in a temporary file).
1917
<a name="SEC23"></a>
1918
<table cellpadding="1" cellspacing="1" border="0">
1919
<tr><td valign="middle" align="left">[<a href="#SEC22" title="Previous section in reading order"> < </a>]</td>
1920
<td valign="middle" align="left">[<a href="#SEC24" title="Next section in reading order"> > </a>]</td>
1921
<td valign="middle" align="left"> </td>
1922
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1923
<td valign="middle" align="left">[<a href="#SEC20" title="Up section"> Up </a>]</td>
1924
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1925
<td valign="middle" align="left"> </td>
1926
<td valign="middle" align="left"> </td>
1927
<td valign="middle" align="left"> </td>
1928
<td valign="middle" align="left"> </td>
1929
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1930
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1931
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1932
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1934
<h4 class="subsubsection"> 3.6.5.3 Mac OS X </h4>
1936
<p>‘<tt>/dev/cdrom</tt>’ is an alias to the first CDROM.
1938
<p>Currently there is no specific code to handle removable media, so it
1939
is better to use the <code>change</code> or <code>eject</code> monitor commands to
1940
change or eject media.
1943
<a name="disk_005fimages_005ffat_005fimages"></a>
1944
<a name="SEC24"></a>
1945
<table cellpadding="1" cellspacing="1" border="0">
1946
<tr><td valign="middle" align="left">[<a href="#SEC23" title="Previous section in reading order"> < </a>]</td>
1947
<td valign="middle" align="left">[<a href="#SEC25" title="Next section in reading order"> > </a>]</td>
1948
<td valign="middle" align="left"> </td>
1949
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1950
<td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
1951
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
1952
<td valign="middle" align="left"> </td>
1953
<td valign="middle" align="left"> </td>
1954
<td valign="middle" align="left"> </td>
1955
<td valign="middle" align="left"> </td>
1956
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1957
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1958
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
1959
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1961
<h3 class="subsection"> 3.6.6 Virtual FAT disk images </h3>
1963
<p>QEMU can automatically create a virtual FAT disk image from a
1964
directory tree. In order to use it, just type:
1966
<table><tr><td> </td><td><pre class="example">qemu linux.img -hdb fat:/my_directory
1967
</pre></td></tr></table>
1969
<p>Then you access access to all the files in the ‘<tt>/my_directory</tt>’
1970
directory without having to copy them in a disk image or to export
1971
them via SAMBA or NFS. The default access is <em>read-only</em>.
1973
<p>Floppies can be emulated with the <code>:floppy:</code> option:
1975
<table><tr><td> </td><td><pre class="example">qemu linux.img -fda fat:floppy:/my_directory
1976
</pre></td></tr></table>
1978
<p>A read/write support is available for testing (beta stage) with the
1979
<code>:rw:</code> option:
1981
<table><tr><td> </td><td><pre class="example">qemu linux.img -fda fat:floppy:rw:/my_directory
1982
</pre></td></tr></table>
1984
<p>What you should <em>never</em> do:
1985
</p><ul class="toc">
1986
<li> use non-ASCII filenames ;
1987
</li><li> use "-snapshot" together with ":rw:" ;
1988
</li><li> expect it to work when loadvm'ing ;
1989
</li><li> write to the FAT directory on the host system while accessing it with the guest system.
1993
<a name="pcsys_005fnetwork"></a>
1994
<a name="SEC25"></a>
1995
<table cellpadding="1" cellspacing="1" border="0">
1996
<tr><td valign="middle" align="left">[<a href="#SEC24" title="Previous section in reading order"> < </a>]</td>
1997
<td valign="middle" align="left">[<a href="#SEC26" title="Next section in reading order"> > </a>]</td>
1998
<td valign="middle" align="left"> </td>
1999
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2000
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2001
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2002
<td valign="middle" align="left"> </td>
2003
<td valign="middle" align="left"> </td>
2004
<td valign="middle" align="left"> </td>
2005
<td valign="middle" align="left"> </td>
2006
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2007
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2008
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2009
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2011
<h2 class="section"> 3.7 Network emulation </h2>
2013
<p>QEMU can simulate several network cards (PCI or ISA cards on the PC
2014
target) and can connect them to an arbitrary number of Virtual Local
2015
Area Networks (VLANs). Host TAP devices can be connected to any QEMU
2016
VLAN. VLAN can be connected between separate instances of QEMU to
2017
simulate large networks. For simpler usage, a non privileged user mode
2018
network stack can replace the TAP device to have a basic network
2022
<a name="SEC26"></a>
2023
<table cellpadding="1" cellspacing="1" border="0">
2024
<tr><td valign="middle" align="left">[<a href="#SEC25" title="Previous section in reading order"> < </a>]</td>
2025
<td valign="middle" align="left">[<a href="#SEC27" title="Next section in reading order"> > </a>]</td>
2026
<td valign="middle" align="left"> </td>
2027
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2028
<td valign="middle" align="left">[<a href="#SEC25" title="Up section"> Up </a>]</td>
2029
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2030
<td valign="middle" align="left"> </td>
2031
<td valign="middle" align="left"> </td>
2032
<td valign="middle" align="left"> </td>
2033
<td valign="middle" align="left"> </td>
2034
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2035
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2036
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2037
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2039
<h3 class="subsection"> 3.7.1 VLANs </h3>
2041
<p>QEMU simulates several VLANs. A VLAN can be symbolised as a virtual
2042
connection between several network devices. These devices can be for
2043
example QEMU virtual Ethernet cards or virtual Host ethernet devices
2047
<a name="SEC27"></a>
2048
<table cellpadding="1" cellspacing="1" border="0">
2049
<tr><td valign="middle" align="left">[<a href="#SEC26" title="Previous section in reading order"> < </a>]</td>
2050
<td valign="middle" align="left">[<a href="#SEC28" title="Next section in reading order"> > </a>]</td>
2051
<td valign="middle" align="left"> </td>
2052
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2053
<td valign="middle" align="left">[<a href="#SEC25" title="Up section"> Up </a>]</td>
2054
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2055
<td valign="middle" align="left"> </td>
2056
<td valign="middle" align="left"> </td>
2057
<td valign="middle" align="left"> </td>
2058
<td valign="middle" align="left"> </td>
2059
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2060
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2061
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2062
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2064
<h3 class="subsection"> 3.7.2 Using TAP network interfaces </h3>
2066
<p>This is the standard way to connect QEMU to a real network. QEMU adds
2067
a virtual network device on your host (called <code>tapN</code>), and you
2068
can then configure it as if it was a real ethernet card.
2071
<a name="SEC28"></a>
2072
<table cellpadding="1" cellspacing="1" border="0">
2073
<tr><td valign="middle" align="left">[<a href="#SEC27" title="Previous section in reading order"> < </a>]</td>
2074
<td valign="middle" align="left">[<a href="#SEC29" title="Next section in reading order"> > </a>]</td>
2075
<td valign="middle" align="left"> </td>
2076
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2077
<td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2078
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2079
<td valign="middle" align="left"> </td>
2080
<td valign="middle" align="left"> </td>
2081
<td valign="middle" align="left"> </td>
2082
<td valign="middle" align="left"> </td>
2083
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2084
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2085
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2086
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2088
<h4 class="subsubsection"> 3.7.2.1 Linux host </h4>
2090
<p>As an example, you can download the ‘<tt>linux-test-xxx.tar.gz</tt>’
2091
archive and copy the script ‘<tt>qemu-ifup</tt>’ in ‘<tt>/etc</tt>’ and
2092
configure properly <code>sudo</code> so that the command <code>ifconfig</code>
2093
contained in ‘<tt>qemu-ifup</tt>’ can be executed as root. You must verify
2094
that your host kernel supports the TAP network interfaces: the
2095
device ‘<tt>/dev/net/tun</tt>’ must be present.
2097
<p>See <a href="#SEC10">Invocation</a> to have examples of command lines using the
2098
TAP network interfaces.
2101
<a name="SEC29"></a>
2102
<table cellpadding="1" cellspacing="1" border="0">
2103
<tr><td valign="middle" align="left">[<a href="#SEC28" title="Previous section in reading order"> < </a>]</td>
2104
<td valign="middle" align="left">[<a href="#SEC30" title="Next section in reading order"> > </a>]</td>
2105
<td valign="middle" align="left"> </td>
2106
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2107
<td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2108
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2109
<td valign="middle" align="left"> </td>
2110
<td valign="middle" align="left"> </td>
2111
<td valign="middle" align="left"> </td>
2112
<td valign="middle" align="left"> </td>
2113
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2114
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2115
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2116
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2118
<h4 class="subsubsection"> 3.7.2.2 Windows host </h4>
2120
<p>There is a virtual ethernet driver for Windows 2000/XP systems, called
2121
TAP-Win32. But it is not included in standard QEMU for Windows,
2122
so you will need to get it separately. It is part of OpenVPN package,
2123
so download OpenVPN from : <a href="http://openvpn.net/">http://openvpn.net/</a>.
2126
<a name="SEC30"></a>
2127
<table cellpadding="1" cellspacing="1" border="0">
2128
<tr><td valign="middle" align="left">[<a href="#SEC29" title="Previous section in reading order"> < </a>]</td>
2129
<td valign="middle" align="left">[<a href="#SEC31" title="Next section in reading order"> > </a>]</td>
2130
<td valign="middle" align="left"> </td>
2131
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2132
<td valign="middle" align="left">[<a href="#SEC25" title="Up section"> Up </a>]</td>
2133
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2134
<td valign="middle" align="left"> </td>
2135
<td valign="middle" align="left"> </td>
2136
<td valign="middle" align="left"> </td>
2137
<td valign="middle" align="left"> </td>
2138
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2139
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2140
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2141
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2143
<h3 class="subsection"> 3.7.3 Using the user mode network stack </h3>
2145
<p>By using the option ‘<samp>-net user</samp>’ (default configuration if no
2146
‘<samp>-net</samp>’ option is specified), QEMU uses a completely user mode
2147
network stack (you don't need root privilege to use the virtual
2148
network). The virtual network configuration is the following:
2150
<table><tr><td> </td><td><pre class="example">
2151
QEMU VLAN <------> Firewall/DHCP server <-----> Internet
2154
----> DNS server (10.0.2.3)
2156
----> SMB server (10.0.2.4)
2157
</pre></td></tr></table>
2159
<p>The QEMU VM behaves as if it was behind a firewall which blocks all
2160
incoming connections. You can use a DHCP client to automatically
2161
configure the network in the QEMU VM. The DHCP server assign addresses
2162
to the hosts starting from 10.0.2.15.
2164
<p>In order to check that the user mode network is working, you can ping
2165
the address 10.0.2.2 and verify that you got an address in the range
2166
10.0.2.x from the QEMU virtual DHCP server.
2168
<p>Note that <code>ping</code> is not supported reliably to the internet as it
2169
would require root privileges. It means you can only ping the local
2172
<p>When using the built-in TFTP server, the router is also the TFTP
2175
<p>When using the ‘<samp>-redir</samp>’ option, TCP or UDP connections can be
2176
redirected from the host to the guest. It allows for example to
2177
redirect X11, telnet or SSH connections.
2180
<a name="SEC31"></a>
2181
<table cellpadding="1" cellspacing="1" border="0">
2182
<tr><td valign="middle" align="left">[<a href="#SEC30" title="Previous section in reading order"> < </a>]</td>
2183
<td valign="middle" align="left">[<a href="#SEC32" title="Next section in reading order"> > </a>]</td>
2184
<td valign="middle" align="left"> </td>
2185
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2186
<td valign="middle" align="left">[<a href="#SEC25" title="Up section"> Up </a>]</td>
2187
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2188
<td valign="middle" align="left"> </td>
2189
<td valign="middle" align="left"> </td>
2190
<td valign="middle" align="left"> </td>
2191
<td valign="middle" align="left"> </td>
2192
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2193
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2194
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2195
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2197
<h3 class="subsection"> 3.7.4 Connecting VLANs between QEMU instances </h3>
2199
<p>Using the ‘<samp>-net socket</samp>’ option, it is possible to make VLANs
2200
that span several QEMU instances. See <a href="#SEC10">Invocation</a> to have a
2204
<a name="direct_005flinux_005fboot"></a>
2205
<a name="SEC32"></a>
2206
<table cellpadding="1" cellspacing="1" border="0">
2207
<tr><td valign="middle" align="left">[<a href="#SEC31" title="Previous section in reading order"> < </a>]</td>
2208
<td valign="middle" align="left">[<a href="#SEC33" title="Next section in reading order"> > </a>]</td>
2209
<td valign="middle" align="left"> </td>
2210
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2211
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2212
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2213
<td valign="middle" align="left"> </td>
2214
<td valign="middle" align="left"> </td>
2215
<td valign="middle" align="left"> </td>
2216
<td valign="middle" align="left"> </td>
2217
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2218
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2219
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2220
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2222
<h2 class="section"> 3.8 Direct Linux Boot </h2>
2224
<p>This section explains how to launch a Linux kernel inside QEMU without
2225
having to make a full bootable image. It is very useful for fast Linux
2229
</p><table><tr><td> </td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda"
2230
</pre></td></tr></table>
2232
<p>Use ‘<samp>-kernel</samp>’ to provide the Linux kernel image and
2233
‘<samp>-append</samp>’ to give the kernel command line arguments. The
2234
‘<samp>-initrd</samp>’ option can be used to provide an INITRD image.
2236
<p>When using the direct Linux boot, a disk image for the first hard disk
2237
‘<tt>hda</tt>’ is required because its boot sector is used to launch the
2240
<p>If you do not need graphical output, you can disable it and redirect
2241
the virtual serial port and the QEMU monitor to the console with the
2242
‘<samp>-nographic</samp>’ option. The typical command line is:
2243
</p><table><tr><td> </td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
2244
-append "root=/dev/hda console=ttyS0" -nographic
2245
</pre></td></tr></table>
2247
<p>Use <Ctrl-a c> to switch between the serial console and the
2248
monitor (see section <a href="#SEC11">Keys</a>).
2251
<a name="pcsys_005fusb"></a>
2252
<a name="SEC33"></a>
2253
<table cellpadding="1" cellspacing="1" border="0">
2254
<tr><td valign="middle" align="left">[<a href="#SEC32" title="Previous section in reading order"> < </a>]</td>
2255
<td valign="middle" align="left">[<a href="#SEC34" title="Next section in reading order"> > </a>]</td>
2256
<td valign="middle" align="left"> </td>
2257
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2258
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2259
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2260
<td valign="middle" align="left"> </td>
2261
<td valign="middle" align="left"> </td>
2262
<td valign="middle" align="left"> </td>
2263
<td valign="middle" align="left"> </td>
2264
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2265
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2266
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2267
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2269
<h2 class="section"> 3.9 USB emulation </h2>
2271
<p>QEMU emulates a PCI UHCI USB controller. You can virtually plug
2272
virtual USB devices or real host USB devices (experimental, works only
2273
on Linux hosts). Qemu will automatically create and connect virtual USB hubs
2274
as necessary to connect multiple USB devices.
2276
<table class="menu" border="0" cellspacing="0">
2277
<tr><td align="left" valign="top"><a href="#SEC34">3.9.1 Connecting USB devices</a></td><td> </td><td align="left" valign="top">
2279
<tr><td align="left" valign="top"><a href="#SEC35">3.9.2 Using host USB devices on a Linux host</a></td><td> </td><td align="left" valign="top">
2283
<a name="usb_005fdevices"></a>
2284
<a name="SEC34"></a>
2285
<table cellpadding="1" cellspacing="1" border="0">
2286
<tr><td valign="middle" align="left">[<a href="#SEC33" title="Previous section in reading order"> < </a>]</td>
2287
<td valign="middle" align="left">[<a href="#SEC35" title="Next section in reading order"> > </a>]</td>
2288
<td valign="middle" align="left"> </td>
2289
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2290
<td valign="middle" align="left">[<a href="#SEC33" title="Up section"> Up </a>]</td>
2291
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2292
<td valign="middle" align="left"> </td>
2293
<td valign="middle" align="left"> </td>
2294
<td valign="middle" align="left"> </td>
2295
<td valign="middle" align="left"> </td>
2296
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2297
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2298
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2299
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2301
<h3 class="subsection"> 3.9.1 Connecting USB devices </h3>
2303
<p>USB devices can be connected with the ‘<samp>-usbdevice</samp>’ commandline option
2304
or the <code>usb_add</code> monitor command. Available devices are:
2306
<dl compact="compact">
2307
<dt> <var><code>mouse</code></var></dt>
2308
<dd><p>Virtual Mouse. This will override the PS/2 mouse emulation when activated.
2310
<dt> <var><code>tablet</code></var></dt>
2311
<dd><p>Pointer device that uses absolute coordinates (like a touchscreen).
2312
This means qemu is able to report the mouse position without having
2313
to grab the mouse. Also overrides the PS/2 mouse emulation when activated.
2315
<dt> <var><code>disk:file</code></var></dt>
2316
<dd><p>Mass storage device based on <var>file</var> (see section <a href="#SEC15">Disk Images</a>)
2318
<dt> <var><code>host:bus.addr</code></var></dt>
2319
<dd><p>Pass through the host device identified by <var>bus.addr</var>
2322
<dt> <var><code>host:vendor_id:product_id</code></var></dt>
2323
<dd><p>Pass through the host device identified by <var>vendor_id:product_id</var>
2326
<dt> <var><code>wacom-tablet</code></var></dt>
2327
<dd><p>Virtual Wacom PenPartner tablet. This device is similar to the <code>tablet</code>
2328
above but it can be used with the tslib library because in addition to touch
2329
coordinates it reports touch pressure.
2331
<dt> <var><code>keyboard</code></var></dt>
2332
<dd><p>Standard USB keyboard. Will override the PS/2 keyboard (if present).
2337
<a name="host_005fusb_005fdevices"></a>
2338
<a name="SEC35"></a>
2339
<table cellpadding="1" cellspacing="1" border="0">
2340
<tr><td valign="middle" align="left">[<a href="#SEC34" title="Previous section in reading order"> < </a>]</td>
2341
<td valign="middle" align="left">[<a href="#SEC36" title="Next section in reading order"> > </a>]</td>
2342
<td valign="middle" align="left"> </td>
2343
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2344
<td valign="middle" align="left">[<a href="#SEC33" title="Up section"> Up </a>]</td>
2345
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2346
<td valign="middle" align="left"> </td>
2347
<td valign="middle" align="left"> </td>
2348
<td valign="middle" align="left"> </td>
2349
<td valign="middle" align="left"> </td>
2350
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2351
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2352
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2353
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2355
<h3 class="subsection"> 3.9.2 Using host USB devices on a Linux host </h3>
2357
<p>WARNING: this is an experimental feature. QEMU will slow down when
2358
using it. USB devices requiring real time streaming (i.e. USB Video
2359
Cameras) are not supported yet.
2362
<li> If you use an early Linux 2.4 kernel, verify that no Linux driver
2363
is actually using the USB device. A simple way to do that is simply to
2364
disable the corresponding kernel module by renaming it from ‘<tt>mydriver.o</tt>’
2365
to ‘<tt>mydriver.o.disabled</tt>’.
2367
</li><li> Verify that ‘<tt>/proc/bus/usb</tt>’ is working (most Linux distributions should enable it by default). You should see something like that:
2368
<table><tr><td> </td><td><pre class="example">ls /proc/bus/usb
2370
</pre></td></tr></table>
2372
</li><li> 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:
2373
<table><tr><td> </td><td><pre class="example">chown -R myuid /proc/bus/usb
2374
</pre></td></tr></table>
2376
</li><li> Launch QEMU and do in the monitor:
2377
<table><tr><td> </td><td><pre class="example">info usbhost
2378
Device 1.2, speed 480 Mb/s
2379
Class 00: USB device 1234:5678, USB DISK
2380
</pre></td></tr></table>
2381
<p>You should see the list of the devices you can use (Never try to use
2382
hubs, it won't work).
2384
</li><li> Add the device in QEMU by using:
2385
<table><tr><td> </td><td><pre class="example">usb_add host:1234:5678
2386
</pre></td></tr></table>
2388
<p>Normally the guest OS should report that a new USB device is
2389
plugged. You can use the option ‘<samp>-usbdevice</samp>’ to do the same.
2391
</li><li> Now you can try to use the host USB device in QEMU.
2395
<p>When relaunching QEMU, you may have to unplug and plug again the USB
2396
device to make it work again (this is a bug).
2399
<a name="vnc_005fsecurity"></a>
2400
<a name="SEC36"></a>
2401
<table cellpadding="1" cellspacing="1" border="0">
2402
<tr><td valign="middle" align="left">[<a href="#SEC35" title="Previous section in reading order"> < </a>]</td>
2403
<td valign="middle" align="left">[<a href="#SEC37" title="Next section in reading order"> > </a>]</td>
2404
<td valign="middle" align="left"> </td>
2405
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2406
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2407
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2408
<td valign="middle" align="left"> </td>
2409
<td valign="middle" align="left"> </td>
2410
<td valign="middle" align="left"> </td>
2411
<td valign="middle" align="left"> </td>
2412
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2413
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2414
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2415
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2417
<h2 class="section"> 3.10 VNC security </h2>
2419
<p>The VNC server capability provides access to the graphical console
2420
of the guest VM across the network. This has a number of security
2421
considerations depending on the deployment scenarios.
2423
<table class="menu" border="0" cellspacing="0">
2424
<tr><td align="left" valign="top"><a href="#SEC37">3.10.1 Without passwords</a></td><td> </td><td align="left" valign="top">
2426
<tr><td align="left" valign="top"><a href="#SEC38">3.10.2 With passwords</a></td><td> </td><td align="left" valign="top">
2428
<tr><td align="left" valign="top"><a href="#SEC39">3.10.3 With x509 certificates</a></td><td> </td><td align="left" valign="top">
2430
<tr><td align="left" valign="top"><a href="#SEC40">3.10.4 With x509 certificates and client verification</a></td><td> </td><td align="left" valign="top">
2432
<tr><td align="left" valign="top"><a href="#SEC41">3.10.5 With x509 certificates, client verification and passwords</a></td><td> </td><td align="left" valign="top">
2434
<tr><td align="left" valign="top"><a href="#SEC42">3.10.6 Generating certificates for VNC</a></td><td> </td><td align="left" valign="top">
2438
<a name="vnc_005fsec_005fnone"></a>
2439
<a name="SEC37"></a>
2440
<table cellpadding="1" cellspacing="1" border="0">
2441
<tr><td valign="middle" align="left">[<a href="#SEC36" title="Previous section in reading order"> < </a>]</td>
2442
<td valign="middle" align="left">[<a href="#SEC38" title="Next section in reading order"> > </a>]</td>
2443
<td valign="middle" align="left"> </td>
2444
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2445
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2446
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2447
<td valign="middle" align="left"> </td>
2448
<td valign="middle" align="left"> </td>
2449
<td valign="middle" align="left"> </td>
2450
<td valign="middle" align="left"> </td>
2451
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2452
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2453
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2454
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2456
<h3 class="subsection"> 3.10.1 Without passwords </h3>
2458
<p>The simplest VNC server setup does not include any form of authentication.
2459
For this setup it is recommended to restrict it to listen on a UNIX domain
2460
socket only. For example
2462
<table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
2463
</pre></td></tr></table>
2465
<p>This ensures that only users on local box with read/write access to that
2466
path can access the VNC server. To securely access the VNC server from a
2467
remote machine, a combination of netcat+ssh can be used to provide a secure
2471
<a name="vnc_005fsec_005fpassword"></a>
2472
<a name="SEC38"></a>
2473
<table cellpadding="1" cellspacing="1" border="0">
2474
<tr><td valign="middle" align="left">[<a href="#SEC37" title="Previous section in reading order"> < </a>]</td>
2475
<td valign="middle" align="left">[<a href="#SEC39" title="Next section in reading order"> > </a>]</td>
2476
<td valign="middle" align="left"> </td>
2477
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2478
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2479
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2480
<td valign="middle" align="left"> </td>
2481
<td valign="middle" align="left"> </td>
2482
<td valign="middle" align="left"> </td>
2483
<td valign="middle" align="left"> </td>
2484
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2485
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2486
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2487
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2489
<h3 class="subsection"> 3.10.2 With passwords </h3>
2491
<p>The VNC protocol has limited support for password based authentication. Since
2492
the protocol limits passwords to 8 characters it should not be considered
2493
to provide high security. The password can be fairly easily brute-forced by
2494
a client making repeat connections. For this reason, a VNC server using password
2495
authentication should be restricted to only listen on the loopback interface
2496
or UNIX domain sockets. Password ayuthentication is requested with the <code>password</code>
2497
option, and then once QEMU is running the password is set with the monitor. Until
2498
the monitor is used to set the password all clients will be rejected.
2500
<table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password -monitor stdio
2501
(qemu) change vnc password
2504
</pre></td></tr></table>
2507
<a name="vnc_005fsec_005fcertificate"></a>
2508
<a name="SEC39"></a>
2509
<table cellpadding="1" cellspacing="1" border="0">
2510
<tr><td valign="middle" align="left">[<a href="#SEC38" title="Previous section in reading order"> < </a>]</td>
2511
<td valign="middle" align="left">[<a href="#SEC40" title="Next section in reading order"> > </a>]</td>
2512
<td valign="middle" align="left"> </td>
2513
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2514
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2515
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2516
<td valign="middle" align="left"> </td>
2517
<td valign="middle" align="left"> </td>
2518
<td valign="middle" align="left"> </td>
2519
<td valign="middle" align="left"> </td>
2520
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2521
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2522
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2523
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2525
<h3 class="subsection"> 3.10.3 With x509 certificates </h3>
2527
<p>The QEMU VNC server also implements the VeNCrypt extension allowing use of
2528
TLS for encryption of the session, and x509 certificates for authentication.
2529
The use of x509 certificates is strongly recommended, because TLS on its
2530
own is susceptible to man-in-the-middle attacks. Basic x509 certificate
2531
support provides a secure session, but no authentication. This allows any
2532
client to connect, and provides an encrypted session.
2534
<table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio
2535
</pre></td></tr></table>
2537
<p>In the above example <code>/etc/pki/qemu</code> should contain at least three files,
2538
<code>ca-cert.pem</code>, <code>server-cert.pem</code> and <code>server-key.pem</code>. Unprivileged
2539
users will want to use a private directory, for example <code>$HOME/.pki/qemu</code>.
2540
NB the <code>server-key.pem</code> file should be protected with file mode 0600 to
2541
only be readable by the user owning it.
2544
<a name="vnc_005fsec_005fcertificate_005fverify"></a>
2545
<a name="SEC40"></a>
2546
<table cellpadding="1" cellspacing="1" border="0">
2547
<tr><td valign="middle" align="left">[<a href="#SEC39" title="Previous section in reading order"> < </a>]</td>
2548
<td valign="middle" align="left">[<a href="#SEC41" title="Next section in reading order"> > </a>]</td>
2549
<td valign="middle" align="left"> </td>
2550
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2551
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2552
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2553
<td valign="middle" align="left"> </td>
2554
<td valign="middle" align="left"> </td>
2555
<td valign="middle" align="left"> </td>
2556
<td valign="middle" align="left"> </td>
2557
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2558
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2559
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2560
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2562
<h3 class="subsection"> 3.10.4 With x509 certificates and client verification </h3>
2564
<p>Certificates can also provide a means to authenticate the client connecting.
2565
The server will request that the client provide a certificate, which it will
2566
then validate against the CA certificate. This is a good choice if deploying
2567
in an environment with a private internal certificate authority.
2569
<table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio
2570
</pre></td></tr></table>
2574
<a name="vnc_005fsec_005fcertificate_005fpw"></a>
2575
<a name="SEC41"></a>
2576
<table cellpadding="1" cellspacing="1" border="0">
2577
<tr><td valign="middle" align="left">[<a href="#SEC40" title="Previous section in reading order"> < </a>]</td>
2578
<td valign="middle" align="left">[<a href="#SEC42" title="Next section in reading order"> > </a>]</td>
2579
<td valign="middle" align="left"> </td>
2580
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2581
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2582
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2583
<td valign="middle" align="left"> </td>
2584
<td valign="middle" align="left"> </td>
2585
<td valign="middle" align="left"> </td>
2586
<td valign="middle" align="left"> </td>
2587
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2588
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2589
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2590
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2592
<h3 class="subsection"> 3.10.5 With x509 certificates, client verification and passwords </h3>
2594
<p>Finally, the previous method can be combined with VNC password authentication
2595
to provide two layers of authentication for clients.
2597
<table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio
2598
(qemu) change vnc password
2601
</pre></td></tr></table>
2604
<a name="vnc_005fgenerate_005fcert"></a>
2605
<a name="SEC42"></a>
2606
<table cellpadding="1" cellspacing="1" border="0">
2607
<tr><td valign="middle" align="left">[<a href="#SEC41" title="Previous section in reading order"> < </a>]</td>
2608
<td valign="middle" align="left">[<a href="#SEC43" title="Next section in reading order"> > </a>]</td>
2609
<td valign="middle" align="left"> </td>
2610
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2611
<td valign="middle" align="left">[<a href="#SEC36" title="Up section"> Up </a>]</td>
2612
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2613
<td valign="middle" align="left"> </td>
2614
<td valign="middle" align="left"> </td>
2615
<td valign="middle" align="left"> </td>
2616
<td valign="middle" align="left"> </td>
2617
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2618
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2619
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2620
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2622
<h3 class="subsection"> 3.10.6 Generating certificates for VNC </h3>
2624
<p>The GNU TLS packages provides a command called <code>certtool</code> which can
2625
be used to generate certificates and keys in PEM format. At a minimum it
2626
is neccessary to setup a certificate authority, and issue certificates to
2627
each server. If using certificates for authentication, then each client
2628
will also need to be issued a certificate. The recommendation is for the
2629
server to keep its certificates in either <code>/etc/pki/qemu</code> or for
2630
unprivileged users in <code>$HOME/.pki/qemu</code>.
2632
<table class="menu" border="0" cellspacing="0">
2633
<tr><td align="left" valign="top"><a href="#SEC43">3.10.6.1 Setup the Certificate Authority</a></td><td> </td><td align="left" valign="top">
2635
<tr><td align="left" valign="top"><a href="#SEC44">3.10.6.2 Issuing server certificates</a></td><td> </td><td align="left" valign="top">
2637
<tr><td align="left" valign="top"><a href="#SEC45">3.10.6.3 Issuing client certificates</a></td><td> </td><td align="left" valign="top">
2641
<a name="vnc_005fgenerate_005fca"></a>
2642
<a name="SEC43"></a>
2643
<table cellpadding="1" cellspacing="1" border="0">
2644
<tr><td valign="middle" align="left">[<a href="#SEC42" title="Previous section in reading order"> < </a>]</td>
2645
<td valign="middle" align="left">[<a href="#SEC44" title="Next section in reading order"> > </a>]</td>
2646
<td valign="middle" align="left"> </td>
2647
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2648
<td valign="middle" align="left">[<a href="#SEC42" title="Up section"> Up </a>]</td>
2649
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2650
<td valign="middle" align="left"> </td>
2651
<td valign="middle" align="left"> </td>
2652
<td valign="middle" align="left"> </td>
2653
<td valign="middle" align="left"> </td>
2654
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2655
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2656
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2657
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2659
<h4 class="subsubsection"> 3.10.6.1 Setup the Certificate Authority </h4>
2661
<p>This step only needs to be performed once per organization / organizational
2662
unit. First the CA needs a private key. This key must be kept VERY secret
2663
and secure. If this key is compromised the entire trust chain of the certificates
2664
issued with it is lost.
2666
<table><tr><td> </td><td><pre class="example"># certtool --generate-privkey > ca-key.pem
2667
</pre></td></tr></table>
2669
<p>A CA needs to have a public certificate. For simplicity it can be a self-signed
2670
certificate, or one issue by a commercial certificate issuing authority. To
2671
generate a self-signed certificate requires one core piece of information, the
2672
name of the organization.
2674
<table><tr><td> </td><td><pre class="example"># cat > ca.info <<EOF
2675
cn = Name of your organization
2679
# certtool --generate-self-signed \
2680
--load-privkey ca-key.pem
2681
--template ca.info \
2682
--outfile ca-cert.pem
2683
</pre></td></tr></table>
2685
<p>The <code>ca-cert.pem</code> file should be copied to all servers and clients wishing to utilize
2686
TLS support in the VNC server. The <code>ca-key.pem</code> must not be disclosed/copied at all.
2689
<a name="vnc_005fgenerate_005fserver"></a>
2690
<a name="SEC44"></a>
2691
<table cellpadding="1" cellspacing="1" border="0">
2692
<tr><td valign="middle" align="left">[<a href="#SEC43" title="Previous section in reading order"> < </a>]</td>
2693
<td valign="middle" align="left">[<a href="#SEC45" title="Next section in reading order"> > </a>]</td>
2694
<td valign="middle" align="left"> </td>
2695
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2696
<td valign="middle" align="left">[<a href="#SEC42" title="Up section"> Up </a>]</td>
2697
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2698
<td valign="middle" align="left"> </td>
2699
<td valign="middle" align="left"> </td>
2700
<td valign="middle" align="left"> </td>
2701
<td valign="middle" align="left"> </td>
2702
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2703
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2704
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2705
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2707
<h4 class="subsubsection"> 3.10.6.2 Issuing server certificates </h4>
2709
<p>Each server (or host) needs to be issued with a key and certificate. When connecting
2710
the certificate is sent to the client which validates it against the CA certificate.
2711
The core piece of information for a server certificate is the hostname. This should
2712
be the fully qualified hostname that the client will connect with, since the client
2713
will typically also verify the hostname in the certificate. On the host holding the
2714
secure CA private key:
2716
<table><tr><td> </td><td><pre class="example"># cat > server.info <<EOF
2717
organization = Name of your organization
2718
cn = server.foo.example.com
2723
# certtool --generate-privkey > server-key.pem
2724
# certtool --generate-certificate \
2725
--load-ca-certificate ca-cert.pem \
2726
--load-ca-privkey ca-key.pem \
2727
--load-privkey server server-key.pem \
2728
--template server.info \
2729
--outfile server-cert.pem
2730
</pre></td></tr></table>
2732
<p>The <code>server-key.pem</code> and <code>server-cert.pem</code> files should now be securely copied
2733
to the server for which they were generated. The <code>server-key.pem</code> is security
2734
sensitive and should be kept protected with file mode 0600 to prevent disclosure.
2737
<a name="vnc_005fgenerate_005fclient"></a>
2738
<a name="SEC45"></a>
2739
<table cellpadding="1" cellspacing="1" border="0">
2740
<tr><td valign="middle" align="left">[<a href="#SEC44" title="Previous section in reading order"> < </a>]</td>
2741
<td valign="middle" align="left">[<a href="#SEC46" title="Next section in reading order"> > </a>]</td>
2742
<td valign="middle" align="left"> </td>
2743
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2744
<td valign="middle" align="left">[<a href="#SEC42" title="Up section"> Up </a>]</td>
2745
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2746
<td valign="middle" align="left"> </td>
2747
<td valign="middle" align="left"> </td>
2748
<td valign="middle" align="left"> </td>
2749
<td valign="middle" align="left"> </td>
2750
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2751
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2752
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2753
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2755
<h4 class="subsubsection"> 3.10.6.3 Issuing client certificates </h4>
2757
<p>If the QEMU VNC server is to use the <code>x509verify</code> option to validate client
2758
certificates as its authentication mechanism, each client also needs to be issued
2759
a certificate. The client certificate contains enough metadata to uniquely identify
2760
the client, typically organization, state, city, building, etc. On the host holding
2761
the secure CA private key:
2763
<table><tr><td> </td><td><pre class="example"># cat > client.info <<EOF
2767
organiazation = Name of your organization
2768
cn = client.foo.example.com
2773
# certtool --generate-privkey > client-key.pem
2774
# certtool --generate-certificate \
2775
--load-ca-certificate ca-cert.pem \
2776
--load-ca-privkey ca-key.pem \
2777
--load-privkey client-key.pem \
2778
--template client.info \
2779
--outfile client-cert.pem
2780
</pre></td></tr></table>
2782
<p>The <code>client-key.pem</code> and <code>client-cert.pem</code> files should now be securely
2783
copied to the client for which they were generated.
2786
<a name="gdb_005fusage"></a>
2787
<a name="SEC46"></a>
2788
<table cellpadding="1" cellspacing="1" border="0">
2789
<tr><td valign="middle" align="left">[<a href="#SEC45" title="Previous section in reading order"> < </a>]</td>
2790
<td valign="middle" align="left">[<a href="#SEC47" title="Next section in reading order"> > </a>]</td>
2791
<td valign="middle" align="left"> </td>
2792
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2793
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2794
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2795
<td valign="middle" align="left"> </td>
2796
<td valign="middle" align="left"> </td>
2797
<td valign="middle" align="left"> </td>
2798
<td valign="middle" align="left"> </td>
2799
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2800
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2801
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2802
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2804
<h2 class="section"> 3.11 GDB usage </h2>
2806
<p>QEMU has a primitive support to work with gdb, so that you can do
2807
'Ctrl-C' while the virtual machine is running and inspect its state.
2809
<p>In order to use gdb, launch qemu with the '-s' option. It will wait for a
2811
</p><table><tr><td> </td><td><pre class="example">> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
2812
-append "root=/dev/hda"
2813
Connected to host network interface: tun0
2814
Waiting gdb connection on port 1234
2815
</pre></td></tr></table>
2817
<p>Then launch gdb on the 'vmlinux' executable:
2818
</p><table><tr><td> </td><td><pre class="example">> gdb vmlinux
2819
</pre></td></tr></table>
2821
<p>In gdb, connect to QEMU:
2822
</p><table><tr><td> </td><td><pre class="example">(gdb) target remote localhost:1234
2823
</pre></td></tr></table>
2825
<p>Then you can use gdb normally. For example, type 'c' to launch the kernel:
2826
</p><table><tr><td> </td><td><pre class="example">(gdb) c
2827
</pre></td></tr></table>
2829
<p>Here are some useful tips in order to use gdb on system code:
2833
Use <code>info reg</code> to display all the CPU registers.
2835
Use <code>x/10i $eip</code> to display the code at the PC position.
2837
Use <code>set architecture i8086</code> to dump 16 bit code. Then use
2838
<code>x/10i $cs*16+$eip</code> to dump the code at the PC position.
2842
<a name="pcsys_005fos_005fspecific"></a>
2843
<a name="SEC47"></a>
2844
<table cellpadding="1" cellspacing="1" border="0">
2845
<tr><td valign="middle" align="left">[<a href="#SEC46" title="Previous section in reading order"> < </a>]</td>
2846
<td valign="middle" align="left">[<a href="#SEC48" title="Next section in reading order"> > </a>]</td>
2847
<td valign="middle" align="left"> </td>
2848
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2849
<td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2850
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2851
<td valign="middle" align="left"> </td>
2852
<td valign="middle" align="left"> </td>
2853
<td valign="middle" align="left"> </td>
2854
<td valign="middle" align="left"> </td>
2855
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2856
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2857
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2858
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2860
<h2 class="section"> 3.12 Target OS specific information </h2>
2863
<a name="SEC48"></a>
2864
<table cellpadding="1" cellspacing="1" border="0">
2865
<tr><td valign="middle" align="left">[<a href="#SEC47" title="Previous section in reading order"> < </a>]</td>
2866
<td valign="middle" align="left">[<a href="#SEC49" title="Next section in reading order"> > </a>]</td>
2867
<td valign="middle" align="left"> </td>
2868
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2869
<td valign="middle" align="left">[<a href="#SEC47" title="Up section"> Up </a>]</td>
2870
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2871
<td valign="middle" align="left"> </td>
2872
<td valign="middle" align="left"> </td>
2873
<td valign="middle" align="left"> </td>
2874
<td valign="middle" align="left"> </td>
2875
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2876
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2877
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2878
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2880
<h3 class="subsection"> 3.12.1 Linux </h3>
2882
<p>To have access to SVGA graphic modes under X11, use the <code>vesa</code> or
2883
the <code>cirrus</code> X11 driver. For optimal performances, use 16 bit
2884
color depth in the guest and the host OS.
2886
<p>When using a 2.6 guest Linux kernel, you should add the option
2887
<code>clock=pit</code> on the kernel command line because the 2.6 Linux
2888
kernels make very strict real time clock checks by default that QEMU
2889
cannot simulate exactly.
2891
<p>When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is
2892
not activated because QEMU is slower with this patch. The QEMU
2893
Accelerator Module is also much slower in this case. Earlier Fedora
2894
Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate this
2895
patch by default. Newer kernels don't have it.
2898
<a name="SEC49"></a>
2899
<table cellpadding="1" cellspacing="1" border="0">
2900
<tr><td valign="middle" align="left">[<a href="#SEC48" title="Previous section in reading order"> < </a>]</td>
2901
<td valign="middle" align="left">[<a href="#SEC50" title="Next section in reading order"> > </a>]</td>
2902
<td valign="middle" align="left"> </td>
2903
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2904
<td valign="middle" align="left">[<a href="#SEC47" title="Up section"> Up </a>]</td>
2905
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2906
<td valign="middle" align="left"> </td>
2907
<td valign="middle" align="left"> </td>
2908
<td valign="middle" align="left"> </td>
2909
<td valign="middle" align="left"> </td>
2910
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2911
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2912
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2913
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2915
<h3 class="subsection"> 3.12.2 Windows </h3>
2917
<p>If you have a slow host, using Windows 95 is better as it gives the
2918
best speed. Windows 2000 is also a good choice.
2921
<a name="SEC50"></a>
2922
<table cellpadding="1" cellspacing="1" border="0">
2923
<tr><td valign="middle" align="left">[<a href="#SEC49" title="Previous section in reading order"> < </a>]</td>
2924
<td valign="middle" align="left">[<a href="#SEC51" title="Next section in reading order"> > </a>]</td>
2925
<td valign="middle" align="left"> </td>
2926
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2927
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
2928
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2929
<td valign="middle" align="left"> </td>
2930
<td valign="middle" align="left"> </td>
2931
<td valign="middle" align="left"> </td>
2932
<td valign="middle" align="left"> </td>
2933
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2934
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2935
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2936
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2938
<h4 class="subsubsection"> 3.12.2.1 SVGA graphic modes support </h4>
2940
<p>QEMU emulates a Cirrus Logic GD5446 Video
2941
card. All Windows versions starting from Windows 95 should recognize
2942
and use this graphic card. For optimal performances, use 16 bit color
2943
depth in the guest and the host OS.
2945
<p>If you are using Windows XP as guest OS and if you want to use high
2946
resolution modes which the Cirrus Logic BIOS does not support (i.e. >=
2947
1280x1024x16), then you should use the VESA VBE virtual graphic card
2948
(option ‘<samp>-std-vga</samp>’).
2951
<a name="SEC51"></a>
2952
<table cellpadding="1" cellspacing="1" border="0">
2953
<tr><td valign="middle" align="left">[<a href="#SEC50" title="Previous section in reading order"> < </a>]</td>
2954
<td valign="middle" align="left">[<a href="#SEC52" title="Next section in reading order"> > </a>]</td>
2955
<td valign="middle" align="left"> </td>
2956
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2957
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
2958
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2959
<td valign="middle" align="left"> </td>
2960
<td valign="middle" align="left"> </td>
2961
<td valign="middle" align="left"> </td>
2962
<td valign="middle" align="left"> </td>
2963
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2964
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2965
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2966
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2968
<h4 class="subsubsection"> 3.12.2.2 CPU usage reduction </h4>
2970
<p>Windows 9x does not correctly use the CPU HLT
2971
instruction. The result is that it takes host CPU cycles even when
2972
idle. You can install the utility from
2973
<a href="http://www.user.cityline.ru/~maxamn/amnhltm.zip">http://www.user.cityline.ru/~maxamn/amnhltm.zip</a> to solve this
2974
problem. Note that no such tool is needed for NT, 2000 or XP.
2977
<a name="SEC52"></a>
2978
<table cellpadding="1" cellspacing="1" border="0">
2979
<tr><td valign="middle" align="left">[<a href="#SEC51" title="Previous section in reading order"> < </a>]</td>
2980
<td valign="middle" align="left">[<a href="#SEC53" title="Next section in reading order"> > </a>]</td>
2981
<td valign="middle" align="left"> </td>
2982
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2983
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
2984
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
2985
<td valign="middle" align="left"> </td>
2986
<td valign="middle" align="left"> </td>
2987
<td valign="middle" align="left"> </td>
2988
<td valign="middle" align="left"> </td>
2989
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2990
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2991
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
2992
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2994
<h4 class="subsubsection"> 3.12.2.3 Windows 2000 disk full problem </h4>
2996
<p>Windows 2000 has a bug which gives a disk full problem during its
2997
installation. When installing it, use the ‘<samp>-win2k-hack</samp>’ QEMU
2998
option to enable a specific workaround. After Windows 2000 is
2999
installed, you no longer need this option (this option slows down the
3003
<a name="SEC53"></a>
3004
<table cellpadding="1" cellspacing="1" border="0">
3005
<tr><td valign="middle" align="left">[<a href="#SEC52" title="Previous section in reading order"> < </a>]</td>
3006
<td valign="middle" align="left">[<a href="#SEC54" title="Next section in reading order"> > </a>]</td>
3007
<td valign="middle" align="left"> </td>
3008
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3009
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
3010
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
3011
<td valign="middle" align="left"> </td>
3012
<td valign="middle" align="left"> </td>
3013
<td valign="middle" align="left"> </td>
3014
<td valign="middle" align="left"> </td>
3015
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3016
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3017
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3018
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3020
<h4 class="subsubsection"> 3.12.2.4 Windows 2000 shutdown </h4>
3022
<p>Windows 2000 cannot automatically shutdown in QEMU although Windows 98
3023
can. It comes from the fact that Windows 2000 does not automatically
3024
use the APM driver provided by the BIOS.
3026
<p>In order to correct that, do the following (thanks to Struan
3027
Bartlett): go to the Control Panel => Add/Remove Hardware & Next =>
3028
Add/Troubleshoot a device => Add a new device & Next => No, select the
3029
hardware from a list & Next => NT Apm/Legacy Support & Next => Next
3030
(again) a few times. Now the driver is installed and Windows 2000 now
3031
correctly instructs QEMU to shutdown at the appropriate moment.
3034
<a name="SEC54"></a>
3035
<table cellpadding="1" cellspacing="1" border="0">
3036
<tr><td valign="middle" align="left">[<a href="#SEC53" title="Previous section in reading order"> < </a>]</td>
3037
<td valign="middle" align="left">[<a href="#SEC55" title="Next section in reading order"> > </a>]</td>
3038
<td valign="middle" align="left"> </td>
3039
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3040
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
3041
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
3042
<td valign="middle" align="left"> </td>
3043
<td valign="middle" align="left"> </td>
3044
<td valign="middle" align="left"> </td>
3045
<td valign="middle" align="left"> </td>
3046
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3047
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3048
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3049
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3051
<h4 class="subsubsection"> 3.12.2.5 Share a directory between Unix and Windows </h4>
3053
<p>See <a href="#SEC10">Invocation</a> about the help of the option ‘<samp>-smb</samp>’.
3056
<a name="SEC55"></a>
3057
<table cellpadding="1" cellspacing="1" border="0">
3058
<tr><td valign="middle" align="left">[<a href="#SEC54" title="Previous section in reading order"> < </a>]</td>
3059
<td valign="middle" align="left">[<a href="#SEC56" title="Next section in reading order"> > </a>]</td>
3060
<td valign="middle" align="left"> </td>
3061
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3062
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
3063
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
3064
<td valign="middle" align="left"> </td>
3065
<td valign="middle" align="left"> </td>
3066
<td valign="middle" align="left"> </td>
3067
<td valign="middle" align="left"> </td>
3068
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3069
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3070
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3071
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3073
<h4 class="subsubsection"> 3.12.2.6 Windows XP security problem </h4>
3075
<p>Some releases of Windows XP install correctly but give a security
3077
</p><table><tr><td> </td><td><pre class="example">A problem is preventing Windows from accurately checking the
3078
license for this computer. Error code: 0x800703e6.
3079
</pre></td></tr></table>
3081
<p>The workaround is to install a service pack for XP after a boot in safe
3082
mode. Then reboot, and the problem should go away. Since there is no
3083
network while in safe mode, its recommended to download the full
3084
installation of SP1 or SP2 and transfer that via an ISO or using the
3085
vvfat block device ("-hdb fat:directory_which_holds_the_SP").
3088
<a name="SEC56"></a>
3089
<table cellpadding="1" cellspacing="1" border="0">
3090
<tr><td valign="middle" align="left">[<a href="#SEC55" title="Previous section in reading order"> < </a>]</td>
3091
<td valign="middle" align="left">[<a href="#SEC57" title="Next section in reading order"> > </a>]</td>
3092
<td valign="middle" align="left"> </td>
3093
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3094
<td valign="middle" align="left">[<a href="#SEC47" title="Up section"> Up </a>]</td>
3095
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
3096
<td valign="middle" align="left"> </td>
3097
<td valign="middle" align="left"> </td>
3098
<td valign="middle" align="left"> </td>
3099
<td valign="middle" align="left"> </td>
3100
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3101
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3102
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3103
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3105
<h3 class="subsection"> 3.12.3 MS-DOS and FreeDOS </h3>
3108
<a name="SEC57"></a>
3109
<table cellpadding="1" cellspacing="1" border="0">
3110
<tr><td valign="middle" align="left">[<a href="#SEC56" title="Previous section in reading order"> < </a>]</td>
3111
<td valign="middle" align="left">[<a href="#SEC58" title="Next section in reading order"> > </a>]</td>
3112
<td valign="middle" align="left"> </td>
3113
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3114
<td valign="middle" align="left">[<a href="#SEC56" title="Up section"> Up </a>]</td>
3115
<td valign="middle" align="left">[<a href="#SEC58" title="Next chapter"> >> </a>]</td>
3116
<td valign="middle" align="left"> </td>
3117
<td valign="middle" align="left"> </td>
3118
<td valign="middle" align="left"> </td>
3119
<td valign="middle" align="left"> </td>
3120
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3121
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3122
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3123
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3125
<h4 class="subsubsection"> 3.12.3.1 CPU usage reduction </h4>
3127
<p>DOS does not correctly use the CPU HLT instruction. The result is that
3128
it takes host CPU cycles even when idle. You can install the utility
3129
from <a href="http://www.vmware.com/software/dosidle210.zip">http://www.vmware.com/software/dosidle210.zip</a> to solve this
3133
<a name="QEMU-System-emulator-for-non-PC-targets"></a>
3134
<a name="SEC58"></a>
3135
<table cellpadding="1" cellspacing="1" border="0">
3136
<tr><td valign="middle" align="left">[<a href="#SEC57" title="Previous section in reading order"> < </a>]</td>
3137
<td valign="middle" align="left">[<a href="#SEC59" title="Next section in reading order"> > </a>]</td>
3138
<td valign="middle" align="left"> </td>
3139
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3140
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
3141
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3142
<td valign="middle" align="left"> </td>
3143
<td valign="middle" align="left"> </td>
3144
<td valign="middle" align="left"> </td>
3145
<td valign="middle" align="left"> </td>
3146
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3147
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3148
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3149
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3151
<h1 class="chapter"> 4. QEMU System emulator for non PC targets </h1>
3153
<p>QEMU is a generic emulator and it emulates many non PC
3154
machines. Most of the options are similar to the PC emulator. The
3155
differences are mentioned in the following sections.
3157
<table class="menu" border="0" cellspacing="0">
3158
<tr><td align="left" valign="top"><a href="#SEC59">4.1 QEMU PowerPC System emulator</a></td><td> </td><td align="left" valign="top">
3160
<tr><td align="left" valign="top"><a href="#SEC60">4.2 Sparc32 System emulator</a></td><td> </td><td align="left" valign="top">
3162
<tr><td align="left" valign="top"><a href="#SEC61">4.3 Sparc64 System emulator</a></td><td> </td><td align="left" valign="top">
3164
<tr><td align="left" valign="top"><a href="#SEC62">4.4 MIPS System emulator</a></td><td> </td><td align="left" valign="top">
3166
<tr><td align="left" valign="top"><a href="#SEC63">4.5 ARM System emulator</a></td><td> </td><td align="left" valign="top">
3168
<tr><td align="left" valign="top"><a href="#SEC64">4.6 ColdFire System emulator</a></td><td> </td><td align="left" valign="top">
3173
<a name="QEMU-PowerPC-System-emulator"></a>
3174
<a name="SEC59"></a>
3175
<table cellpadding="1" cellspacing="1" border="0">
3176
<tr><td valign="middle" align="left">[<a href="#SEC58" title="Previous section in reading order"> < </a>]</td>
3177
<td valign="middle" align="left">[<a href="#SEC60" title="Next section in reading order"> > </a>]</td>
3178
<td valign="middle" align="left"> </td>
3179
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3180
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3181
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3182
<td valign="middle" align="left"> </td>
3183
<td valign="middle" align="left"> </td>
3184
<td valign="middle" align="left"> </td>
3185
<td valign="middle" align="left"> </td>
3186
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3187
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3188
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3189
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3191
<h2 class="section"> 4.1 QEMU PowerPC System emulator </h2>
3193
<p>Use the executable ‘<tt>qemu-system-ppc</tt>’ to simulate a complete PREP
3194
or PowerMac PowerPC system.
3196
<p>QEMU emulates the following PowerMac peripherals:
3202
PCI VGA compatible card with VESA Bochs Extensions
3204
2 PMAC IDE interfaces with hard disk and CD-ROM support
3210
VIA-CUDA with ADB keyboard and mouse.
3213
<p>QEMU emulates the following PREP peripherals:
3219
PCI VGA compatible card with VESA Bochs Extensions
3221
2 IDE interfaces with hard disk and CD-ROM support
3225
NE2000 network adapters
3229
PREP Non Volatile RAM
3231
PC compatible keyboard and mouse.
3234
<p>QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at
3235
<a href="http://perso.magic.fr/l_indien/OpenHackWare/index.htm">http://perso.magic.fr/l_indien/OpenHackWare/index.htm</a>.
3238
<p>The following options are specific to the PowerPC emulation:
3240
<dl compact="compact">
3241
<dt> ‘<samp>-g WxH[xDEPTH]</samp>’</dt>
3243
<p>Set the initial VGA graphic mode. The default is 800x600x15.
3250
<p>More information is available at
3251
<a href="http://perso.magic.fr/l_indien/qemu-ppc/">http://perso.magic.fr/l_indien/qemu-ppc/</a>.
3254
<a name="Sparc32-System-emulator"></a>
3255
<a name="SEC60"></a>
3256
<table cellpadding="1" cellspacing="1" border="0">
3257
<tr><td valign="middle" align="left">[<a href="#SEC59" title="Previous section in reading order"> < </a>]</td>
3258
<td valign="middle" align="left">[<a href="#SEC61" title="Next section in reading order"> > </a>]</td>
3259
<td valign="middle" align="left"> </td>
3260
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3261
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3262
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3263
<td valign="middle" align="left"> </td>
3264
<td valign="middle" align="left"> </td>
3265
<td valign="middle" align="left"> </td>
3266
<td valign="middle" align="left"> </td>
3267
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3268
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3269
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3270
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3272
<h2 class="section"> 4.2 Sparc32 System emulator </h2>
3274
<p>Use the executable ‘<tt>qemu-system-sparc</tt>’ to simulate a SparcStation 5
3275
or SparcStation 10 (sun4m architecture). The emulation is somewhat complete.
3277
<p>QEMU emulates the following sun4m peripherals:
3285
Lance (Am7990) Ethernet
3287
Non Volatile RAM M48T08
3289
Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard
3290
and power/reset logic
3292
ESP SCSI controller with hard disk and CD-ROM support
3296
CS4231 sound device (only on SS-5, not working yet)
3299
<p>The number of peripherals is fixed in the architecture.
3301
<p>Since version 0.8.2, QEMU uses OpenBIOS
3302
<a href="http://www.openbios.org/">http://www.openbios.org/</a>. OpenBIOS is a free (GPL v2) portable
3303
firmware implementation. The goal is to implement a 100% IEEE
3304
1275-1994 (referred to as Open Firmware) compliant firmware.
3306
<p>A sample Linux 2.6 series kernel and ram disk image are available on
3307
the QEMU web site. Please note that currently NetBSD, OpenBSD or
3308
Solaris kernels don't work.
3311
<p>The following options are specific to the Sparc32 emulation:
3313
<dl compact="compact">
3314
<dt> ‘<samp>-g WxHx[xDEPTH]</samp>’</dt>
3316
<p>Set the initial TCX graphic mode. The default is 1024x768x8, currently
3317
the only other possible mode is 1024x768x24.
3320
<dt> ‘<samp>-prom-env string</samp>’</dt>
3322
<p>Set OpenBIOS variables in NVRAM, for example:
3324
<table><tr><td> </td><td><pre class="example">qemu-system-sparc -prom-env 'auto-boot?=false' \
3325
-prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
3326
</pre></td></tr></table>
3329
<dt> ‘<samp>-M [SS-5|SS-10]</samp>’</dt>
3331
<p>Set the emulated machine type. Default is SS-5.
3338
<a name="Sparc64-System-emulator"></a>
3339
<a name="SEC61"></a>
3340
<table cellpadding="1" cellspacing="1" border="0">
3341
<tr><td valign="middle" align="left">[<a href="#SEC60" title="Previous section in reading order"> < </a>]</td>
3342
<td valign="middle" align="left">[<a href="#SEC62" title="Next section in reading order"> > </a>]</td>
3343
<td valign="middle" align="left"> </td>
3344
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3345
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3346
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3347
<td valign="middle" align="left"> </td>
3348
<td valign="middle" align="left"> </td>
3349
<td valign="middle" align="left"> </td>
3350
<td valign="middle" align="left"> </td>
3351
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3352
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3353
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3354
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3356
<h2 class="section"> 4.3 Sparc64 System emulator </h2>
3358
<p>Use the executable ‘<tt>qemu-system-sparc64</tt>’ to simulate a Sun4u machine.
3359
The emulator is not usable for anything yet.
3361
<p>QEMU emulates the following sun4u peripherals:
3365
UltraSparc IIi APB PCI Bridge
3367
PCI VGA compatible card with VESA Bochs Extensions
3369
Non Volatile RAM M48T59
3371
PC-compatible serial ports
3375
<a name="MIPS-System-emulator"></a>
3376
<a name="SEC62"></a>
3377
<table cellpadding="1" cellspacing="1" border="0">
3378
<tr><td valign="middle" align="left">[<a href="#SEC61" title="Previous section in reading order"> < </a>]</td>
3379
<td valign="middle" align="left">[<a href="#SEC63" title="Next section in reading order"> > </a>]</td>
3380
<td valign="middle" align="left"> </td>
3381
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3382
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3383
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3384
<td valign="middle" align="left"> </td>
3385
<td valign="middle" align="left"> </td>
3386
<td valign="middle" align="left"> </td>
3387
<td valign="middle" align="left"> </td>
3388
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3389
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3390
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3391
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3393
<h2 class="section"> 4.4 MIPS System emulator </h2>
3395
<p>Use the executable ‘<tt>qemu-system-mips</tt>’ to simulate a MIPS machine.
3396
Three different machine types are emulated:
3400
A generic ISA PC-like machine "mips"
3402
The MIPS Malta prototype board "malta"
3404
An ACER Pica "pica61"
3407
<p>The generic emulation is supported by Debian 'Etch' and is able to
3408
install Debian into a virtual disk image. The following devices are
3415
PC style serial port
3422
<p>The Malta emulation supports the following devices:
3426
Core board with MIPS 24Kf CPU and Galileo system controller
3428
PIIX4 PCI/USB/SMbus controller
3430
The Multi-I/O chip's serial device
3432
PCnet32 PCI network card
3434
Malta FPGA serial device
3436
Cirrus VGA graphics card
3439
<p>The ACER Pica emulation supports:
3445
PC-style IRQ and DMA controllers
3453
<a name="ARM-System-emulator"></a>
3454
<a name="SEC63"></a>
3455
<table cellpadding="1" cellspacing="1" border="0">
3456
<tr><td valign="middle" align="left">[<a href="#SEC62" title="Previous section in reading order"> < </a>]</td>
3457
<td valign="middle" align="left">[<a href="#SEC64" title="Next section in reading order"> > </a>]</td>
3458
<td valign="middle" align="left"> </td>
3459
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3460
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3461
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3462
<td valign="middle" align="left"> </td>
3463
<td valign="middle" align="left"> </td>
3464
<td valign="middle" align="left"> </td>
3465
<td valign="middle" align="left"> </td>
3466
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3467
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3468
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3469
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3471
<h2 class="section"> 4.5 ARM System emulator </h2>
3473
<p>Use the executable ‘<tt>qemu-system-arm</tt>’ to simulate a ARM
3474
machine. The ARM Integrator/CP board is emulated with the following
3479
ARM926E, ARM1026E or ARM946E CPU
3483
SMC 91c111 Ethernet adapter
3485
PL110 LCD controller
3487
PL050 KMI with PS/2 keyboard and mouse.
3489
PL181 MultiMedia Card Interface with SD card.
3492
<p>The ARM Versatile baseboard is emulated with the following devices:
3498
PL190 Vectored Interrupt Controller
3502
SMC 91c111 Ethernet adapter
3504
PL110 LCD controller
3506
PL050 KMI with PS/2 keyboard and mouse.
3508
PCI host bridge. Note the emulated PCI bridge only provides access to
3509
PCI memory space. It does not provide access to PCI IO space.
3510
This means some devices (eg. ne2k_pci NIC) are not usable, and others
3511
(eg. rtl8139 NIC) are only usable when the guest drivers use the memory
3512
mapped control registers.
3514
PCI OHCI USB controller.
3516
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices.
3518
PL181 MultiMedia Card Interface with SD card.
3521
<p>The ARM RealView Emulation baseboard is emulated with the following devices:
3527
ARM AMBA Generic/Distributed Interrupt Controller
3531
SMC 91c111 Ethernet adapter
3533
PL110 LCD controller
3535
PL050 KMI with PS/2 keyboard and mouse
3539
PCI OHCI USB controller
3541
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices
3543
PL181 MultiMedia Card Interface with SD card.
3546
<p>The XScale-based clamshell PDA models ("Spitz", "Akita", "Borzoi"
3547
and "Terrier") emulation includes the following peripherals:
3551
Intel PXA270 System-on-chip (ARM V5TE core)
3555
IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in "Akita"
3557
On-chip OHCI USB controller
3559
On-chip LCD controller
3561
On-chip Real Time Clock
3563
TI ADS7846 touchscreen controller on SSP bus
3565
Maxim MAX1111 analog-digital converter on I<em>^2</em>C bus
3567
GPIO-connected keyboard controller and LEDs
3569
Secure Digital card connected to PXA MMC/SD host
3573
WM8750 audio CODEC on I<em>^2</em>C and I<em>^2</em>S busses
3576
<p>A Linux 2.6 test image is available on the QEMU web site. More
3577
information is available in the QEMU mailing-list archive.
3580
<a name="ColdFire-System-emulator"></a>
3581
<a name="SEC64"></a>
3582
<table cellpadding="1" cellspacing="1" border="0">
3583
<tr><td valign="middle" align="left">[<a href="#SEC63" title="Previous section in reading order"> < </a>]</td>
3584
<td valign="middle" align="left">[<a href="#SEC65" title="Next section in reading order"> > </a>]</td>
3585
<td valign="middle" align="left"> </td>
3586
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3587
<td valign="middle" align="left">[<a href="#SEC58" title="Up section"> Up </a>]</td>
3588
<td valign="middle" align="left">[<a href="#SEC65" title="Next chapter"> >> </a>]</td>
3589
<td valign="middle" align="left"> </td>
3590
<td valign="middle" align="left"> </td>
3591
<td valign="middle" align="left"> </td>
3592
<td valign="middle" align="left"> </td>
3593
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3594
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3595
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3596
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3598
<h2 class="section"> 4.6 ColdFire System emulator </h2>
3600
<p>Use the executable ‘<tt>qemu-system-m68k</tt>’ to simulate a ColdFire machine.
3601
The emulator is able to boot a uClinux kernel.
3603
<p>The M5208EVB emulation includes the following devices:
3607
MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC).
3609
Three Two on-chip UARTs.
3611
Fast Ethernet Controller (FEC)
3614
<p>The AN5206 emulation includes the following devices:
3618
MCF5206 ColdFire V2 Microprocessor.
3624
<a name="QEMU-User-space-emulator"></a>
3625
<a name="SEC65"></a>
3626
<table cellpadding="1" cellspacing="1" border="0">
3627
<tr><td valign="middle" align="left">[<a href="#SEC64" title="Previous section in reading order"> < </a>]</td>
3628
<td valign="middle" align="left">[<a href="#SEC66" title="Next section in reading order"> > </a>]</td>
3629
<td valign="middle" align="left"> </td>
3630
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3631
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
3632
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3633
<td valign="middle" align="left"> </td>
3634
<td valign="middle" align="left"> </td>
3635
<td valign="middle" align="left"> </td>
3636
<td valign="middle" align="left"> </td>
3637
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3638
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3639
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3640
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3642
<h1 class="chapter"> 5. QEMU User space emulator </h1>
3644
<table class="menu" border="0" cellspacing="0">
3645
<tr><td align="left" valign="top"><a href="#SEC66">5.1 Supported Operating Systems</a></td><td> </td><td align="left" valign="top">
3647
<tr><td align="left" valign="top"><a href="#SEC67">5.2 Linux User space emulator</a></td><td> </td><td align="left" valign="top">
3649
<tr><td align="left" valign="top"><a href="#SEC72">5.3 Mac OS X/Darwin User space emulator</a></td><td> </td><td align="left" valign="top">
3654
<a name="Supported-Operating-Systems"></a>
3655
<a name="SEC66"></a>
3656
<table cellpadding="1" cellspacing="1" border="0">
3657
<tr><td valign="middle" align="left">[<a href="#SEC65" title="Previous section in reading order"> < </a>]</td>
3658
<td valign="middle" align="left">[<a href="#SEC67" title="Next section in reading order"> > </a>]</td>
3659
<td valign="middle" align="left"> </td>
3660
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3661
<td valign="middle" align="left">[<a href="#SEC65" title="Up section"> Up </a>]</td>
3662
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3663
<td valign="middle" align="left"> </td>
3664
<td valign="middle" align="left"> </td>
3665
<td valign="middle" align="left"> </td>
3666
<td valign="middle" align="left"> </td>
3667
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3668
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3669
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3670
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3672
<h2 class="section"> 5.1 Supported Operating Systems </h2>
3674
<p>The following OS are supported in user space emulation:
3678
Linux (referred as qemu-linux-user)
3680
Mac OS X/Darwin (referred as qemu-darwin-user)
3684
<a name="Linux-User-space-emulator"></a>
3685
<a name="SEC67"></a>
3686
<table cellpadding="1" cellspacing="1" border="0">
3687
<tr><td valign="middle" align="left">[<a href="#SEC66" title="Previous section in reading order"> < </a>]</td>
3688
<td valign="middle" align="left">[<a href="#SEC68" title="Next section in reading order"> > </a>]</td>
3689
<td valign="middle" align="left"> </td>
3690
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3691
<td valign="middle" align="left">[<a href="#SEC65" title="Up section"> Up </a>]</td>
3692
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3693
<td valign="middle" align="left"> </td>
3694
<td valign="middle" align="left"> </td>
3695
<td valign="middle" align="left"> </td>
3696
<td valign="middle" align="left"> </td>
3697
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3698
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3699
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3700
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3702
<h2 class="section"> 5.2 Linux User space emulator </h2>
3704
<table class="menu" border="0" cellspacing="0">
3705
<tr><td align="left" valign="top"><a href="#SEC68">5.2.1 Quick Start</a></td><td> </td><td align="left" valign="top">
3707
<tr><td align="left" valign="top"><a href="#SEC69">5.2.2 Wine launch</a></td><td> </td><td align="left" valign="top">
3709
<tr><td align="left" valign="top"><a href="#SEC70">5.2.3 Command line options</a></td><td> </td><td align="left" valign="top">
3711
<tr><td align="left" valign="top"><a href="#SEC71">5.2.4 Other binaries</a></td><td> </td><td align="left" valign="top">
3716
<a name="Quick-Start"></a>
3717
<a name="SEC68"></a>
3718
<table cellpadding="1" cellspacing="1" border="0">
3719
<tr><td valign="middle" align="left">[<a href="#SEC67" title="Previous section in reading order"> < </a>]</td>
3720
<td valign="middle" align="left">[<a href="#SEC69" title="Next section in reading order"> > </a>]</td>
3721
<td valign="middle" align="left"> </td>
3722
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3723
<td valign="middle" align="left">[<a href="#SEC67" title="Up section"> Up </a>]</td>
3724
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3725
<td valign="middle" align="left"> </td>
3726
<td valign="middle" align="left"> </td>
3727
<td valign="middle" align="left"> </td>
3728
<td valign="middle" align="left"> </td>
3729
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3730
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3731
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3732
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3734
<h3 class="subsection"> 5.2.1 Quick Start </h3>
3736
<p>In order to launch a Linux process, QEMU needs the process executable
3737
itself and all the target (x86) dynamic libraries used by it.
3740
<li> On x86, you can just try to launch any process by using the native
3743
<table><tr><td> </td><td><pre class="example">qemu-i386 -L / /bin/ls
3744
</pre></td></tr></table>
3746
<p><code>-L /</code> tells that the x86 dynamic linker must be searched with a
3747
‘<tt>/</tt>’ prefix.
3749
</li><li> Since QEMU is also a linux process, you can launch qemu with
3750
qemu (NOTE: you can only do that if you compiled QEMU from the sources):
3752
<table><tr><td> </td><td><pre class="example">qemu-i386 -L / qemu-i386 -L / /bin/ls
3753
</pre></td></tr></table>
3755
</li><li> On non x86 CPUs, you need first to download at least an x86 glibc
3756
(‘<tt>qemu-runtime-i386-XXX-.tar.gz</tt>’ on the QEMU web page). Ensure that
3757
<code>LD_LIBRARY_PATH</code> is not set:
3759
<table><tr><td> </td><td><pre class="example">unset LD_LIBRARY_PATH
3760
</pre></td></tr></table>
3762
<p>Then you can launch the precompiled ‘<tt>ls</tt>’ x86 executable:
3764
<table><tr><td> </td><td><pre class="example">qemu-i386 tests/i386/ls
3765
</pre></td></tr></table>
3766
<p>You can look at ‘<tt>qemu-binfmt-conf.sh</tt>’ so that
3767
QEMU is automatically launched by the Linux kernel when you try to
3768
launch x86 executables. It requires the <code>binfmt_misc</code> module in the
3771
</li><li> The x86 version of QEMU is also included. You can try weird things such as:
3772
<table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \
3773
/usr/local/qemu-i386/bin/ls-i386
3774
</pre></td></tr></table>
3779
<a name="Wine-launch"></a>
3780
<a name="SEC69"></a>
3781
<table cellpadding="1" cellspacing="1" border="0">
3782
<tr><td valign="middle" align="left">[<a href="#SEC68" title="Previous section in reading order"> < </a>]</td>
3783
<td valign="middle" align="left">[<a href="#SEC70" title="Next section in reading order"> > </a>]</td>
3784
<td valign="middle" align="left"> </td>
3785
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3786
<td valign="middle" align="left">[<a href="#SEC67" title="Up section"> Up </a>]</td>
3787
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3788
<td valign="middle" align="left"> </td>
3789
<td valign="middle" align="left"> </td>
3790
<td valign="middle" align="left"> </td>
3791
<td valign="middle" align="left"> </td>
3792
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3793
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3794
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3795
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3797
<h3 class="subsection"> 5.2.2 Wine launch </h3>
3800
<li> Ensure that you have a working QEMU with the x86 glibc
3801
distribution (see previous section). In order to verify it, you must be
3804
<table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/bin/ls-i386
3805
</pre></td></tr></table>
3807
</li><li> Download the binary x86 Wine install
3808
(‘<tt>qemu-XXX-i386-wine.tar.gz</tt>’ on the QEMU web page).
3810
</li><li> Configure Wine on your account. Look at the provided script
3811
‘<tt>/usr/local/qemu-i386/bin/wine-conf.sh</tt>’. Your previous
3812
<code>${HOME}/.wine</code> directory is saved to <code>${HOME}/.wine.org</code>.
3814
</li><li> Then you can try the example ‘<tt>putty.exe</tt>’:
3816
<table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/wine/bin/wine \
3817
/usr/local/qemu-i386/wine/c/Program\ Files/putty.exe
3818
</pre></td></tr></table>
3823
<a name="Command-line-options"></a>
3824
<a name="SEC70"></a>
3825
<table cellpadding="1" cellspacing="1" border="0">
3826
<tr><td valign="middle" align="left">[<a href="#SEC69" title="Previous section in reading order"> < </a>]</td>
3827
<td valign="middle" align="left">[<a href="#SEC71" title="Next section in reading order"> > </a>]</td>
3828
<td valign="middle" align="left"> </td>
3829
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3830
<td valign="middle" align="left">[<a href="#SEC67" title="Up section"> Up </a>]</td>
3831
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3832
<td valign="middle" align="left"> </td>
3833
<td valign="middle" align="left"> </td>
3834
<td valign="middle" align="left"> </td>
3835
<td valign="middle" align="left"> </td>
3836
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3837
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3838
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3839
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3841
<h3 class="subsection"> 5.2.3 Command line options </h3>
3843
<table><tr><td> </td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
3844
</pre></td></tr></table>
3846
<dl compact="compact">
3847
<dt> ‘<samp>-h</samp>’</dt>
3848
<dd><p>Print the help
3850
<dt> ‘<samp>-L path</samp>’</dt>
3851
<dd><p>Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
3853
<dt> ‘<samp>-s size</samp>’</dt>
3854
<dd><p>Set the x86 stack size in bytes (default=524288)
3860
<dl compact="compact">
3861
<dt> ‘<samp>-d</samp>’</dt>
3862
<dd><p>Activate log (logfile=/tmp/qemu.log)
3864
<dt> ‘<samp>-p pagesize</samp>’</dt>
3865
<dd><p>Act as if the host page size was 'pagesize' bytes
3870
<a name="Other-binaries"></a>
3871
<a name="SEC71"></a>
3872
<table cellpadding="1" cellspacing="1" border="0">
3873
<tr><td valign="middle" align="left">[<a href="#SEC70" title="Previous section in reading order"> < </a>]</td>
3874
<td valign="middle" align="left">[<a href="#SEC72" title="Next section in reading order"> > </a>]</td>
3875
<td valign="middle" align="left"> </td>
3876
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3877
<td valign="middle" align="left">[<a href="#SEC67" title="Up section"> Up </a>]</td>
3878
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3879
<td valign="middle" align="left"> </td>
3880
<td valign="middle" align="left"> </td>
3881
<td valign="middle" align="left"> </td>
3882
<td valign="middle" align="left"> </td>
3883
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3884
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3885
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3886
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3888
<h3 class="subsection"> 5.2.4 Other binaries </h3>
3890
<p><code>qemu-arm</code> is also capable of running ARM "Angel" semihosted ELF
3891
binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
3892
configurations), and arm-uclinux bFLT format binaries.
3894
<p><code>qemu-m68k</code> is capable of running semihosted binaries using the BDM
3895
(m5xxx-ram-hosted.ld) or m68k-sim (sim.ld) syscall interfaces, and
3896
coldfire uClinux bFLT format binaries.
3898
<p>The binary format is detected automatically.
3901
<a name="Mac-OS-X_002fDarwin-User-space-emulator"></a>
3902
<a name="SEC72"></a>
3903
<table cellpadding="1" cellspacing="1" border="0">
3904
<tr><td valign="middle" align="left">[<a href="#SEC71" title="Previous section in reading order"> < </a>]</td>
3905
<td valign="middle" align="left">[<a href="#SEC73" title="Next section in reading order"> > </a>]</td>
3906
<td valign="middle" align="left"> </td>
3907
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3908
<td valign="middle" align="left">[<a href="#SEC65" title="Up section"> Up </a>]</td>
3909
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3910
<td valign="middle" align="left"> </td>
3911
<td valign="middle" align="left"> </td>
3912
<td valign="middle" align="left"> </td>
3913
<td valign="middle" align="left"> </td>
3914
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3915
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3916
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3917
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3919
<h2 class="section"> 5.3 Mac OS X/Darwin User space emulator </h2>
3921
<table class="menu" border="0" cellspacing="0">
3922
<tr><td align="left" valign="top"><a href="#SEC73">5.3.1 Mac OS X/Darwin Status</a></td><td> </td><td align="left" valign="top">
3924
<tr><td align="left" valign="top"><a href="#SEC74">5.3.2 Quick Start</a></td><td> </td><td align="left" valign="top">
3926
<tr><td align="left" valign="top"><a href="#SEC75">5.3.3 Command line options</a></td><td> </td><td align="left" valign="top">
3931
<a name="Mac-OS-X_002fDarwin-Status"></a>
3932
<a name="SEC73"></a>
3933
<table cellpadding="1" cellspacing="1" border="0">
3934
<tr><td valign="middle" align="left">[<a href="#SEC72" title="Previous section in reading order"> < </a>]</td>
3935
<td valign="middle" align="left">[<a href="#SEC74" title="Next section in reading order"> > </a>]</td>
3936
<td valign="middle" align="left"> </td>
3937
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3938
<td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
3939
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3940
<td valign="middle" align="left"> </td>
3941
<td valign="middle" align="left"> </td>
3942
<td valign="middle" align="left"> </td>
3943
<td valign="middle" align="left"> </td>
3944
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3945
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3946
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3947
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3949
<h3 class="subsection"> 5.3.1 Mac OS X/Darwin Status </h3>
3953
target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
3955
target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
3957
target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1]
3959
target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported.
3962
<p>[1] If you're host commpage can be executed by qemu.
3965
<a name="Mac-OS-X_002fDarwin-Quick-Start"></a>
3966
<a name="SEC74"></a>
3967
<table cellpadding="1" cellspacing="1" border="0">
3968
<tr><td valign="middle" align="left">[<a href="#SEC73" title="Previous section in reading order"> < </a>]</td>
3969
<td valign="middle" align="left">[<a href="#SEC75" title="Next section in reading order"> > </a>]</td>
3970
<td valign="middle" align="left"> </td>
3971
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3972
<td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
3973
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
3974
<td valign="middle" align="left"> </td>
3975
<td valign="middle" align="left"> </td>
3976
<td valign="middle" align="left"> </td>
3977
<td valign="middle" align="left"> </td>
3978
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3979
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3980
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
3981
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3983
<h3 class="subsection"> 5.3.2 Quick Start </h3>
3985
<p>In order to launch a Mac OS X/Darwin process, QEMU needs the process executable
3986
itself and all the target dynamic libraries used by it. If you don't have the FAT
3987
libraries (you're running Mac OS X/ppc) you'll need to obtain it from a Mac OS X
3988
CD or compile them by hand.
3991
<li> On x86, you can just try to launch any process by using the native
3994
<table><tr><td> </td><td><pre class="example">qemu-i386 /bin/ls
3995
</pre></td></tr></table>
3997
<p>or to run the ppc version of the executable:
3999
<table><tr><td> </td><td><pre class="example">qemu-ppc /bin/ls
4000
</pre></td></tr></table>
4002
</li><li> On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker)
4005
<table><tr><td> </td><td><pre class="example">qemu-i386 -L /opt/x86_root/ /bin/ls
4006
</pre></td></tr></table>
4008
<p><code>-L /opt/x86_root/</code> tells that the dynamic linker (dyld) path is in
4009
‘<tt>/opt/x86_root/usr/bin/dyld</tt>’.
4014
<a name="Mac-OS-X_002fDarwin-Command-line-options"></a>
4015
<a name="SEC75"></a>
4016
<table cellpadding="1" cellspacing="1" border="0">
4017
<tr><td valign="middle" align="left">[<a href="#SEC74" title="Previous section in reading order"> < </a>]</td>
4018
<td valign="middle" align="left">[<a href="#SEC76" title="Next section in reading order"> > </a>]</td>
4019
<td valign="middle" align="left"> </td>
4020
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4021
<td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
4022
<td valign="middle" align="left">[<a href="#SEC76" title="Next chapter"> >> </a>]</td>
4023
<td valign="middle" align="left"> </td>
4024
<td valign="middle" align="left"> </td>
4025
<td valign="middle" align="left"> </td>
4026
<td valign="middle" align="left"> </td>
4027
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4028
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4029
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4030
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4032
<h3 class="subsection"> 5.3.3 Command line options </h3>
4034
<table><tr><td> </td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
4035
</pre></td></tr></table>
4037
<dl compact="compact">
4038
<dt> ‘<samp>-h</samp>’</dt>
4039
<dd><p>Print the help
4041
<dt> ‘<samp>-L path</samp>’</dt>
4042
<dd><p>Set the library root path (default=/)
4044
<dt> ‘<samp>-s size</samp>’</dt>
4045
<dd><p>Set the stack size in bytes (default=524288)
4051
<dl compact="compact">
4052
<dt> ‘<samp>-d</samp>’</dt>
4053
<dd><p>Activate log (logfile=/tmp/qemu.log)
4055
<dt> ‘<samp>-p pagesize</samp>’</dt>
4056
<dd><p>Act as if the host page size was 'pagesize' bytes
4061
<a name="compilation"></a>
4062
<a name="SEC76"></a>
4063
<table cellpadding="1" cellspacing="1" border="0">
4064
<tr><td valign="middle" align="left">[<a href="#SEC75" title="Previous section in reading order"> < </a>]</td>
4065
<td valign="middle" align="left">[<a href="#SEC77" title="Next section in reading order"> > </a>]</td>
4066
<td valign="middle" align="left"> </td>
4067
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4068
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
4069
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4070
<td valign="middle" align="left"> </td>
4071
<td valign="middle" align="left"> </td>
4072
<td valign="middle" align="left"> </td>
4073
<td valign="middle" align="left"> </td>
4074
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4075
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4076
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4077
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4079
<h1 class="chapter"> 6. Compilation from the sources </h1>
4081
<table class="menu" border="0" cellspacing="0">
4082
<tr><td align="left" valign="top"><a href="#SEC77">6.1 Linux/Unix</a></td><td> </td><td align="left" valign="top">
4084
<tr><td align="left" valign="top"><a href="#SEC80">6.2 Windows</a></td><td> </td><td align="left" valign="top">
4086
<tr><td align="left" valign="top"><a href="#SEC81">6.3 Cross compilation for Windows with Linux</a></td><td> </td><td align="left" valign="top">
4088
<tr><td align="left" valign="top"><a href="#SEC82">6.4 Mac OS X</a></td><td> </td><td align="left" valign="top">
4093
<a name="Linux_002fUnix"></a>
4094
<a name="SEC77"></a>
4095
<table cellpadding="1" cellspacing="1" border="0">
4096
<tr><td valign="middle" align="left">[<a href="#SEC76" title="Previous section in reading order"> < </a>]</td>
4097
<td valign="middle" align="left">[<a href="#SEC78" title="Next section in reading order"> > </a>]</td>
4098
<td valign="middle" align="left"> </td>
4099
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4100
<td valign="middle" align="left">[<a href="#SEC76" title="Up section"> Up </a>]</td>
4101
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4102
<td valign="middle" align="left"> </td>
4103
<td valign="middle" align="left"> </td>
4104
<td valign="middle" align="left"> </td>
4105
<td valign="middle" align="left"> </td>
4106
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4107
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4108
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4109
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4111
<h2 class="section"> 6.1 Linux/Unix </h2>
4114
<a name="SEC78"></a>
4115
<table cellpadding="1" cellspacing="1" border="0">
4116
<tr><td valign="middle" align="left">[<a href="#SEC77" title="Previous section in reading order"> < </a>]</td>
4117
<td valign="middle" align="left">[<a href="#SEC79" title="Next section in reading order"> > </a>]</td>
4118
<td valign="middle" align="left"> </td>
4119
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4120
<td valign="middle" align="left">[<a href="#SEC77" title="Up section"> Up </a>]</td>
4121
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4122
<td valign="middle" align="left"> </td>
4123
<td valign="middle" align="left"> </td>
4124
<td valign="middle" align="left"> </td>
4125
<td valign="middle" align="left"> </td>
4126
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4127
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4128
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4129
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4131
<h3 class="subsection"> 6.1.1 Compilation </h3>
4133
<p>First you must decompress the sources:
4134
</p><table><tr><td> </td><td><pre class="example">cd /tmp
4135
tar zxvf qemu-x.y.z.tar.gz
4137
</pre></td></tr></table>
4139
<p>Then you configure QEMU and build it (usually no options are needed):
4140
</p><table><tr><td> </td><td><pre class="example">./configure
4142
</pre></td></tr></table>
4144
<p>Then type as root user:
4145
</p><table><tr><td> </td><td><pre class="example">make install
4146
</pre></td></tr></table>
4147
<p>to install QEMU in ‘<tt>/usr/local</tt>’.
4150
<a name="SEC79"></a>
4151
<table cellpadding="1" cellspacing="1" border="0">
4152
<tr><td valign="middle" align="left">[<a href="#SEC78" title="Previous section in reading order"> < </a>]</td>
4153
<td valign="middle" align="left">[<a href="#SEC80" title="Next section in reading order"> > </a>]</td>
4154
<td valign="middle" align="left"> </td>
4155
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4156
<td valign="middle" align="left">[<a href="#SEC77" title="Up section"> Up </a>]</td>
4157
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4158
<td valign="middle" align="left"> </td>
4159
<td valign="middle" align="left"> </td>
4160
<td valign="middle" align="left"> </td>
4161
<td valign="middle" align="left"> </td>
4162
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4163
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4164
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4165
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4167
<h3 class="subsection"> 6.1.2 GCC version </h3>
4169
<p>In order to compile QEMU successfully, it is very important that you
4170
have the right tools. The most important one is gcc. On most hosts and
4171
in particular on x86 ones, <em>gcc 4.x is not supported</em>. If your
4172
Linux distribution includes a gcc 4.x compiler, you can usually
4173
install an older version (it is invoked by <code>gcc32</code> or
4174
<code>gcc34</code>). The QEMU configure script automatically probes for
4175
these older versions so that usually you don't have to do anything.
4178
<a name="Windows"></a>
4179
<a name="SEC80"></a>
4180
<table cellpadding="1" cellspacing="1" border="0">
4181
<tr><td valign="middle" align="left">[<a href="#SEC79" title="Previous section in reading order"> < </a>]</td>
4182
<td valign="middle" align="left">[<a href="#SEC81" title="Next section in reading order"> > </a>]</td>
4183
<td valign="middle" align="left"> </td>
4184
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4185
<td valign="middle" align="left">[<a href="#SEC76" title="Up section"> Up </a>]</td>
4186
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4187
<td valign="middle" align="left"> </td>
4188
<td valign="middle" align="left"> </td>
4189
<td valign="middle" align="left"> </td>
4190
<td valign="middle" align="left"> </td>
4191
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4192
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4193
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4194
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4196
<h2 class="section"> 6.2 Windows </h2>
4199
<li> Install the current versions of MSYS and MinGW from
4200
<a href="http://www.mingw.org/">http://www.mingw.org/</a>. You can find detailed installation
4201
instructions in the download section and the FAQ.
4204
the MinGW development library of SDL 1.2.x
4205
(‘<tt>SDL-devel-1.2.x-mingw32.tar.gz</tt>’) from
4206
<a href="http://www.libsdl.org">http://www.libsdl.org</a>. Unpack it in a temporary place, and
4207
unpack the archive ‘<tt>i386-mingw32msvc.tar.gz</tt>’ in the MinGW tool
4208
directory. Edit the ‘<tt>sdl-config</tt>’ script so that it gives the
4209
correct SDL directory when invoked.
4211
</li><li> Extract the current version of QEMU.
4213
</li><li> Start the MSYS shell (file ‘<tt>msys.bat</tt>’).
4215
</li><li> Change to the QEMU directory. Launch ‘<tt>./configure</tt>’ and
4216
‘<tt>make</tt>’. If you have problems using SDL, verify that
4217
‘<tt>sdl-config</tt>’ can be launched from the MSYS command line.
4219
</li><li> You can install QEMU in ‘<tt>Program Files/Qemu</tt>’ by typing
4220
‘<tt>make install</tt>’. Don't forget to copy ‘<tt>SDL.dll</tt>’ in
4221
‘<tt>Program Files/Qemu</tt>’.
4226
<a name="Cross-compilation-for-Windows-with-Linux"></a>
4227
<a name="SEC81"></a>
4228
<table cellpadding="1" cellspacing="1" border="0">
4229
<tr><td valign="middle" align="left">[<a href="#SEC80" title="Previous section in reading order"> < </a>]</td>
4230
<td valign="middle" align="left">[<a href="#SEC82" title="Next section in reading order"> > </a>]</td>
4231
<td valign="middle" align="left"> </td>
4232
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4233
<td valign="middle" align="left">[<a href="#SEC76" title="Up section"> Up </a>]</td>
4234
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4235
<td valign="middle" align="left"> </td>
4236
<td valign="middle" align="left"> </td>
4237
<td valign="middle" align="left"> </td>
4238
<td valign="middle" align="left"> </td>
4239
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4240
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4241
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4242
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4244
<h2 class="section"> 6.3 Cross compilation for Windows with Linux </h2>
4248
Install the MinGW cross compilation tools available at
4249
<a href="http://www.mingw.org/">http://www.mingw.org/</a>.
4252
Install the Win32 version of SDL (<a href="http://www.libsdl.org">http://www.libsdl.org</a>) by
4253
unpacking ‘<tt>i386-mingw32msvc.tar.gz</tt>’. Set up the PATH environment
4254
variable so that ‘<tt>i386-mingw32msvc-sdl-config</tt>’ can be launched by
4255
the QEMU configuration script.
4258
Configure QEMU for Windows cross compilation:
4259
<table><tr><td> </td><td><pre class="example">./configure --enable-mingw32
4260
</pre></td></tr></table>
4261
<p>If necessary, you can change the cross-prefix according to the prefix
4262
chosen for the MinGW tools with –cross-prefix. You can also use
4263
–prefix to set the Win32 install path.
4265
</li><li> You can install QEMU in the installation directory by typing
4266
‘<tt>make install</tt>’. Don't forget to copy ‘<tt>SDL.dll</tt>’ in the
4267
installation directory.
4271
<p>Note: Currently, Wine does not seem able to launch
4275
<a name="Mac-OS-X"></a>
4276
<a name="SEC82"></a>
4277
<table cellpadding="1" cellspacing="1" border="0">
4278
<tr><td valign="middle" align="left">[<a href="#SEC81" title="Previous section in reading order"> < </a>]</td>
4279
<td valign="middle" align="left">[<a href="#SEC83" title="Next section in reading order"> > </a>]</td>
4280
<td valign="middle" align="left"> </td>
4281
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4282
<td valign="middle" align="left">[<a href="#SEC76" title="Up section"> Up </a>]</td>
4283
<td valign="middle" align="left">[<a href="#SEC83" title="Next chapter"> >> </a>]</td>
4284
<td valign="middle" align="left"> </td>
4285
<td valign="middle" align="left"> </td>
4286
<td valign="middle" align="left"> </td>
4287
<td valign="middle" align="left"> </td>
4288
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4289
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4290
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4291
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4293
<h2 class="section"> 6.4 Mac OS X </h2>
4295
<p>The Mac OS X patches are not fully merged in QEMU, so you should look
4296
at the QEMU mailing list archive to have all the necessary
4300
<a name="Index"></a>
4301
<a name="SEC83"></a>
4302
<table cellpadding="1" cellspacing="1" border="0">
4303
<tr><td valign="middle" align="left">[<a href="#SEC82" title="Previous section in reading order"> < </a>]</td>
4304
<td valign="middle" align="left">[ > ]</td>
4305
<td valign="middle" align="left"> </td>
4306
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4307
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
4308
<td valign="middle" align="left">[ >> ]</td>
4309
<td valign="middle" align="left"> </td>
4310
<td valign="middle" align="left"> </td>
4311
<td valign="middle" align="left"> </td>
4312
<td valign="middle" align="left"> </td>
4313
<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4314
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4315
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4316
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4318
<h1 class="chapter"> 7. Index </h1>
4321
<a name="SEC_Contents"></a>
4322
<table cellpadding="1" cellspacing="1" border="0">
4323
<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4324
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4325
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4326
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4328
<h1>Table of Contents</h1>
4329
<div class="contents">
4332
<li><a name="TOC1" href="#SEC1">1. Introduction</a>
4334
<li><a name="TOC2" href="#SEC2">1.1 Features</a></li>
4336
<li><a name="TOC3" href="#SEC3">2. Installation</a>
4338
<li><a name="TOC4" href="#SEC4">2.1 Linux</a></li>
4339
<li><a name="TOC5" href="#SEC5">2.2 Windows</a></li>
4340
<li><a name="TOC6" href="#SEC6">2.3 Mac OS X</a></li>
4342
<li><a name="TOC7" href="#SEC7">3. QEMU PC System emulator</a>
4344
<li><a name="TOC8" href="#SEC8">3.1 Introduction</a></li>
4345
<li><a name="TOC9" href="#SEC9">3.2 Quick Start</a></li>
4346
<li><a name="TOC10" href="#SEC10">3.3 Invocation</a></li>
4347
<li><a name="TOC11" href="#SEC11">3.4 Keys</a></li>
4348
<li><a name="TOC12" href="#SEC12">3.5 QEMU Monitor</a>
4350
<li><a name="TOC13" href="#SEC13">3.5.1 Commands</a></li>
4351
<li><a name="TOC14" href="#SEC14">3.5.2 Integer expressions</a></li>
4353
<li><a name="TOC15" href="#SEC15">3.6 Disk Images</a>
4355
<li><a name="TOC16" href="#SEC16">3.6.1 Quick start for disk image creation</a></li>
4356
<li><a name="TOC17" href="#SEC17">3.6.2 Snapshot mode</a></li>
4357
<li><a name="TOC18" href="#SEC18">3.6.3 VM snapshots</a></li>
4358
<li><a name="TOC19" href="#SEC19">3.6.4 <code>qemu-img</code> Invocation</a></li>
4359
<li><a name="TOC20" href="#SEC20">3.6.5 Using host drives</a>
4361
<li><a name="TOC21" href="#SEC21">3.6.5.1 Linux</a></li>
4362
<li><a name="TOC22" href="#SEC22">3.6.5.2 Windows</a></li>
4363
<li><a name="TOC23" href="#SEC23">3.6.5.3 Mac OS X</a></li>
4365
<li><a name="TOC24" href="#SEC24">3.6.6 Virtual FAT disk images</a></li>
4367
<li><a name="TOC25" href="#SEC25">3.7 Network emulation</a>
4369
<li><a name="TOC26" href="#SEC26">3.7.1 VLANs</a></li>
4370
<li><a name="TOC27" href="#SEC27">3.7.2 Using TAP network interfaces</a>
4372
<li><a name="TOC28" href="#SEC28">3.7.2.1 Linux host</a></li>
4373
<li><a name="TOC29" href="#SEC29">3.7.2.2 Windows host</a></li>
4375
<li><a name="TOC30" href="#SEC30">3.7.3 Using the user mode network stack</a></li>
4376
<li><a name="TOC31" href="#SEC31">3.7.4 Connecting VLANs between QEMU instances</a></li>
4378
<li><a name="TOC32" href="#SEC32">3.8 Direct Linux Boot</a></li>
4379
<li><a name="TOC33" href="#SEC33">3.9 USB emulation</a>
4381
<li><a name="TOC34" href="#SEC34">3.9.1 Connecting USB devices</a></li>
4382
<li><a name="TOC35" href="#SEC35">3.9.2 Using host USB devices on a Linux host</a></li>
4384
<li><a name="TOC36" href="#SEC36">3.10 VNC security</a>
4386
<li><a name="TOC37" href="#SEC37">3.10.1 Without passwords</a></li>
4387
<li><a name="TOC38" href="#SEC38">3.10.2 With passwords</a></li>
4388
<li><a name="TOC39" href="#SEC39">3.10.3 With x509 certificates</a></li>
4389
<li><a name="TOC40" href="#SEC40">3.10.4 With x509 certificates and client verification</a></li>
4390
<li><a name="TOC41" href="#SEC41">3.10.5 With x509 certificates, client verification and passwords</a></li>
4391
<li><a name="TOC42" href="#SEC42">3.10.6 Generating certificates for VNC</a>
4393
<li><a name="TOC43" href="#SEC43">3.10.6.1 Setup the Certificate Authority</a></li>
4394
<li><a name="TOC44" href="#SEC44">3.10.6.2 Issuing server certificates</a></li>
4395
<li><a name="TOC45" href="#SEC45">3.10.6.3 Issuing client certificates</a></li>
4399
<li><a name="TOC46" href="#SEC46">3.11 GDB usage</a></li>
4400
<li><a name="TOC47" href="#SEC47">3.12 Target OS specific information</a>
4402
<li><a name="TOC48" href="#SEC48">3.12.1 Linux</a></li>
4403
<li><a name="TOC49" href="#SEC49">3.12.2 Windows</a>
4405
<li><a name="TOC50" href="#SEC50">3.12.2.1 SVGA graphic modes support</a></li>
4406
<li><a name="TOC51" href="#SEC51">3.12.2.2 CPU usage reduction</a></li>
4407
<li><a name="TOC52" href="#SEC52">3.12.2.3 Windows 2000 disk full problem</a></li>
4408
<li><a name="TOC53" href="#SEC53">3.12.2.4 Windows 2000 shutdown</a></li>
4409
<li><a name="TOC54" href="#SEC54">3.12.2.5 Share a directory between Unix and Windows</a></li>
4410
<li><a name="TOC55" href="#SEC55">3.12.2.6 Windows XP security problem</a></li>
4412
<li><a name="TOC56" href="#SEC56">3.12.3 MS-DOS and FreeDOS</a>
4414
<li><a name="TOC57" href="#SEC57">3.12.3.1 CPU usage reduction</a></li>
4420
<li><a name="TOC58" href="#SEC58">4. QEMU System emulator for non PC targets</a>
4422
<li><a name="TOC59" href="#SEC59">4.1 QEMU PowerPC System emulator</a></li>
4423
<li><a name="TOC60" href="#SEC60">4.2 Sparc32 System emulator</a></li>
4424
<li><a name="TOC61" href="#SEC61">4.3 Sparc64 System emulator</a></li>
4425
<li><a name="TOC62" href="#SEC62">4.4 MIPS System emulator</a></li>
4426
<li><a name="TOC63" href="#SEC63">4.5 ARM System emulator</a></li>
4427
<li><a name="TOC64" href="#SEC64">4.6 ColdFire System emulator</a></li>
4429
<li><a name="TOC65" href="#SEC65">5. QEMU User space emulator</a>
4431
<li><a name="TOC66" href="#SEC66">5.1 Supported Operating Systems</a></li>
4432
<li><a name="TOC67" href="#SEC67">5.2 Linux User space emulator</a>
4434
<li><a name="TOC68" href="#SEC68">5.2.1 Quick Start</a></li>
4435
<li><a name="TOC69" href="#SEC69">5.2.2 Wine launch</a></li>
4436
<li><a name="TOC70" href="#SEC70">5.2.3 Command line options</a></li>
4437
<li><a name="TOC71" href="#SEC71">5.2.4 Other binaries</a></li>
4439
<li><a name="TOC72" href="#SEC72">5.3 Mac OS X/Darwin User space emulator</a>
4441
<li><a name="TOC73" href="#SEC73">5.3.1 Mac OS X/Darwin Status</a></li>
4442
<li><a name="TOC74" href="#SEC74">5.3.2 Quick Start</a></li>
4443
<li><a name="TOC75" href="#SEC75">5.3.3 Command line options</a></li>
4447
<li><a name="TOC76" href="#SEC76">6. Compilation from the sources</a>
4449
<li><a name="TOC77" href="#SEC77">6.1 Linux/Unix</a>
4451
<li><a name="TOC78" href="#SEC78">6.1.1 Compilation</a></li>
4452
<li><a name="TOC79" href="#SEC79">6.1.2 GCC version</a></li>
4454
<li><a name="TOC80" href="#SEC80">6.2 Windows</a></li>
4455
<li><a name="TOC81" href="#SEC81">6.3 Cross compilation for Windows with Linux</a></li>
4456
<li><a name="TOC82" href="#SEC82">6.4 Mac OS X</a></li>
4458
<li><a name="TOC83" href="#SEC83">7. Index</a></li>
4462
<a name="SEC_About"></a>
4463
<table cellpadding="1" cellspacing="1" border="0">
4464
<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4465
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4466
<td valign="middle" align="left">[<a href="#SEC83" title="Index">Index</a>]</td>
4467
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4469
<h1>About This Document</h1>
4471
This document was generated by <em>Soren Hansen</em> on <em>December, 4 2007</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78</em></a>.
4474
The buttons in the navigation panels have the following meaning:
4481
<th> From 1.2.3 go to</th>
4484
<td align="center"> [ < ] </td>
4485
<td align="center">Back</td>
4486
<td>Previous section in reading order</td>
4490
<td align="center"> [ > ] </td>
4491
<td align="center">Forward</td>
4492
<td>Next section in reading order</td>
4496
<td align="center"> [ << ] </td>
4497
<td align="center">FastBack</td>
4498
<td>Beginning of this chapter or previous chapter</td>
4502
<td align="center"> [ Up ] </td>
4503
<td align="center">Up</td>
4508
<td align="center"> [ >> ] </td>
4509
<td align="center">FastForward</td>
4510
<td>Next chapter</td>
4514
<td align="center"> [Top] </td>
4515
<td align="center">Top</td>
4516
<td>Cover (top) of document</td>
4520
<td align="center"> [Contents] </td>
4521
<td align="center">Contents</td>
4522
<td>Table of contents</td>
4526
<td align="center"> [Index] </td>
4527
<td align="center">Index</td>
4532
<td align="center"> [ ? ] </td>
4533
<td align="center">About</td>
4534
<td>About (help)</td>
4540
where the <strong> Example </strong> assumes that the current position is at <strong> Subsubsection One-Two-Three </strong> of a document of the following structure:
4546
<li>1.1 Subsection One-One
4551
<li>1.2 Subsection One-Two
4553
<li>1.2.1 Subsubsection One-Two-One</li>
4554
<li>1.2.2 Subsubsection One-Two-Two</li>
4555
<li>1.2.3 Subsubsection One-Two-Three
4556
<strong><== Current Position </strong></li>
4557
<li>1.2.4 Subsubsection One-Two-Four</li>
4560
<li>1.3 Subsection One-Three
4565
<li>1.4 Subsection One-Four</li>
4573
This document was generated by <em>Soren Hansen</em> on <em>December, 4 2007</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78</em></a>.