~ubuntu-branches/ubuntu/hardy/kvm/hardy-backports

« back to all changes in this revision

Viewing changes to qemu/qemu-doc.html

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-12-10 13:43:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20071210134303-rw38y458ilx76vmv
Tags: 1:55+dfsg-1ubuntu1
* Merge with Debian. Remaining changes:
  - debian/control:
    - Demote kvm-source to Suggests
    - Mention kvm-source is unnecessary
    - Modify Maintainer value to match the DebianMaintainerField
      specification.
    - Depend on recent bochsbios-qemu.
    - Moved Vcs-* to XS-Original-Vcs-*.
    - Don't recommend linux-image-2.6 since Ubuntu is Linux 2.6 only anyway.
    - Rename suggestions of linux-{headers,source} to Ubuntu's naming scheme.
    - Add pkg-config to Build-Depends (fixes warning during build)
  - Add 08_default_tdf.patch to make -tdf the default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2
 
<html>
3
 
<!-- Created on December, 4 2007 by texi2html 1.78 -->
4
 
<!--
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>
8
 
            and many others.
9
 
Maintained by: Many creative people.
10
 
Send bugs and suggestions to <texi2html-bug@nongnu.org>
11
 
 
12
 
-->
13
 
<head>
14
 
<title>QEMU Emulator User Documentation</title>
15
 
 
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">
23
 
<!--
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}
36
 
-->
37
 
</style>
38
 
 
39
 
 
40
 
</head>
41
 
 
42
 
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
 
 
44
 
<a name="Top"></a>
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>
51
 
</tr></table>
52
 
<h1 class="settitle">QEMU Emulator User Documentation
53
 
</h1>
54
 
 
55
 
<table class="menu" border="0" cellspacing="0">
56
 
<tr><td align="left" valign="top"><a href="#SEC1">1. Introduction</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
57
 
</td></tr>
58
 
<tr><td align="left" valign="top"><a href="#SEC3">2. Installation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
59
 
</td></tr>
60
 
<tr><td align="left" valign="top"><a href="#SEC7">3. QEMU PC System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
61
 
</td></tr>
62
 
<tr><td align="left" valign="top"><a href="#SEC58">4. QEMU System emulator for non PC targets</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
63
 
</td></tr>
64
 
<tr><td align="left" valign="top"><a href="#SEC65">5. QEMU User space emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
65
 
</td></tr>
66
 
<tr><td align="left" valign="top"><a href="#SEC76">6. Compilation from the sources</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
67
 
<tr><td align="left" valign="top"><a href="#SEC83">7. Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
68
 
</td></tr>
69
 
</table>
70
 
 
71
 
 
72
 
<hr size="1">
73
 
<a name="Introduction"></a>
74
 
<a name="SEC1"></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"> &lt; </a>]</td>
77
 
<td valign="middle" align="left">[<a href="#SEC2" title="Next section in reading order"> &gt; </a>]</td>
78
 
<td valign="middle" align="left"> &nbsp; </td>
79
 
<td valign="middle" align="left">[ &lt;&lt; ]</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"> &gt;&gt; </a>]</td>
82
 
<td valign="middle" align="left"> &nbsp; </td>
83
 
<td valign="middle" align="left"> &nbsp; </td>
84
 
<td valign="middle" align="left"> &nbsp; </td>
85
 
<td valign="middle" align="left"> &nbsp; </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>
90
 
</tr></table>
91
 
<h1 class="chapter"> 1. Introduction </h1>
92
 
 
93
 
<table class="menu" border="0" cellspacing="0">
94
 
<tr><td align="left" valign="top"><a href="#SEC2">1.1 Features</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
95
 
</table>
96
 
 
97
 
<hr size="6">
98
 
<a name="intro_005ffeatures"></a>
99
 
<a name="SEC2"></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"> &lt; </a>]</td>
102
 
<td valign="middle" align="left">[<a href="#SEC3" title="Next section in reading order"> &gt; </a>]</td>
103
 
<td valign="middle" align="left"> &nbsp; </td>
104
 
<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
107
 
<td valign="middle" align="left"> &nbsp; </td>
108
 
<td valign="middle" align="left"> &nbsp; </td>
109
 
<td valign="middle" align="left"> &nbsp; </td>
110
 
<td valign="middle" align="left"> &nbsp; </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>
115
 
</tr></table>
116
 
<h2 class="section"> 1.1 Features </h2>
117
 
 
118
 
<p>QEMU is a FAST! processor emulator using dynamic translation to
119
 
achieve good emulation speed.
120
 
</p>
121
 
<p>QEMU has two operating modes:
122
 
</p>
123
 
<ul class="toc">
124
 
<li>-
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.
129
 
 
130
 
</li><li>-
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.
135
 
 
136
 
</li></ul>
137
 
 
138
 
<p>QEMU can run without an host kernel driver and yet gives acceptable
139
 
performance.
140
 
</p>
141
 
<p>For system emulation, the following hardware targets are supported:
142
 
</p><ul class="toc">
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).
157
 
</li></ul>
158
 
 
159
 
<p>For user emulation, x86, PowerPC, ARM, MIPS, Sparc32/64 and ColdFire(m68k) CPUs are supported.
160
 
</p>
161
 
<hr size="6">
162
 
<a name="Installation"></a>
163
 
<a name="SEC3"></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"> &lt; </a>]</td>
166
 
<td valign="middle" align="left">[<a href="#SEC4" title="Next section in reading order"> &gt; </a>]</td>
167
 
<td valign="middle" align="left"> &nbsp; </td>
168
 
<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
171
 
<td valign="middle" align="left"> &nbsp; </td>
172
 
<td valign="middle" align="left"> &nbsp; </td>
173
 
<td valign="middle" align="left"> &nbsp; </td>
174
 
<td valign="middle" align="left"> &nbsp; </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>
179
 
</tr></table>
180
 
<h1 class="chapter"> 2. Installation </h1>
181
 
 
182
 
<p>If you want to compile QEMU yourself, see <a href="#SEC76">Compilation from the sources</a>.
183
 
</p>
184
 
<table class="menu" border="0" cellspacing="0">
185
 
<tr><td align="left" valign="top"><a href="#SEC4">2.1 Linux</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
186
 
<tr><td align="left" valign="top"><a href="#SEC5">2.2 Windows</a></td><td>&nbsp;&nbsp;</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>&nbsp;&nbsp;</td><td align="left" valign="top">     Macintosh
188
 
</td></tr>
189
 
</table>
190
 
 
191
 
<hr size="6">
192
 
<a name="install_005flinux"></a>
193
 
<a name="SEC4"></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"> &lt; </a>]</td>
196
 
<td valign="middle" align="left">[<a href="#SEC5" title="Next section in reading order"> &gt; </a>]</td>
197
 
<td valign="middle" align="left"> &nbsp; </td>
198
 
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
201
 
<td valign="middle" align="left"> &nbsp; </td>
202
 
<td valign="middle" align="left"> &nbsp; </td>
203
 
<td valign="middle" align="left"> &nbsp; </td>
204
 
<td valign="middle" align="left"> &nbsp; </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>
209
 
</tr></table>
210
 
<h2 class="section"> 2.1 Linux </h2>
211
 
 
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>.
214
 
</p>
215
 
<hr size="6">
216
 
<a name="install_005fwindows"></a>
217
 
<a name="SEC5"></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"> &lt; </a>]</td>
220
 
<td valign="middle" align="left">[<a href="#SEC6" title="Next section in reading order"> &gt; </a>]</td>
221
 
<td valign="middle" align="left"> &nbsp; </td>
222
 
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
225
 
<td valign="middle" align="left"> &nbsp; </td>
226
 
<td valign="middle" align="left"> &nbsp; </td>
227
 
<td valign="middle" align="left"> &nbsp; </td>
228
 
<td valign="middle" align="left"> &nbsp; </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>
233
 
</tr></table>
234
 
<h2 class="section"> 2.2 Windows </h2>
235
 
 
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>.
238
 
</p>
239
 
<hr size="6">
240
 
<a name="install_005fmac"></a>
241
 
<a name="SEC6"></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"> &lt; </a>]</td>
244
 
<td valign="middle" align="left">[<a href="#SEC7" title="Next section in reading order"> &gt; </a>]</td>
245
 
<td valign="middle" align="left"> &nbsp; </td>
246
 
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
249
 
<td valign="middle" align="left"> &nbsp; </td>
250
 
<td valign="middle" align="left"> &nbsp; </td>
251
 
<td valign="middle" align="left"> &nbsp; </td>
252
 
<td valign="middle" align="left"> &nbsp; </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>
257
 
</tr></table>
258
 
<h2 class="section"> 2.3 Mac OS X </h2>
259
 
 
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>.
262
 
</p>
263
 
<hr size="6">
264
 
<a name="QEMU-PC-System-emulator"></a>
265
 
<a name="SEC7"></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"> &lt; </a>]</td>
268
 
<td valign="middle" align="left">[<a href="#SEC8" title="Next section in reading order"> &gt; </a>]</td>
269
 
<td valign="middle" align="left"> &nbsp; </td>
270
 
<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
273
 
<td valign="middle" align="left"> &nbsp; </td>
274
 
<td valign="middle" align="left"> &nbsp; </td>
275
 
<td valign="middle" align="left"> &nbsp; </td>
276
 
<td valign="middle" align="left"> &nbsp; </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>
281
 
</tr></table>
282
 
<h1 class="chapter"> 3. QEMU PC System emulator </h1>
283
 
 
284
 
<table class="menu" border="0" cellspacing="0">
285
 
<tr><td align="left" valign="top"><a href="#SEC8">3.1 Introduction</a></td><td>&nbsp;&nbsp;</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>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
287
 
<tr><td align="left" valign="top"><a href="#SEC10">3.3 Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
288
 
<tr><td align="left" valign="top"><a href="#SEC11">3.4 Keys</a></td><td>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
297
 
</table>
298
 
 
299
 
<hr size="6">
300
 
<a name="pcsys_005fintroduction"></a>
301
 
<a name="SEC8"></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"> &lt; </a>]</td>
304
 
<td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> &gt; </a>]</td>
305
 
<td valign="middle" align="left"> &nbsp; </td>
306
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
309
 
<td valign="middle" align="left"> &nbsp; </td>
310
 
<td valign="middle" align="left"> &nbsp; </td>
311
 
<td valign="middle" align="left"> &nbsp; </td>
312
 
<td valign="middle" align="left"> &nbsp; </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>
317
 
</tr></table>
318
 
<h2 class="section"> 3.1 Introduction </h2>
319
 
 
320
 
 
321
 
<p>The QEMU PC System emulator simulates the
322
 
following peripherals:
323
 
</p>
324
 
<ul class="toc">
325
 
<li>-
326
 
i440FX host PCI bridge and PIIX3 PCI to ISA bridge
327
 
</li><li>-
328
 
Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
329
 
extensions (hardware level, including all non standard modes).
330
 
</li><li>-
331
 
PS/2 mouse and keyboard
332
 
</li><li>-
333
 
2 PCI IDE interfaces with hard disk and CD-ROM support
334
 
</li><li>-
335
 
Floppy disk
336
 
</li><li>-
337
 
PCI/ISA PCI network adapters
338
 
</li><li>-
339
 
Serial ports
340
 
</li><li>-
341
 
Creative SoundBlaster 16 sound card
342
 
</li><li>-
343
 
ENSONIQ AudioPCI ES1370 sound card
344
 
</li><li>-
345
 
Adlib(OPL2) - Yamaha YM3812 compatible chip
346
 
</li><li>-
347
 
PCI UHCI USB controller and a virtual USB hub.
348
 
</li></ul>
349
 
 
350
 
<p>SMP is supported with up to 255 CPUs.
351
 
</p>
352
 
<p>Note that adlib is only available when QEMU was configured with
353
 
-enable-adlib
354
 
</p>
355
 
<p>QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
356
 
VGA BIOS.
357
 
</p>
358
 
<p>QEMU uses YM3812 emulation by Tatsuyuki Satoh.
359
 
</p>
360
 
 
361
 
<hr size="6">
362
 
<a name="pcsys_005fquickstart"></a>
363
 
<a name="SEC9"></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"> &lt; </a>]</td>
366
 
<td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> &gt; </a>]</td>
367
 
<td valign="middle" align="left"> &nbsp; </td>
368
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
371
 
<td valign="middle" align="left"> &nbsp; </td>
372
 
<td valign="middle" align="left"> &nbsp; </td>
373
 
<td valign="middle" align="left"> &nbsp; </td>
374
 
<td valign="middle" align="left"> &nbsp; </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>
379
 
</tr></table>
380
 
<h2 class="section"> 3.2 Quick Start </h2>
381
 
 
382
 
<p>Download and uncompress the linux image (&lsquo;<tt>linux.img</tt>&rsquo;) and type:
383
 
</p>
384
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu linux.img
385
 
</pre></td></tr></table>
386
 
 
387
 
<p>Linux should boot and give you a prompt.
388
 
</p>
389
 
<hr size="6">
390
 
<a name="sec_005finvocation"></a>
391
 
<a name="SEC10"></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"> &lt; </a>]</td>
394
 
<td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> &gt; </a>]</td>
395
 
<td valign="middle" align="left"> &nbsp; </td>
396
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
399
 
<td valign="middle" align="left"> &nbsp; </td>
400
 
<td valign="middle" align="left"> &nbsp; </td>
401
 
<td valign="middle" align="left"> &nbsp; </td>
402
 
<td valign="middle" align="left"> &nbsp; </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>
407
 
</tr></table>
408
 
<h2 class="section"> 3.3 Invocation </h2>
409
 
 
410
 
<table><tr><td>&nbsp;</td><td><pre class="example">usage: qemu [options] [disk_image]
411
 
</pre></td></tr></table>
412
 
 
413
 
<p><var>disk_image</var> is a raw hard disk image for IDE hard disk 0.
414
 
</p>
415
 
<p>General options:
416
 
</p><dl compact="compact">
417
 
<dt> &lsquo;<samp>-M machine</samp>&rsquo;</dt>
418
 
<dd><p>Select the emulated machine (<code>-M ?</code> for list)
419
 
</p>
420
 
</dd>
421
 
<dt> &lsquo;<samp>-fda file</samp>&rsquo;</dt>
422
 
<dt> &lsquo;<samp>-fdb file</samp>&rsquo;</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 &lsquo;<tt>/dev/fd0</tt>&rsquo; as filename (see section <a href="#SEC20">Using host drives</a>).
425
 
</p>
426
 
</dd>
427
 
<dt> &lsquo;<samp>-hda file</samp>&rsquo;</dt>
428
 
<dt> &lsquo;<samp>-hdb file</samp>&rsquo;</dt>
429
 
<dt> &lsquo;<samp>-hdc file</samp>&rsquo;</dt>
430
 
<dt> &lsquo;<samp>-hdd file</samp>&rsquo;</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>).
432
 
</p>
433
 
</dd>
434
 
<dt> &lsquo;<samp>-cdrom file</samp>&rsquo;</dt>
435
 
<dd><p>Use <var>file</var> as CD-ROM image (you cannot use &lsquo;<samp>-hdc</samp>&rsquo; and and
436
 
&lsquo;<samp>-cdrom</samp>&rsquo; at the same time). You can use the host CD-ROM by
437
 
using &lsquo;<tt>/dev/cdrom</tt>&rsquo; as filename (see section <a href="#SEC20">Using host drives</a>).
438
 
</p>
439
 
</dd>
440
 
<dt> &lsquo;<samp>-boot [a|c|d|n]</samp>&rsquo;</dt>
441
 
<dd><p>Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n). Hard disk boot
442
 
is the default.
443
 
</p>
444
 
</dd>
445
 
<dt> &lsquo;<samp>-snapshot</samp>&rsquo;</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 &lt;C-a s&gt; (see section <a href="#SEC15">Disk Images</a>).
449
 
</p>
450
 
</dd>
451
 
<dt> &lsquo;<samp>-no-fd-bootchk</samp>&rsquo;</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.
454
 
</p>
455
 
</dd>
456
 
<dt> &lsquo;<samp>-m megs</samp>&rsquo;</dt>
457
 
<dd><p>Set virtual RAM size to <var>megs</var> megabytes. Default is 128 MB.
458
 
</p>
459
 
</dd>
460
 
<dt> &lsquo;<samp>-smp n</samp>&rsquo;</dt>
461
 
<dd><p>Simulate an SMP system with <var>n</var> CPUs. On the PC target, up to 255
462
 
CPUs are supported.
463
 
</p>
464
 
</dd>
465
 
<dt> &lsquo;<samp>-audio-help</samp>&rsquo;</dt>
466
 
<dd>
467
 
<p>Will show the audio subsystem help: list of drivers, tunable
468
 
parameters.
469
 
</p>
470
 
</dd>
471
 
<dt> &lsquo;<samp>-soundhw card1,card2,... or -soundhw all</samp>&rsquo;</dt>
472
 
<dd>
473
 
<p>Enable audio and selected sound hardware. Use ? to print all
474
 
available sound hardware.
475
 
</p>
476
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu -soundhw sb16,adlib hda
477
 
qemu -soundhw es1370 hda
478
 
qemu -soundhw all hda
479
 
qemu -soundhw ?
480
 
</pre></td></tr></table>
481
 
 
482
 
</dd>
483
 
<dt> &lsquo;<samp>-localtime</samp>&rsquo;</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
486
 
Windows.
487
 
</p>
488
 
</dd>
489
 
<dt> &lsquo;<samp>-pidfile file</samp>&rsquo;</dt>
490
 
<dd><p>Store the QEMU process PID in <var>file</var>. It is useful if you launch QEMU
491
 
from a script.
492
 
</p>
493
 
</dd>
494
 
<dt> &lsquo;<samp>-daemonize</samp>&rsquo;</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.
499
 
</p>
500
 
</dd>
501
 
<dt> &lsquo;<samp>-win2k-hack</samp>&rsquo;</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).
505
 
</p>
506
 
</dd>
507
 
<dt> &lsquo;<samp>-option-rom file</samp>&rsquo;</dt>
508
 
<dd><p>Load the contents of file as an option ROM.  This option is useful to load
509
 
things like EtherBoot.
510
 
</p>
511
 
</dd>
512
 
<dt> &lsquo;<samp>-name string</samp>&rsquo;</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.
515
 
</p>
516
 
</dd>
517
 
</dl>
518
 
 
519
 
<p>Display options:
520
 
</p><dl compact="compact">
521
 
<dt> &lsquo;<samp>-nographic</samp>&rsquo;</dt>
522
 
<dd>
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.
528
 
</p>
529
 
</dd>
530
 
<dt> &lsquo;<samp>-no-frame</samp>&rsquo;</dt>
531
 
<dd>
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.
535
 
</p>
536
 
</dd>
537
 
<dt> &lsquo;<samp>-full-screen</samp>&rsquo;</dt>
538
 
<dd><p>Start in full screen.
539
 
</p>
540
 
</dd>
541
 
<dt> &lsquo;<samp>-vnc display[,option[,option[,...]]]</samp>&rsquo;</dt>
542
 
<dd>
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 &lsquo;<samp>-usbdevice
547
 
tablet</samp>&rsquo;). When using the VNC display, you must use the &lsquo;<samp>-k</samp>&rsquo;
548
 
parameter to set the keyboard layout if you are not using en-us. Valid
549
 
syntax for the <var>display</var> is
550
 
</p>
551
 
<dl compact="compact">
552
 
<dt> <code><var>interface:d</var></code></dt>
553
 
<dd>
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.
557
 
</p>
558
 
</dd>
559
 
<dt> <code><var>unix:path</var></code></dt>
560
 
<dd>
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.
563
 
</p>
564
 
</dd>
565
 
<dt> <code><var>none</var></code></dt>
566
 
<dd>
567
 
<p>VNC is initialized by not started. The monitor <code>change</code> command can be used
568
 
to later start the VNC server.
569
 
</p>
570
 
</dd>
571
 
</dl>
572
 
 
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
575
 
</p>
576
 
<dl compact="compact">
577
 
<dt> <code><var>password</var></code></dt>
578
 
<dd>
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>
582
 
</p>
583
 
</dd>
584
 
<dt> <code><var>tls</var></code></dt>
585
 
<dd>
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.
590
 
</p>
591
 
</dd>
592
 
<dt> <code><var>x509=/path/to/certificate/dir</var></code></dt>
593
 
<dd>
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.
600
 
</p>
601
 
</dd>
602
 
<dt> <code><var>x509verify=/path/to/certificate/dir</var></code></dt>
603
 
<dd>
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
613
 
certificates.
614
 
</p>
615
 
</dd>
616
 
</dl>
617
 
 
618
 
</dd>
619
 
<dt> &lsquo;<samp>-k language</samp>&rsquo;</dt>
620
 
<dd>
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
625
 
hosts.
626
 
</p>
627
 
<p>The available layouts are:
628
 
</p><table><tr><td>&nbsp;</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>
632
 
 
633
 
<p>The default is <code>en-us</code>.
634
 
</p>
635
 
</dd>
636
 
</dl>
637
 
 
638
 
<p>USB options:
639
 
</p><dl compact="compact">
640
 
<dt> &lsquo;<samp>-usb</samp>&rsquo;</dt>
641
 
<dd><p>Enable the USB driver (will be the default soon)
642
 
</p>
643
 
</dd>
644
 
<dt> &lsquo;<samp>-usbdevice devname</samp>&rsquo;</dt>
645
 
<dd><p>Add the USB device <var>devname</var>. See section <a href="#SEC34">Connecting USB devices</a>.
646
 
</p></dd>
647
 
</dl>
648
 
 
649
 
<p>Network options:
650
 
</p>
651
 
<dl compact="compact">
652
 
<dt> &lsquo;<samp>-net nic[,vlan=n][,macaddr=addr][,model=type]</samp>&rsquo;</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
 
&lsquo;<samp>-net</samp>&rsquo; 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.
664
 
</p>
665
 
</dd>
666
 
<dt> &lsquo;<samp>-net user[,vlan=n][,hostname=name]</samp>&rsquo;</dt>
667
 
<dd><p>Use the user mode network stack which requires no administrator
668
 
privilege to run.  &lsquo;<samp>hostname=name</samp>&rsquo; can be used to specify the client
669
 
hostname reported by the builtin DHCP server.
670
 
</p>
671
 
</dd>
672
 
<dt> &lsquo;<samp>-net tap[,vlan=n][,fd=h][,ifname=name][,script=file]</samp>&rsquo;</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 &lsquo;<tt>/etc/qemu-ifup</tt>&rsquo;. Use &lsquo;<samp>script=no</samp>&rsquo; to
676
 
disable script execution. If <var>name</var> is not
677
 
provided, the OS automatically provides one.  &lsquo;<samp>fd=h</samp>&rsquo; can be
678
 
used to specify the handle of an already opened host TAP interface. Example:
679
 
</p>
680
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu linux.img -net nic -net tap
681
 
</pre></td></tr></table>
682
 
 
683
 
<p>More complicated example (two NICs, each one connected to a TAP device)
684
 
</p><table><tr><td>&nbsp;</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>
687
 
 
688
 
 
689
 
</dd>
690
 
<dt> &lsquo;<samp>-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]</samp>&rsquo;</dt>
691
 
<dd>
692
 
<p>Connect the VLAN <var>n</var> to a remote VLAN in another QEMU virtual
693
 
machine using a TCP socket connection. If &lsquo;<samp>listen</samp>&rsquo; is
694
 
specified, QEMU waits for incoming connections on <var>port</var>
695
 
(<var>host</var> is optional). &lsquo;<samp>connect</samp>&rsquo; is used to connect to
696
 
another QEMU instance using the &lsquo;<samp>listen</samp>&rsquo; option. &lsquo;<samp>fd=h</samp>&rsquo;
697
 
specifies an already opened TCP socket.
698
 
</p>
699
 
<p>Example:
700
 
</p><table><tr><td>&nbsp;</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>
708
 
 
709
 
</dd>
710
 
<dt> &lsquo;<samp>-net socket[,vlan=n][,fd=h][,mcast=maddr:port]</samp>&rsquo;</dt>
711
 
<dd>
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>.
715
 
NOTES:
716
 
</p><ol>
717
 
<li>
718
 
Several QEMU can be running on different hosts and share same bus (assuming
719
 
correct multicast setup for these hosts).
720
 
</li><li>
721
 
mcast support is compatible with User Mode Linux (argument &lsquo;<samp>eth<var>N</var>=mcast</samp>&rsquo;), see
722
 
<a href="http://user-mode-linux.sf.net">http://user-mode-linux.sf.net</a>.
723
 
</li><li>
724
 
Use &lsquo;<samp>fd=h</samp>&rsquo; to specify an already opened UDP multicast socket.
725
 
</li></ol>
726
 
 
727
 
<p>Example:
728
 
</p><table><tr><td>&nbsp;</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 &quot;bus&quot;
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 &quot;bus&quot;
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>
738
 
 
739
 
<p>Example (User Mode Linux compat.):
740
 
</p><table><tr><td>&nbsp;</td><td><pre class="example"># launch QEMU instance (note mcast address selected
741
 
# is UML's default)
742
 
qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
743
 
               -net socket,mcast=239.192.168.1:1102
744
 
# launch UML
745
 
/path/to/linux ubd0=/path/to/root_fs eth0=mcast
746
 
</pre></td></tr></table>
747
 
 
748
 
</dd>
749
 
<dt> &lsquo;<samp>-net none</samp>&rsquo;</dt>
750
 
<dd><p>Indicate that no network devices should be configured. It is used to
751
 
override the default configuration (&lsquo;<samp>-net nic -net user</samp>&rsquo;) which
752
 
is activated if no &lsquo;<samp>-net</samp>&rsquo; options are provided.
753
 
</p>
754
 
</dd>
755
 
<dt> &lsquo;<samp>-tftp dir</samp>&rsquo;</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
760
 
usual 10.0.2.2.
761
 
</p>
762
 
</dd>
763
 
<dt> &lsquo;<samp>-bootp file</samp>&rsquo;</dt>
764
 
<dd><p>When using the user mode network stack, broadcast <var>file</var> as the BOOTP
765
 
filename.  In conjunction with &lsquo;<samp>-tftp</samp>&rsquo;, this can be used to network boot
766
 
a guest from a local directory.
767
 
</p>
768
 
<p>Example (using pxelinux):
769
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">qemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0
770
 
</pre></td></tr></table>
771
 
 
772
 
</dd>
773
 
<dt> &lsquo;<samp>-smb dir</samp>&rsquo;</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 &lsquo;<tt>dir</tt>&rsquo;
776
 
transparently.
777
 
</p>
778
 
<p>In the guest Windows OS, the line:
779
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">10.0.2.4 smbserver
780
 
</pre></td></tr></table>
781
 
<p>must be added in the file &lsquo;<tt>C:\WINDOWS\LMHOSTS</tt>&rsquo; (for windows 9x/Me)
782
 
or &lsquo;<tt>C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS</tt>&rsquo; (Windows NT/2000).
783
 
</p>
784
 
<p>Then &lsquo;<tt>dir</tt>&rsquo; can be accessed in &lsquo;<tt>\\smbserver\qemu</tt>&rsquo;.
785
 
</p>
786
 
<p>Note that a SAMBA server must be installed on the host OS in
787
 
&lsquo;<tt>/usr/sbin/smbd</tt>&rsquo;. 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.
789
 
</p>
790
 
</dd>
791
 
<dt> &lsquo;<samp>-redir [tcp|udp]:host-port:[guest-host]:guest-port</samp>&rsquo;</dt>
792
 
<dd>
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).
798
 
</p>
799
 
<p>For example, to redirect host X11 connection from screen 1 to guest
800
 
screen 0, use the following:
801
 
</p>
802
 
<table><tr><td>&nbsp;</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
805
 
xterm -display :1
806
 
</pre></td></tr></table>
807
 
 
808
 
<p>To redirect telnet connections from host port 5555 to telnet port on
809
 
the guest, use the following:
810
 
</p>
811
 
<table><tr><td>&nbsp;</td><td><pre class="example"># on the host
812
 
qemu -redir tcp:5555::23 [...]
813
 
telnet localhost 5555
814
 
</pre></td></tr></table>
815
 
 
816
 
<p>Then when you use on the host <code>telnet localhost 5555</code>, you
817
 
connect to the guest telnet server.
818
 
</p>
819
 
</dd>
820
 
</dl>
821
 
 
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.
825
 
</p>
826
 
<dl compact="compact">
827
 
<dt> &lsquo;<samp>-kernel bzImage</samp>&rsquo;</dt>
828
 
<dd><p>Use <var>bzImage</var> as kernel image.
829
 
</p>
830
 
</dd>
831
 
<dt> &lsquo;<samp>-append cmdline</samp>&rsquo;</dt>
832
 
<dd><p>Use <var>cmdline</var> as kernel command line
833
 
</p>
834
 
</dd>
835
 
<dt> &lsquo;<samp>-initrd file</samp>&rsquo;</dt>
836
 
<dd><p>Use <var>file</var> as initial ram disk.
837
 
</p>
838
 
</dd>
839
 
</dl>
840
 
 
841
 
<p>Debug/Expert options:
842
 
</p><dl compact="compact">
843
 
<dt> &lsquo;<samp>-serial dev</samp>&rsquo;</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.
847
 
</p>
848
 
<p>This option can be used several times to simulate up to 4 serials
849
 
ports.
850
 
</p>
851
 
<p>Use <code>-serial none</code> to disable all serial ports.
852
 
</p>
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>&nbsp;</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>&nbsp;</td><td><pre class="example">vc:80Cx24C
861
 
</pre></td></tr></table>
862
 
</dd>
863
 
<dt> <code>pty</code></dt>
864
 
<dd><p>[Linux only] Pseudo TTY (a new PTY is automatically allocated)
865
 
</p></dd>
866
 
<dt> <code>none</code></dt>
867
 
<dd><p>No device is allocated.
868
 
</p></dd>
869
 
<dt> <code>null</code></dt>
870
 
<dd><p>void device
871
 
</p></dd>
872
 
<dt> <code>/dev/XXX</code></dt>
873
 
<dd><p>[Linux only] Use host tty, e.g. &lsquo;<tt>/dev/ttyS0</tt>&rsquo;. The host serial port
874
 
parameters are set according to the emulated ones.
875
 
</p></dd>
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.
879
 
</p></dd>
880
 
<dt> <code>file:filename</code></dt>
881
 
<dd><p>Write output to filename. No character can be read.
882
 
</p></dd>
883
 
<dt> <code>stdio</code></dt>
884
 
<dd><p>[Unix only] standard input/output
885
 
</p></dd>
886
 
<dt> <code>pipe:filename</code></dt>
887
 
<dd><p>name pipe <var>filename</var>
888
 
</p></dd>
889
 
<dt> <code>COMn</code></dt>
890
 
<dd><p>[Windows only] Use host serial port <var>n</var>
891
 
</p></dd>
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.
894
 
</p>
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.
899
 
</p>
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
912
 
</p></dd>
913
 
<dt> <code>netcat options:</code></dt>
914
 
<dd><p>-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
915
 
</p></dd>
916
 
<dt> <code>telnet options:</code></dt>
917
 
<dd><p>localhost 5555
918
 
</p></dd>
919
 
</dl>
920
 
 
921
 
 
922
 
</dd>
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
936
 
</p></dd>
937
 
<dt> <code>Example to listen and wait on port 4444 for connection</code></dt>
938
 
<dd><p>-serial tcp::4444,server
939
 
</p></dd>
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
942
 
</p></dd>
943
 
</dl>
944
 
 
945
 
</dd>
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 &quot;send break&quot; followed by pressing the enter key.
954
 
</p>
955
 
</dd>
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.
960
 
</p>
961
 
</dd>
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
 
&lt;Control-a&gt; and then pressing &lt;c&gt;. 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>
972
 
</dl>
973
 
 
974
 
</dd>
975
 
</dl>
976
 
 
977
 
</dd>
978
 
<dt> &lsquo;<samp>-parallel dev</samp>&rsquo;</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, &lsquo;<tt>/dev/parportN</tt>&rsquo; can
981
 
be used to use hardware devices connected on the corresponding host
982
 
parallel port.
983
 
</p>
984
 
<p>This option can be used several times to simulate up to 3 parallel
985
 
ports.
986
 
</p>
987
 
<p>Use <code>-parallel none</code> to disable all parallel ports.
988
 
</p>
989
 
</dd>
990
 
<dt> &lsquo;<samp>-monitor dev</samp>&rsquo;</dt>
991
 
<dd><p>Redirect the monitor to host device <var>dev</var> (same devices as the
992
 
serial port).
993
 
The default device is <code>vc</code> in graphical mode and <code>stdio</code> in
994
 
non graphical mode.
995
 
</p>
996
 
</dd>
997
 
<dt> &lsquo;<samp>-echr numeric_ascii_value</samp>&rsquo;</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>
1008
 
</dl>
1009
 
 
1010
 
</dd>
1011
 
<dt> &lsquo;<samp>-s</samp>&rsquo;</dt>
1012
 
<dd><p>Wait gdb connection to port 1234 (see section <a href="#SEC46">GDB usage</a>).
1013
 
</p></dd>
1014
 
<dt> &lsquo;<samp>-p port</samp>&rsquo;</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).
1017
 
</p></dd>
1018
 
<dt> &lsquo;<samp>-S</samp>&rsquo;</dt>
1019
 
<dd><p>Do not start CPU at startup (you must type 'c' in the monitor).
1020
 
</p></dd>
1021
 
<dt> &lsquo;<samp>-d</samp>&rsquo;</dt>
1022
 
<dd><p>Output log in /tmp/qemu.log
1023
 
</p></dd>
1024
 
<dt> &lsquo;<samp>-hdachs c,h,s,[,t]</samp>&rsquo;</dt>
1025
 
<dd><p>Force hard disk 0 physical geometry (1 &lt;= <var>c</var> &lt;= 16383, 1 &lt;=
1026
 
<var>h</var> &lt;= 16, 1 &lt;= <var>s</var> &lt;= 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
1029
 
images.
1030
 
</p>
1031
 
</dd>
1032
 
<dt> &lsquo;<samp>-L path</samp>&rsquo;</dt>
1033
 
<dd><p>Set the directory for the BIOS, VGA BIOS and keymaps.
1034
 
</p>
1035
 
</dd>
1036
 
<dt> &lsquo;<samp>-std-vga</samp>&rsquo;</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 (&gt;= 1280x1024x16) then you should use this option.
1041
 
</p>
1042
 
</dd>
1043
 
<dt> &lsquo;<samp>-no-acpi</samp>&rsquo;</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
1046
 
only).
1047
 
</p>
1048
 
</dd>
1049
 
<dt> &lsquo;<samp>-no-reboot</samp>&rsquo;</dt>
1050
 
<dd><p>Exit instead of rebooting.
1051
 
</p>
1052
 
</dd>
1053
 
<dt> &lsquo;<samp>-loadvm file</samp>&rsquo;</dt>
1054
 
<dd><p>Start right away with a saved state (<code>loadvm</code> in monitor)
1055
 
</p>
1056
 
</dd>
1057
 
<dt> &lsquo;<samp>-semihosting</samp>&rsquo;</dt>
1058
 
<dd><p>Enable semihosting syscall emulation (ARM and M68K target machines only).
1059
 
</p>
1060
 
<p>On ARM this implements the &quot;Angel&quot; interface.
1061
 
On M68K this implements the &quot;ColdFire GDB&quot; interface used by libgloss.
1062
 
</p>
1063
 
<p>Note that this allows guest direct access to the host filesystem,
1064
 
so should only be used with trusted guest OS.
1065
 
</p></dd>
1066
 
</dl>
1067
 
 
1068
 
 
1069
 
<hr size="6">
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"> &lt; </a>]</td>
1074
 
<td valign="middle" align="left">[<a href="#SEC12" title="Next section in reading order"> &gt; </a>]</td>
1075
 
<td valign="middle" align="left"> &nbsp; </td>
1076
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1079
 
<td valign="middle" align="left"> &nbsp; </td>
1080
 
<td valign="middle" align="left"> &nbsp; </td>
1081
 
<td valign="middle" align="left"> &nbsp; </td>
1082
 
<td valign="middle" align="left"> &nbsp; </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>
1087
 
</tr></table>
1088
 
<h2 class="section"> 3.4 Keys </h2>
1089
 
 
1090
 
 
1091
 
<p>During the graphical emulation, you can use the following keys:
1092
 
</p><dl compact="compact">
1093
 
<dt> &lt;Ctrl-Alt-f&gt;</dt>
1094
 
<dd><p>Toggle full screen
1095
 
</p>
1096
 
</dd>
1097
 
<dt> &lt;Ctrl-Alt-n&gt;</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
1102
 
</p></dd>
1103
 
<dt> <em>2</em></dt>
1104
 
<dd><p>Monitor
1105
 
</p></dd>
1106
 
<dt> <em>3</em></dt>
1107
 
<dd><p>Serial port
1108
 
</p></dd>
1109
 
</dl>
1110
 
 
1111
 
</dd>
1112
 
<dt> &lt;Ctrl-Alt&gt;</dt>
1113
 
<dd><p>Toggle mouse and keyboard grab.
1114
 
</p></dd>
1115
 
</dl>
1116
 
 
1117
 
<p>In the virtual consoles, you can use &lt;Ctrl-Up&gt;, &lt;Ctrl-Down&gt;,
1118
 
&lt;Ctrl-PageUp&gt; and &lt;Ctrl-PageDown&gt; to move in the back log.
1119
 
</p>
1120
 
<p>During emulation, if you are using the &lsquo;<samp>-nographic</samp>&rsquo; option, use
1121
 
&lt;Ctrl-a h&gt; to get terminal commands:
1122
 
</p>
1123
 
<dl compact="compact">
1124
 
<dt> &lt;Ctrl-a h&gt;</dt>
1125
 
<dd><p>Print this help
1126
 
</p></dd>
1127
 
<dt> &lt;Ctrl-a x&gt;</dt>
1128
 
<dd><p>Exit emulator
1129
 
</p></dd>
1130
 
<dt> &lt;Ctrl-a s&gt;</dt>
1131
 
<dd><p>Save disk data back to file (if -snapshot)
1132
 
</p></dd>
1133
 
<dt> &lt;Ctrl-a t&gt;</dt>
1134
 
<dd><p>toggle console timestamps
1135
 
</p></dd>
1136
 
<dt> &lt;Ctrl-a b&gt;</dt>
1137
 
<dd><p>Send break (magic sysrq in Linux)
1138
 
</p></dd>
1139
 
<dt> &lt;Ctrl-a c&gt;</dt>
1140
 
<dd><p>Switch between console and monitor
1141
 
</p></dd>
1142
 
<dt> &lt;Ctrl-a Ctrl-a&gt;</dt>
1143
 
<dd><p>Send Ctrl-a
1144
 
</p></dd>
1145
 
</dl>
1146
 
 
1147
 
 
1148
 
<hr size="6">
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"> &lt; </a>]</td>
1153
 
<td valign="middle" align="left">[<a href="#SEC13" title="Next section in reading order"> &gt; </a>]</td>
1154
 
<td valign="middle" align="left"> &nbsp; </td>
1155
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1158
 
<td valign="middle" align="left"> &nbsp; </td>
1159
 
<td valign="middle" align="left"> &nbsp; </td>
1160
 
<td valign="middle" align="left"> &nbsp; </td>
1161
 
<td valign="middle" align="left"> &nbsp; </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>
1166
 
</tr></table>
1167
 
<h2 class="section"> 3.5 QEMU Monitor </h2>
1168
 
 
1169
 
<p>The QEMU monitor is used to give complex commands to the QEMU
1170
 
emulator. You can use it to:
1171
 
</p>
1172
 
<ul class="toc">
1173
 
<li>-
1174
 
Remove or insert removable media images
1175
 
(such as CD-ROM or floppies)
1176
 
 
1177
 
</li><li>-
1178
 
Freeze/unfreeze the Virtual Machine (VM) and save or restore its state
1179
 
from a disk file.
1180
 
 
1181
 
</li><li>- Inspect the VM state without an external debugger.
1182
 
 
1183
 
</li></ul>
1184
 
 
1185
 
<hr size="6">
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"> &lt; </a>]</td>
1189
 
<td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> &gt; </a>]</td>
1190
 
<td valign="middle" align="left"> &nbsp; </td>
1191
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1194
 
<td valign="middle" align="left"> &nbsp; </td>
1195
 
<td valign="middle" align="left"> &nbsp; </td>
1196
 
<td valign="middle" align="left"> &nbsp; </td>
1197
 
<td valign="middle" align="left"> &nbsp; </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>
1202
 
</tr></table>
1203
 
<h3 class="subsection"> 3.5.1 Commands </h3>
1204
 
 
1205
 
<p>The following commands are available:
1206
 
</p>
1207
 
<dl compact="compact">
1208
 
<dt> &lsquo;<samp>help or ? [cmd]</samp>&rsquo;</dt>
1209
 
<dd><p>Show the help for all commands or just for command <var>cmd</var>.
1210
 
</p>
1211
 
</dd>
1212
 
<dt> &lsquo;<samp>commit</samp>&rsquo;</dt>
1213
 
<dd><p>Commit changes to the disk images (if -snapshot is used)
1214
 
</p>
1215
 
</dd>
1216
 
<dt> &lsquo;<samp>info subcommand</samp>&rsquo;</dt>
1217
 
<dd><p>show various information about the system state
1218
 
</p>
1219
 
<dl compact="compact">
1220
 
<dt> &lsquo;<samp>info network</samp>&rsquo;</dt>
1221
 
<dd><p>show the various VLANs and the associated devices
1222
 
</p></dd>
1223
 
<dt> &lsquo;<samp>info block</samp>&rsquo;</dt>
1224
 
<dd><p>show the block devices
1225
 
</p></dd>
1226
 
<dt> &lsquo;<samp>info registers</samp>&rsquo;</dt>
1227
 
<dd><p>show the cpu registers
1228
 
</p></dd>
1229
 
<dt> &lsquo;<samp>info history</samp>&rsquo;</dt>
1230
 
<dd><p>show the command line history
1231
 
</p></dd>
1232
 
<dt> &lsquo;<samp>info pci</samp>&rsquo;</dt>
1233
 
<dd><p>show emulated PCI device
1234
 
</p></dd>
1235
 
<dt> &lsquo;<samp>info usb</samp>&rsquo;</dt>
1236
 
<dd><p>show USB devices plugged on the virtual USB hub
1237
 
</p></dd>
1238
 
<dt> &lsquo;<samp>info usbhost</samp>&rsquo;</dt>
1239
 
<dd><p>show all USB host devices
1240
 
</p></dd>
1241
 
<dt> &lsquo;<samp>info capture</samp>&rsquo;</dt>
1242
 
<dd><p>show information about active capturing
1243
 
</p></dd>
1244
 
<dt> &lsquo;<samp>info snapshots</samp>&rsquo;</dt>
1245
 
<dd><p>show list of VM snapshots
1246
 
</p></dd>
1247
 
<dt> &lsquo;<samp>info mice</samp>&rsquo;</dt>
1248
 
<dd><p>show which guest mouse is receiving events
1249
 
</p></dd>
1250
 
</dl>
1251
 
 
1252
 
</dd>
1253
 
<dt> &lsquo;<samp>q or quit</samp>&rsquo;</dt>
1254
 
<dd><p>Quit the emulator.
1255
 
</p>
1256
 
</dd>
1257
 
<dt> &lsquo;<samp>eject [-f] device</samp>&rsquo;</dt>
1258
 
<dd><p>Eject a removable medium (use -f to force it).
1259
 
</p>
1260
 
</dd>
1261
 
<dt> &lsquo;<samp>change device setting</samp>&rsquo;</dt>
1262
 
<dd>
1263
 
<p>Change the configuration of a device
1264
 
</p>
1265
 
<dl compact="compact">
1266
 
<dt> &lsquo;<samp>change <var>diskdevice</var> <var>filename</var></samp>&rsquo;</dt>
1267
 
<dd><p>Change the medium for a removable disk device to point to <var>filename</var>. eg
1268
 
</p>
1269
 
<table><tr><td>&nbsp;</td><td><pre class="example">(qemu) change cdrom /path/to/some.iso
1270
 
</pre></td></tr></table>
1271
 
 
1272
 
</dd>
1273
 
<dt> &lsquo;<samp>change vnc <var>display,options</var></samp>&rsquo;</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
1276
 
</p>
1277
 
<table><tr><td>&nbsp;</td><td><pre class="example">(qemu) change vnc localhost:1
1278
 
</pre></td></tr></table>
1279
 
 
1280
 
</dd>
1281
 
<dt> &lsquo;<samp>change vnc password</samp>&rsquo;</dt>
1282
 
<dd>
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.
1285
 
eg.
1286
 
</p>
1287
 
<table><tr><td>&nbsp;</td><td><pre class="example">(qemu) change vnc password
1288
 
Password: ********
1289
 
</pre></td></tr></table>
1290
 
 
1291
 
</dd>
1292
 
</dl>
1293
 
 
1294
 
</dd>
1295
 
<dt> &lsquo;<samp>screendump filename</samp>&rsquo;</dt>
1296
 
<dd><p>Save screen into PPM image <var>filename</var>.
1297
 
</p>
1298
 
</dd>
1299
 
<dt> &lsquo;<samp>mouse_move dx dy [dz]</samp>&rsquo;</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>.
1302
 
</p>
1303
 
</dd>
1304
 
<dt> &lsquo;<samp>mouse_button val</samp>&rsquo;</dt>
1305
 
<dd><p>Change the active mouse button state <var>val</var> (1=L, 2=M, 4=R).
1306
 
</p>
1307
 
</dd>
1308
 
<dt> &lsquo;<samp>mouse_set index</samp>&rsquo;</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>&nbsp;</td><td><pre class="example">info mice
1312
 
</pre></td></tr></table>
1313
 
 
1314
 
</dd>
1315
 
<dt> &lsquo;<samp>wavcapture filename [frequency [bits [channels]]]</samp>&rsquo;</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>.
1318
 
</p>
1319
 
<p>Defaults:
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
1324
 
</li></ul>
1325
 
 
1326
 
</dd>
1327
 
<dt> &lsquo;<samp>stopcapture index</samp>&rsquo;</dt>
1328
 
<dd><p>Stop capture with a given <var>index</var>, index can be obtained with
1329
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">info capture
1330
 
</pre></td></tr></table>
1331
 
 
1332
 
</dd>
1333
 
<dt> &lsquo;<samp>log item1[,...]</samp>&rsquo;</dt>
1334
 
<dd><p>Activate logging of the specified items to &lsquo;<tt>/tmp/qemu.log</tt>&rsquo;.
1335
 
</p>
1336
 
</dd>
1337
 
<dt> &lsquo;<samp>savevm [tag|id]</samp>&rsquo;</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>.
1342
 
</p>
1343
 
</dd>
1344
 
<dt> &lsquo;<samp>loadvm tag|id</samp>&rsquo;</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>.
1347
 
</p>
1348
 
</dd>
1349
 
<dt> &lsquo;<samp>delvm tag|id</samp>&rsquo;</dt>
1350
 
<dd><p>Delete the snapshot identified by <var>tag</var> or <var>id</var>.
1351
 
</p>
1352
 
</dd>
1353
 
<dt> &lsquo;<samp>stop</samp>&rsquo;</dt>
1354
 
<dd><p>Stop emulation.
1355
 
</p>
1356
 
</dd>
1357
 
<dt> &lsquo;<samp>c or cont</samp>&rsquo;</dt>
1358
 
<dd><p>Resume emulation.
1359
 
</p>
1360
 
</dd>
1361
 
<dt> &lsquo;<samp>gdbserver [port]</samp>&rsquo;</dt>
1362
 
<dd><p>Start gdbserver session (default port=1234)
1363
 
</p>
1364
 
</dd>
1365
 
<dt> &lsquo;<samp>x/fmt addr</samp>&rsquo;</dt>
1366
 
<dd><p>Virtual memory dump starting at <var>addr</var>.
1367
 
</p>
1368
 
</dd>
1369
 
<dt> &lsquo;<samp>xp /fmt addr</samp>&rsquo;</dt>
1370
 
<dd><p>Physical memory dump starting at <var>addr</var>.
1371
 
</p>
1372
 
<p><var>fmt</var> is a format which tells the command how to format the
1373
 
data. Its syntax is: &lsquo;<samp>/{count}{format}{size}</samp>&rsquo;
1374
 
</p>
1375
 
<dl compact="compact">
1376
 
<dt> <var>count</var></dt>
1377
 
<dd><p>is the number of items to be dumped.
1378
 
</p>
1379
 
</dd>
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).
1383
 
</p>
1384
 
</dd>
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.
1389
 
</p>
1390
 
</dd>
1391
 
</dl>
1392
 
 
1393
 
<p>Examples:
1394
 
</p><ul class="toc">
1395
 
<li>
1396
 
Dump 10 instructions at the current instruction pointer:
1397
 
<table><tr><td>&nbsp;</td><td><pre class="example">(qemu) x/10i $eip
1398
 
0x90107063:  ret
1399
 
0x90107064:  sti
1400
 
0x90107065:  lea    0x0(%esi,1),%esi
1401
 
0x90107069:  lea    0x0(%edi,1),%edi
1402
 
0x90107070:  ret
1403
 
0x90107071:  jmp    0x90107080
1404
 
0x90107073:  nop
1405
 
0x90107074:  nop
1406
 
0x90107075:  nop
1407
 
0x90107076:  nop
1408
 
</pre></td></tr></table>
1409
 
 
1410
 
</li><li>
1411
 
Dump 80 16 bit values at the start of the video memory.
1412
 
<table><tr><td>&nbsp;</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>
1424
 
</li></ul>
1425
 
 
1426
 
</dd>
1427
 
<dt> &lsquo;<samp>p or print/fmt expr</samp>&rsquo;</dt>
1428
 
<dd>
1429
 
<p>Print expression value. Only the <var>format</var> part of <var>fmt</var> is
1430
 
used.
1431
 
</p>
1432
 
</dd>
1433
 
<dt> &lsquo;<samp>sendkey keys</samp>&rsquo;</dt>
1434
 
<dd>
1435
 
<p>Send <var>keys</var> to the emulator. Use <code>-</code> to press several keys
1436
 
simultaneously. Example:
1437
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">sendkey ctrl-alt-f1
1438
 
</pre></td></tr></table>
1439
 
 
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.
1442
 
</p>
1443
 
</dd>
1444
 
<dt> &lsquo;<samp>system_reset</samp>&rsquo;</dt>
1445
 
<dd>
1446
 
<p>Reset the system.
1447
 
</p>
1448
 
</dd>
1449
 
<dt> &lsquo;<samp>usb_add devname</samp>&rsquo;</dt>
1450
 
<dd>
1451
 
<p>Add the USB device <var>devname</var>.  For details of available devices see
1452
 
<a href="#SEC34">Connecting USB devices</a>
1453
 
</p>
1454
 
</dd>
1455
 
<dt> &lsquo;<samp>usb_del devname</samp>&rsquo;</dt>
1456
 
<dd>
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.
1460
 
</p>
1461
 
</dd>
1462
 
</dl>
1463
 
 
1464
 
<hr size="6">
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"> &lt; </a>]</td>
1468
 
<td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> &gt; </a>]</td>
1469
 
<td valign="middle" align="left"> &nbsp; </td>
1470
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1473
 
<td valign="middle" align="left"> &nbsp; </td>
1474
 
<td valign="middle" align="left"> &nbsp; </td>
1475
 
<td valign="middle" align="left"> &nbsp; </td>
1476
 
<td valign="middle" align="left"> &nbsp; </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>
1481
 
</tr></table>
1482
 
<h3 class="subsection"> 3.5.2 Integer expressions </h3>
1483
 
 
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>.
1487
 
</p>
1488
 
<hr size="6">
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"> &lt; </a>]</td>
1493
 
<td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> &gt; </a>]</td>
1494
 
<td valign="middle" align="left"> &nbsp; </td>
1495
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1498
 
<td valign="middle" align="left"> &nbsp; </td>
1499
 
<td valign="middle" align="left"> &nbsp; </td>
1500
 
<td valign="middle" align="left"> &nbsp; </td>
1501
 
<td valign="middle" align="left"> &nbsp; </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>
1506
 
</tr></table>
1507
 
<h2 class="section"> 3.6 Disk Images </h2>
1508
 
 
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
1513
 
snapshots.
1514
 
</p>
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</td><td align="left" valign="top">       qemu-img Invocation
1520
 
</td></tr>
1521
 
<tr><td align="left" valign="top"><a href="#SEC20">3.6.5 Using host drives</a></td><td>&nbsp;&nbsp;</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>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
1523
 
</table>
1524
 
 
1525
 
<hr size="6">
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"> &lt; </a>]</td>
1530
 
<td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> &gt; </a>]</td>
1531
 
<td valign="middle" align="left"> &nbsp; </td>
1532
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1535
 
<td valign="middle" align="left"> &nbsp; </td>
1536
 
<td valign="middle" align="left"> &nbsp; </td>
1537
 
<td valign="middle" align="left"> &nbsp; </td>
1538
 
<td valign="middle" align="left"> &nbsp; </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>
1543
 
</tr></table>
1544
 
<h3 class="subsection"> 3.6.1 Quick start for disk image creation </h3>
1545
 
 
1546
 
<p>You can create a disk image with the command:
1547
 
</p><table><tr><td>&nbsp;</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.
1552
 
</p>
1553
 
<p>See <a href="#SEC19"><code>qemu-img</code> Invocation</a> for more information.
1554
 
</p>
1555
 
<hr size="6">
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"> &lt; </a>]</td>
1560
 
<td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> &gt; </a>]</td>
1561
 
<td valign="middle" align="left"> &nbsp; </td>
1562
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1565
 
<td valign="middle" align="left"> &nbsp; </td>
1566
 
<td valign="middle" align="left"> &nbsp; </td>
1567
 
<td valign="middle" align="left"> &nbsp; </td>
1568
 
<td valign="middle" align="left"> &nbsp; </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>
1573
 
</tr></table>
1574
 
<h3 class="subsection"> 3.6.2 Snapshot mode </h3>
1575
 
 
1576
 
<p>If you use the option &lsquo;<samp>-snapshot</samp>&rsquo;, all disk images are
1577
 
considered as read only. When sectors in written, they are written in
1578
 
a temporary file created in &lsquo;<tt>/tmp</tt>&rsquo;. You can however force the
1579
 
write back to the raw disk images by using the <code>commit</code> monitor
1580
 
command (or &lt;C-a s&gt; in the serial console).
1581
 
</p>
1582
 
<hr size="6">
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"> &lt; </a>]</td>
1587
 
<td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> &gt; </a>]</td>
1588
 
<td valign="middle" align="left"> &nbsp; </td>
1589
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1592
 
<td valign="middle" align="left"> &nbsp; </td>
1593
 
<td valign="middle" align="left"> &nbsp; </td>
1594
 
<td valign="middle" align="left"> &nbsp; </td>
1595
 
<td valign="middle" align="left"> &nbsp; </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>
1600
 
</tr></table>
1601
 
<h3 class="subsection"> 3.6.3 VM snapshots </h3>
1602
 
 
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.
1608
 
</p>
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.
1612
 
</p>
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:
1616
 
</p>
1617
 
<table><tr><td>&nbsp;</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>
1625
 
 
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
1634
 
disk images).
1635
 
</p>
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.
1639
 
</p>
1640
 
<p>VM snapshots currently have the following known limitations:
1641
 
</p><ul class="toc">
1642
 
<li>
1643
 
They cannot cope with removable devices if they are removed or
1644
 
inserted after a snapshot is done.
1645
 
</li><li>
1646
 
A few device drivers still have incomplete snapshot support so their
1647
 
state is not saved or restored properly (in particular USB).
1648
 
</li></ul>
1649
 
 
1650
 
<hr size="6">
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"> &lt; </a>]</td>
1655
 
<td valign="middle" align="left">[<a href="#SEC20" title="Next section in reading order"> &gt; </a>]</td>
1656
 
<td valign="middle" align="left"> &nbsp; </td>
1657
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1660
 
<td valign="middle" align="left"> &nbsp; </td>
1661
 
<td valign="middle" align="left"> &nbsp; </td>
1662
 
<td valign="middle" align="left"> &nbsp; </td>
1663
 
<td valign="middle" align="left"> &nbsp; </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>
1668
 
</tr></table>
1669
 
<h3 class="subsection"> 3.6.4 <code>qemu-img</code> Invocation </h3>
1670
 
 
1671
 
<table><tr><td>&nbsp;</td><td><pre class="example">usage: qemu-img command [command options]
1672
 
</pre></td></tr></table>
1673
 
 
1674
 
 
1675
 
<p>The following commands are supported:
1676
 
</p><dl compact="compact">
1677
 
<dt> &lsquo;<samp>create [-e] [-6] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>&rsquo;</dt>
1678
 
<dt> &lsquo;<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>&rsquo;</dt>
1679
 
<dt> &lsquo;<samp>convert [-c] [-e] [-6] [-f <var>fmt</var>] <var>filename</var> [-O <var>output_fmt</var>] <var>output_filename</var></samp>&rsquo;</dt>
1680
 
<dt> &lsquo;<samp>info [-f <var>fmt</var>] <var>filename</var></samp>&rsquo;</dt>
1681
 
</dl>
1682
 
 
1683
 
<p>Command parameters:
1684
 
</p><dl compact="compact">
1685
 
<dt> <var>filename</var></dt>
1686
 
<dd><p> is a disk image filename
1687
 
</p></dd>
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
1691
 
</p>
1692
 
</dd>
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:
1695
 
</p>
1696
 
<dl compact="compact">
1697
 
<dt> <code>raw</code></dt>
1698
 
<dd>
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.
1705
 
</p>
1706
 
</dd>
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.
1712
 
</p></dd>
1713
 
<dt> <code>qcow</code></dt>
1714
 
<dd><p>Old QEMU image format. Left for compatibility.
1715
 
</p></dd>
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.
1720
 
</p></dd>
1721
 
<dt> <code>vmdk</code></dt>
1722
 
<dd><p>VMware 3 and 4 compatible image format.
1723
 
</p></dd>
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.
1727
 
</p></dd>
1728
 
</dl>
1729
 
 
1730
 
</dd>
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
1734
 
</p>
1735
 
</dd>
1736
 
<dt> <var>output_filename</var></dt>
1737
 
<dd><p>is the destination disk image filename
1738
 
</p>
1739
 
</dd>
1740
 
<dt> <var>output_fmt</var></dt>
1741
 
<dd><p> is the destination format
1742
 
</p>
1743
 
</dd>
1744
 
<dt> <var>-c</var></dt>
1745
 
<dd><p>indicates that target image must be compressed (qcow format only)
1746
 
</p></dd>
1747
 
<dt> <var>-e</var></dt>
1748
 
<dd><p>indicates that the target image must be encrypted (qcow format only)
1749
 
</p></dd>
1750
 
<dt> <var>-6</var></dt>
1751
 
<dd><p>indicates that the target image must use compatibility level 6 (vmdk format only)
1752
 
</p></dd>
1753
 
</dl>
1754
 
 
1755
 
<p>Command description:
1756
 
</p>
1757
 
<dl compact="compact">
1758
 
<dt> &lsquo;<samp>create [-6] [-e] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>&rsquo;</dt>
1759
 
<dd>
1760
 
<p>Create the new disk image <var>filename</var> of size <var>size</var> and format
1761
 
<var>fmt</var>.
1762
 
</p>
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.
1767
 
</p>
1768
 
</dd>
1769
 
<dt> &lsquo;<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>&rsquo;</dt>
1770
 
<dd>
1771
 
<p>Commit the changes recorded in <var>filename</var> in its base image.
1772
 
</p>
1773
 
</dd>
1774
 
<dt> &lsquo;<samp>convert [-c] [-e] [-f <var>fmt</var>] <var>filename</var> [-O <var>output_fmt</var>] <var>output_filename</var></samp>&rsquo;</dt>
1775
 
<dd>
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).
1779
 
</p>
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.
1783
 
</p>
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.
1786
 
</p>
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.
1790
 
</p>
1791
 
</dd>
1792
 
<dt> &lsquo;<samp>info [-f <var>fmt</var>] <var>filename</var></samp>&rsquo;</dt>
1793
 
<dd>
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.
1798
 
</p></dd>
1799
 
</dl>
1800
 
 
1801
 
 
1802
 
 
1803
 
<hr size="6">
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"> &lt; </a>]</td>
1808
 
<td valign="middle" align="left">[<a href="#SEC21" title="Next section in reading order"> &gt; </a>]</td>
1809
 
<td valign="middle" align="left"> &nbsp; </td>
1810
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1813
 
<td valign="middle" align="left"> &nbsp; </td>
1814
 
<td valign="middle" align="left"> &nbsp; </td>
1815
 
<td valign="middle" align="left"> &nbsp; </td>
1816
 
<td valign="middle" align="left"> &nbsp; </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>
1821
 
</tr></table>
1822
 
<h3 class="subsection"> 3.6.5 Using host drives </h3>
1823
 
 
1824
 
<p>In addition to disk image files, QEMU can directly access host
1825
 
devices. We describe here the usage for QEMU version &gt;= 0.8.3.
1826
 
</p>
1827
 
<hr size="6">
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"> &lt; </a>]</td>
1831
 
<td valign="middle" align="left">[<a href="#SEC22" title="Next section in reading order"> &gt; </a>]</td>
1832
 
<td valign="middle" align="left"> &nbsp; </td>
1833
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1836
 
<td valign="middle" align="left"> &nbsp; </td>
1837
 
<td valign="middle" align="left"> &nbsp; </td>
1838
 
<td valign="middle" align="left"> &nbsp; </td>
1839
 
<td valign="middle" align="left"> &nbsp; </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>
1844
 
</tr></table>
1845
 
<h4 class="subsubsection"> 3.6.5.1 Linux </h4>
1846
 
 
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 &lsquo;<tt>/dev/cdrom</tt>&rsquo; to access to the CDROM or
1850
 
&lsquo;<tt>/dev/fd0</tt>&rsquo; for the floppy.
1851
 
</p>
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.
1857
 
</p></dd>
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).
1863
 
</p></dd>
1864
 
<dt> <code>Hard disks</code></dt>
1865
 
<dd><p>Hard disks can be used. Normally you must specify the whole disk
1866
 
(&lsquo;<tt>/dev/hdb</tt>&rsquo; instead of &lsquo;<tt>/dev/hdb1</tt>&rsquo;) 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 &lsquo;<samp>-snapshot</samp>&rsquo; command
1870
 
line option or modify the device permissions accordingly).
1871
 
</p></dd>
1872
 
</dl>
1873
 
 
1874
 
<hr size="6">
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"> &lt; </a>]</td>
1878
 
<td valign="middle" align="left">[<a href="#SEC23" title="Next section in reading order"> &gt; </a>]</td>
1879
 
<td valign="middle" align="left"> &nbsp; </td>
1880
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1883
 
<td valign="middle" align="left"> &nbsp; </td>
1884
 
<td valign="middle" align="left"> &nbsp; </td>
1885
 
<td valign="middle" align="left"> &nbsp; </td>
1886
 
<td valign="middle" align="left"> &nbsp; </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>
1891
 
</tr></table>
1892
 
<h4 class="subsubsection"> 3.6.5.2 Windows </h4>
1893
 
 
1894
 
<dl compact="compact">
1895
 
<dt> <code>CD</code></dt>
1896
 
<dd><p>The preferred syntax is the drive letter (e.g. &lsquo;<tt>d:</tt>&rsquo;). The
1897
 
alternate syntax &lsquo;<tt>\\.\d:</tt>&rsquo; is supported. &lsquo;<tt>/dev/cdrom</tt>&rsquo; is
1898
 
supported as an alias to the first CDROM drive.
1899
 
</p>
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.
1903
 
</p></dd>
1904
 
<dt> <code>Hard disks</code></dt>
1905
 
<dd><p>Hard disks can be used with the syntax: &lsquo;<tt>\\.\PhysicalDriveN</tt>&rsquo;
1906
 
where <var>N</var> is the drive number (0 is the first hard disk).
1907
 
</p>
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 &lsquo;<samp>-snapshot</samp>&rsquo; command line so that the
1911
 
modifications are written in a temporary file).
1912
 
</p></dd>
1913
 
</dl>
1914
 
 
1915
 
 
1916
 
<hr size="6">
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"> &lt; </a>]</td>
1920
 
<td valign="middle" align="left">[<a href="#SEC24" title="Next section in reading order"> &gt; </a>]</td>
1921
 
<td valign="middle" align="left"> &nbsp; </td>
1922
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1925
 
<td valign="middle" align="left"> &nbsp; </td>
1926
 
<td valign="middle" align="left"> &nbsp; </td>
1927
 
<td valign="middle" align="left"> &nbsp; </td>
1928
 
<td valign="middle" align="left"> &nbsp; </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>
1933
 
</tr></table>
1934
 
<h4 class="subsubsection"> 3.6.5.3 Mac OS X </h4>
1935
 
 
1936
 
<p>&lsquo;<tt>/dev/cdrom</tt>&rsquo; is an alias to the first CDROM.
1937
 
</p>
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.
1941
 
</p>
1942
 
<hr size="6">
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"> &lt; </a>]</td>
1947
 
<td valign="middle" align="left">[<a href="#SEC25" title="Next section in reading order"> &gt; </a>]</td>
1948
 
<td valign="middle" align="left"> &nbsp; </td>
1949
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
1952
 
<td valign="middle" align="left"> &nbsp; </td>
1953
 
<td valign="middle" align="left"> &nbsp; </td>
1954
 
<td valign="middle" align="left"> &nbsp; </td>
1955
 
<td valign="middle" align="left"> &nbsp; </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>
1960
 
</tr></table>
1961
 
<h3 class="subsection"> 3.6.6 Virtual FAT disk images </h3>
1962
 
 
1963
 
<p>QEMU can automatically create a virtual FAT disk image from a
1964
 
directory tree. In order to use it, just type:
1965
 
</p>
1966
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu linux.img -hdb fat:/my_directory
1967
 
</pre></td></tr></table>
1968
 
 
1969
 
<p>Then you access access to all the files in the &lsquo;<tt>/my_directory</tt>&rsquo;
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>.
1972
 
</p>
1973
 
<p>Floppies can be emulated with the <code>:floppy:</code> option:
1974
 
</p>
1975
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu linux.img -fda fat:floppy:/my_directory
1976
 
</pre></td></tr></table>
1977
 
 
1978
 
<p>A read/write support is available for testing (beta stage) with the
1979
 
<code>:rw:</code> option:
1980
 
</p>
1981
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu linux.img -fda fat:floppy:rw:/my_directory
1982
 
</pre></td></tr></table>
1983
 
 
1984
 
<p>What you should <em>never</em> do:
1985
 
</p><ul class="toc">
1986
 
<li> use non-ASCII filenames ;
1987
 
</li><li> use &quot;-snapshot&quot; together with &quot;:rw:&quot; ;
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.
1990
 
</li></ul>
1991
 
 
1992
 
<hr size="6">
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"> &lt; </a>]</td>
1997
 
<td valign="middle" align="left">[<a href="#SEC26" title="Next section in reading order"> &gt; </a>]</td>
1998
 
<td valign="middle" align="left"> &nbsp; </td>
1999
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2002
 
<td valign="middle" align="left"> &nbsp; </td>
2003
 
<td valign="middle" align="left"> &nbsp; </td>
2004
 
<td valign="middle" align="left"> &nbsp; </td>
2005
 
<td valign="middle" align="left"> &nbsp; </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>
2010
 
</tr></table>
2011
 
<h2 class="section"> 3.7 Network emulation </h2>
2012
 
 
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
2019
 
connection.
2020
 
</p>
2021
 
<hr size="6">
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"> &lt; </a>]</td>
2025
 
<td valign="middle" align="left">[<a href="#SEC27" title="Next section in reading order"> &gt; </a>]</td>
2026
 
<td valign="middle" align="left"> &nbsp; </td>
2027
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2030
 
<td valign="middle" align="left"> &nbsp; </td>
2031
 
<td valign="middle" align="left"> &nbsp; </td>
2032
 
<td valign="middle" align="left"> &nbsp; </td>
2033
 
<td valign="middle" align="left"> &nbsp; </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>
2038
 
</tr></table>
2039
 
<h3 class="subsection"> 3.7.1 VLANs </h3>
2040
 
 
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
2044
 
(TAP devices).
2045
 
</p>
2046
 
<hr size="6">
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"> &lt; </a>]</td>
2050
 
<td valign="middle" align="left">[<a href="#SEC28" title="Next section in reading order"> &gt; </a>]</td>
2051
 
<td valign="middle" align="left"> &nbsp; </td>
2052
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2055
 
<td valign="middle" align="left"> &nbsp; </td>
2056
 
<td valign="middle" align="left"> &nbsp; </td>
2057
 
<td valign="middle" align="left"> &nbsp; </td>
2058
 
<td valign="middle" align="left"> &nbsp; </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>
2063
 
</tr></table>
2064
 
<h3 class="subsection"> 3.7.2 Using TAP network interfaces </h3>
2065
 
 
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.
2069
 
</p>
2070
 
<hr size="6">
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"> &lt; </a>]</td>
2074
 
<td valign="middle" align="left">[<a href="#SEC29" title="Next section in reading order"> &gt; </a>]</td>
2075
 
<td valign="middle" align="left"> &nbsp; </td>
2076
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2079
 
<td valign="middle" align="left"> &nbsp; </td>
2080
 
<td valign="middle" align="left"> &nbsp; </td>
2081
 
<td valign="middle" align="left"> &nbsp; </td>
2082
 
<td valign="middle" align="left"> &nbsp; </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>
2087
 
</tr></table>
2088
 
<h4 class="subsubsection"> 3.7.2.1 Linux host </h4>
2089
 
 
2090
 
<p>As an example, you can download the &lsquo;<tt>linux-test-xxx.tar.gz</tt>&rsquo;
2091
 
archive and copy the script &lsquo;<tt>qemu-ifup</tt>&rsquo; in &lsquo;<tt>/etc</tt>&rsquo; and
2092
 
configure properly <code>sudo</code> so that the command <code>ifconfig</code>
2093
 
contained in &lsquo;<tt>qemu-ifup</tt>&rsquo; can be executed as root. You must verify
2094
 
that your host kernel supports the TAP network interfaces: the
2095
 
device &lsquo;<tt>/dev/net/tun</tt>&rsquo; must be present.
2096
 
</p>
2097
 
<p>See <a href="#SEC10">Invocation</a> to have examples of command lines using the
2098
 
TAP network interfaces.
2099
 
</p>
2100
 
<hr size="6">
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"> &lt; </a>]</td>
2104
 
<td valign="middle" align="left">[<a href="#SEC30" title="Next section in reading order"> &gt; </a>]</td>
2105
 
<td valign="middle" align="left"> &nbsp; </td>
2106
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2109
 
<td valign="middle" align="left"> &nbsp; </td>
2110
 
<td valign="middle" align="left"> &nbsp; </td>
2111
 
<td valign="middle" align="left"> &nbsp; </td>
2112
 
<td valign="middle" align="left"> &nbsp; </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>
2117
 
</tr></table>
2118
 
<h4 class="subsubsection"> 3.7.2.2 Windows host </h4>
2119
 
 
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>.
2124
 
</p>
2125
 
<hr size="6">
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"> &lt; </a>]</td>
2129
 
<td valign="middle" align="left">[<a href="#SEC31" title="Next section in reading order"> &gt; </a>]</td>
2130
 
<td valign="middle" align="left"> &nbsp; </td>
2131
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2134
 
<td valign="middle" align="left"> &nbsp; </td>
2135
 
<td valign="middle" align="left"> &nbsp; </td>
2136
 
<td valign="middle" align="left"> &nbsp; </td>
2137
 
<td valign="middle" align="left"> &nbsp; </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>
2142
 
</tr></table>
2143
 
<h3 class="subsection"> 3.7.3 Using the user mode network stack </h3>
2144
 
 
2145
 
<p>By using the option &lsquo;<samp>-net user</samp>&rsquo; (default configuration if no
2146
 
&lsquo;<samp>-net</samp>&rsquo; 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:
2149
 
</p>
2150
 
<table><tr><td>&nbsp;</td><td><pre class="example">
2151
 
         QEMU VLAN      &lt;------&gt;  Firewall/DHCP server &lt;-----&gt; Internet
2152
 
                           |          (10.0.2.2)
2153
 
                           |
2154
 
                           ----&gt;  DNS server (10.0.2.3)
2155
 
                           |
2156
 
                           ----&gt;  SMB server (10.0.2.4)
2157
 
</pre></td></tr></table>
2158
 
 
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.
2163
 
</p>
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.
2167
 
</p>
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
2170
 
router (10.0.2.2).
2171
 
</p>
2172
 
<p>When using the built-in TFTP server, the router is also the TFTP
2173
 
server.
2174
 
</p>
2175
 
<p>When using the &lsquo;<samp>-redir</samp>&rsquo; 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.
2178
 
</p>
2179
 
<hr size="6">
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"> &lt; </a>]</td>
2183
 
<td valign="middle" align="left">[<a href="#SEC32" title="Next section in reading order"> &gt; </a>]</td>
2184
 
<td valign="middle" align="left"> &nbsp; </td>
2185
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2188
 
<td valign="middle" align="left"> &nbsp; </td>
2189
 
<td valign="middle" align="left"> &nbsp; </td>
2190
 
<td valign="middle" align="left"> &nbsp; </td>
2191
 
<td valign="middle" align="left"> &nbsp; </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>
2196
 
</tr></table>
2197
 
<h3 class="subsection"> 3.7.4 Connecting VLANs between QEMU instances </h3>
2198
 
 
2199
 
<p>Using the &lsquo;<samp>-net socket</samp>&rsquo; option, it is possible to make VLANs
2200
 
that span several QEMU instances. See <a href="#SEC10">Invocation</a> to have a
2201
 
basic example.
2202
 
</p>
2203
 
<hr size="6">
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"> &lt; </a>]</td>
2208
 
<td valign="middle" align="left">[<a href="#SEC33" title="Next section in reading order"> &gt; </a>]</td>
2209
 
<td valign="middle" align="left"> &nbsp; </td>
2210
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2213
 
<td valign="middle" align="left"> &nbsp; </td>
2214
 
<td valign="middle" align="left"> &nbsp; </td>
2215
 
<td valign="middle" align="left"> &nbsp; </td>
2216
 
<td valign="middle" align="left"> &nbsp; </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>
2221
 
</tr></table>
2222
 
<h2 class="section"> 3.8 Direct Linux Boot </h2>
2223
 
 
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
2226
 
kernel testing.
2227
 
</p>
2228
 
<p>The syntax is:
2229
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append &quot;root=/dev/hda&quot;
2230
 
</pre></td></tr></table>
2231
 
 
2232
 
<p>Use &lsquo;<samp>-kernel</samp>&rsquo; to provide the Linux kernel image and
2233
 
&lsquo;<samp>-append</samp>&rsquo; to give the kernel command line arguments. The
2234
 
&lsquo;<samp>-initrd</samp>&rsquo; option can be used to provide an INITRD image.
2235
 
</p>
2236
 
<p>When using the direct Linux boot, a disk image for the first hard disk
2237
 
&lsquo;<tt>hda</tt>&rsquo; is required because its boot sector is used to launch the
2238
 
Linux kernel.
2239
 
</p>
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
 
&lsquo;<samp>-nographic</samp>&rsquo; option. The typical command line is:
2243
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
2244
 
     -append &quot;root=/dev/hda console=ttyS0&quot; -nographic
2245
 
</pre></td></tr></table>
2246
 
 
2247
 
<p>Use &lt;Ctrl-a c&gt; to switch between the serial console and the
2248
 
monitor (see section <a href="#SEC11">Keys</a>).
2249
 
</p>
2250
 
<hr size="6">
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"> &lt; </a>]</td>
2255
 
<td valign="middle" align="left">[<a href="#SEC34" title="Next section in reading order"> &gt; </a>]</td>
2256
 
<td valign="middle" align="left"> &nbsp; </td>
2257
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2260
 
<td valign="middle" align="left"> &nbsp; </td>
2261
 
<td valign="middle" align="left"> &nbsp; </td>
2262
 
<td valign="middle" align="left"> &nbsp; </td>
2263
 
<td valign="middle" align="left"> &nbsp; </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>
2268
 
</tr></table>
2269
 
<h2 class="section"> 3.9 USB emulation </h2>
2270
 
 
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.
2275
 
</p>
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>&nbsp;&nbsp;</td><td align="left" valign="top">
2278
 
</td></tr>
2279
 
<tr><td align="left" valign="top"><a href="#SEC35">3.9.2 Using host USB devices on a Linux host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2280
 
</td></tr>
2281
 
</table>
2282
 
<hr size="6">
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"> &lt; </a>]</td>
2287
 
<td valign="middle" align="left">[<a href="#SEC35" title="Next section in reading order"> &gt; </a>]</td>
2288
 
<td valign="middle" align="left"> &nbsp; </td>
2289
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2292
 
<td valign="middle" align="left"> &nbsp; </td>
2293
 
<td valign="middle" align="left"> &nbsp; </td>
2294
 
<td valign="middle" align="left"> &nbsp; </td>
2295
 
<td valign="middle" align="left"> &nbsp; </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>
2300
 
</tr></table>
2301
 
<h3 class="subsection"> 3.9.1 Connecting USB devices </h3>
2302
 
 
2303
 
<p>USB devices can be connected with the &lsquo;<samp>-usbdevice</samp>&rsquo; commandline option
2304
 
or the <code>usb_add</code> monitor command.  Available devices are:
2305
 
</p>
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.
2309
 
</p></dd>
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.
2314
 
</p></dd>
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>)
2317
 
</p></dd>
2318
 
<dt> <var><code>host:bus.addr</code></var></dt>
2319
 
<dd><p>Pass through the host device identified by <var>bus.addr</var>
2320
 
(Linux only)
2321
 
</p></dd>
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>
2324
 
(Linux only)
2325
 
</p></dd>
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.
2330
 
</p></dd>
2331
 
<dt> <var><code>keyboard</code></var></dt>
2332
 
<dd><p>Standard USB keyboard.  Will override the PS/2 keyboard (if present).
2333
 
</p></dd>
2334
 
</dl>
2335
 
 
2336
 
<hr size="6">
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"> &lt; </a>]</td>
2341
 
<td valign="middle" align="left">[<a href="#SEC36" title="Next section in reading order"> &gt; </a>]</td>
2342
 
<td valign="middle" align="left"> &nbsp; </td>
2343
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2346
 
<td valign="middle" align="left"> &nbsp; </td>
2347
 
<td valign="middle" align="left"> &nbsp; </td>
2348
 
<td valign="middle" align="left"> &nbsp; </td>
2349
 
<td valign="middle" align="left"> &nbsp; </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>
2354
 
</tr></table>
2355
 
<h3 class="subsection"> 3.9.2 Using host USB devices on a Linux host </h3>
2356
 
 
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.
2360
 
</p>
2361
 
<ol>
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 &lsquo;<tt>mydriver.o</tt>&rsquo;
2365
 
to &lsquo;<tt>mydriver.o.disabled</tt>&rsquo;.
2366
 
 
2367
 
</li><li> Verify that &lsquo;<tt>/proc/bus/usb</tt>&rsquo; is working (most Linux distributions should enable it by default). You should see something like that:
2368
 
<table><tr><td>&nbsp;</td><td><pre class="example">ls /proc/bus/usb
2369
 
001  devices  drivers
2370
 
</pre></td></tr></table>
2371
 
 
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>&nbsp;</td><td><pre class="example">chown -R myuid /proc/bus/usb
2374
 
</pre></td></tr></table>
2375
 
 
2376
 
</li><li> Launch QEMU and do in the monitor:
2377
 
<table><tr><td>&nbsp;</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).
2383
 
</p>
2384
 
</li><li> Add the device in QEMU by using:
2385
 
<table><tr><td>&nbsp;</td><td><pre class="example">usb_add host:1234:5678
2386
 
</pre></td></tr></table>
2387
 
 
2388
 
<p>Normally the guest OS should report that a new USB device is
2389
 
plugged. You can use the option &lsquo;<samp>-usbdevice</samp>&rsquo; to do the same.
2390
 
</p>
2391
 
</li><li> Now you can try to use the host USB device in QEMU.
2392
 
 
2393
 
</li></ol>
2394
 
 
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).
2397
 
</p>
2398
 
<hr size="6">
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"> &lt; </a>]</td>
2403
 
<td valign="middle" align="left">[<a href="#SEC37" title="Next section in reading order"> &gt; </a>]</td>
2404
 
<td valign="middle" align="left"> &nbsp; </td>
2405
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2408
 
<td valign="middle" align="left"> &nbsp; </td>
2409
 
<td valign="middle" align="left"> &nbsp; </td>
2410
 
<td valign="middle" align="left"> &nbsp; </td>
2411
 
<td valign="middle" align="left"> &nbsp; </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>
2416
 
</tr></table>
2417
 
<h2 class="section"> 3.10 VNC security </h2>
2418
 
 
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.
2422
 
</p>
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>&nbsp;&nbsp;</td><td align="left" valign="top">
2425
 
</td></tr>
2426
 
<tr><td align="left" valign="top"><a href="#SEC38">3.10.2 With passwords</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2427
 
</td></tr>
2428
 
<tr><td align="left" valign="top"><a href="#SEC39">3.10.3 With x509 certificates</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2429
 
</td></tr>
2430
 
<tr><td align="left" valign="top"><a href="#SEC40">3.10.4 With x509 certificates and client verification</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2431
 
</td></tr>
2432
 
<tr><td align="left" valign="top"><a href="#SEC41">3.10.5 With x509 certificates, client verification and passwords</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2433
 
</td></tr>
2434
 
<tr><td align="left" valign="top"><a href="#SEC42">3.10.6 Generating certificates for VNC</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2435
 
</td></tr>
2436
 
</table>
2437
 
<hr size="6">
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"> &lt; </a>]</td>
2442
 
<td valign="middle" align="left">[<a href="#SEC38" title="Next section in reading order"> &gt; </a>]</td>
2443
 
<td valign="middle" align="left"> &nbsp; </td>
2444
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2447
 
<td valign="middle" align="left"> &nbsp; </td>
2448
 
<td valign="middle" align="left"> &nbsp; </td>
2449
 
<td valign="middle" align="left"> &nbsp; </td>
2450
 
<td valign="middle" align="left"> &nbsp; </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>
2455
 
</tr></table>
2456
 
<h3 class="subsection"> 3.10.1 Without passwords </h3>
2457
 
 
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
2461
 
</p>
2462
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
2463
 
</pre></td></tr></table>
2464
 
 
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
2468
 
tunnel.
2469
 
</p>
2470
 
<hr size="6">
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"> &lt; </a>]</td>
2475
 
<td valign="middle" align="left">[<a href="#SEC39" title="Next section in reading order"> &gt; </a>]</td>
2476
 
<td valign="middle" align="left"> &nbsp; </td>
2477
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2480
 
<td valign="middle" align="left"> &nbsp; </td>
2481
 
<td valign="middle" align="left"> &nbsp; </td>
2482
 
<td valign="middle" align="left"> &nbsp; </td>
2483
 
<td valign="middle" align="left"> &nbsp; </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>
2488
 
</tr></table>
2489
 
<h3 class="subsection"> 3.10.2 With passwords </h3>
2490
 
 
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.
2499
 
</p>
2500
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password -monitor stdio
2501
 
(qemu) change vnc password
2502
 
Password: ********
2503
 
(qemu)
2504
 
</pre></td></tr></table>
2505
 
 
2506
 
<hr size="6">
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"> &lt; </a>]</td>
2511
 
<td valign="middle" align="left">[<a href="#SEC40" title="Next section in reading order"> &gt; </a>]</td>
2512
 
<td valign="middle" align="left"> &nbsp; </td>
2513
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2516
 
<td valign="middle" align="left"> &nbsp; </td>
2517
 
<td valign="middle" align="left"> &nbsp; </td>
2518
 
<td valign="middle" align="left"> &nbsp; </td>
2519
 
<td valign="middle" align="left"> &nbsp; </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>
2524
 
</tr></table>
2525
 
<h3 class="subsection"> 3.10.3 With x509 certificates </h3>
2526
 
 
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.
2533
 
</p>
2534
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio
2535
 
</pre></td></tr></table>
2536
 
 
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.
2542
 
</p>
2543
 
<hr size="6">
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"> &lt; </a>]</td>
2548
 
<td valign="middle" align="left">[<a href="#SEC41" title="Next section in reading order"> &gt; </a>]</td>
2549
 
<td valign="middle" align="left"> &nbsp; </td>
2550
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2553
 
<td valign="middle" align="left"> &nbsp; </td>
2554
 
<td valign="middle" align="left"> &nbsp; </td>
2555
 
<td valign="middle" align="left"> &nbsp; </td>
2556
 
<td valign="middle" align="left"> &nbsp; </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>
2561
 
</tr></table>
2562
 
<h3 class="subsection"> 3.10.4 With x509 certificates and client verification </h3>
2563
 
 
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.
2568
 
</p>
2569
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio
2570
 
</pre></td></tr></table>
2571
 
 
2572
 
 
2573
 
<hr size="6">
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"> &lt; </a>]</td>
2578
 
<td valign="middle" align="left">[<a href="#SEC42" title="Next section in reading order"> &gt; </a>]</td>
2579
 
<td valign="middle" align="left"> &nbsp; </td>
2580
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2583
 
<td valign="middle" align="left"> &nbsp; </td>
2584
 
<td valign="middle" align="left"> &nbsp; </td>
2585
 
<td valign="middle" align="left"> &nbsp; </td>
2586
 
<td valign="middle" align="left"> &nbsp; </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>
2591
 
</tr></table>
2592
 
<h3 class="subsection"> 3.10.5 With x509 certificates, client verification and passwords </h3>
2593
 
 
2594
 
<p>Finally, the previous method can be combined with VNC password authentication
2595
 
to provide two layers of authentication for clients.
2596
 
</p>
2597
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio
2598
 
(qemu) change vnc password
2599
 
Password: ********
2600
 
(qemu)
2601
 
</pre></td></tr></table>
2602
 
 
2603
 
<hr size="6">
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"> &lt; </a>]</td>
2608
 
<td valign="middle" align="left">[<a href="#SEC43" title="Next section in reading order"> &gt; </a>]</td>
2609
 
<td valign="middle" align="left"> &nbsp; </td>
2610
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2613
 
<td valign="middle" align="left"> &nbsp; </td>
2614
 
<td valign="middle" align="left"> &nbsp; </td>
2615
 
<td valign="middle" align="left"> &nbsp; </td>
2616
 
<td valign="middle" align="left"> &nbsp; </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>
2621
 
</tr></table>
2622
 
<h3 class="subsection"> 3.10.6 Generating certificates for VNC </h3>
2623
 
 
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>.
2631
 
</p>
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>&nbsp;&nbsp;</td><td align="left" valign="top">
2634
 
</td></tr>
2635
 
<tr><td align="left" valign="top"><a href="#SEC44">3.10.6.2 Issuing server certificates</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2636
 
</td></tr>
2637
 
<tr><td align="left" valign="top"><a href="#SEC45">3.10.6.3 Issuing client certificates</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
2638
 
</td></tr>
2639
 
</table>
2640
 
<hr size="6">
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"> &lt; </a>]</td>
2645
 
<td valign="middle" align="left">[<a href="#SEC44" title="Next section in reading order"> &gt; </a>]</td>
2646
 
<td valign="middle" align="left"> &nbsp; </td>
2647
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2650
 
<td valign="middle" align="left"> &nbsp; </td>
2651
 
<td valign="middle" align="left"> &nbsp; </td>
2652
 
<td valign="middle" align="left"> &nbsp; </td>
2653
 
<td valign="middle" align="left"> &nbsp; </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>
2658
 
</tr></table>
2659
 
<h4 class="subsubsection"> 3.10.6.1 Setup the Certificate Authority </h4>
2660
 
 
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.
2665
 
</p>
2666
 
<table><tr><td>&nbsp;</td><td><pre class="example"># certtool --generate-privkey &gt; ca-key.pem
2667
 
</pre></td></tr></table>
2668
 
 
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.
2673
 
</p>
2674
 
<table><tr><td>&nbsp;</td><td><pre class="example"># cat &gt; ca.info &lt;&lt;EOF
2675
 
cn = Name of your organization
2676
 
ca
2677
 
cert_signing_key
2678
 
EOF
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>
2684
 
 
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.
2687
 
</p>
2688
 
<hr size="6">
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"> &lt; </a>]</td>
2693
 
<td valign="middle" align="left">[<a href="#SEC45" title="Next section in reading order"> &gt; </a>]</td>
2694
 
<td valign="middle" align="left"> &nbsp; </td>
2695
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2698
 
<td valign="middle" align="left"> &nbsp; </td>
2699
 
<td valign="middle" align="left"> &nbsp; </td>
2700
 
<td valign="middle" align="left"> &nbsp; </td>
2701
 
<td valign="middle" align="left"> &nbsp; </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>
2706
 
</tr></table>
2707
 
<h4 class="subsubsection"> 3.10.6.2 Issuing server certificates </h4>
2708
 
 
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:
2715
 
</p>
2716
 
<table><tr><td>&nbsp;</td><td><pre class="example"># cat &gt; server.info &lt;&lt;EOF
2717
 
organization = Name  of your organization
2718
 
cn = server.foo.example.com
2719
 
tls_www_server
2720
 
encryption_key
2721
 
signing_key
2722
 
EOF
2723
 
# certtool --generate-privkey &gt; 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>
2731
 
 
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.
2735
 
</p>
2736
 
<hr size="6">
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"> &lt; </a>]</td>
2741
 
<td valign="middle" align="left">[<a href="#SEC46" title="Next section in reading order"> &gt; </a>]</td>
2742
 
<td valign="middle" align="left"> &nbsp; </td>
2743
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2746
 
<td valign="middle" align="left"> &nbsp; </td>
2747
 
<td valign="middle" align="left"> &nbsp; </td>
2748
 
<td valign="middle" align="left"> &nbsp; </td>
2749
 
<td valign="middle" align="left"> &nbsp; </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>
2754
 
</tr></table>
2755
 
<h4 class="subsubsection"> 3.10.6.3 Issuing client certificates </h4>
2756
 
 
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:
2762
 
</p>
2763
 
<table><tr><td>&nbsp;</td><td><pre class="example"># cat &gt; client.info &lt;&lt;EOF
2764
 
country = GB
2765
 
state = London
2766
 
locality = London
2767
 
organiazation = Name of your organization
2768
 
cn = client.foo.example.com
2769
 
tls_www_client
2770
 
encryption_key
2771
 
signing_key
2772
 
EOF
2773
 
# certtool --generate-privkey &gt; 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>
2781
 
 
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.
2784
 
</p>
2785
 
<hr size="6">
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"> &lt; </a>]</td>
2790
 
<td valign="middle" align="left">[<a href="#SEC47" title="Next section in reading order"> &gt; </a>]</td>
2791
 
<td valign="middle" align="left"> &nbsp; </td>
2792
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2795
 
<td valign="middle" align="left"> &nbsp; </td>
2796
 
<td valign="middle" align="left"> &nbsp; </td>
2797
 
<td valign="middle" align="left"> &nbsp; </td>
2798
 
<td valign="middle" align="left"> &nbsp; </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>
2803
 
</tr></table>
2804
 
<h2 class="section"> 3.11 GDB usage </h2>
2805
 
 
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.
2808
 
</p>
2809
 
<p>In order to use gdb, launch qemu with the '-s' option. It will wait for a
2810
 
gdb connection:
2811
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">&gt; qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
2812
 
       -append &quot;root=/dev/hda&quot;
2813
 
Connected to host network interface: tun0
2814
 
Waiting gdb connection on port 1234
2815
 
</pre></td></tr></table>
2816
 
 
2817
 
<p>Then launch gdb on the 'vmlinux' executable:
2818
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">&gt; gdb vmlinux
2819
 
</pre></td></tr></table>
2820
 
 
2821
 
<p>In gdb, connect to QEMU:
2822
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">(gdb) target remote localhost:1234
2823
 
</pre></td></tr></table>
2824
 
 
2825
 
<p>Then you can use gdb normally. For example, type 'c' to launch the kernel:
2826
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">(gdb) c
2827
 
</pre></td></tr></table>
2828
 
 
2829
 
<p>Here are some useful tips in order to use gdb on system code:
2830
 
</p>
2831
 
<ol>
2832
 
<li>
2833
 
Use <code>info reg</code> to display all the CPU registers.
2834
 
</li><li>
2835
 
Use <code>x/10i $eip</code> to display the code at the PC position.
2836
 
</li><li>
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.
2839
 
</li></ol>
2840
 
 
2841
 
<hr size="6">
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"> &lt; </a>]</td>
2846
 
<td valign="middle" align="left">[<a href="#SEC48" title="Next section in reading order"> &gt; </a>]</td>
2847
 
<td valign="middle" align="left"> &nbsp; </td>
2848
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2851
 
<td valign="middle" align="left"> &nbsp; </td>
2852
 
<td valign="middle" align="left"> &nbsp; </td>
2853
 
<td valign="middle" align="left"> &nbsp; </td>
2854
 
<td valign="middle" align="left"> &nbsp; </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>
2859
 
</tr></table>
2860
 
<h2 class="section"> 3.12 Target OS specific information </h2>
2861
 
 
2862
 
<hr size="6">
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"> &lt; </a>]</td>
2866
 
<td valign="middle" align="left">[<a href="#SEC49" title="Next section in reading order"> &gt; </a>]</td>
2867
 
<td valign="middle" align="left"> &nbsp; </td>
2868
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2871
 
<td valign="middle" align="left"> &nbsp; </td>
2872
 
<td valign="middle" align="left"> &nbsp; </td>
2873
 
<td valign="middle" align="left"> &nbsp; </td>
2874
 
<td valign="middle" align="left"> &nbsp; </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>
2879
 
</tr></table>
2880
 
<h3 class="subsection"> 3.12.1 Linux </h3>
2881
 
 
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.
2885
 
</p>
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.
2890
 
</p>
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 (&lt; 2.6.9-1.724_FC3) were known to incorporate this
2895
 
patch by default. Newer kernels don't have it.
2896
 
</p>
2897
 
<hr size="6">
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"> &lt; </a>]</td>
2901
 
<td valign="middle" align="left">[<a href="#SEC50" title="Next section in reading order"> &gt; </a>]</td>
2902
 
<td valign="middle" align="left"> &nbsp; </td>
2903
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2906
 
<td valign="middle" align="left"> &nbsp; </td>
2907
 
<td valign="middle" align="left"> &nbsp; </td>
2908
 
<td valign="middle" align="left"> &nbsp; </td>
2909
 
<td valign="middle" align="left"> &nbsp; </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>
2914
 
</tr></table>
2915
 
<h3 class="subsection"> 3.12.2 Windows </h3>
2916
 
 
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.
2919
 
</p>
2920
 
<hr size="6">
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"> &lt; </a>]</td>
2924
 
<td valign="middle" align="left">[<a href="#SEC51" title="Next section in reading order"> &gt; </a>]</td>
2925
 
<td valign="middle" align="left"> &nbsp; </td>
2926
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2929
 
<td valign="middle" align="left"> &nbsp; </td>
2930
 
<td valign="middle" align="left"> &nbsp; </td>
2931
 
<td valign="middle" align="left"> &nbsp; </td>
2932
 
<td valign="middle" align="left"> &nbsp; </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>
2937
 
</tr></table>
2938
 
<h4 class="subsubsection"> 3.12.2.1 SVGA graphic modes support </h4>
2939
 
 
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.
2944
 
</p>
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. &gt;=
2947
 
1280x1024x16), then you should use the VESA VBE virtual graphic card
2948
 
(option &lsquo;<samp>-std-vga</samp>&rsquo;).
2949
 
</p>
2950
 
<hr size="6">
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"> &lt; </a>]</td>
2954
 
<td valign="middle" align="left">[<a href="#SEC52" title="Next section in reading order"> &gt; </a>]</td>
2955
 
<td valign="middle" align="left"> &nbsp; </td>
2956
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2959
 
<td valign="middle" align="left"> &nbsp; </td>
2960
 
<td valign="middle" align="left"> &nbsp; </td>
2961
 
<td valign="middle" align="left"> &nbsp; </td>
2962
 
<td valign="middle" align="left"> &nbsp; </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>
2967
 
</tr></table>
2968
 
<h4 class="subsubsection"> 3.12.2.2 CPU usage reduction </h4>
2969
 
 
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.
2975
 
</p>
2976
 
<hr size="6">
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"> &lt; </a>]</td>
2980
 
<td valign="middle" align="left">[<a href="#SEC53" title="Next section in reading order"> &gt; </a>]</td>
2981
 
<td valign="middle" align="left"> &nbsp; </td>
2982
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
2985
 
<td valign="middle" align="left"> &nbsp; </td>
2986
 
<td valign="middle" align="left"> &nbsp; </td>
2987
 
<td valign="middle" align="left"> &nbsp; </td>
2988
 
<td valign="middle" align="left"> &nbsp; </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>
2993
 
</tr></table>
2994
 
<h4 class="subsubsection"> 3.12.2.3 Windows 2000 disk full problem </h4>
2995
 
 
2996
 
<p>Windows 2000 has a bug which gives a disk full problem during its
2997
 
installation. When installing it, use the &lsquo;<samp>-win2k-hack</samp>&rsquo; 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
3000
 
IDE transfers).
3001
 
</p>
3002
 
<hr size="6">
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"> &lt; </a>]</td>
3006
 
<td valign="middle" align="left">[<a href="#SEC54" title="Next section in reading order"> &gt; </a>]</td>
3007
 
<td valign="middle" align="left"> &nbsp; </td>
3008
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3011
 
<td valign="middle" align="left"> &nbsp; </td>
3012
 
<td valign="middle" align="left"> &nbsp; </td>
3013
 
<td valign="middle" align="left"> &nbsp; </td>
3014
 
<td valign="middle" align="left"> &nbsp; </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>
3019
 
</tr></table>
3020
 
<h4 class="subsubsection"> 3.12.2.4 Windows 2000 shutdown </h4>
3021
 
 
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.
3025
 
</p>
3026
 
<p>In order to correct that, do the following (thanks to Struan
3027
 
Bartlett): go to the Control Panel =&gt; Add/Remove Hardware &amp; Next =&gt;
3028
 
Add/Troubleshoot a device =&gt; Add a new device &amp; Next =&gt; No, select the
3029
 
hardware from a list &amp; Next =&gt; NT Apm/Legacy Support &amp; Next =&gt; 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.
3032
 
</p>
3033
 
<hr size="6">
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"> &lt; </a>]</td>
3037
 
<td valign="middle" align="left">[<a href="#SEC55" title="Next section in reading order"> &gt; </a>]</td>
3038
 
<td valign="middle" align="left"> &nbsp; </td>
3039
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3042
 
<td valign="middle" align="left"> &nbsp; </td>
3043
 
<td valign="middle" align="left"> &nbsp; </td>
3044
 
<td valign="middle" align="left"> &nbsp; </td>
3045
 
<td valign="middle" align="left"> &nbsp; </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>
3050
 
</tr></table>
3051
 
<h4 class="subsubsection"> 3.12.2.5 Share a directory between Unix and Windows </h4>
3052
 
 
3053
 
<p>See <a href="#SEC10">Invocation</a> about the help of the option &lsquo;<samp>-smb</samp>&rsquo;.
3054
 
</p>
3055
 
<hr size="6">
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"> &lt; </a>]</td>
3059
 
<td valign="middle" align="left">[<a href="#SEC56" title="Next section in reading order"> &gt; </a>]</td>
3060
 
<td valign="middle" align="left"> &nbsp; </td>
3061
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3064
 
<td valign="middle" align="left"> &nbsp; </td>
3065
 
<td valign="middle" align="left"> &nbsp; </td>
3066
 
<td valign="middle" align="left"> &nbsp; </td>
3067
 
<td valign="middle" align="left"> &nbsp; </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>
3072
 
</tr></table>
3073
 
<h4 class="subsubsection"> 3.12.2.6 Windows XP security problem </h4>
3074
 
 
3075
 
<p>Some releases of Windows XP install correctly but give a security
3076
 
error when booting:
3077
 
</p><table><tr><td>&nbsp;</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>
3080
 
 
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 (&quot;-hdb fat:directory_which_holds_the_SP&quot;).
3086
 
</p>
3087
 
<hr size="6">
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"> &lt; </a>]</td>
3091
 
<td valign="middle" align="left">[<a href="#SEC57" title="Next section in reading order"> &gt; </a>]</td>
3092
 
<td valign="middle" align="left"> &nbsp; </td>
3093
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3096
 
<td valign="middle" align="left"> &nbsp; </td>
3097
 
<td valign="middle" align="left"> &nbsp; </td>
3098
 
<td valign="middle" align="left"> &nbsp; </td>
3099
 
<td valign="middle" align="left"> &nbsp; </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>
3104
 
</tr></table>
3105
 
<h3 class="subsection"> 3.12.3 MS-DOS and FreeDOS </h3>
3106
 
 
3107
 
<hr size="6">
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"> &lt; </a>]</td>
3111
 
<td valign="middle" align="left">[<a href="#SEC58" title="Next section in reading order"> &gt; </a>]</td>
3112
 
<td valign="middle" align="left"> &nbsp; </td>
3113
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3116
 
<td valign="middle" align="left"> &nbsp; </td>
3117
 
<td valign="middle" align="left"> &nbsp; </td>
3118
 
<td valign="middle" align="left"> &nbsp; </td>
3119
 
<td valign="middle" align="left"> &nbsp; </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>
3124
 
</tr></table>
3125
 
<h4 class="subsubsection"> 3.12.3.1 CPU usage reduction </h4>
3126
 
 
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
3130
 
problem.
3131
 
</p>
3132
 
<hr size="6">
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"> &lt; </a>]</td>
3137
 
<td valign="middle" align="left">[<a href="#SEC59" title="Next section in reading order"> &gt; </a>]</td>
3138
 
<td valign="middle" align="left"> &nbsp; </td>
3139
 
<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3142
 
<td valign="middle" align="left"> &nbsp; </td>
3143
 
<td valign="middle" align="left"> &nbsp; </td>
3144
 
<td valign="middle" align="left"> &nbsp; </td>
3145
 
<td valign="middle" align="left"> &nbsp; </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>
3150
 
</tr></table>
3151
 
<h1 class="chapter"> 4. QEMU System emulator for non PC targets </h1>
3152
 
 
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.
3156
 
</p>
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>&nbsp;&nbsp;</td><td align="left" valign="top">
3159
 
</td></tr>
3160
 
<tr><td align="left" valign="top"><a href="#SEC60">4.2 Sparc32 System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3161
 
</td></tr>
3162
 
<tr><td align="left" valign="top"><a href="#SEC61">4.3 Sparc64 System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3163
 
</td></tr>
3164
 
<tr><td align="left" valign="top"><a href="#SEC62">4.4 MIPS System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3165
 
</td></tr>
3166
 
<tr><td align="left" valign="top"><a href="#SEC63">4.5 ARM System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3167
 
</td></tr>
3168
 
<tr><td align="left" valign="top"><a href="#SEC64">4.6 ColdFire System emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3169
 
</td></tr>
3170
 
</table>
3171
 
 
3172
 
<hr size="6">
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"> &lt; </a>]</td>
3177
 
<td valign="middle" align="left">[<a href="#SEC60" title="Next section in reading order"> &gt; </a>]</td>
3178
 
<td valign="middle" align="left"> &nbsp; </td>
3179
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3182
 
<td valign="middle" align="left"> &nbsp; </td>
3183
 
<td valign="middle" align="left"> &nbsp; </td>
3184
 
<td valign="middle" align="left"> &nbsp; </td>
3185
 
<td valign="middle" align="left"> &nbsp; </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>
3190
 
</tr></table>
3191
 
<h2 class="section"> 4.1 QEMU PowerPC System emulator </h2>
3192
 
 
3193
 
<p>Use the executable &lsquo;<tt>qemu-system-ppc</tt>&rsquo; to simulate a complete PREP
3194
 
or PowerMac PowerPC system.
3195
 
</p>
3196
 
<p>QEMU emulates the following PowerMac peripherals:
3197
 
</p>
3198
 
<ul class="toc">
3199
 
<li>-
3200
 
UniNorth PCI Bridge
3201
 
</li><li>-
3202
 
PCI VGA compatible card with VESA Bochs Extensions
3203
 
</li><li>-
3204
 
2 PMAC IDE interfaces with hard disk and CD-ROM support
3205
 
</li><li>-
3206
 
NE2000 PCI adapters
3207
 
</li><li>-
3208
 
Non Volatile RAM
3209
 
</li><li>-
3210
 
VIA-CUDA with ADB keyboard and mouse.
3211
 
</li></ul>
3212
 
 
3213
 
<p>QEMU emulates the following PREP peripherals:
3214
 
</p>
3215
 
<ul class="toc">
3216
 
<li>-
3217
 
PCI Bridge
3218
 
</li><li>-
3219
 
PCI VGA compatible card with VESA Bochs Extensions
3220
 
</li><li>-
3221
 
2 IDE interfaces with hard disk and CD-ROM support
3222
 
</li><li>-
3223
 
Floppy disk
3224
 
</li><li>-
3225
 
NE2000 network adapters
3226
 
</li><li>-
3227
 
Serial port
3228
 
</li><li>-
3229
 
PREP Non Volatile RAM
3230
 
</li><li>-
3231
 
PC compatible keyboard and mouse.
3232
 
</li></ul>
3233
 
 
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>.
3236
 
</p>
3237
 
 
3238
 
<p>The following options are specific to the PowerPC emulation:
3239
 
</p>
3240
 
<dl compact="compact">
3241
 
<dt> &lsquo;<samp>-g WxH[xDEPTH]</samp>&rsquo;</dt>
3242
 
<dd>
3243
 
<p>Set the initial VGA graphic mode. The default is 800x600x15.
3244
 
</p>
3245
 
</dd>
3246
 
</dl>
3247
 
 
3248
 
 
3249
 
 
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>.
3252
 
</p>
3253
 
<hr size="6">
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"> &lt; </a>]</td>
3258
 
<td valign="middle" align="left">[<a href="#SEC61" title="Next section in reading order"> &gt; </a>]</td>
3259
 
<td valign="middle" align="left"> &nbsp; </td>
3260
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3263
 
<td valign="middle" align="left"> &nbsp; </td>
3264
 
<td valign="middle" align="left"> &nbsp; </td>
3265
 
<td valign="middle" align="left"> &nbsp; </td>
3266
 
<td valign="middle" align="left"> &nbsp; </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>
3271
 
</tr></table>
3272
 
<h2 class="section"> 4.2 Sparc32 System emulator </h2>
3273
 
 
3274
 
<p>Use the executable &lsquo;<tt>qemu-system-sparc</tt>&rsquo; to simulate a SparcStation 5
3275
 
or SparcStation 10 (sun4m architecture). The emulation is somewhat complete.
3276
 
</p>
3277
 
<p>QEMU emulates the following sun4m peripherals:
3278
 
</p>
3279
 
<ul class="toc">
3280
 
<li>-
3281
 
IOMMU
3282
 
</li><li>-
3283
 
TCX Frame buffer
3284
 
</li><li>-
3285
 
Lance (Am7990) Ethernet
3286
 
</li><li>-
3287
 
Non Volatile RAM M48T08
3288
 
</li><li>-
3289
 
Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard
3290
 
and power/reset logic
3291
 
</li><li>-
3292
 
ESP SCSI controller with hard disk and CD-ROM support
3293
 
</li><li>-
3294
 
Floppy drive
3295
 
</li><li>-
3296
 
CS4231 sound device (only on SS-5, not working yet)
3297
 
</li></ul>
3298
 
 
3299
 
<p>The number of peripherals is fixed in the architecture.
3300
 
</p>
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.
3305
 
</p>
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.
3309
 
</p>
3310
 
 
3311
 
<p>The following options are specific to the Sparc32 emulation:
3312
 
</p>
3313
 
<dl compact="compact">
3314
 
<dt> &lsquo;<samp>-g WxHx[xDEPTH]</samp>&rsquo;</dt>
3315
 
<dd>
3316
 
<p>Set the initial TCX graphic mode. The default is 1024x768x8, currently
3317
 
the only other possible mode is 1024x768x24.
3318
 
</p>
3319
 
</dd>
3320
 
<dt> &lsquo;<samp>-prom-env string</samp>&rsquo;</dt>
3321
 
<dd>
3322
 
<p>Set OpenBIOS variables in NVRAM, for example:
3323
 
</p>
3324
 
<table><tr><td>&nbsp;</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>
3327
 
 
3328
 
</dd>
3329
 
<dt> &lsquo;<samp>-M [SS-5|SS-10]</samp>&rsquo;</dt>
3330
 
<dd>
3331
 
<p>Set the emulated machine type. Default is SS-5.
3332
 
</p>
3333
 
</dd>
3334
 
</dl>
3335
 
 
3336
 
 
3337
 
<hr size="6">
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"> &lt; </a>]</td>
3342
 
<td valign="middle" align="left">[<a href="#SEC62" title="Next section in reading order"> &gt; </a>]</td>
3343
 
<td valign="middle" align="left"> &nbsp; </td>
3344
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3347
 
<td valign="middle" align="left"> &nbsp; </td>
3348
 
<td valign="middle" align="left"> &nbsp; </td>
3349
 
<td valign="middle" align="left"> &nbsp; </td>
3350
 
<td valign="middle" align="left"> &nbsp; </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>
3355
 
</tr></table>
3356
 
<h2 class="section"> 4.3 Sparc64 System emulator </h2>
3357
 
 
3358
 
<p>Use the executable &lsquo;<tt>qemu-system-sparc64</tt>&rsquo; to simulate a Sun4u machine.
3359
 
The emulator is not usable for anything yet.
3360
 
</p>
3361
 
<p>QEMU emulates the following sun4u peripherals:
3362
 
</p>
3363
 
<ul class="toc">
3364
 
<li>-
3365
 
UltraSparc IIi APB PCI Bridge
3366
 
</li><li>-
3367
 
PCI VGA compatible card with VESA Bochs Extensions
3368
 
</li><li>-
3369
 
Non Volatile RAM M48T59
3370
 
</li><li>-
3371
 
PC-compatible serial ports
3372
 
</li></ul>
3373
 
 
3374
 
<hr size="6">
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"> &lt; </a>]</td>
3379
 
<td valign="middle" align="left">[<a href="#SEC63" title="Next section in reading order"> &gt; </a>]</td>
3380
 
<td valign="middle" align="left"> &nbsp; </td>
3381
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3384
 
<td valign="middle" align="left"> &nbsp; </td>
3385
 
<td valign="middle" align="left"> &nbsp; </td>
3386
 
<td valign="middle" align="left"> &nbsp; </td>
3387
 
<td valign="middle" align="left"> &nbsp; </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>
3392
 
</tr></table>
3393
 
<h2 class="section"> 4.4 MIPS System emulator </h2>
3394
 
 
3395
 
<p>Use the executable &lsquo;<tt>qemu-system-mips</tt>&rsquo; to simulate a MIPS machine.
3396
 
Three different machine types are emulated:
3397
 
</p>
3398
 
<ul class="toc">
3399
 
<li>-
3400
 
A generic ISA PC-like machine &quot;mips&quot;
3401
 
</li><li>-
3402
 
The MIPS Malta prototype board &quot;malta&quot;
3403
 
</li><li>-
3404
 
An ACER Pica &quot;pica61&quot;
3405
 
</li></ul>
3406
 
 
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
3409
 
emulated:
3410
 
</p>
3411
 
<ul class="toc">
3412
 
<li>-
3413
 
MIPS 24Kf CPU
3414
 
</li><li>-
3415
 
PC style serial port
3416
 
</li><li>-
3417
 
PC style IDE disk
3418
 
</li><li>-
3419
 
NE2000 network card
3420
 
</li></ul>
3421
 
 
3422
 
<p>The Malta emulation supports the following devices:
3423
 
</p>
3424
 
<ul class="toc">
3425
 
<li>-
3426
 
Core board with MIPS 24Kf CPU and Galileo system controller
3427
 
</li><li>-
3428
 
PIIX4 PCI/USB/SMbus controller
3429
 
</li><li>-
3430
 
The Multi-I/O chip's serial device
3431
 
</li><li>-
3432
 
PCnet32 PCI network card
3433
 
</li><li>-
3434
 
Malta FPGA serial device
3435
 
</li><li>-
3436
 
Cirrus VGA graphics card
3437
 
</li></ul>
3438
 
 
3439
 
<p>The ACER Pica emulation supports:
3440
 
</p>
3441
 
<ul class="toc">
3442
 
<li>-
3443
 
MIPS R4000 CPU
3444
 
</li><li>-
3445
 
PC-style IRQ and DMA controllers
3446
 
</li><li>-
3447
 
PC Keyboard
3448
 
</li><li>-
3449
 
IDE controller
3450
 
</li></ul>
3451
 
 
3452
 
<hr size="6">
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"> &lt; </a>]</td>
3457
 
<td valign="middle" align="left">[<a href="#SEC64" title="Next section in reading order"> &gt; </a>]</td>
3458
 
<td valign="middle" align="left"> &nbsp; </td>
3459
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3462
 
<td valign="middle" align="left"> &nbsp; </td>
3463
 
<td valign="middle" align="left"> &nbsp; </td>
3464
 
<td valign="middle" align="left"> &nbsp; </td>
3465
 
<td valign="middle" align="left"> &nbsp; </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>
3470
 
</tr></table>
3471
 
<h2 class="section"> 4.5 ARM System emulator </h2>
3472
 
 
3473
 
<p>Use the executable &lsquo;<tt>qemu-system-arm</tt>&rsquo; to simulate a ARM
3474
 
machine. The ARM Integrator/CP board is emulated with the following
3475
 
devices:
3476
 
</p>
3477
 
<ul class="toc">
3478
 
<li>-
3479
 
ARM926E, ARM1026E or ARM946E CPU
3480
 
</li><li>-
3481
 
Two PL011 UARTs
3482
 
</li><li>-
3483
 
SMC 91c111 Ethernet adapter
3484
 
</li><li>-
3485
 
PL110 LCD controller
3486
 
</li><li>-
3487
 
PL050 KMI with PS/2 keyboard and mouse.
3488
 
</li><li>-
3489
 
PL181 MultiMedia Card Interface with SD card.
3490
 
</li></ul>
3491
 
 
3492
 
<p>The ARM Versatile baseboard is emulated with the following devices:
3493
 
</p>
3494
 
<ul class="toc">
3495
 
<li>-
3496
 
ARM926E CPU
3497
 
</li><li>-
3498
 
PL190 Vectored Interrupt Controller
3499
 
</li><li>-
3500
 
Four PL011 UARTs
3501
 
</li><li>-
3502
 
SMC 91c111 Ethernet adapter
3503
 
</li><li>-
3504
 
PL110 LCD controller
3505
 
</li><li>-
3506
 
PL050 KMI with PS/2 keyboard and mouse.
3507
 
</li><li>-
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.
3513
 
</li><li>-
3514
 
PCI OHCI USB controller.
3515
 
</li><li>-
3516
 
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices.
3517
 
</li><li>-
3518
 
PL181 MultiMedia Card Interface with SD card.
3519
 
</li></ul>
3520
 
 
3521
 
<p>The ARM RealView Emulation baseboard is emulated with the following devices:
3522
 
</p>
3523
 
<ul class="toc">
3524
 
<li>-
3525
 
ARM926E CPU
3526
 
</li><li>-
3527
 
ARM AMBA Generic/Distributed Interrupt Controller
3528
 
</li><li>-
3529
 
Four PL011 UARTs
3530
 
</li><li>-
3531
 
SMC 91c111 Ethernet adapter
3532
 
</li><li>-
3533
 
PL110 LCD controller
3534
 
</li><li>-
3535
 
PL050 KMI with PS/2 keyboard and mouse
3536
 
</li><li>-
3537
 
PCI host bridge
3538
 
</li><li>-
3539
 
PCI OHCI USB controller
3540
 
</li><li>-
3541
 
LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices
3542
 
</li><li>-
3543
 
PL181 MultiMedia Card Interface with SD card.
3544
 
</li></ul>
3545
 
 
3546
 
<p>The XScale-based clamshell PDA models (&quot;Spitz&quot;, &quot;Akita&quot;, &quot;Borzoi&quot;
3547
 
and &quot;Terrier&quot;) emulation includes the following peripherals:
3548
 
</p>
3549
 
<ul class="toc">
3550
 
<li>-
3551
 
Intel PXA270 System-on-chip (ARM V5TE core)
3552
 
</li><li>-
3553
 
NAND Flash memory
3554
 
</li><li>-
3555
 
IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in &quot;Akita&quot;
3556
 
</li><li>-
3557
 
On-chip OHCI USB controller
3558
 
</li><li>-
3559
 
On-chip LCD controller
3560
 
</li><li>-
3561
 
On-chip Real Time Clock
3562
 
</li><li>-
3563
 
TI ADS7846 touchscreen controller on SSP bus
3564
 
</li><li>-
3565
 
Maxim MAX1111 analog-digital converter on I<em>^2</em>C bus
3566
 
</li><li>-
3567
 
GPIO-connected keyboard controller and LEDs
3568
 
</li><li>-
3569
 
Secure Digital card connected to PXA MMC/SD host
3570
 
</li><li>-
3571
 
Three on-chip UARTs
3572
 
</li><li>-
3573
 
WM8750 audio CODEC on I<em>^2</em>C and I<em>^2</em>S busses
3574
 
</li></ul>
3575
 
 
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.
3578
 
</p>
3579
 
<hr size="6">
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"> &lt; </a>]</td>
3584
 
<td valign="middle" align="left">[<a href="#SEC65" title="Next section in reading order"> &gt; </a>]</td>
3585
 
<td valign="middle" align="left"> &nbsp; </td>
3586
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3589
 
<td valign="middle" align="left"> &nbsp; </td>
3590
 
<td valign="middle" align="left"> &nbsp; </td>
3591
 
<td valign="middle" align="left"> &nbsp; </td>
3592
 
<td valign="middle" align="left"> &nbsp; </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>
3597
 
</tr></table>
3598
 
<h2 class="section"> 4.6 ColdFire System emulator </h2>
3599
 
 
3600
 
<p>Use the executable &lsquo;<tt>qemu-system-m68k</tt>&rsquo; to simulate a ColdFire machine.
3601
 
The emulator is able to boot a uClinux kernel.
3602
 
</p>
3603
 
<p>The M5208EVB emulation includes the following devices:
3604
 
</p>
3605
 
<ul class="toc">
3606
 
<li>-
3607
 
MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC).
3608
 
</li><li>-
3609
 
Three Two on-chip UARTs.
3610
 
</li><li>-
3611
 
Fast Ethernet Controller (FEC)
3612
 
</li></ul>
3613
 
 
3614
 
<p>The AN5206 emulation includes the following devices:
3615
 
</p>
3616
 
<ul class="toc">
3617
 
<li>-
3618
 
MCF5206 ColdFire V2 Microprocessor.
3619
 
</li><li>-
3620
 
Two on-chip UARTs.
3621
 
</li></ul>
3622
 
 
3623
 
<hr size="6">
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"> &lt; </a>]</td>
3628
 
<td valign="middle" align="left">[<a href="#SEC66" title="Next section in reading order"> &gt; </a>]</td>
3629
 
<td valign="middle" align="left"> &nbsp; </td>
3630
 
<td valign="middle" align="left">[<a href="#SEC58" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3633
 
<td valign="middle" align="left"> &nbsp; </td>
3634
 
<td valign="middle" align="left"> &nbsp; </td>
3635
 
<td valign="middle" align="left"> &nbsp; </td>
3636
 
<td valign="middle" align="left"> &nbsp; </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>
3641
 
</tr></table>
3642
 
<h1 class="chapter"> 5. QEMU User space emulator </h1>
3643
 
 
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>&nbsp;&nbsp;</td><td align="left" valign="top">
3646
 
</td></tr>
3647
 
<tr><td align="left" valign="top"><a href="#SEC67">5.2 Linux User space emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3648
 
</td></tr>
3649
 
<tr><td align="left" valign="top"><a href="#SEC72">5.3 Mac OS X/Darwin User space emulator</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3650
 
</td></tr>
3651
 
</table>
3652
 
 
3653
 
<hr size="6">
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"> &lt; </a>]</td>
3658
 
<td valign="middle" align="left">[<a href="#SEC67" title="Next section in reading order"> &gt; </a>]</td>
3659
 
<td valign="middle" align="left"> &nbsp; </td>
3660
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3663
 
<td valign="middle" align="left"> &nbsp; </td>
3664
 
<td valign="middle" align="left"> &nbsp; </td>
3665
 
<td valign="middle" align="left"> &nbsp; </td>
3666
 
<td valign="middle" align="left"> &nbsp; </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>
3671
 
</tr></table>
3672
 
<h2 class="section"> 5.1 Supported Operating Systems </h2>
3673
 
 
3674
 
<p>The following OS are supported in user space emulation:
3675
 
</p>
3676
 
<ul class="toc">
3677
 
<li>-
3678
 
Linux (referred as qemu-linux-user)
3679
 
</li><li>-
3680
 
Mac OS X/Darwin (referred as qemu-darwin-user)
3681
 
</li></ul>
3682
 
 
3683
 
<hr size="6">
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"> &lt; </a>]</td>
3688
 
<td valign="middle" align="left">[<a href="#SEC68" title="Next section in reading order"> &gt; </a>]</td>
3689
 
<td valign="middle" align="left"> &nbsp; </td>
3690
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3693
 
<td valign="middle" align="left"> &nbsp; </td>
3694
 
<td valign="middle" align="left"> &nbsp; </td>
3695
 
<td valign="middle" align="left"> &nbsp; </td>
3696
 
<td valign="middle" align="left"> &nbsp; </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>
3701
 
</tr></table>
3702
 
<h2 class="section"> 5.2 Linux User space emulator </h2>
3703
 
 
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>&nbsp;&nbsp;</td><td align="left" valign="top">
3706
 
</td></tr>
3707
 
<tr><td align="left" valign="top"><a href="#SEC69">5.2.2 Wine launch</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3708
 
</td></tr>
3709
 
<tr><td align="left" valign="top"><a href="#SEC70">5.2.3 Command line options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3710
 
</td></tr>
3711
 
<tr><td align="left" valign="top"><a href="#SEC71">5.2.4 Other binaries</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3712
 
</td></tr>
3713
 
</table>
3714
 
 
3715
 
<hr size="6">
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"> &lt; </a>]</td>
3720
 
<td valign="middle" align="left">[<a href="#SEC69" title="Next section in reading order"> &gt; </a>]</td>
3721
 
<td valign="middle" align="left"> &nbsp; </td>
3722
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3725
 
<td valign="middle" align="left"> &nbsp; </td>
3726
 
<td valign="middle" align="left"> &nbsp; </td>
3727
 
<td valign="middle" align="left"> &nbsp; </td>
3728
 
<td valign="middle" align="left"> &nbsp; </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>
3733
 
</tr></table>
3734
 
<h3 class="subsection"> 5.2.1 Quick Start </h3>
3735
 
 
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.
3738
 
</p>
3739
 
<ul class="toc">
3740
 
<li> On x86, you can just try to launch any process by using the native
3741
 
libraries:
3742
 
 
3743
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 -L / /bin/ls
3744
 
</pre></td></tr></table>
3745
 
 
3746
 
<p><code>-L /</code> tells that the x86 dynamic linker must be searched with a
3747
 
&lsquo;<tt>/</tt>&rsquo; prefix.
3748
 
</p>
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):
3751
 
 
3752
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 -L / qemu-i386 -L / /bin/ls
3753
 
</pre></td></tr></table>
3754
 
 
3755
 
</li><li> On non x86 CPUs, you need first to download at least an x86 glibc
3756
 
(&lsquo;<tt>qemu-runtime-i386-XXX-.tar.gz</tt>&rsquo; on the QEMU web page). Ensure that
3757
 
<code>LD_LIBRARY_PATH</code> is not set:
3758
 
 
3759
 
<table><tr><td>&nbsp;</td><td><pre class="example">unset LD_LIBRARY_PATH
3760
 
</pre></td></tr></table>
3761
 
 
3762
 
<p>Then you can launch the precompiled &lsquo;<tt>ls</tt>&rsquo; x86 executable:
3763
 
</p>
3764
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 tests/i386/ls
3765
 
</pre></td></tr></table>
3766
 
<p>You can look at &lsquo;<tt>qemu-binfmt-conf.sh</tt>&rsquo; 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
3769
 
Linux kernel.
3770
 
</p>
3771
 
</li><li> The x86 version of QEMU is also included. You can try weird things such as:
3772
 
<table><tr><td>&nbsp;</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>
3775
 
 
3776
 
</li></ul>
3777
 
 
3778
 
<hr size="6">
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"> &lt; </a>]</td>
3783
 
<td valign="middle" align="left">[<a href="#SEC70" title="Next section in reading order"> &gt; </a>]</td>
3784
 
<td valign="middle" align="left"> &nbsp; </td>
3785
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3788
 
<td valign="middle" align="left"> &nbsp; </td>
3789
 
<td valign="middle" align="left"> &nbsp; </td>
3790
 
<td valign="middle" align="left"> &nbsp; </td>
3791
 
<td valign="middle" align="left"> &nbsp; </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>
3796
 
</tr></table>
3797
 
<h3 class="subsection"> 5.2.2 Wine launch </h3>
3798
 
 
3799
 
<ul class="toc">
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
3802
 
able to do:
3803
 
 
3804
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/bin/ls-i386
3805
 
</pre></td></tr></table>
3806
 
 
3807
 
</li><li> Download the binary x86 Wine install
3808
 
(&lsquo;<tt>qemu-XXX-i386-wine.tar.gz</tt>&rsquo; on the QEMU web page).
3809
 
 
3810
 
</li><li> Configure Wine on your account. Look at the provided script
3811
 
&lsquo;<tt>/usr/local/qemu-i386/bin/wine-conf.sh</tt>&rsquo;. Your previous
3812
 
<code>${HOME}/.wine</code> directory is saved to <code>${HOME}/.wine.org</code>.
3813
 
 
3814
 
</li><li> Then you can try the example &lsquo;<tt>putty.exe</tt>&rsquo;:
3815
 
 
3816
 
<table><tr><td>&nbsp;</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>
3819
 
 
3820
 
</li></ul>
3821
 
 
3822
 
<hr size="6">
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"> &lt; </a>]</td>
3827
 
<td valign="middle" align="left">[<a href="#SEC71" title="Next section in reading order"> &gt; </a>]</td>
3828
 
<td valign="middle" align="left"> &nbsp; </td>
3829
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3832
 
<td valign="middle" align="left"> &nbsp; </td>
3833
 
<td valign="middle" align="left"> &nbsp; </td>
3834
 
<td valign="middle" align="left"> &nbsp; </td>
3835
 
<td valign="middle" align="left"> &nbsp; </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>
3840
 
</tr></table>
3841
 
<h3 class="subsection"> 5.2.3 Command line options </h3>
3842
 
 
3843
 
<table><tr><td>&nbsp;</td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
3844
 
</pre></td></tr></table>
3845
 
 
3846
 
<dl compact="compact">
3847
 
<dt> &lsquo;<samp>-h</samp>&rsquo;</dt>
3848
 
<dd><p>Print the help
3849
 
</p></dd>
3850
 
<dt> &lsquo;<samp>-L path</samp>&rsquo;</dt>
3851
 
<dd><p>Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
3852
 
</p></dd>
3853
 
<dt> &lsquo;<samp>-s size</samp>&rsquo;</dt>
3854
 
<dd><p>Set the x86 stack size in bytes (default=524288)
3855
 
</p></dd>
3856
 
</dl>
3857
 
 
3858
 
<p>Debug options:
3859
 
</p>
3860
 
<dl compact="compact">
3861
 
<dt> &lsquo;<samp>-d</samp>&rsquo;</dt>
3862
 
<dd><p>Activate log (logfile=/tmp/qemu.log)
3863
 
</p></dd>
3864
 
<dt> &lsquo;<samp>-p pagesize</samp>&rsquo;</dt>
3865
 
<dd><p>Act as if the host page size was 'pagesize' bytes
3866
 
</p></dd>
3867
 
</dl>
3868
 
 
3869
 
<hr size="6">
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"> &lt; </a>]</td>
3874
 
<td valign="middle" align="left">[<a href="#SEC72" title="Next section in reading order"> &gt; </a>]</td>
3875
 
<td valign="middle" align="left"> &nbsp; </td>
3876
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3879
 
<td valign="middle" align="left"> &nbsp; </td>
3880
 
<td valign="middle" align="left"> &nbsp; </td>
3881
 
<td valign="middle" align="left"> &nbsp; </td>
3882
 
<td valign="middle" align="left"> &nbsp; </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>
3887
 
</tr></table>
3888
 
<h3 class="subsection"> 5.2.4 Other binaries </h3>
3889
 
 
3890
 
<p><code>qemu-arm</code> is also capable of running ARM &quot;Angel&quot; semihosted ELF
3891
 
binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
3892
 
configurations), and arm-uclinux bFLT format binaries.
3893
 
</p>
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.
3897
 
</p>
3898
 
<p>The binary format is detected automatically.
3899
 
</p>
3900
 
<hr size="6">
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"> &lt; </a>]</td>
3905
 
<td valign="middle" align="left">[<a href="#SEC73" title="Next section in reading order"> &gt; </a>]</td>
3906
 
<td valign="middle" align="left"> &nbsp; </td>
3907
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3910
 
<td valign="middle" align="left"> &nbsp; </td>
3911
 
<td valign="middle" align="left"> &nbsp; </td>
3912
 
<td valign="middle" align="left"> &nbsp; </td>
3913
 
<td valign="middle" align="left"> &nbsp; </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>
3918
 
</tr></table>
3919
 
<h2 class="section"> 5.3 Mac OS X/Darwin User space emulator </h2>
3920
 
 
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>&nbsp;&nbsp;</td><td align="left" valign="top">
3923
 
</td></tr>
3924
 
<tr><td align="left" valign="top"><a href="#SEC74">5.3.2 Quick Start</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3925
 
</td></tr>
3926
 
<tr><td align="left" valign="top"><a href="#SEC75">5.3.3 Command line options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
3927
 
</td></tr>
3928
 
</table>
3929
 
 
3930
 
<hr size="6">
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"> &lt; </a>]</td>
3935
 
<td valign="middle" align="left">[<a href="#SEC74" title="Next section in reading order"> &gt; </a>]</td>
3936
 
<td valign="middle" align="left"> &nbsp; </td>
3937
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3940
 
<td valign="middle" align="left"> &nbsp; </td>
3941
 
<td valign="middle" align="left"> &nbsp; </td>
3942
 
<td valign="middle" align="left"> &nbsp; </td>
3943
 
<td valign="middle" align="left"> &nbsp; </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>
3948
 
</tr></table>
3949
 
<h3 class="subsection"> 5.3.1 Mac OS X/Darwin Status </h3>
3950
 
 
3951
 
<ul class="toc">
3952
 
<li>-
3953
 
target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
3954
 
</li><li>-
3955
 
target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
3956
 
</li><li>-
3957
 
target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1]
3958
 
</li><li>-
3959
 
target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported.
3960
 
</li></ul>
3961
 
 
3962
 
<p>[1] If you're host commpage can be executed by qemu.
3963
 
</p>
3964
 
<hr size="6">
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"> &lt; </a>]</td>
3969
 
<td valign="middle" align="left">[<a href="#SEC75" title="Next section in reading order"> &gt; </a>]</td>
3970
 
<td valign="middle" align="left"> &nbsp; </td>
3971
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
3974
 
<td valign="middle" align="left"> &nbsp; </td>
3975
 
<td valign="middle" align="left"> &nbsp; </td>
3976
 
<td valign="middle" align="left"> &nbsp; </td>
3977
 
<td valign="middle" align="left"> &nbsp; </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>
3982
 
</tr></table>
3983
 
<h3 class="subsection"> 5.3.2 Quick Start </h3>
3984
 
 
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.
3989
 
</p>
3990
 
<ul class="toc">
3991
 
<li> On x86, you can just try to launch any process by using the native
3992
 
libraries:
3993
 
 
3994
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 /bin/ls
3995
 
</pre></td></tr></table>
3996
 
 
3997
 
<p>or to run the ppc version of the executable:
3998
 
</p>
3999
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-ppc /bin/ls
4000
 
</pre></td></tr></table>
4001
 
 
4002
 
</li><li> On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker)
4003
 
are installed:
4004
 
 
4005
 
<table><tr><td>&nbsp;</td><td><pre class="example">qemu-i386 -L /opt/x86_root/ /bin/ls
4006
 
</pre></td></tr></table>
4007
 
 
4008
 
<p><code>-L /opt/x86_root/</code> tells that the dynamic linker (dyld) path is in
4009
 
&lsquo;<tt>/opt/x86_root/usr/bin/dyld</tt>&rsquo;.
4010
 
</p>
4011
 
</li></ul>
4012
 
 
4013
 
<hr size="6">
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"> &lt; </a>]</td>
4018
 
<td valign="middle" align="left">[<a href="#SEC76" title="Next section in reading order"> &gt; </a>]</td>
4019
 
<td valign="middle" align="left"> &nbsp; </td>
4020
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4023
 
<td valign="middle" align="left"> &nbsp; </td>
4024
 
<td valign="middle" align="left"> &nbsp; </td>
4025
 
<td valign="middle" align="left"> &nbsp; </td>
4026
 
<td valign="middle" align="left"> &nbsp; </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>
4031
 
</tr></table>
4032
 
<h3 class="subsection"> 5.3.3 Command line options </h3>
4033
 
 
4034
 
<table><tr><td>&nbsp;</td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
4035
 
</pre></td></tr></table>
4036
 
 
4037
 
<dl compact="compact">
4038
 
<dt> &lsquo;<samp>-h</samp>&rsquo;</dt>
4039
 
<dd><p>Print the help
4040
 
</p></dd>
4041
 
<dt> &lsquo;<samp>-L path</samp>&rsquo;</dt>
4042
 
<dd><p>Set the library root path (default=/)
4043
 
</p></dd>
4044
 
<dt> &lsquo;<samp>-s size</samp>&rsquo;</dt>
4045
 
<dd><p>Set the stack size in bytes (default=524288)
4046
 
</p></dd>
4047
 
</dl>
4048
 
 
4049
 
<p>Debug options:
4050
 
</p>
4051
 
<dl compact="compact">
4052
 
<dt> &lsquo;<samp>-d</samp>&rsquo;</dt>
4053
 
<dd><p>Activate log (logfile=/tmp/qemu.log)
4054
 
</p></dd>
4055
 
<dt> &lsquo;<samp>-p pagesize</samp>&rsquo;</dt>
4056
 
<dd><p>Act as if the host page size was 'pagesize' bytes
4057
 
</p></dd>
4058
 
</dl>
4059
 
 
4060
 
<hr size="6">
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"> &lt; </a>]</td>
4065
 
<td valign="middle" align="left">[<a href="#SEC77" title="Next section in reading order"> &gt; </a>]</td>
4066
 
<td valign="middle" align="left"> &nbsp; </td>
4067
 
<td valign="middle" align="left">[<a href="#SEC65" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4070
 
<td valign="middle" align="left"> &nbsp; </td>
4071
 
<td valign="middle" align="left"> &nbsp; </td>
4072
 
<td valign="middle" align="left"> &nbsp; </td>
4073
 
<td valign="middle" align="left"> &nbsp; </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>
4078
 
</tr></table>
4079
 
<h1 class="chapter"> 6. Compilation from the sources </h1>
4080
 
 
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>&nbsp;&nbsp;</td><td align="left" valign="top">
4083
 
</td></tr>
4084
 
<tr><td align="left" valign="top"><a href="#SEC80">6.2 Windows</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
4085
 
</td></tr>
4086
 
<tr><td align="left" valign="top"><a href="#SEC81">6.3 Cross compilation for Windows with Linux</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
4087
 
</td></tr>
4088
 
<tr><td align="left" valign="top"><a href="#SEC82">6.4 Mac OS X</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
4089
 
</td></tr>
4090
 
</table>
4091
 
 
4092
 
<hr size="6">
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"> &lt; </a>]</td>
4097
 
<td valign="middle" align="left">[<a href="#SEC78" title="Next section in reading order"> &gt; </a>]</td>
4098
 
<td valign="middle" align="left"> &nbsp; </td>
4099
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4102
 
<td valign="middle" align="left"> &nbsp; </td>
4103
 
<td valign="middle" align="left"> &nbsp; </td>
4104
 
<td valign="middle" align="left"> &nbsp; </td>
4105
 
<td valign="middle" align="left"> &nbsp; </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>
4110
 
</tr></table>
4111
 
<h2 class="section"> 6.1 Linux/Unix </h2>
4112
 
 
4113
 
<hr size="6">
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"> &lt; </a>]</td>
4117
 
<td valign="middle" align="left">[<a href="#SEC79" title="Next section in reading order"> &gt; </a>]</td>
4118
 
<td valign="middle" align="left"> &nbsp; </td>
4119
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4122
 
<td valign="middle" align="left"> &nbsp; </td>
4123
 
<td valign="middle" align="left"> &nbsp; </td>
4124
 
<td valign="middle" align="left"> &nbsp; </td>
4125
 
<td valign="middle" align="left"> &nbsp; </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>
4130
 
</tr></table>
4131
 
<h3 class="subsection"> 6.1.1 Compilation </h3>
4132
 
 
4133
 
<p>First you must decompress the sources:
4134
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">cd /tmp
4135
 
tar zxvf qemu-x.y.z.tar.gz
4136
 
cd qemu-x.y.z
4137
 
</pre></td></tr></table>
4138
 
 
4139
 
<p>Then you configure QEMU and build it (usually no options are needed):
4140
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">./configure
4141
 
make
4142
 
</pre></td></tr></table>
4143
 
 
4144
 
<p>Then type as root user:
4145
 
</p><table><tr><td>&nbsp;</td><td><pre class="example">make install
4146
 
</pre></td></tr></table>
4147
 
<p>to install QEMU in &lsquo;<tt>/usr/local</tt>&rsquo;.
4148
 
</p>
4149
 
<hr size="6">
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"> &lt; </a>]</td>
4153
 
<td valign="middle" align="left">[<a href="#SEC80" title="Next section in reading order"> &gt; </a>]</td>
4154
 
<td valign="middle" align="left"> &nbsp; </td>
4155
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4158
 
<td valign="middle" align="left"> &nbsp; </td>
4159
 
<td valign="middle" align="left"> &nbsp; </td>
4160
 
<td valign="middle" align="left"> &nbsp; </td>
4161
 
<td valign="middle" align="left"> &nbsp; </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>
4166
 
</tr></table>
4167
 
<h3 class="subsection"> 6.1.2 GCC version </h3>
4168
 
 
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.
4176
 
</p>
4177
 
<hr size="6">
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"> &lt; </a>]</td>
4182
 
<td valign="middle" align="left">[<a href="#SEC81" title="Next section in reading order"> &gt; </a>]</td>
4183
 
<td valign="middle" align="left"> &nbsp; </td>
4184
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4187
 
<td valign="middle" align="left"> &nbsp; </td>
4188
 
<td valign="middle" align="left"> &nbsp; </td>
4189
 
<td valign="middle" align="left"> &nbsp; </td>
4190
 
<td valign="middle" align="left"> &nbsp; </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>
4195
 
</tr></table>
4196
 
<h2 class="section"> 6.2 Windows </h2>
4197
 
 
4198
 
<ul class="toc">
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.
4202
 
 
4203
 
</li><li> Download
4204
 
the MinGW development library of SDL 1.2.x
4205
 
(&lsquo;<tt>SDL-devel-1.2.x-mingw32.tar.gz</tt>&rsquo;) from
4206
 
<a href="http://www.libsdl.org">http://www.libsdl.org</a>. Unpack it in a temporary place, and
4207
 
unpack the archive &lsquo;<tt>i386-mingw32msvc.tar.gz</tt>&rsquo; in the MinGW tool
4208
 
directory. Edit the &lsquo;<tt>sdl-config</tt>&rsquo; script so that it gives the
4209
 
correct SDL directory when invoked.
4210
 
 
4211
 
</li><li> Extract the current version of QEMU.
4212
 
 
4213
 
</li><li> Start the MSYS shell (file &lsquo;<tt>msys.bat</tt>&rsquo;).
4214
 
 
4215
 
</li><li> Change to the QEMU directory. Launch &lsquo;<tt>./configure</tt>&rsquo; and
4216
 
&lsquo;<tt>make</tt>&rsquo;.  If you have problems using SDL, verify that
4217
 
&lsquo;<tt>sdl-config</tt>&rsquo; can be launched from the MSYS command line.
4218
 
 
4219
 
</li><li> You can install QEMU in &lsquo;<tt>Program Files/Qemu</tt>&rsquo; by typing
4220
 
&lsquo;<tt>make install</tt>&rsquo;. Don't forget to copy &lsquo;<tt>SDL.dll</tt>&rsquo; in
4221
 
&lsquo;<tt>Program Files/Qemu</tt>&rsquo;.
4222
 
 
4223
 
</li></ul>
4224
 
 
4225
 
<hr size="6">
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"> &lt; </a>]</td>
4230
 
<td valign="middle" align="left">[<a href="#SEC82" title="Next section in reading order"> &gt; </a>]</td>
4231
 
<td valign="middle" align="left"> &nbsp; </td>
4232
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4235
 
<td valign="middle" align="left"> &nbsp; </td>
4236
 
<td valign="middle" align="left"> &nbsp; </td>
4237
 
<td valign="middle" align="left"> &nbsp; </td>
4238
 
<td valign="middle" align="left"> &nbsp; </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>
4243
 
</tr></table>
4244
 
<h2 class="section"> 6.3 Cross compilation for Windows with Linux </h2>
4245
 
 
4246
 
<ul class="toc">
4247
 
<li>
4248
 
Install the MinGW cross compilation tools available at
4249
 
<a href="http://www.mingw.org/">http://www.mingw.org/</a>.
4250
 
 
4251
 
</li><li>
4252
 
Install the Win32 version of SDL (<a href="http://www.libsdl.org">http://www.libsdl.org</a>) by
4253
 
unpacking &lsquo;<tt>i386-mingw32msvc.tar.gz</tt>&rsquo;. Set up the PATH environment
4254
 
variable so that &lsquo;<tt>i386-mingw32msvc-sdl-config</tt>&rsquo; can be launched by
4255
 
the QEMU configuration script.
4256
 
 
4257
 
</li><li>
4258
 
Configure QEMU for Windows cross compilation:
4259
 
<table><tr><td>&nbsp;</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 &ndash;cross-prefix. You can also use
4263
 
&ndash;prefix to set the Win32 install path.
4264
 
</p>
4265
 
</li><li> You can install QEMU in the installation directory by typing
4266
 
&lsquo;<tt>make install</tt>&rsquo;. Don't forget to copy &lsquo;<tt>SDL.dll</tt>&rsquo; in the
4267
 
installation directory.
4268
 
 
4269
 
</li></ul>
4270
 
 
4271
 
<p>Note: Currently, Wine does not seem able to launch
4272
 
QEMU for Win32.
4273
 
</p>
4274
 
<hr size="6">
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"> &lt; </a>]</td>
4279
 
<td valign="middle" align="left">[<a href="#SEC83" title="Next section in reading order"> &gt; </a>]</td>
4280
 
<td valign="middle" align="left"> &nbsp; </td>
4281
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </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"> &gt;&gt; </a>]</td>
4284
 
<td valign="middle" align="left"> &nbsp; </td>
4285
 
<td valign="middle" align="left"> &nbsp; </td>
4286
 
<td valign="middle" align="left"> &nbsp; </td>
4287
 
<td valign="middle" align="left"> &nbsp; </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>
4292
 
</tr></table>
4293
 
<h2 class="section"> 6.4 Mac OS X </h2>
4294
 
 
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
4297
 
information.
4298
 
</p>
4299
 
<hr size="6">
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"> &lt; </a>]</td>
4304
 
<td valign="middle" align="left">[ &gt; ]</td>
4305
 
<td valign="middle" align="left"> &nbsp; </td>
4306
 
<td valign="middle" align="left">[<a href="#SEC76" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
4307
 
<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
4308
 
<td valign="middle" align="left">[ &gt;&gt; ]</td>
4309
 
<td valign="middle" align="left"> &nbsp; </td>
4310
 
<td valign="middle" align="left"> &nbsp; </td>
4311
 
<td valign="middle" align="left"> &nbsp; </td>
4312
 
<td valign="middle" align="left"> &nbsp; </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>
4317
 
</tr></table>
4318
 
<h1 class="chapter"> 7. Index </h1>
4319
 
 
4320
 
<hr size="6">
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>
4327
 
</tr></table>
4328
 
<h1>Table of Contents</h1>
4329
 
<div class="contents">
4330
 
 
4331
 
<ul class="toc">
4332
 
  <li><a name="TOC1" href="#SEC1">1. Introduction</a>
4333
 
  <ul class="toc">
4334
 
    <li><a name="TOC2" href="#SEC2">1.1 Features</a></li>
4335
 
  </ul></li>
4336
 
  <li><a name="TOC3" href="#SEC3">2. Installation</a>
4337
 
  <ul class="toc">
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>
4341
 
  </ul></li>
4342
 
  <li><a name="TOC7" href="#SEC7">3. QEMU PC System emulator</a>
4343
 
  <ul class="toc">
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>
4349
 
    <ul class="toc">
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>
4352
 
    </ul></li>
4353
 
    <li><a name="TOC15" href="#SEC15">3.6 Disk Images</a>
4354
 
    <ul class="toc">
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>
4360
 
      <ul class="toc">
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>
4364
 
      </ul></li>
4365
 
      <li><a name="TOC24" href="#SEC24">3.6.6 Virtual FAT disk images</a></li>
4366
 
    </ul></li>
4367
 
    <li><a name="TOC25" href="#SEC25">3.7 Network emulation</a>
4368
 
    <ul class="toc">
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>
4371
 
      <ul class="toc">
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>
4374
 
      </ul></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>
4377
 
    </ul></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>
4380
 
    <ul class="toc">
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>
4383
 
    </ul></li>
4384
 
    <li><a name="TOC36" href="#SEC36">3.10 VNC security</a>
4385
 
    <ul class="toc">
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>
4392
 
      <ul class="toc">
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>
4396
 
      </ul>
4397
 
</li>
4398
 
    </ul></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>
4401
 
    <ul class="toc">
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>
4404
 
      <ul class="toc">
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>
4411
 
      </ul></li>
4412
 
      <li><a name="TOC56" href="#SEC56">3.12.3 MS-DOS and FreeDOS</a>
4413
 
      <ul class="toc">
4414
 
        <li><a name="TOC57" href="#SEC57">3.12.3.1 CPU usage reduction</a></li>
4415
 
      </ul>
4416
 
</li>
4417
 
    </ul>
4418
 
</li>
4419
 
  </ul></li>
4420
 
  <li><a name="TOC58" href="#SEC58">4. QEMU System emulator for non PC targets</a>
4421
 
  <ul class="toc">
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>
4428
 
  </ul></li>
4429
 
  <li><a name="TOC65" href="#SEC65">5. QEMU User space emulator</a>
4430
 
  <ul class="toc">
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>
4433
 
    <ul class="toc">
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>
4438
 
    </ul></li>
4439
 
    <li><a name="TOC72" href="#SEC72">5.3 Mac OS X/Darwin User space emulator</a>
4440
 
    <ul class="toc">
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>
4444
 
    </ul>
4445
 
</li>
4446
 
  </ul></li>
4447
 
  <li><a name="TOC76" href="#SEC76">6. Compilation from the sources</a>
4448
 
  <ul class="toc">
4449
 
    <li><a name="TOC77" href="#SEC77">6.1 Linux/Unix</a>
4450
 
    <ul class="toc">
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>
4453
 
    </ul></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>
4457
 
  </ul></li>
4458
 
  <li><a name="TOC83" href="#SEC83">7. Index</a></li>
4459
 
</ul>
4460
 
</div>
4461
 
<hr size="1">
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>
4468
 
</tr></table>
4469
 
<h1>About This Document</h1>
4470
 
<p>
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>.
4472
 
</p>
4473
 
<p>
4474
 
  The buttons in the navigation panels have the following meaning:
4475
 
</p>
4476
 
<table border="1">
4477
 
  <tr>
4478
 
    <th> Button </th>
4479
 
    <th> Name </th>
4480
 
    <th> Go to </th>
4481
 
    <th> From 1.2.3 go to</th>
4482
 
  </tr>
4483
 
  <tr>
4484
 
    <td align="center"> [ &lt; ] </td>
4485
 
    <td align="center">Back</td>
4486
 
    <td>Previous section in reading order</td>
4487
 
    <td>1.2.2</td>
4488
 
  </tr>
4489
 
  <tr>
4490
 
    <td align="center"> [ &gt; ] </td>
4491
 
    <td align="center">Forward</td>
4492
 
    <td>Next section in reading order</td>
4493
 
    <td>1.2.4</td>
4494
 
  </tr>
4495
 
  <tr>
4496
 
    <td align="center"> [ &lt;&lt; ] </td>
4497
 
    <td align="center">FastBack</td>
4498
 
    <td>Beginning of this chapter or previous chapter</td>
4499
 
    <td>1</td>
4500
 
  </tr>
4501
 
  <tr>
4502
 
    <td align="center"> [ Up ] </td>
4503
 
    <td align="center">Up</td>
4504
 
    <td>Up section</td>
4505
 
    <td>1.2</td>
4506
 
  </tr>
4507
 
  <tr>
4508
 
    <td align="center"> [ &gt;&gt; ] </td>
4509
 
    <td align="center">FastForward</td>
4510
 
    <td>Next chapter</td>
4511
 
    <td>2</td>
4512
 
  </tr>
4513
 
  <tr>
4514
 
    <td align="center"> [Top] </td>
4515
 
    <td align="center">Top</td>
4516
 
    <td>Cover (top) of document</td>
4517
 
    <td> &nbsp; </td>
4518
 
  </tr>
4519
 
  <tr>
4520
 
    <td align="center"> [Contents] </td>
4521
 
    <td align="center">Contents</td>
4522
 
    <td>Table of contents</td>
4523
 
    <td> &nbsp; </td>
4524
 
  </tr>
4525
 
  <tr>
4526
 
    <td align="center"> [Index] </td>
4527
 
    <td align="center">Index</td>
4528
 
    <td>Index</td>
4529
 
    <td> &nbsp; </td>
4530
 
  </tr>
4531
 
  <tr>
4532
 
    <td align="center"> [ ? ] </td>
4533
 
    <td align="center">About</td>
4534
 
    <td>About (help)</td>
4535
 
    <td> &nbsp; </td>
4536
 
  </tr>
4537
 
</table>
4538
 
 
4539
 
<p>
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:
4541
 
</p>
4542
 
 
4543
 
<ul>
4544
 
  <li> 1. Section One
4545
 
    <ul>
4546
 
      <li>1.1 Subsection One-One
4547
 
        <ul>
4548
 
          <li>...</li>
4549
 
        </ul>
4550
 
      </li>
4551
 
      <li>1.2 Subsection One-Two
4552
 
        <ul>
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 &nbsp; &nbsp;
4556
 
            <strong>&lt;== Current Position </strong></li>
4557
 
          <li>1.2.4 Subsubsection One-Two-Four</li>
4558
 
        </ul>
4559
 
      </li>
4560
 
      <li>1.3 Subsection One-Three
4561
 
        <ul>
4562
 
          <li>...</li>
4563
 
        </ul>
4564
 
      </li>
4565
 
      <li>1.4 Subsection One-Four</li>
4566
 
    </ul>
4567
 
  </li>
4568
 
</ul>
4569
 
 
4570
 
<hr size="1">
4571
 
<p>
4572
 
 <font size="-1">
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>.
4574
 
 </font>
4575
 
 <br>
4576
 
 
4577
 
</p>
4578
 
</body>
4579
 
</html>