|
|
1.1 root 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2: <html>
3: <!-- Created on May, 1 2009 by texi2html 1.78 -->
4: <!--
5: Written by: Lionel Cons <[email protected]> (original author)
6: Karl Berry <[email protected]>
7: Olaf Bachmann <[email protected]>
8: and many others.
9: Maintained by: Many creative people.
10: Send bugs and suggestions to <[email protected]>
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="#SEC92" 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> </td><td align="left" valign="top">
57: </td></tr>
58: <tr><td align="left" valign="top"><a href="#SEC3">2. Installation</a></td><td> </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> </td><td align="left" valign="top">
61: </td></tr>
62: <tr><td align="left" valign="top"><a href="#SEC63">4. QEMU System emulator for non PC targets</a></td><td> </td><td align="left" valign="top">
63: </td></tr>
64: <tr><td align="left" valign="top"><a href="#SEC70">5. QEMU User space emulator</a></td><td> </td><td align="left" valign="top">
65: </td></tr>
66: <tr><td align="left" valign="top"><a href="#SEC85">6. Compilation from the sources</a></td><td> </td><td align="left" valign="top"></td></tr>
67: <tr><td align="left" valign="top"><a href="#SEC92">7. Index</a></td><td> </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"> < </a>]</td>
77: <td valign="middle" align="left">[<a href="#SEC2" title="Next section in reading order"> > </a>]</td>
78: <td valign="middle" align="left"> </td>
79: <td valign="middle" align="left">[ << ]</td>
80: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
81: <td valign="middle" align="left">[<a href="#SEC3" title="Next chapter"> >> </a>]</td>
82: <td valign="middle" align="left"> </td>
83: <td valign="middle" align="left"> </td>
84: <td valign="middle" align="left"> </td>
85: <td valign="middle" align="left"> </td>
86: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
87: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
88: <td valign="middle" align="left">[<a href="#SEC92" 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> </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"> < </a>]</td>
102: <td valign="middle" align="left">[<a href="#SEC3" title="Next section in reading order"> > </a>]</td>
103: <td valign="middle" align="left"> </td>
104: <td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td>
105: <td valign="middle" align="left">[<a href="#SEC1" title="Up section"> Up </a>]</td>
106: <td valign="middle" align="left">[<a href="#SEC3" title="Next chapter"> >> </a>]</td>
107: <td valign="middle" align="left"> </td>
108: <td valign="middle" align="left"> </td>
109: <td valign="middle" align="left"> </td>
110: <td valign="middle" align="left"> </td>
111: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
112: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
113: <td valign="middle" align="left">[<a href="#SEC92" 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 Beige PowerMac (PowerPC processor)
147: </li><li> Mac99 PowerMac (PowerPC processor, in progress)
148: </li><li> Sun4m/Sun4c/Sun4d (32-bit Sparc processor)
149: </li><li> Sun4u/Sun4v (64-bit Sparc processor, in progress)
150: </li><li> Malta board (32-bit and 64-bit MIPS processors)
151: </li><li> MIPS Magnum (64-bit MIPS processor)
152: </li><li> ARM Integrator/CP (ARM)
153: </li><li> ARM Versatile baseboard (ARM)
154: </li><li> ARM RealView Emulation baseboard (ARM)
155: </li><li> Spitz, Akita, Borzoi, Terrier and Tosa PDAs (PXA270 processor)
156: </li><li> Luminary Micro LM3S811EVB (ARM Cortex-M3)
157: </li><li> Luminary Micro LM3S6965EVB (ARM Cortex-M3)
158: </li><li> Freescale MCF5208EVB (ColdFire V2).
159: </li><li> Arnewsh MCF5206 evaluation board (ColdFire V2).
160: </li><li> Palm Tungsten|E PDA (OMAP310 processor)
161: </li><li> N800 and N810 tablets (OMAP2420 processor)
162: </li><li> MusicPal (MV88W8618 ARM processor)
163: </li><li> Gumstix "Connex" and "Verdex" motherboards (PXA255/270).
164: </li><li> Siemens SX1 smartphone (OMAP310 processor)
165: </li></ul>
166:
167: <p>For user emulation, x86, PowerPC, ARM, 32-bit MIPS, Sparc32/64 and ColdFire(m68k) CPUs are supported.
168: </p>
169: <hr size="6">
170: <a name="Installation"></a>
171: <a name="SEC3"></a>
172: <table cellpadding="1" cellspacing="1" border="0">
173: <tr><td valign="middle" align="left">[<a href="#SEC2" title="Previous section in reading order"> < </a>]</td>
174: <td valign="middle" align="left">[<a href="#SEC4" title="Next section in reading order"> > </a>]</td>
175: <td valign="middle" align="left"> </td>
176: <td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td>
177: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
178: <td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
179: <td valign="middle" align="left"> </td>
180: <td valign="middle" align="left"> </td>
181: <td valign="middle" align="left"> </td>
182: <td valign="middle" align="left"> </td>
183: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
184: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
185: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
186: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
187: </tr></table>
188: <h1 class="chapter"> 2. Installation </h1>
189:
190: <p>If you want to compile QEMU yourself, see <a href="#SEC85">Compilation from the sources</a>.
191: </p>
192: <table class="menu" border="0" cellspacing="0">
193: <tr><td align="left" valign="top"><a href="#SEC4">2.1 Linux</a></td><td> </td><td align="left" valign="top"></td></tr>
194: <tr><td align="left" valign="top"><a href="#SEC5">2.2 Windows</a></td><td> </td><td align="left" valign="top"></td></tr>
195: <tr><td align="left" valign="top"><a href="#SEC6">2.3 Mac OS X</a></td><td> </td><td align="left" valign="top"> Macintosh
196: </td></tr>
197: </table>
198:
199: <hr size="6">
200: <a name="install_005flinux"></a>
201: <a name="SEC4"></a>
202: <table cellpadding="1" cellspacing="1" border="0">
203: <tr><td valign="middle" align="left">[<a href="#SEC3" title="Previous section in reading order"> < </a>]</td>
204: <td valign="middle" align="left">[<a href="#SEC5" title="Next section in reading order"> > </a>]</td>
205: <td valign="middle" align="left"> </td>
206: <td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
207: <td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
208: <td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
209: <td valign="middle" align="left"> </td>
210: <td valign="middle" align="left"> </td>
211: <td valign="middle" align="left"> </td>
212: <td valign="middle" align="left"> </td>
213: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
214: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
215: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
216: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
217: </tr></table>
218: <h2 class="section"> 2.1 Linux </h2>
219:
220: <p>If a precompiled package is available for your distribution - you just
221: have to install it. Otherwise, see <a href="#SEC85">Compilation from the sources</a>.
222: </p>
223: <hr size="6">
224: <a name="install_005fwindows"></a>
225: <a name="SEC5"></a>
226: <table cellpadding="1" cellspacing="1" border="0">
227: <tr><td valign="middle" align="left">[<a href="#SEC4" title="Previous section in reading order"> < </a>]</td>
228: <td valign="middle" align="left">[<a href="#SEC6" title="Next section in reading order"> > </a>]</td>
229: <td valign="middle" align="left"> </td>
230: <td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
231: <td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
232: <td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
233: <td valign="middle" align="left"> </td>
234: <td valign="middle" align="left"> </td>
235: <td valign="middle" align="left"> </td>
236: <td valign="middle" align="left"> </td>
237: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
238: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
239: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
240: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
241: </tr></table>
242: <h2 class="section"> 2.2 Windows </h2>
243:
244: <p>Download the experimental binary installer at
245: <a href="http://www.free.oszoo.org/download.html">http://www.free.oszoo.org/download.html</a>.
246: </p>
247: <hr size="6">
248: <a name="install_005fmac"></a>
249: <a name="SEC6"></a>
250: <table cellpadding="1" cellspacing="1" border="0">
251: <tr><td valign="middle" align="left">[<a href="#SEC5" title="Previous section in reading order"> < </a>]</td>
252: <td valign="middle" align="left">[<a href="#SEC7" title="Next section in reading order"> > </a>]</td>
253: <td valign="middle" align="left"> </td>
254: <td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
255: <td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td>
256: <td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td>
257: <td valign="middle" align="left"> </td>
258: <td valign="middle" align="left"> </td>
259: <td valign="middle" align="left"> </td>
260: <td valign="middle" align="left"> </td>
261: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
262: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
263: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
264: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
265: </tr></table>
266: <h2 class="section"> 2.3 Mac OS X </h2>
267:
268: <p>Download the experimental binary installer at
269: <a href="http://www.free.oszoo.org/download.html">http://www.free.oszoo.org/download.html</a>.
270: </p>
271: <hr size="6">
272: <a name="QEMU-PC-System-emulator"></a>
273: <a name="SEC7"></a>
274: <table cellpadding="1" cellspacing="1" border="0">
275: <tr><td valign="middle" align="left">[<a href="#SEC6" title="Previous section in reading order"> < </a>]</td>
276: <td valign="middle" align="left">[<a href="#SEC8" title="Next section in reading order"> > </a>]</td>
277: <td valign="middle" align="left"> </td>
278: <td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td>
279: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
280: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
281: <td valign="middle" align="left"> </td>
282: <td valign="middle" align="left"> </td>
283: <td valign="middle" align="left"> </td>
284: <td valign="middle" align="left"> </td>
285: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
286: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
287: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
288: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
289: </tr></table>
290: <h1 class="chapter"> 3. QEMU PC System emulator </h1>
291:
292: <table class="menu" border="0" cellspacing="0">
293: <tr><td align="left" valign="top"><a href="#SEC8">3.1 Introduction</a></td><td> </td><td align="left" valign="top"></td></tr>
294: <tr><td align="left" valign="top"><a href="#SEC9">3.2 Quick Start</a></td><td> </td><td align="left" valign="top"></td></tr>
295: <tr><td align="left" valign="top"><a href="#SEC10">3.3 Invocation</a></td><td> </td><td align="left" valign="top"></td></tr>
296: <tr><td align="left" valign="top"><a href="#SEC11">3.4 Keys</a></td><td> </td><td align="left" valign="top"></td></tr>
297: <tr><td align="left" valign="top"><a href="#SEC12">3.5 QEMU Monitor</a></td><td> </td><td align="left" valign="top"></td></tr>
298: <tr><td align="left" valign="top"><a href="#SEC15">3.6 Disk Images</a></td><td> </td><td align="left" valign="top"></td></tr>
299: <tr><td align="left" valign="top"><a href="#SEC27">3.7 Network emulation</a></td><td> </td><td align="left" valign="top"></td></tr>
300: <tr><td align="left" valign="top"><a href="#SEC34">3.8 Direct Linux Boot</a></td><td> </td><td align="left" valign="top"></td></tr>
301: <tr><td align="left" valign="top"><a href="#SEC35">3.9 USB emulation</a></td><td> </td><td align="left" valign="top"></td></tr>
302: <tr><td align="left" valign="top"><a href="#SEC38">3.10 VNC security</a></td><td> </td><td align="left" valign="top"></td></tr>
303: <tr><td align="left" valign="top"><a href="#SEC51">3.11 GDB usage</a></td><td> </td><td align="left" valign="top"></td></tr>
304: <tr><td align="left" valign="top"><a href="#SEC52">3.12 Target OS specific information</a></td><td> </td><td align="left" valign="top"></td></tr>
305: </table>
306:
307: <hr size="6">
308: <a name="pcsys_005fintroduction"></a>
309: <a name="SEC8"></a>
310: <table cellpadding="1" cellspacing="1" border="0">
311: <tr><td valign="middle" align="left">[<a href="#SEC7" title="Previous section in reading order"> < </a>]</td>
312: <td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> > </a>]</td>
313: <td valign="middle" align="left"> </td>
314: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
315: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
316: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
317: <td valign="middle" align="left"> </td>
318: <td valign="middle" align="left"> </td>
319: <td valign="middle" align="left"> </td>
320: <td valign="middle" align="left"> </td>
321: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
322: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
323: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
324: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
325: </tr></table>
326: <h2 class="section"> 3.1 Introduction </h2>
327:
328:
329: <p>The QEMU PC System emulator simulates the
330: following peripherals:
331: </p>
332: <ul class="toc">
333: <li>-
334: i440FX host PCI bridge and PIIX3 PCI to ISA bridge
335: </li><li>-
336: Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA
337: extensions (hardware level, including all non standard modes).
338: </li><li>-
339: PS/2 mouse and keyboard
340: </li><li>-
341: 2 PCI IDE interfaces with hard disk and CD-ROM support
342: </li><li>-
343: Floppy disk
344: </li><li>-
345: PCI/ISA PCI network adapters
346: </li><li>-
347: Serial ports
348: </li><li>-
349: Creative SoundBlaster 16 sound card
350: </li><li>-
351: ENSONIQ AudioPCI ES1370 sound card
352: </li><li>-
353: Intel 82801AA AC97 Audio compatible sound card
354: </li><li>-
355: Adlib(OPL2) - Yamaha YM3812 compatible chip
356: </li><li>-
357: Gravis Ultrasound GF1 sound card
358: </li><li>-
359: CS4231A compatible sound card
360: </li><li>-
361: PCI UHCI USB controller and a virtual USB hub.
362: </li></ul>
363:
364: <p>SMP is supported with up to 255 CPUs.
365: </p>
366: <p>Note that adlib, gus and cs4231a are only available when QEMU was
367: configured with –audio-card-list option containing the name(s) of
368: required card(s).
369: </p>
370: <p>QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
371: VGA BIOS.
372: </p>
373: <p>QEMU uses YM3812 emulation by Tatsuyuki Satoh.
374: </p>
375: <p>QEMU uses GUS emulation(GUSEMU32 <a href="http://www.deinmeister.de/gusemu/">http://www.deinmeister.de/gusemu/</a>)
376: by Tibor "TS" Schütz.
377: </p>
378: <p>CS4231A is the chip used in Windows Sound System and GUSMAX products
379: </p>
380:
381: <hr size="6">
382: <a name="pcsys_005fquickstart"></a>
383: <a name="SEC9"></a>
384: <table cellpadding="1" cellspacing="1" border="0">
385: <tr><td valign="middle" align="left">[<a href="#SEC8" title="Previous section in reading order"> < </a>]</td>
386: <td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> > </a>]</td>
387: <td valign="middle" align="left"> </td>
388: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
389: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
390: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
391: <td valign="middle" align="left"> </td>
392: <td valign="middle" align="left"> </td>
393: <td valign="middle" align="left"> </td>
394: <td valign="middle" align="left"> </td>
395: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
396: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
397: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
398: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
399: </tr></table>
400: <h2 class="section"> 3.2 Quick Start </h2>
401:
402: <p>Download and uncompress the linux image (‘<tt>linux.img</tt>’) and type:
403: </p>
404: <table><tr><td> </td><td><pre class="example">qemu linux.img
405: </pre></td></tr></table>
406:
407: <p>Linux should boot and give you a prompt.
408: </p>
409: <hr size="6">
410: <a name="sec_005finvocation"></a>
411: <a name="SEC10"></a>
412: <table cellpadding="1" cellspacing="1" border="0">
413: <tr><td valign="middle" align="left">[<a href="#SEC9" title="Previous section in reading order"> < </a>]</td>
414: <td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> > </a>]</td>
415: <td valign="middle" align="left"> </td>
416: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
417: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
418: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
419: <td valign="middle" align="left"> </td>
420: <td valign="middle" align="left"> </td>
421: <td valign="middle" align="left"> </td>
422: <td valign="middle" align="left"> </td>
423: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
424: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
425: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
426: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
427: </tr></table>
428: <h2 class="section"> 3.3 Invocation </h2>
429:
430: <table><tr><td> </td><td><pre class="example">usage: qemu [options] [<var>disk_image</var>]
431: </pre></td></tr></table>
432:
433: <p><var>disk_image</var> is a raw hard disk image for IDE hard disk 0. Some
434: targets do not need a disk image.
435: </p>
436: <p>Standard options:
437: </p><dl compact="compact">
438: <dt> ‘<samp>-h</samp>’</dt>
439: <dd><p>Display help and exit
440: </p></dd>
441: <dt> ‘<samp>-version</samp>’</dt>
442: <dd><p>Display version information and exit
443: </p></dd>
444: <dt> ‘<samp>-M <var>machine</var></samp>’</dt>
445: <dd><p>Select the emulated <var>machine</var> (<code>-M ?</code> for list)
446: </p></dd>
447: <dt> ‘<samp>-cpu <var>model</var></samp>’</dt>
448: <dd><p>Select CPU model (-cpu ? for list and additional feature selection)
449: </p></dd>
450: <dt> ‘<samp>-smp <var>n</var></samp>’</dt>
451: <dd><p>Simulate an SMP system with <var>n</var> CPUs. On the PC target, up to 255
452: CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
453: to 4.
454: </p></dd>
455: <dt> ‘<samp>-numa <var>opts</var></samp>’</dt>
456: <dd><p>Simulate a multi node NUMA system. If mem and cpus are omitted, resources
457: are split equally.
458: </p></dd>
459: <dt> ‘<samp>-fda <var>file</var></samp>’</dt>
460: <dt> ‘<samp>-fdb <var>file</var></samp>’</dt>
461: <dd><p>Use <var>file</var> as floppy disk 0/1 image (see section <a href="#SEC15">Disk Images</a>). You can
462: use the host floppy by using ‘<tt>/dev/fd0</tt>’ as filename (see section <a href="#SEC21">Using host drives</a>).
463: </p></dd>
464: <dt> ‘<samp>-hda <var>file</var></samp>’</dt>
465: <dt> ‘<samp>-hdb <var>file</var></samp>’</dt>
466: <dt> ‘<samp>-hdc <var>file</var></samp>’</dt>
467: <dt> ‘<samp>-hdd <var>file</var></samp>’</dt>
468: <dd><p>Use <var>file</var> as hard disk 0, 1, 2 or 3 image (see section <a href="#SEC15">Disk Images</a>).
469: </p></dd>
470: <dt> ‘<samp>-cdrom <var>file</var></samp>’</dt>
471: <dd><p>Use <var>file</var> as CD-ROM image (you cannot use ‘<samp>-hdc</samp>’ and
472: ‘<samp>-cdrom</samp>’ at the same time). You can use the host CD-ROM by
473: using ‘<tt>/dev/cdrom</tt>’ as filename (see section <a href="#SEC21">Using host drives</a>).
474: </p></dd>
475: <dt> ‘<samp>-drive <var>option</var>[,<var>option</var>[,<var>option</var>[,...]]]</samp>’</dt>
476: <dd>
477: <p>Define a new drive. Valid options are:
478: </p>
479: <dl compact="compact">
480: <dt> <code>file=<var>file</var></code></dt>
481: <dd><p>This option defines which disk image (see section <a href="#SEC15">Disk Images</a>) to use with
482: this drive. If the filename contains comma, you must double it
483: (for instance, "file=my,,file" to use file "my,file").
484: </p></dd>
485: <dt> <code>if=<var>interface</var></code></dt>
486: <dd><p>This option defines on which type on interface the drive is connected.
487: Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
488: </p></dd>
489: <dt> <code>bus=<var>bus</var>,unit=<var>unit</var></code></dt>
490: <dd><p>These options define where is connected the drive by defining the bus number and
491: the unit id.
492: </p></dd>
493: <dt> <code>index=<var>index</var></code></dt>
494: <dd><p>This option defines where is connected the drive by using an index in the list
495: of available connectors of a given interface type.
496: </p></dd>
497: <dt> <code>media=<var>media</var></code></dt>
498: <dd><p>This option defines the type of the media: disk or cdrom.
499: </p></dd>
500: <dt> <code>cyls=<var>c</var>,heads=<var>h</var>,secs=<var>s</var>[,trans=<var>t</var>]</code></dt>
501: <dd><p>These options have the same definition as they have in ‘<samp>-hdachs</samp>’.
502: </p></dd>
503: <dt> <code>snapshot=<var>snapshot</var></code></dt>
504: <dd><p><var>snapshot</var> is "on" or "off" and allows to enable snapshot for given drive (see ‘<samp>-snapshot</samp>’).
505: </p></dd>
506: <dt> <code>cache=<var>cache</var></code></dt>
507: <dd><p><var>cache</var> is "none", "writeback", or "writethrough" and controls how the host cache is used to access block data.
508: </p></dd>
509: <dt> <code>format=<var>format</var></code></dt>
510: <dd><p>Specify which disk <var>format</var> will be used rather than detecting
511: the format. Can be used to specifiy format=raw to avoid interpreting
512: an untrusted format header.
513: </p></dd>
514: <dt> <code>serial=<var>serial</var></code></dt>
515: <dd><p>This option specifies the serial number to assign to the device.
516: </p></dd>
517: </dl>
518:
519: <p>By default, writethrough caching is used for all block device. This means that
520: the host page cache will be used to read and write data but write notification
521: will be sent to the guest only when the data has been reported as written by
522: the storage subsystem.
523: </p>
524: <p>Writeback caching will report data writes as completed as soon as the data is
525: present in the host page cache. This is safe as long as you trust your host.
526: If your host crashes or loses power, then the guest may experience data
527: corruption. When using the ‘<samp>-snapshot</samp>’ option, writeback caching is
528: used by default.
529: </p>
530: <p>The host page can be avoided entirely with ‘<samp>cache=none</samp>’. This will
531: attempt to do disk IO directly to the guests memory. QEMU may still perform
532: an internal copy of the data.
533: </p>
534: <p>Some block drivers perform badly with ‘<samp>cache=writethrough</samp>’, most notably,
535: qcow2. If performance is more important than correctness,
536: ‘<samp>cache=writeback</samp>’ should be used with qcow2. By default, if no explicit
537: caching is specified for a qcow2 disk image, ‘<samp>cache=writeback</samp>’ will be
538: used. For all other disk types, ‘<samp>cache=writethrough</samp>’ is the default.
539: </p>
540: <p>Instead of ‘<samp>-cdrom</samp>’ you can use:
541: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=file,index=2,media=cdrom
542: </pre></td></tr></table>
543:
544: <p>Instead of ‘<samp>-hda</samp>’, ‘<samp>-hdb</samp>’, ‘<samp>-hdc</samp>’, ‘<samp>-hdd</samp>’, you can
545: use:
546: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=file,index=0,media=disk
547: qemu -drive file=file,index=1,media=disk
548: qemu -drive file=file,index=2,media=disk
549: qemu -drive file=file,index=3,media=disk
550: </pre></td></tr></table>
551:
552: <p>You can connect a CDROM to the slave of ide0:
553: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=file,if=ide,index=1,media=cdrom
554: </pre></td></tr></table>
555:
556: <p>If you don't specify the "file=" argument, you define an empty drive:
557: </p><table><tr><td> </td><td><pre class="example">qemu -drive if=ide,index=1,media=cdrom
558: </pre></td></tr></table>
559:
560: <p>You can connect a SCSI disk with unit ID 6 on the bus #0:
561: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=file,if=scsi,bus=0,unit=6
562: </pre></td></tr></table>
563:
564: <p>Instead of ‘<samp>-fda</samp>’, ‘<samp>-fdb</samp>’, you can use:
565: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=file,index=0,if=floppy
566: qemu -drive file=file,index=1,if=floppy
567: </pre></td></tr></table>
568:
569: <p>By default, <var>interface</var> is "ide" and <var>index</var> is automatically
570: incremented:
571: </p><table><tr><td> </td><td><pre class="example">qemu -drive file=a -drive file=b"
572: </pre></td></tr></table>
573: <p>is interpreted like:
574: </p><table><tr><td> </td><td><pre class="example">qemu -hda a -hdb b
575: </pre></td></tr></table>
576:
577: </dd>
578: <dt> ‘<samp>-mtdblock file</samp>’</dt>
579: <dd><p>Use 'file' as on-board Flash memory image.
580: </p></dd>
581: <dt> ‘<samp>-sd file</samp>’</dt>
582: <dd><p>Use 'file' as SecureDigital card image.
583: </p></dd>
584: <dt> ‘<samp>-pflash file</samp>’</dt>
585: <dd><p>Use 'file' as a parallel flash image.
586: </p></dd>
587: <dt> ‘<samp>-boot [a|c|d|n]</samp>’</dt>
588: <dd><p>Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n). Hard disk boot
589: is the default.
590: </p></dd>
591: <dt> ‘<samp>-snapshot</samp>’</dt>
592: <dd><p>Write to temporary files instead of disk image files. In this case,
593: the raw disk image you use is not written back. You can however force
594: the write back by pressing <C-a s> (see section <a href="#SEC15">Disk Images</a>).
595: </p></dd>
596: <dt> ‘<samp>-m <var>megs</var></samp>’</dt>
597: <dd><p>Set virtual RAM size to <var>megs</var> megabytes. Default is 128 MiB. Optionally,
598: a suffix of “M” or “G” can be used to signify a value in megabytes or
599: gigabytes respectively.
600: </p></dd>
601: <dt> ‘<samp>-k <var>language</var></samp>’</dt>
602: <dd>
603: <p>Use keyboard layout <var>language</var> (for example <code>fr</code> for
604: French). This option is only needed where it is not easy to get raw PC
605: keycodes (e.g. on Macs, with some X11 servers or with a VNC
606: display). You don't normally need to use it on PC/Linux or PC/Windows
607: hosts.
608: </p>
609: <p>The available layouts are:
610: </p><table><tr><td> </td><td><pre class="example">ar de-ch es fo fr-ca hu ja mk no pt-br sv
611: da en-gb et fr fr-ch is lt nl pl ru th
612: de en-us fi fr-be hr it lv nl-be pt sl tr
613: </pre></td></tr></table>
614:
615: <p>The default is <code>en-us</code>.
616: </p></dd>
617: <dt> ‘<samp>-audio-help</samp>’</dt>
618: <dd>
619: <p>Will show the audio subsystem help: list of drivers, tunable
620: parameters.
621: </p></dd>
622: <dt> ‘<samp>-soundhw <var>card1</var>[,<var>card2</var>,...] or -soundhw all</samp>’</dt>
623: <dd>
624: <p>Enable audio and selected sound hardware. Use ? to print all
625: available sound hardware.
626: </p>
627: <table><tr><td> </td><td><pre class="example">qemu -soundhw sb16,adlib disk.img
628: qemu -soundhw es1370 disk.img
629: qemu -soundhw ac97 disk.img
630: qemu -soundhw all disk.img
631: qemu -soundhw ?
632: </pre></td></tr></table>
633:
634: <p>Note that Linux's i810_audio OSS kernel (for AC97) module might
635: require manually specifying clocking.
636: </p>
637: <table><tr><td> </td><td><pre class="example">modprobe i810_audio clocking=48000
638: </pre></td></tr></table>
639: </dd>
640: </dl>
641: <p>USB options:
642: </p><dl compact="compact">
643: <dt> ‘<samp>-usb</samp>’</dt>
644: <dd><p>Enable the USB driver (will be the default soon)
645: </p>
646: </dd>
647: <dt> ‘<samp>-usbdevice <var>devname</var></samp>’</dt>
648: <dd><p>Add the USB device <var>devname</var>. See section <a href="#SEC36">Connecting USB devices</a>.
649: </p>
650: <dl compact="compact">
651: <dt> <code>mouse</code></dt>
652: <dd><p>Virtual Mouse. This will override the PS/2 mouse emulation when activated.
653: </p>
654: </dd>
655: <dt> <code>tablet</code></dt>
656: <dd><p>Pointer device that uses absolute coordinates (like a touchscreen). This
657: means qemu is able to report the mouse position without having to grab the
658: mouse. Also overrides the PS/2 mouse emulation when activated.
659: </p>
660: </dd>
661: <dt> <code>disk:[format=<var>format</var>]:file</code></dt>
662: <dd><p>Mass storage device based on file. The optional <var>format</var> argument
663: will be used rather than detecting the format. Can be used to specifiy
664: format=raw to avoid interpreting an untrusted format header.
665: </p>
666: </dd>
667: <dt> <code>host:bus.addr</code></dt>
668: <dd><p>Pass through the host device identified by bus.addr (Linux only).
669: </p>
670: </dd>
671: <dt> <code>host:vendor_id:product_id</code></dt>
672: <dd><p>Pass through the host device identified by vendor_id:product_id (Linux only).
673: </p>
674: </dd>
675: <dt> <code>serial:[vendorid=<var>vendor_id</var>][,productid=<var>product_id</var>]:<var>dev</var></code></dt>
676: <dd><p>Serial converter to host character device <var>dev</var>, see <code>-serial</code> for the
677: available devices.
678: </p>
679: </dd>
680: <dt> <code>braille</code></dt>
681: <dd><p>Braille device. This will use BrlAPI to display the braille output on a real
682: or fake device.
683: </p>
684: </dd>
685: <dt> <code>net:options</code></dt>
686: <dd><p>Network adapter that supports CDC ethernet and RNDIS protocols.
687: </p>
688: </dd>
689: </dl>
690: </dd>
691: <dt> ‘<samp>-name <var>name</var></samp>’</dt>
692: <dd><p>Sets the <var>name</var> of the guest.
693: This name will be displayed in the SDL window caption.
694: The <var>name</var> will also be used for the VNC server.
695: </p></dd>
696: <dt> ‘<samp>-uuid <var>uuid</var></samp>’</dt>
697: <dd><p>Set system UUID.
698: </p></dd>
699: </dl>
700:
701: <p>Display options:
702: </p><dl compact="compact">
703: <dt> ‘<samp>-nographic</samp>’</dt>
704: <dd>
705: <p>Normally, QEMU uses SDL to display the VGA output. With this option,
706: you can totally disable graphical output so that QEMU is a simple
707: command line application. The emulated serial port is redirected on
708: the console. Therefore, you can still use QEMU to debug a Linux kernel
709: with a serial console.
710: </p></dd>
711: <dt> ‘<samp>-curses</samp>’</dt>
712: <dd>
713: <p>Normally, QEMU uses SDL to display the VGA output. With this option,
714: QEMU can display the VGA output when in text mode using a
715: curses/ncurses interface. Nothing is displayed in graphical mode.
716: </p></dd>
717: <dt> ‘<samp>-no-frame</samp>’</dt>
718: <dd>
719: <p>Do not use decorations for SDL windows and start them using the whole
720: available screen space. This makes the using QEMU in a dedicated desktop
721: workspace more convenient.
722: </p></dd>
723: <dt> ‘<samp>-alt-grab</samp>’</dt>
724: <dd>
725: <p>Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt).
726: </p></dd>
727: <dt> ‘<samp>-no-quit</samp>’</dt>
728: <dd>
729: <p>Disable SDL window close capability.
730: </p></dd>
731: <dt> ‘<samp>-sdl</samp>’</dt>
732: <dd>
733: <p>Enable SDL.
734: </p></dd>
735: <dt> ‘<samp>-portrait</samp>’</dt>
736: <dd>
737: <p>Rotate graphical output 90 deg left (only PXA LCD).
738: </p></dd>
739: <dt> ‘<samp>-vga <var>type</var></samp>’</dt>
740: <dd><p>Select type of VGA card to emulate. Valid values for <var>type</var> are
741: </p><dl compact="compact">
742: <dt> <code>cirrus</code></dt>
743: <dd><p>Cirrus Logic GD5446 Video card. All Windows versions starting from
744: Windows 95 should recognize and use this graphic card. For optimal
745: performances, use 16 bit color depth in the guest and the host OS.
746: (This one is the default)
747: </p></dd>
748: <dt> <code>std</code></dt>
749: <dd><p>Standard VGA card with Bochs VBE extensions. If your guest OS
750: supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
751: to use high resolution modes (>= 1280x1024x16) then you should use
752: this option.
753: </p></dd>
754: <dt> <code>vmware</code></dt>
755: <dd><p>VMWare SVGA-II compatible adapter. Use it if you have sufficiently
756: recent XFree86/XOrg server or Windows guest with a driver for this
757: card.
758: </p></dd>
759: <dt> <code>none</code></dt>
760: <dd><p>Disable VGA card.
761: </p></dd>
762: </dl>
763: </dd>
764: <dt> ‘<samp>-full-screen</samp>’</dt>
765: <dd><p>Start in full screen.
766: </p></dd>
767: <dt> ‘<samp>-vnc <var>display</var>[,<var>option</var>[,<var>option</var>[,...]]]</samp>’</dt>
768: <dd>
769: <p>Normally, QEMU uses SDL to display the VGA output. With this option,
770: you can have QEMU listen on VNC display <var>display</var> and redirect the VGA
771: display over the VNC session. It is very useful to enable the usb
772: tablet device when using this option (option ‘<samp>-usbdevice
773: tablet</samp>’). When using the VNC display, you must use the ‘<samp>-k</samp>’
774: parameter to set the keyboard layout if you are not using en-us. Valid
775: syntax for the <var>display</var> is
776: </p>
777: <dl compact="compact">
778: <dt> <code><var>host</var>:<var>d</var></code></dt>
779: <dd>
780: <p>TCP connections will only be allowed from <var>host</var> on display <var>d</var>.
781: By convention the TCP port is 5900+<var>d</var>. Optionally, <var>host</var> can
782: be omitted in which case the server will accept connections from any host.
783: </p>
784: </dd>
785: <dt> <code><code>unix</code>:<var>path</var></code></dt>
786: <dd>
787: <p>Connections will be allowed over UNIX domain sockets where <var>path</var> is the
788: location of a unix socket to listen for connections on.
789: </p>
790: </dd>
791: <dt> <code>none</code></dt>
792: <dd>
793: <p>VNC is initialized but not started. The monitor <code>change</code> command
794: can be used to later start the VNC server.
795: </p>
796: </dd>
797: </dl>
798:
799: <p>Following the <var>display</var> value there may be one or more <var>option</var> flags
800: separated by commas. Valid options are
801: </p>
802: <dl compact="compact">
803: <dt> <code>reverse</code></dt>
804: <dd>
805: <p>Connect to a listening VNC client via a “reverse” connection. The
806: client is specified by the <var>display</var>. For reverse network
807: connections (<var>host</var>:<var>d</var>,<code>reverse</code>), the <var>d</var> argument
808: is a TCP port number, not a display number.
809: </p>
810: </dd>
811: <dt> <code>password</code></dt>
812: <dd>
813: <p>Require that password based authentication is used for client connections.
814: The password must be set separately using the <code>change</code> command in the
815: <a href="#SEC12">QEMU Monitor</a>
816: </p>
817: </dd>
818: <dt> <code>tls</code></dt>
819: <dd>
820: <p>Require that client use TLS when communicating with the VNC server. This
821: uses anonymous TLS credentials so is susceptible to a man-in-the-middle
822: attack. It is recommended that this option be combined with either the
823: <var>x509</var> or <var>x509verify</var> options.
824: </p>
825: </dd>
826: <dt> <code>x509=<var>/path/to/certificate/dir</var></code></dt>
827: <dd>
828: <p>Valid if ‘<samp>tls</samp>’ is specified. Require that x509 credentials are used
829: for negotiating the TLS session. The server will send its x509 certificate
830: to the client. It is recommended that a password be set on the VNC server
831: to provide authentication of the client when this is used. The path following
832: this option specifies where the x509 certificates are to be loaded from.
833: See the <a href="#SEC38">VNC security</a> section for details on generating certificates.
834: </p>
835: </dd>
836: <dt> <code>x509verify=<var>/path/to/certificate/dir</var></code></dt>
837: <dd>
838: <p>Valid if ‘<samp>tls</samp>’ is specified. Require that x509 credentials are used
839: for negotiating the TLS session. The server will send its x509 certificate
840: to the client, and request that the client send its own x509 certificate.
841: The server will validate the client's certificate against the CA certificate,
842: and reject clients when validation fails. If the certificate authority is
843: trusted, this is a sufficient authentication mechanism. You may still wish
844: to set a password on the VNC server as a second authentication layer. The
845: path following this option specifies where the x509 certificates are to
846: be loaded from. See the <a href="#SEC38">VNC security</a> section for details on generating
847: certificates.
848: </p>
849: </dd>
850: <dt> <code>sasl</code></dt>
851: <dd>
852: <p>Require that the client use SASL to authenticate with the VNC server.
853: The exact choice of authentication method used is controlled from the
854: system / user's SASL configuration file for the 'qemu' service. This
855: is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
856: unprivileged user, an environment variable SASL_CONF_PATH can be used
857: to make it search alternate locations for the service config.
858: While some SASL auth methods can also provide data encryption (eg GSSAPI),
859: it is recommended that SASL always be combined with the 'tls' and
860: 'x509' settings to enable use of SSL and server certificates. This
861: ensures a data encryption preventing compromise of authentication
862: credentials. See the <a href="#SEC38">VNC security</a> section for details on using
863: SASL authentication.
864: </p>
865: </dd>
866: <dt> <code>acl</code></dt>
867: <dd>
868: <p>Turn on access control lists for checking of the x509 client certificate
869: and SASL party. For x509 certs, the ACL check is made against the
870: certificate's distinguished name. This is something that looks like
871: <code>C=GB,O=ACME,L=Boston,CN=bob</code>. For SASL party, the ACL check is
872: made against the username, which depending on the SASL plugin, may
873: include a realm component, eg <code>bob</code> or <code>[email protected]</code>.
874: When the ‘<samp>acl</samp>’ flag is set, the initial access list will be
875: empty, with a <code>deny</code> policy. Thus no one will be allowed to
876: use the VNC server until the ACLs have been loaded. This can be
877: achieved using the <code>acl</code> monitor command.
878: </p>
879: </dd>
880: </dl>
881: </dd>
882: </dl>
883:
884: <p>i386 target only:
885: </p><dl compact="compact">
886: <dt> ‘<samp>-win2k-hack</samp>’</dt>
887: <dd><p>Use it when installing Windows 2000 to avoid a disk full bug. After
888: Windows 2000 is installed, you no longer need this option (this option
889: slows down the IDE transfers).
890: </p></dd>
891: <dt> ‘<samp>-rtc-td-hack</samp>’</dt>
892: <dd><p>Use it if you experience time drift problem in Windows with ACPI HAL.
893: This option will try to figure out how many timer interrupts were not
894: processed by the Windows guest and will re-inject them.
895: </p></dd>
896: <dt> ‘<samp>-no-fd-bootchk</samp>’</dt>
897: <dd><p>Disable boot signature checking for floppy disks in Bochs BIOS. It may
898: be needed to boot from old floppy disks.
899: </p></dd>
900: <dt> ‘<samp>-no-acpi</samp>’</dt>
901: <dd><p>Disable ACPI (Advanced Configuration and Power Interface) support. Use
902: it if your guest OS complains about ACPI problems (PC target machine
903: only).
904: </p></dd>
905: <dt> ‘<samp>-no-hpet</samp>’</dt>
906: <dd><p>Disable HPET support.
907: </p></dd>
908: <dt> ‘<samp>-acpitable [sig=<var>str</var>][,rev=<var>n</var>][,oem_id=<var>str</var>][,oem_table_id=<var>str</var>][,oem_rev=<var>n</var>] [,asl_compiler_id=<var>str</var>][,asl_compiler_rev=<var>n</var>][,data=<var>file1</var>[:<var>file2</var>]...]</samp>’</dt>
909: <dd><p>Add ACPI table with specified header fields and context from specified files.
910: </p></dd>
911: <dt> ‘<samp>-smbios file=<var>binary</var></samp>’</dt>
912: <dd><p>Load SMBIOS entry from binary file.
913: </p>
914: </dd>
915: <dt> ‘<samp>-smbios type=0[,vendor=<var>str</var>][,version=<var>str</var>][,date=<var>str</var>][,release=<var>%d.%d</var>]</samp>’</dt>
916: <dd><p>Specify SMBIOS type 0 fields
917: </p>
918: </dd>
919: <dt> ‘<samp>-smbios type=1[,manufacturer=<var>str</var>][,product=<var>str</var>][,version=<var>str</var>][,serial=<var>str</var>][,uuid=<var>uuid</var>][,sku=<var>str</var>][,family=<var>str</var>]</samp>’</dt>
920: <dd><p>Specify SMBIOS type 1 fields
921: </p>
922: </dd>
923: </dl>
924: <p>Network options:
925: </p><dl compact="compact">
926: <dt> ‘<samp>-net nic[,vlan=<var>n</var>][,macaddr=<var>addr</var>][,model=<var>type</var>][,name=<var>name</var>]</samp>’</dt>
927: <dd><p>Create a new Network Interface Card and connect it to VLAN <var>n</var> (<var>n</var>
928: = 0 is the default). The NIC is an ne2k_pci by default on the PC
929: target. Optionally, the MAC address can be changed to <var>addr</var>
930: and a <var>name</var> can be assigned for use in monitor commands. If no
931: ‘<samp>-net</samp>’ option is specified, a single NIC is created.
932: Qemu can emulate several different models of network card.
933: Valid values for <var>type</var> are
934: <code>i82551</code>, <code>i82557b</code>, <code>i82559er</code>,
935: <code>ne2k_pci</code>, <code>ne2k_isa</code>, <code>pcnet</code>, <code>rtl8139</code>,
936: <code>e1000</code>, <code>smc91c111</code>, <code>lance</code> and <code>mcf_fec</code>.
937: Not all devices are supported on all targets. Use -net nic,model=?
938: for a list of available devices for your target.
939: </p>
940: </dd>
941: <dt> ‘<samp>-net user[,vlan=<var>n</var>][,hostname=<var>name</var>][,name=<var>name</var>]</samp>’</dt>
942: <dd><p>Use the user mode network stack which requires no administrator
943: privilege to run. ‘<samp>hostname=name</samp>’ can be used to specify the client
944: hostname reported by the builtin DHCP server.
945: </p>
946: </dd>
947: <dt> ‘<samp>-net channel,<var>port</var>:<var>dev</var></samp>’</dt>
948: <dd><p>Forward ‘<samp>user</samp>’ TCP connection to port <var>port</var> to character device <var>dev</var>
949: </p>
950: </dd>
951: <dt> ‘<samp>-net tap[,vlan=<var>n</var>][,name=<var>name</var>][,fd=<var>h</var>][,ifname=<var>name</var>][,script=<var>file</var>][,downscript=<var>dfile</var>]</samp>’</dt>
952: <dd><p>Connect the host TAP network interface <var>name</var> to VLAN <var>n</var>, use
953: the network script <var>file</var> to configure it and the network script
954: <var>dfile</var> to deconfigure it. If <var>name</var> is not provided, the OS
955: automatically provides one. ‘<samp>fd</samp>’=<var>h</var> can be used to specify
956: the handle of an already opened host TAP interface. The default network
957: configure script is ‘<tt>/etc/qemu-ifup</tt>’ and the default network
958: deconfigure script is ‘<tt>/etc/qemu-ifdown</tt>’. Use ‘<samp>script=no</samp>’
959: or ‘<samp>downscript=no</samp>’ to disable script execution. Example:
960: </p>
961: <table><tr><td> </td><td><pre class="example">qemu linux.img -net nic -net tap
962: </pre></td></tr></table>
963:
964: <p>More complicated example (two NICs, each one connected to a TAP device)
965: </p><table><tr><td> </td><td><pre class="example">qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
966: -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
967: </pre></td></tr></table>
968:
969: </dd>
970: <dt> ‘<samp>-net socket[,vlan=<var>n</var>][,name=<var>name</var>][,fd=<var>h</var>][,listen=[<var>host</var>]:<var>port</var>][,connect=<var>host</var>:<var>port</var>]</samp>’</dt>
971: <dd>
972: <p>Connect the VLAN <var>n</var> to a remote VLAN in another QEMU virtual
973: machine using a TCP socket connection. If ‘<samp>listen</samp>’ is
974: specified, QEMU waits for incoming connections on <var>port</var>
975: (<var>host</var> is optional). ‘<samp>connect</samp>’ is used to connect to
976: another QEMU instance using the ‘<samp>listen</samp>’ option. ‘<samp>fd</samp>’=<var>h</var>
977: specifies an already opened TCP socket.
978: </p>
979: <p>Example:
980: </p><table><tr><td> </td><td><pre class="example"># launch a first QEMU instance
981: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
982: -net socket,listen=:1234
983: # connect the VLAN 0 of this instance to the VLAN 0
984: # of the first instance
985: qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
986: -net socket,connect=127.0.0.1:1234
987: </pre></td></tr></table>
988:
989: </dd>
990: <dt> ‘<samp>-net socket[,vlan=<var>n</var>][,name=<var>name</var>][,fd=<var>h</var>][,mcast=<var>maddr</var>:<var>port</var>]</samp>’</dt>
991: <dd>
992: <p>Create a VLAN <var>n</var> shared with another QEMU virtual
993: machines using a UDP multicast socket, effectively making a bus for
994: every QEMU with same multicast address <var>maddr</var> and <var>port</var>.
995: NOTES:
996: </p><ol>
997: <li>
998: Several QEMU can be running on different hosts and share same bus (assuming
999: correct multicast setup for these hosts).
1000: </li><li>
1001: mcast support is compatible with User Mode Linux (argument ‘<samp>eth<var>N</var>=mcast</samp>’), see
1002: <a href="http://user-mode-linux.sf.net">http://user-mode-linux.sf.net</a>.
1003: </li><li>
1004: Use ‘<samp>fd=h</samp>’ to specify an already opened UDP multicast socket.
1005: </li></ol>
1006:
1007: <p>Example:
1008: </p><table><tr><td> </td><td><pre class="example"># launch one QEMU instance
1009: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
1010: -net socket,mcast=230.0.0.1:1234
1011: # launch another QEMU instance on same "bus"
1012: qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
1013: -net socket,mcast=230.0.0.1:1234
1014: # launch yet another QEMU instance on same "bus"
1015: qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \
1016: -net socket,mcast=230.0.0.1:1234
1017: </pre></td></tr></table>
1018:
1019: <p>Example (User Mode Linux compat.):
1020: </p><table><tr><td> </td><td><pre class="example"># launch QEMU instance (note mcast address selected
1021: # is UML's default)
1022: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
1023: -net socket,mcast=239.192.168.1:1102
1024: # launch UML
1025: /path/to/linux ubd0=/path/to/root_fs eth0=mcast
1026: </pre></td></tr></table>
1027:
1028: </dd>
1029: <dt> ‘<samp>-net vde[,vlan=<var>n</var>][,name=<var>name</var>][,sock=<var>socketpath</var>][,port=<var>n</var>][,group=<var>groupname</var>][,mode=<var>octalmode</var>]</samp>’</dt>
1030: <dd><p>Connect VLAN <var>n</var> to PORT <var>n</var> of a vde switch running on host and
1031: listening for incoming connections on <var>socketpath</var>. Use GROUP <var>groupname</var>
1032: and MODE <var>octalmode</var> to change default ownership and permissions for
1033: communication port. This option is available only if QEMU has been compiled
1034: with vde support enabled.
1035: </p>
1036: <p>Example:
1037: </p><table><tr><td> </td><td><pre class="example"># launch vde switch
1038: vde_switch -F -sock /tmp/myswitch
1039: # launch QEMU instance
1040: qemu linux.img -net nic -net vde,sock=/tmp/myswitch
1041: </pre></td></tr></table>
1042:
1043: </dd>
1044: <dt> ‘<samp>-net dump[,vlan=<var>n</var>][,file=<var>file</var>][,len=<var>len</var>]</samp>’</dt>
1045: <dd><p>Dump network traffic on VLAN <var>n</var> to file <var>file</var> (‘<tt>qemu-vlan0.pcap</tt>’ by default).
1046: At most <var>len</var> bytes (64k by default) per packet are stored. The file format is
1047: libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
1048: </p>
1049: </dd>
1050: <dt> ‘<samp>-net none</samp>’</dt>
1051: <dd><p>Indicate that no network devices should be configured. It is used to
1052: override the default configuration (‘<samp>-net nic -net user</samp>’) which
1053: is activated if no ‘<samp>-net</samp>’ options are provided.
1054: </p></dd>
1055: <dt> ‘<samp>-tftp <var>dir</var></samp>’</dt>
1056: <dd><p>When using the user mode network stack, activate a built-in TFTP
1057: server. The files in <var>dir</var> will be exposed as the root of a TFTP server.
1058: The TFTP client on the guest must be configured in binary mode (use the command
1059: <code>bin</code> of the Unix TFTP client). The host IP address on the guest is as
1060: usual 10.0.2.2.
1061: </p></dd>
1062: <dt> ‘<samp>-bootp <var>file</var></samp>’</dt>
1063: <dd><p>When using the user mode network stack, broadcast <var>file</var> as the BOOTP
1064: filename. In conjunction with ‘<samp>-tftp</samp>’, this can be used to network boot
1065: a guest from a local directory.
1066: </p>
1067: <p>Example (using pxelinux):
1068: </p><table><tr><td> </td><td><pre class="example">qemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0
1069: </pre></td></tr></table>
1070: </dd>
1071: <dt> ‘<samp>-smb <var>dir</var></samp>’</dt>
1072: <dd><p>When using the user mode network stack, activate a built-in SMB
1073: server so that Windows OSes can access to the host files in ‘<tt><var>dir</var></tt>’
1074: transparently.
1075: </p>
1076: <p>In the guest Windows OS, the line:
1077: </p><table><tr><td> </td><td><pre class="example">10.0.2.4 smbserver
1078: </pre></td></tr></table>
1079: <p>must be added in the file ‘<tt>C:\WINDOWS\LMHOSTS</tt>’ (for windows 9x/Me)
1080: or ‘<tt>C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS</tt>’ (Windows NT/2000).
1081: </p>
1082: <p>Then ‘<tt><var>dir</var></tt>’ can be accessed in ‘<tt>\\smbserver\qemu</tt>’.
1083: </p>
1084: <p>Note that a SAMBA server must be installed on the host OS in
1085: ‘<tt>/usr/sbin/smbd</tt>’. QEMU was tested successfully with smbd version
1086: 2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3.
1087: </p></dd>
1088: <dt> ‘<samp>-redir [tcp|udp]:<var>host-port</var>:[<var>guest-host</var>]:<var>guest-port</var></samp>’</dt>
1089: <dd>
1090: <p>When using the user mode network stack, redirect incoming TCP or UDP
1091: connections to the host port <var>host-port</var> to the guest
1092: <var>guest-host</var> on guest port <var>guest-port</var>. If <var>guest-host</var>
1093: is not specified, its value is 10.0.2.15 (default address given by the
1094: built-in DHCP server). If no connection type is specified, TCP is used.
1095: </p>
1096: <p>For example, to redirect host X11 connection from screen 1 to guest
1097: screen 0, use the following:
1098: </p>
1099: <table><tr><td> </td><td><pre class="example"># on the host
1100: qemu -redir tcp:6001::6000 [...]
1101: # this host xterm should open in the guest X11 server
1102: xterm -display :1
1103: </pre></td></tr></table>
1104:
1105: <p>To redirect telnet connections from host port 5555 to telnet port on
1106: the guest, use the following:
1107: </p>
1108: <table><tr><td> </td><td><pre class="example"># on the host
1109: qemu -redir tcp:5555::23 [...]
1110: telnet localhost 5555
1111: </pre></td></tr></table>
1112:
1113: <p>Then when you use on the host <code>telnet localhost 5555</code>, you
1114: connect to the guest telnet server.
1115: </p>
1116: </dd>
1117: </dl>
1118: <p>Bluetooth(R) options:
1119: </p><dl compact="compact">
1120: <dt> ‘<samp>-bt hci[...]</samp>’</dt>
1121: <dd><p>Defines the function of the corresponding Bluetooth HCI. -bt options
1122: are matched with the HCIs present in the chosen machine type. For
1123: example when emulating a machine with only one HCI built into it, only
1124: the first <code>-bt hci[...]</code> option is valid and defines the HCI's
1125: logic. The Transport Layer is decided by the machine type. Currently
1126: the machines <code>n800</code> and <code>n810</code> have one HCI and all other
1127: machines have none.
1128: </p>
1129: <p><a name="bt_002dhcis"></a>
1130: The following three types are recognized:
1131: </p>
1132: <dl compact="compact">
1133: <dt> <code>-bt hci,null</code></dt>
1134: <dd><p>(default) The corresponding Bluetooth HCI assumes no internal logic
1135: and will not respond to any HCI commands or emit events.
1136: </p>
1137: </dd>
1138: <dt> <code>-bt hci,host[:<var>id</var>]</code></dt>
1139: <dd><p>(<code>bluez</code> only) The corresponding HCI passes commands / events
1140: to / from the physical HCI identified by the name <var>id</var> (default:
1141: <code>hci0</code>) on the computer running QEMU. Only available on <code>bluez</code>
1142: capable systems like Linux.
1143: </p>
1144: </dd>
1145: <dt> <code>-bt hci[,vlan=<var>n</var>]</code></dt>
1146: <dd><p>Add a virtual, standard HCI that will participate in the Bluetooth
1147: scatternet <var>n</var> (default <code>0</code>). Similarly to ‘<samp>-net</samp>’
1148: VLANs, devices inside a bluetooth network <var>n</var> can only communicate
1149: with other devices in the same network (scatternet).
1150: </p></dd>
1151: </dl>
1152:
1153: </dd>
1154: <dt> ‘<samp>-bt vhci[,vlan=<var>n</var>]</samp>’</dt>
1155: <dd><p>(Linux-host only) Create a HCI in scatternet <var>n</var> (default 0) attached
1156: to the host bluetooth stack instead of to the emulated target. This
1157: allows the host and target machines to participate in a common scatternet
1158: and communicate. Requires the Linux <code>vhci</code> driver installed. Can
1159: be used as following:
1160: </p>
1161: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
1162: </pre></td></tr></table>
1163:
1164: </dd>
1165: <dt> ‘<samp>-bt device:<var>dev</var>[,vlan=<var>n</var>]</samp>’</dt>
1166: <dd><p>Emulate a bluetooth device <var>dev</var> and place it in network <var>n</var>
1167: (default <code>0</code>). QEMU can only emulate one type of bluetooth devices
1168: currently:
1169: </p>
1170: <dl compact="compact">
1171: <dt> <code>keyboard</code></dt>
1172: <dd><p>Virtual wireless keyboard implementing the HIDP bluetooth profile.
1173: </p></dd>
1174: </dl>
1175: </dd>
1176: </dl>
1177:
1178: <p>Linux boot specific:
1179: When using these options, you can use a given
1180: Linux kernel without installing it in the disk image. It can be useful
1181: for easier testing of various kernels.
1182: </p>
1183: <dl compact="compact">
1184: <dt> ‘<samp>-kernel <var>bzImage</var></samp>’</dt>
1185: <dd><p>Use <var>bzImage</var> as kernel image.
1186: </p></dd>
1187: <dt> ‘<samp>-append <var>cmdline</var></samp>’</dt>
1188: <dd><p>Use <var>cmdline</var> as kernel command line
1189: </p></dd>
1190: <dt> ‘<samp>-initrd <var>file</var></samp>’</dt>
1191: <dd><p>Use <var>file</var> as initial ram disk.
1192: </p></dd>
1193: </dl>
1194:
1195: <p>Debug/Expert options:
1196: </p><dl compact="compact">
1197: <dt> ‘<samp>-serial <var>dev</var></samp>’</dt>
1198: <dd><p>Redirect the virtual serial port to host character device
1199: <var>dev</var>. The default device is <code>vc</code> in graphical mode and
1200: <code>stdio</code> in non graphical mode.
1201: </p>
1202: <p>This option can be used several times to simulate up to 4 serial
1203: ports.
1204: </p>
1205: <p>Use <code>-serial none</code> to disable all serial ports.
1206: </p>
1207: <p>Available character devices are:
1208: </p><dl compact="compact">
1209: <dt> <code>vc[:WxH]</code></dt>
1210: <dd><p>Virtual console. Optionally, a width and height can be given in pixel with
1211: </p><table><tr><td> </td><td><pre class="example">vc:800x600
1212: </pre></td></tr></table>
1213: <p>It is also possible to specify width or height in characters:
1214: </p><table><tr><td> </td><td><pre class="example">vc:80Cx24C
1215: </pre></td></tr></table>
1216: </dd>
1217: <dt> <code>pty</code></dt>
1218: <dd><p>[Linux only] Pseudo TTY (a new PTY is automatically allocated)
1219: </p></dd>
1220: <dt> <code>none</code></dt>
1221: <dd><p>No device is allocated.
1222: </p></dd>
1223: <dt> <code>null</code></dt>
1224: <dd><p>void device
1225: </p></dd>
1226: <dt> <code>/dev/XXX</code></dt>
1227: <dd><p>[Linux only] Use host tty, e.g. ‘<tt>/dev/ttyS0</tt>’. The host serial port
1228: parameters are set according to the emulated ones.
1229: </p></dd>
1230: <dt> <code>/dev/parport<var>N</var></code></dt>
1231: <dd><p>[Linux only, parallel port only] Use host parallel port
1232: <var>N</var>. Currently SPP and EPP parallel port features can be used.
1233: </p></dd>
1234: <dt> <code>file:<var>filename</var></code></dt>
1235: <dd><p>Write output to <var>filename</var>. No character can be read.
1236: </p></dd>
1237: <dt> <code>stdio</code></dt>
1238: <dd><p>[Unix only] standard input/output
1239: </p></dd>
1240: <dt> <code>pipe:<var>filename</var></code></dt>
1241: <dd><p>name pipe <var>filename</var>
1242: </p></dd>
1243: <dt> <code>COM<var>n</var></code></dt>
1244: <dd><p>[Windows only] Use host serial port <var>n</var>
1245: </p></dd>
1246: <dt> <code>udp:[<var>remote_host</var>]:<var>remote_port</var>[@[<var>src_ip</var>]:<var>src_port</var>]</code></dt>
1247: <dd><p>This implements UDP Net Console.
1248: When <var>remote_host</var> or <var>src_ip</var> are not specified
1249: they default to <code>0.0.0.0</code>.
1250: When not using a specified <var>src_port</var> a random port is automatically chosen.
1251: </p></dd>
1252: <dt> <code>msmouse</code></dt>
1253: <dd><p>Three button serial mouse. Configure the guest to use Microsoft protocol.
1254: </p>
1255: <p>If you just want a simple readonly console you can use <code>netcat</code> or
1256: <code>nc</code>, by starting qemu with: <code>-serial udp::4555</code> and nc as:
1257: <code>nc -u -l -p 4555</code>. Any time qemu writes something to that port it
1258: will appear in the netconsole session.
1259: </p>
1260: <p>If you plan to send characters back via netconsole or you want to stop
1261: and start qemu a lot of times, you should have qemu use the same
1262: source port each time by using something like <code>-serial
1263: udp::4555@:4556</code> to qemu. Another approach is to use a patched
1264: version of netcat which can listen to a TCP port and send and receive
1265: characters via udp. If you have a patched version of netcat which
1266: activates telnet remote echo and single char transfer, then you can
1267: use the following options to step up a netcat redirector to allow
1268: telnet on port 5555 to access the qemu port.
1269: </p><dl compact="compact">
1270: <dt> <code>Qemu Options:</code></dt>
1271: <dd><p>-serial udp::4555@:4556
1272: </p></dd>
1273: <dt> <code>netcat options:</code></dt>
1274: <dd><p>-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
1275: </p></dd>
1276: <dt> <code>telnet options:</code></dt>
1277: <dd><p>localhost 5555
1278: </p></dd>
1279: </dl>
1280:
1281: </dd>
1282: <dt> <code>tcp:[<var>host</var>]:<var>port</var>[,<var>server</var>][,nowait][,nodelay]</code></dt>
1283: <dd><p>The TCP Net Console has two modes of operation. It can send the serial
1284: I/O to a location or wait for a connection from a location. By default
1285: the TCP Net Console is sent to <var>host</var> at the <var>port</var>. If you use
1286: the <var>server</var> option QEMU will wait for a client socket application
1287: to connect to the port before continuing, unless the <code>nowait</code>
1288: option was specified. The <code>nodelay</code> option disables the Nagle buffering
1289: algorithm. If <var>host</var> is omitted, 0.0.0.0 is assumed. Only
1290: one TCP connection at a time is accepted. You can use <code>telnet</code> to
1291: connect to the corresponding character device.
1292: </p><dl compact="compact">
1293: <dt> <code>Example to send tcp console to 192.168.0.2 port 4444</code></dt>
1294: <dd><p>-serial tcp:192.168.0.2:4444
1295: </p></dd>
1296: <dt> <code>Example to listen and wait on port 4444 for connection</code></dt>
1297: <dd><p>-serial tcp::4444,server
1298: </p></dd>
1299: <dt> <code>Example to not wait and listen on ip 192.168.0.100 port 4444</code></dt>
1300: <dd><p>-serial tcp:192.168.0.100:4444,server,nowait
1301: </p></dd>
1302: </dl>
1303:
1304: </dd>
1305: <dt> <code>telnet:<var>host</var>:<var>port</var>[,server][,nowait][,nodelay]</code></dt>
1306: <dd><p>The telnet protocol is used instead of raw tcp sockets. The options
1307: work the same as if you had specified <code>-serial tcp</code>. The
1308: difference is that the port acts like a telnet server or client using
1309: telnet option negotiation. This will also allow you to send the
1310: MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
1311: sequence. Typically in unix telnet you do it with Control-] and then
1312: type "send break" followed by pressing the enter key.
1313: </p>
1314: </dd>
1315: <dt> <code>unix:<var>path</var>[,server][,nowait]</code></dt>
1316: <dd><p>A unix domain socket is used instead of a tcp socket. The option works the
1317: same as if you had specified <code>-serial tcp</code> except the unix domain socket
1318: <var>path</var> is used for connections.
1319: </p>
1320: </dd>
1321: <dt> <code>mon:<var>dev_string</var></code></dt>
1322: <dd><p>This is a special option to allow the monitor to be multiplexed onto
1323: another serial port. The monitor is accessed with key sequence of
1324: <Control-a> and then pressing <c>. See monitor access
1325: <a href="#SEC11">Keys</a> in the -nographic section for more keys.
1326: <var>dev_string</var> should be any one of the serial devices specified
1327: above. An example to multiplex the monitor onto a telnet server
1328: listening on port 4444 would be:
1329: </p><dl compact="compact">
1330: <dt> <code>-serial mon:telnet::4444,server,nowait</code></dt>
1331: </dl>
1332:
1333: </dd>
1334: <dt> <code>braille</code></dt>
1335: <dd><p>Braille device. This will use BrlAPI to display the braille output on a real
1336: or fake device.
1337: </p>
1338: </dd>
1339: </dl>
1340: </dd>
1341: <dt> ‘<samp>-parallel <var>dev</var></samp>’</dt>
1342: <dd><p>Redirect the virtual parallel port to host device <var>dev</var> (same
1343: devices as the serial port). On Linux hosts, ‘<tt>/dev/parportN</tt>’ can
1344: be used to use hardware devices connected on the corresponding host
1345: parallel port.
1346: </p>
1347: <p>This option can be used several times to simulate up to 3 parallel
1348: ports.
1349: </p>
1350: <p>Use <code>-parallel none</code> to disable all parallel ports.
1351: </p></dd>
1352: <dt> ‘<samp>-monitor <var>dev</var></samp>’</dt>
1353: <dd><p>Redirect the monitor to host device <var>dev</var> (same devices as the
1354: serial port).
1355: The default device is <code>vc</code> in graphical mode and <code>stdio</code> in
1356: non graphical mode.
1357: </p></dd>
1358: <dt> ‘<samp>-pidfile <var>file</var></samp>’</dt>
1359: <dd><p>Store the QEMU process PID in <var>file</var>. It is useful if you launch QEMU
1360: from a script.
1361: </p></dd>
1362: <dt> ‘<samp>-singlestep</samp>’</dt>
1363: <dd><p>Run the emulation in single step mode.
1364: </p></dd>
1365: <dt> ‘<samp>-S</samp>’</dt>
1366: <dd><p>Do not start CPU at startup (you must type 'c' in the monitor).
1367: </p></dd>
1368: <dt> ‘<samp>-gdb <var>dev</var></samp>’</dt>
1369: <dd><p>Wait for gdb connection on device <var>dev</var> (see section <a href="#SEC51">GDB usage</a>). Typical
1370: connections will likely be TCP-based, but also UDP, pseudo TTY, or even
1371: stdio are reasonable use case. The latter is allowing to start qemu from
1372: within gdb and establish the connection via a pipe:
1373: </p><table><tr><td> </td><td><pre class="example">(gdb) target remote | exec qemu -gdb stdio ...
1374: </pre></td></tr></table>
1375: </dd>
1376: <dt> ‘<samp>-s</samp>’</dt>
1377: <dd><p>Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
1378: (see section <a href="#SEC51">GDB usage</a>).
1379: </p></dd>
1380: <dt> ‘<samp>-d</samp>’</dt>
1381: <dd><p>Output log in /tmp/qemu.log
1382: </p></dd>
1383: <dt> ‘<samp>-hdachs <var>c</var>,<var>h</var>,<var>s</var>,[,<var>t</var>]</samp>’</dt>
1384: <dd><p>Force hard disk 0 physical geometry (1 <= <var>c</var> <= 16383, 1 <=
1385: <var>h</var> <= 16, 1 <= <var>s</var> <= 63) and optionally force the BIOS
1386: translation mode (<var>t</var>=none, lba or auto). Usually QEMU can guess
1387: all those parameters. This option is useful for old MS-DOS disk
1388: images.
1389: </p></dd>
1390: <dt> ‘<samp>-L <var>path</var></samp>’</dt>
1391: <dd><p>Set the directory for the BIOS, VGA BIOS and keymaps.
1392: </p></dd>
1393: <dt> ‘<samp>-bios <var>file</var></samp>’</dt>
1394: <dd><p>Set the filename for the BIOS.
1395: </p></dd>
1396: <dt> ‘<samp>-kernel-kqemu</samp>’</dt>
1397: <dd><p>Enable KQEMU full virtualization (default is user mode only).
1398: </p></dd>
1399: <dt> ‘<samp>-no-kqemu</samp>’</dt>
1400: <dd><p>Disable KQEMU kernel module usage. KQEMU options are only available if
1401: KQEMU support is enabled when compiling.
1402: </p></dd>
1403: <dt> ‘<samp>-enable-kvm</samp>’</dt>
1404: <dd><p>Enable KVM full virtualization support. This option is only available
1405: if KVM support is enabled when compiling.
1406: </p></dd>
1407: <dt> ‘<samp>-no-reboot</samp>’</dt>
1408: <dd><p>Exit instead of rebooting.
1409: </p></dd>
1410: <dt> ‘<samp>-no-shutdown</samp>’</dt>
1411: <dd><p>Don't exit QEMU on guest shutdown, but instead only stop the emulation.
1412: This allows for instance switching to monitor to commit changes to the
1413: disk image.
1414: </p></dd>
1415: <dt> ‘<samp>-loadvm <var>file</var></samp>’</dt>
1416: <dd><p>Start right away with a saved state (<code>loadvm</code> in monitor)
1417: </p></dd>
1418: <dt> ‘<samp>-daemonize</samp>’</dt>
1419: <dd><p>Daemonize the QEMU process after initialization. QEMU will not detach from
1420: standard IO until it is ready to receive connections on any of its devices.
1421: This option is a useful way for external programs to launch QEMU without having
1422: to cope with initialization race conditions.
1423: </p></dd>
1424: <dt> ‘<samp>-option-rom <var>file</var></samp>’</dt>
1425: <dd><p>Load the contents of <var>file</var> as an option ROM.
1426: This option is useful to load things like EtherBoot.
1427: </p></dd>
1428: <dt> ‘<samp>-clock <var>method</var></samp>’</dt>
1429: <dd><p>Force the use of the given methods for timer alarm. To see what timers
1430: are available use -clock ?.
1431: </p></dd>
1432: <dt> ‘<samp>-localtime</samp>’</dt>
1433: <dd><p>Set the real time clock to local time (the default is to UTC
1434: time). This option is needed to have correct date in MS-DOS or
1435: Windows.
1436: </p>
1437: </dd>
1438: <dt> ‘<samp>-startdate <var>date</var></samp>’</dt>
1439: <dd><p>Set the initial date of the real time clock. Valid formats for
1440: <var>date</var> are: <code>now</code> or <code>2006-06-17T16:01:21</code> or
1441: <code>2006-06-17</code>. The default value is <code>now</code>.
1442: </p></dd>
1443: <dt> ‘<samp>-icount [N|auto]</samp>’</dt>
1444: <dd><p>Enable virtual instruction counter. The virtual cpu will execute one
1445: instruction every 2^N ns of virtual time. If <code>auto</code> is specified
1446: then the virtual cpu speed will be automatically adjusted to keep virtual
1447: time within a few seconds of real time.
1448: </p>
1449: <p>Note that while this option can give deterministic behavior, it does not
1450: provide cycle accurate emulation. Modern CPUs contain superscalar out of
1451: order cores with complex cache hierarchies. The number of instructions
1452: executed often has little or no correlation with actual performance.
1453: </p>
1454: </dd>
1455: <dt> ‘<samp>-echr numeric_ascii_value</samp>’</dt>
1456: <dd><p>Change the escape character used for switching to the monitor when using
1457: monitor and serial sharing. The default is <code>0x01</code> when using the
1458: <code>-nographic</code> option. <code>0x01</code> is equal to pressing
1459: <code>Control-a</code>. You can select a different character from the ascii
1460: control keys where 1 through 26 map to Control-a through Control-z. For
1461: instance you could use the either of the following to change the escape
1462: character to Control-t.
1463: </p><dl compact="compact">
1464: <dt> <code>-echr 0x14</code></dt>
1465: <dt> <code>-echr 20</code></dt>
1466: </dl>
1467: </dd>
1468: <dt> ‘<samp>-virtioconsole <var>c</var></samp>’</dt>
1469: <dd><p>Set virtio console.
1470: </p></dd>
1471: <dt> ‘<samp>-chroot dir</samp>’</dt>
1472: <dd><p>Immediately before starting guest execution, chroot to the specified
1473: directory. Especially useful in combination with -runas.
1474: </p></dd>
1475: <dt> ‘<samp>-runas user</samp>’</dt>
1476: <dd><p>Immediately before starting guest execution, drop root privileges, switching
1477: to the specified user.
1478: </p></dd>
1479: </dl>
1480:
1481:
1482: <hr size="6">
1483: <a name="pcsys_005fkeys"></a>
1484: <a name="SEC11"></a>
1485: <table cellpadding="1" cellspacing="1" border="0">
1486: <tr><td valign="middle" align="left">[<a href="#SEC10" title="Previous section in reading order"> < </a>]</td>
1487: <td valign="middle" align="left">[<a href="#SEC12" title="Next section in reading order"> > </a>]</td>
1488: <td valign="middle" align="left"> </td>
1489: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1490: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
1491: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
1492: <td valign="middle" align="left"> </td>
1493: <td valign="middle" align="left"> </td>
1494: <td valign="middle" align="left"> </td>
1495: <td valign="middle" align="left"> </td>
1496: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1497: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1498: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
1499: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1500: </tr></table>
1501: <h2 class="section"> 3.4 Keys </h2>
1502:
1503:
1504: <p>During the graphical emulation, you can use the following keys:
1505: </p><dl compact="compact">
1506: <dt> <Ctrl-Alt-f></dt>
1507: <dd><p>Toggle full screen
1508: </p>
1509: </dd>
1510: <dt> <Ctrl-Alt-n></dt>
1511: <dd><p>Switch to virtual console 'n'. Standard console mappings are:
1512: </p><dl compact="compact">
1513: <dt> <em>1</em></dt>
1514: <dd><p>Target system display
1515: </p></dd>
1516: <dt> <em>2</em></dt>
1517: <dd><p>Monitor
1518: </p></dd>
1519: <dt> <em>3</em></dt>
1520: <dd><p>Serial port
1521: </p></dd>
1522: </dl>
1523:
1524: </dd>
1525: <dt> <Ctrl-Alt></dt>
1526: <dd><p>Toggle mouse and keyboard grab.
1527: </p></dd>
1528: </dl>
1529:
1530: <p>In the virtual consoles, you can use <Ctrl-Up>, <Ctrl-Down>,
1531: <Ctrl-PageUp> and <Ctrl-PageDown> to move in the back log.
1532: </p>
1533: <p>During emulation, if you are using the ‘<samp>-nographic</samp>’ option, use
1534: <Ctrl-a h> to get terminal commands:
1535: </p>
1536: <dl compact="compact">
1537: <dt> <Ctrl-a h></dt>
1538: <dt> <Ctrl-a ?></dt>
1539: <dd><p>Print this help
1540: </p></dd>
1541: <dt> <Ctrl-a x></dt>
1542: <dd><p>Exit emulator
1543: </p></dd>
1544: <dt> <Ctrl-a s></dt>
1545: <dd><p>Save disk data back to file (if -snapshot)
1546: </p></dd>
1547: <dt> <Ctrl-a t></dt>
1548: <dd><p>Toggle console timestamps
1549: </p></dd>
1550: <dt> <Ctrl-a b></dt>
1551: <dd><p>Send break (magic sysrq in Linux)
1552: </p></dd>
1553: <dt> <Ctrl-a c></dt>
1554: <dd><p>Switch between console and monitor
1555: </p></dd>
1556: <dt> <Ctrl-a Ctrl-a></dt>
1557: <dd><p>Send Ctrl-a
1558: </p></dd>
1559: </dl>
1560:
1561:
1562: <hr size="6">
1563: <a name="pcsys_005fmonitor"></a>
1564: <a name="SEC12"></a>
1565: <table cellpadding="1" cellspacing="1" border="0">
1566: <tr><td valign="middle" align="left">[<a href="#SEC11" title="Previous section in reading order"> < </a>]</td>
1567: <td valign="middle" align="left">[<a href="#SEC13" title="Next section in reading order"> > </a>]</td>
1568: <td valign="middle" align="left"> </td>
1569: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1570: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
1571: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
1572: <td valign="middle" align="left"> </td>
1573: <td valign="middle" align="left"> </td>
1574: <td valign="middle" align="left"> </td>
1575: <td valign="middle" align="left"> </td>
1576: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1577: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1578: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
1579: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1580: </tr></table>
1581: <h2 class="section"> 3.5 QEMU Monitor </h2>
1582:
1583: <p>The QEMU monitor is used to give complex commands to the QEMU
1584: emulator. You can use it to:
1585: </p>
1586: <ul class="toc">
1587: <li>-
1588: Remove or insert removable media images
1589: (such as CD-ROM or floppies).
1590:
1591: </li><li>-
1592: Freeze/unfreeze the Virtual Machine (VM) and save or restore its state
1593: from a disk file.
1594:
1595: </li><li>- Inspect the VM state without an external debugger.
1596:
1597: </li></ul>
1598:
1599: <hr size="6">
1600: <a name="SEC13"></a>
1601: <table cellpadding="1" cellspacing="1" border="0">
1602: <tr><td valign="middle" align="left">[<a href="#SEC12" title="Previous section in reading order"> < </a>]</td>
1603: <td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> > </a>]</td>
1604: <td valign="middle" align="left"> </td>
1605: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
1606: <td valign="middle" align="left">[<a href="#SEC12" title="Up section"> Up </a>]</td>
1607: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
1608: <td valign="middle" align="left"> </td>
1609: <td valign="middle" align="left"> </td>
1610: <td valign="middle" align="left"> </td>
1611: <td valign="middle" align="left"> </td>
1612: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
1613: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
1614: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
1615: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
1616: </tr></table>
1617: <h3 class="subsection"> 3.5.1 Commands </h3>
1618:
1619: <p>The following commands are available:
1620: </p>
1621: <dl compact="compact">
1622: <dt> ‘<samp>help or ? [<var>cmd</var>]</samp>’</dt>
1623: <dd><p>Show the help for all commands or just for command <var>cmd</var>.
1624: </p>
1625: </dd>
1626: <dt> ‘<samp>commit</samp>’</dt>
1627: <dd><p>Commit changes to the disk images (if -snapshot is used).
1628: </p>
1629: </dd>
1630: <dt> ‘<samp>info <var>subcommand</var></samp>’</dt>
1631: <dd><p>Show various information about the system state.
1632: </p>
1633: <dl compact="compact">
1634: <dt> ‘<samp>info version</samp>’</dt>
1635: <dd><p>show the version of QEMU
1636: </p></dd>
1637: <dt> ‘<samp>info network</samp>’</dt>
1638: <dd><p>show the various VLANs and the associated devices
1639: </p></dd>
1640: <dt> ‘<samp>info chardev</samp>’</dt>
1641: <dd><p>show the character devices
1642: </p></dd>
1643: <dt> ‘<samp>info block</samp>’</dt>
1644: <dd><p>show the block devices
1645: </p></dd>
1646: <dt> ‘<samp>info block</samp>’</dt>
1647: <dd><p>show block device statistics
1648: </p></dd>
1649: <dt> ‘<samp>info registers</samp>’</dt>
1650: <dd><p>show the cpu registers
1651: </p></dd>
1652: <dt> ‘<samp>info cpus</samp>’</dt>
1653: <dd><p>show infos for each CPU
1654: </p></dd>
1655: <dt> ‘<samp>info history</samp>’</dt>
1656: <dd><p>show the command line history
1657: </p></dd>
1658: <dt> ‘<samp>info irq</samp>’</dt>
1659: <dd><p>show the interrupts statistics (if available)
1660: </p></dd>
1661: <dt> ‘<samp>info pic</samp>’</dt>
1662: <dd><p>show i8259 (PIC) state
1663: </p></dd>
1664: <dt> ‘<samp>info pci</samp>’</dt>
1665: <dd><p>show emulated PCI device info
1666: </p></dd>
1667: <dt> ‘<samp>info tlb</samp>’</dt>
1668: <dd><p>show virtual to physical memory mappings (i386 only)
1669: </p></dd>
1670: <dt> ‘<samp>info mem</samp>’</dt>
1671: <dd><p>show the active virtual memory mappings (i386 only)
1672: </p></dd>
1673: <dt> ‘<samp>info hpet</samp>’</dt>
1674: <dd><p>show state of HPET (i386 only)
1675: </p></dd>
1676: <dt> ‘<samp>info kqemu</samp>’</dt>
1677: <dd><p>show KQEMU information
1678: </p></dd>
1679: <dt> ‘<samp>info kvm</samp>’</dt>
1680: <dd><p>show KVM information
1681: </p></dd>
1682: <dt> ‘<samp>info usb</samp>’</dt>
1683: <dd><p>show USB devices plugged on the virtual USB hub
1684: </p></dd>
1685: <dt> ‘<samp>info usbhost</samp>’</dt>
1686: <dd><p>show all USB host devices
1687: </p></dd>
1688: <dt> ‘<samp>info profile</samp>’</dt>
1689: <dd><p>show profiling information
1690: </p></dd>
1691: <dt> ‘<samp>info capture</samp>’</dt>
1692: <dd><p>show information about active capturing
1693: </p></dd>
1694: <dt> ‘<samp>info snapshots</samp>’</dt>
1695: <dd><p>show list of VM snapshots
1696: </p></dd>
1697: <dt> ‘<samp>info status</samp>’</dt>
1698: <dd><p>show the current VM status (running|paused)
1699: </p></dd>
1700: <dt> ‘<samp>info pcmcia</samp>’</dt>
1701: <dd><p>show guest PCMCIA status
1702: </p></dd>
1703: <dt> ‘<samp>info mice</samp>’</dt>
1704: <dd><p>show which guest mouse is receiving events
1705: </p></dd>
1706: <dt> ‘<samp>info vnc</samp>’</dt>
1707: <dd><p>show the vnc server status
1708: </p></dd>
1709: <dt> ‘<samp>info name</samp>’</dt>
1710: <dd><p>show the current VM name
1711: </p></dd>
1712: <dt> ‘<samp>info uuid</samp>’</dt>
1713: <dd><p>show the current VM UUID
1714: </p></dd>
1715: <dt> ‘<samp>info cpustats</samp>’</dt>
1716: <dd><p>show CPU statistics
1717: </p></dd>
1718: <dt> ‘<samp>info slirp</samp>’</dt>
1719: <dd><p>show SLIRP statistics (if available)
1720: </p></dd>
1721: <dt> ‘<samp>info migrate</samp>’</dt>
1722: <dd><p>show migration status
1723: </p></dd>
1724: <dt> ‘<samp>info balloon</samp>’</dt>
1725: <dd><p>show balloon information
1726: </p></dd>
1727: </dl>
1728:
1729: </dd>
1730: <dt> ‘<samp>q or quit</samp>’</dt>
1731: <dd><p>Quit the emulator.
1732: </p>
1733: </dd>
1734: <dt> ‘<samp>eject [-f] <var>device</var></samp>’</dt>
1735: <dd><p>Eject a removable medium (use -f to force it).
1736: </p>
1737: </dd>
1738: <dt> ‘<samp>change <var>device</var> <var>setting</var></samp>’</dt>
1739: <dd>
1740: <p>Change the configuration of a device.
1741: </p>
1742: <dl compact="compact">
1743: <dt> ‘<samp>change <var>diskdevice</var> <var>filename</var> [<var>format</var>]</samp>’</dt>
1744: <dd><p>Change the medium for a removable disk device to point to <var>filename</var>. eg
1745: </p>
1746: <table><tr><td> </td><td><pre class="example">(qemu) change ide1-cd0 /path/to/some.iso
1747: </pre></td></tr></table>
1748:
1749: <p><var>format</var> is optional.
1750: </p>
1751: </dd>
1752: <dt> ‘<samp>change vnc <var>display</var>,<var>options</var></samp>’</dt>
1753: <dd><p>Change the configuration of the VNC server. The valid syntax for <var>display</var>
1754: and <var>options</var> are described at <a href="#SEC10">Invocation</a>. eg
1755: </p>
1756: <table><tr><td> </td><td><pre class="example">(qemu) change vnc localhost:1
1757: </pre></td></tr></table>
1758:
1759: </dd>
1760: <dt> ‘<samp>change vnc password [<var>password</var>]</samp>’</dt>
1761: <dd>
1762: <p>Change the password associated with the VNC server. If the new password is not
1763: supplied, the monitor will prompt for it to be entered. VNC passwords are only
1764: significant up to 8 letters. eg
1765: </p>
1766: <table><tr><td> </td><td><pre class="example">(qemu) change vnc password
1767: Password: ********
1768: </pre></td></tr></table>
1769:
1770: </dd>
1771: </dl>
1772:
1773: </dd>
1774: <dt> ‘<samp>acl <var>subcommand</var> <var>aclname</var> <var>match</var> <var>index</var></samp>’</dt>
1775: <dd>
1776: <p>Manage access control lists for network services. There are currently
1777: two named access control lists, <var>vnc.x509dname</var> and <var>vnc.username</var>
1778: matching on the x509 client certificate distinguished name, and SASL
1779: username respectively.
1780: </p>
1781: <dl compact="compact">
1782: <dt> ‘<samp>acl show <aclname></samp>’</dt>
1783: <dd><p>list all the match rules in the access control list, and the default
1784: policy
1785: </p></dd>
1786: <dt> ‘<samp>acl policy <aclname> <code>allow|deny</code></samp>’</dt>
1787: <dd><p>set the default access control list policy, used in the event that
1788: none of the explicit rules match. The default policy at startup is
1789: always <code>deny</code>
1790: </p></dd>
1791: <dt> ‘<samp>acl allow <aclname> <match> [<index>]</samp>’</dt>
1792: <dd><p>add a match to the access control list, allowing access. The match will
1793: normally be an exact username or x509 distinguished name, but can
1794: optionally include wildcard globs. eg <code>*@EXAMPLE.COM</code> to allow
1795: all users in the <code>EXAMPLE.COM</code> kerberos realm. The match will
1796: normally be appended to the end of the ACL, but can be inserted
1797: earlier in the list if the optional <code>index</code> parameter is supplied.
1798: </p></dd>
1799: <dt> ‘<samp>acl deny <aclname> <match> [<index>]</samp>’</dt>
1800: <dd><p>add a match to the access control list, denying access. The match will
1801: normally be an exact username or x509 distinguished name, but can
1802: optionally include wildcard globs. eg <code>*@EXAMPLE.COM</code> to allow
1803: all users in the <code>EXAMPLE.COM</code> kerberos realm. The match will
1804: normally be appended to the end of the ACL, but can be inserted
1805: earlier in the list if the optional <code>index</code> parameter is supplied.
1806: </p></dd>
1807: <dt> ‘<samp>acl remove <aclname> <match></samp>’</dt>
1808: <dd><p>remove the specified match rule from the access control list.
1809: </p></dd>
1810: <dt> ‘<samp>acl reset <aclname></samp>’</dt>
1811: <dd><p>remove all matches from the access control list, and set the default
1812: policy back to <code>deny</code>.
1813: </p></dd>
1814: </dl>
1815:
1816: </dd>
1817: <dt> ‘<samp>screendump <var>filename</var></samp>’</dt>
1818: <dd><p>Save screen into PPM image <var>filename</var>.
1819: </p>
1820: </dd>
1821: <dt> ‘<samp>logfile <var>filename</var></samp>’</dt>
1822: <dd><p>Output logs to <var>filename</var>.
1823: </p>
1824: </dd>
1825: <dt> ‘<samp>log <var>item1</var>[,...]</samp>’</dt>
1826: <dd><p>Activate logging of the specified items to ‘<tt>/tmp/qemu.log</tt>’.
1827: </p>
1828: </dd>
1829: <dt> ‘<samp>savevm [<var>tag</var>|<var>id</var>]</samp>’</dt>
1830: <dd><p>Create a snapshot of the whole virtual machine. If <var>tag</var> is
1831: provided, it is used as human readable identifier. If there is already
1832: a snapshot with the same tag or ID, it is replaced. More info at
1833: <a href="#SEC18">VM snapshots</a>.
1834: </p>
1835: </dd>
1836: <dt> ‘<samp>loadvm <var>tag</var>|<var>id</var></samp>’</dt>
1837: <dd><p>Set the whole virtual machine to the snapshot identified by the tag
1838: <var>tag</var> or the unique snapshot ID <var>id</var>.
1839: </p>
1840: </dd>
1841: <dt> ‘<samp>delvm <var>tag</var>|<var>id</var></samp>’</dt>
1842: <dd><p>Delete the snapshot identified by <var>tag</var> or <var>id</var>.
1843: </p>
1844: </dd>
1845: <dt> ‘<samp>singlestep [off]</samp>’</dt>
1846: <dd><p>Run the emulation in single step mode.
1847: If called with option off, the emulation returns to normal mode.
1848: </p>
1849: </dd>
1850: <dt> ‘<samp>stop</samp>’</dt>
1851: <dd><p>Stop emulation.
1852: </p>
1853: </dd>
1854: <dt> ‘<samp>c or cont</samp>’</dt>
1855: <dd><p>Resume emulation.
1856: </p>
1857: </dd>
1858: <dt> ‘<samp>gdbserver [<var>port</var>]</samp>’</dt>
1859: <dd><p>Start gdbserver session (default <var>port</var>=1234)
1860: </p>
1861: </dd>
1862: <dt> ‘<samp>x/fmt <var>addr</var></samp>’</dt>
1863: <dd><p>Virtual memory dump starting at <var>addr</var>.
1864: </p>
1865: </dd>
1866: <dt> ‘<samp>xp /<var>fmt</var> <var>addr</var></samp>’</dt>
1867: <dd><p>Physical memory dump starting at <var>addr</var>.
1868: </p>
1869: <p><var>fmt</var> is a format which tells the command how to format the
1870: data. Its syntax is: ‘<samp>/{count}{format}{size}</samp>’
1871: </p>
1872: <dl compact="compact">
1873: <dt> <var>count</var></dt>
1874: <dd><p>is the number of items to be dumped.
1875: </p>
1876: </dd>
1877: <dt> <var>format</var></dt>
1878: <dd><p>can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
1879: c (char) or i (asm instruction).
1880: </p>
1881: </dd>
1882: <dt> <var>size</var></dt>
1883: <dd><p>can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
1884: <code>h</code> or <code>w</code> can be specified with the <code>i</code> format to
1885: respectively select 16 or 32 bit code instruction size.
1886: </p>
1887: </dd>
1888: </dl>
1889:
1890: <p>Examples:
1891: </p><ul class="toc">
1892: <li>
1893: Dump 10 instructions at the current instruction pointer:
1894: <table><tr><td> </td><td><pre class="example">(qemu) x/10i $eip
1895: 0x90107063: ret
1896: 0x90107064: sti
1897: 0x90107065: lea 0x0(%esi,1),%esi
1898: 0x90107069: lea 0x0(%edi,1),%edi
1899: 0x90107070: ret
1900: 0x90107071: jmp 0x90107080
1901: 0x90107073: nop
1902: 0x90107074: nop
1903: 0x90107075: nop
1904: 0x90107076: nop
1905: </pre></td></tr></table>
1906:
1907: </li><li>
1908: Dump 80 16 bit values at the start of the video memory.
1909: <table><tr><td> </td><td><pre class="smallexample">(qemu) xp/80hx 0xb8000
1910: 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
1911: 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
1912: 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
1913: 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
1914: 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
1915: 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
1916: 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1917: 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1918: 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1919: 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
1920: </pre></td></tr></table>
1921: </li></ul>
1922:
1923: </dd>
1924: <dt> ‘<samp>p or print/<var>fmt</var> <var>expr</var></samp>’</dt>
1925: <dd>
1926: <p>Print expression value. Only the <var>format</var> part of <var>fmt</var> is
1927: used.
1928: </p>
1929: </dd>
1930: <dt> ‘<samp>sendkey <var>keys</var></samp>’</dt>
1931: <dd>
1932: <p>Send <var>keys</var> to the emulator. <var>keys</var> could be the name of the
1933: key or <code>#</code> followed by the raw value in either decimal or hexadecimal
1934: format. Use <code>-</code> to press several keys simultaneously. Example:
1935: </p><table><tr><td> </td><td><pre class="example">sendkey ctrl-alt-f1
1936: </pre></td></tr></table>
1937:
1938: <p>This command is useful to send keys that your graphical user interface
1939: intercepts at low level, such as <code>ctrl-alt-f1</code> in X Window.
1940: </p>
1941: </dd>
1942: <dt> ‘<samp>system_reset</samp>’</dt>
1943: <dd>
1944: <p>Reset the system.
1945: </p>
1946: </dd>
1947: <dt> ‘<samp>system_powerdown</samp>’</dt>
1948: <dd>
1949: <p>Power down the system (if supported).
1950: </p>
1951: </dd>
1952: <dt> ‘<samp>sum <var>addr</var> <var>size</var></samp>’</dt>
1953: <dd>
1954: <p>Compute the checksum of a memory region.
1955: </p>
1956: </dd>
1957: <dt> ‘<samp>usb_add <var>devname</var></samp>’</dt>
1958: <dd>
1959: <p>Add the USB device <var>devname</var>. For details of available devices see
1960: <a href="#SEC36">Connecting USB devices</a>
1961: </p>
1962: </dd>
1963: <dt> ‘<samp>usb_del <var>devname</var></samp>’</dt>
1964: <dd>
1965: <p>Remove the USB device <var>devname</var> from the QEMU virtual USB
1966: hub. <var>devname</var> has the syntax <code>bus.addr</code>. Use the monitor
1967: command <code>info usb</code> to see the devices you can remove.
1968: </p>
1969: </dd>
1970: <dt> ‘<samp>mouse_move <var>dx</var> <var>dy</var> [<var>dz</var>]</samp>’</dt>
1971: <dd><p>Move the active mouse to the specified coordinates <var>dx</var> <var>dy</var>
1972: with optional scroll axis <var>dz</var>.
1973: </p>
1974: </dd>
1975: <dt> ‘<samp>mouse_button <var>val</var></samp>’</dt>
1976: <dd><p>Change the active mouse button state <var>val</var> (1=L, 2=M, 4=R).
1977: </p>
1978: </dd>
1979: <dt> ‘<samp>mouse_set <var>index</var></samp>’</dt>
1980: <dd><p>Set which mouse device receives events at given <var>index</var>, index
1981: can be obtained with
1982: </p><table><tr><td> </td><td><pre class="example">info mice
1983: </pre></td></tr></table>
1984:
1985: </dd>
1986: <dt> ‘<samp>wavcapture <var>filename</var> [<var>frequency</var> [<var>bits</var> [<var>channels</var>]]]</samp>’</dt>
1987: <dd><p>Capture audio into <var>filename</var>. Using sample rate <var>frequency</var>
1988: bits per sample <var>bits</var> and number of channels <var>channels</var>.
1989: </p>
1990: <p>Defaults:
1991: </p><ul class="toc">
1992: <li>- Sample rate = 44100 Hz - CD quality
1993: </li><li>- Bits = 16
1994: </li><li>- Number of channels = 2 - Stereo
1995: </li></ul>
1996:
1997: </dd>
1998: <dt> ‘<samp>stopcapture <var>index</var></samp>’</dt>
1999: <dd><p>Stop capture with a given <var>index</var>, index can be obtained with
2000: </p><table><tr><td> </td><td><pre class="example">info capture
2001: </pre></td></tr></table>
2002:
2003: </dd>
2004: <dt> ‘<samp>memsave <var>addr</var> <var>size</var> <var>file</var></samp>’</dt>
2005: <dd><p>save to disk virtual memory dump starting at <var>addr</var> of size <var>size</var>.
2006: </p>
2007: </dd>
2008: <dt> ‘<samp>pmemsave <var>addr</var> <var>size</var> <var>file</var></samp>’</dt>
2009: <dd><p>save to disk physical memory dump starting at <var>addr</var> of size <var>size</var>.
2010: </p>
2011: </dd>
2012: <dt> ‘<samp>boot_set <var>bootdevicelist</var></samp>’</dt>
2013: <dd>
2014: <p>Define new values for the boot device list. Those values will override
2015: the values specified on the command line through the <code>-boot</code> option.
2016: </p>
2017: <p>The values that can be specified here depend on the machine type, but are
2018: the same that can be specified in the <code>-boot</code> command line option.
2019: </p>
2020: </dd>
2021: <dt> ‘<samp>nmi <var>cpu</var></samp>’</dt>
2022: <dd><p>Inject an NMI on the given CPU.
2023: </p>
2024: </dd>
2025: <dt> ‘<samp>migrate [-d] <var>uri</var></samp>’</dt>
2026: <dd><p>Migrate to <var>uri</var> (using -d to not wait for completion).
2027: </p>
2028: </dd>
2029: <dt> ‘<samp>migrate_cancel</samp>’</dt>
2030: <dd><p>Cancel the current VM migration.
2031: </p>
2032: </dd>
2033: <dt> ‘<samp>migrate_set_speed <var>value</var></samp>’</dt>
2034: <dd><p>Set maximum speed to <var>value</var> (in bytes) for migrations.
2035: </p>
2036: </dd>
2037: <dt> ‘<samp>balloon <var>value</var></samp>’</dt>
2038: <dd><p>Request VM to change its memory allocation to <var>value</var> (in MB).
2039: </p>
2040: </dd>
2041: <dt> ‘<samp>set_link <var>name</var> [up|down]</samp>’</dt>
2042: <dd><p>Set link <var>name</var> up or down.
2043: </p>
2044: </dd>
2045: </dl>
2046:
2047: <hr size="6">
2048: <a name="SEC14"></a>
2049: <table cellpadding="1" cellspacing="1" border="0">
2050: <tr><td valign="middle" align="left">[<a href="#SEC13" title="Previous section in reading order"> < </a>]</td>
2051: <td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> > </a>]</td>
2052: <td valign="middle" align="left"> </td>
2053: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2054: <td valign="middle" align="left">[<a href="#SEC12" title="Up section"> Up </a>]</td>
2055: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2056: <td valign="middle" align="left"> </td>
2057: <td valign="middle" align="left"> </td>
2058: <td valign="middle" align="left"> </td>
2059: <td valign="middle" align="left"> </td>
2060: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2061: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2062: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2063: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2064: </tr></table>
2065: <h3 class="subsection"> 3.5.2 Integer expressions </h3>
2066:
2067: <p>The monitor understands integers expressions for every integer
2068: argument. You can use register names to get the value of specifics
2069: CPU registers by prefixing them with <em>$</em>.
2070: </p>
2071: <hr size="6">
2072: <a name="disk_005fimages"></a>
2073: <a name="SEC15"></a>
2074: <table cellpadding="1" cellspacing="1" border="0">
2075: <tr><td valign="middle" align="left">[<a href="#SEC14" title="Previous section in reading order"> < </a>]</td>
2076: <td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> > </a>]</td>
2077: <td valign="middle" align="left"> </td>
2078: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2079: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2080: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2081: <td valign="middle" align="left"> </td>
2082: <td valign="middle" align="left"> </td>
2083: <td valign="middle" align="left"> </td>
2084: <td valign="middle" align="left"> </td>
2085: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2086: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2087: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2088: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2089: </tr></table>
2090: <h2 class="section"> 3.6 Disk Images </h2>
2091:
2092: <p>Since version 0.6.1, QEMU supports many disk image formats, including
2093: growable disk images (their size increase as non empty sectors are
2094: written), compressed and encrypted disk images. Version 0.8.3 added
2095: the new qcow2 disk image format which is essential to support VM
2096: snapshots.
2097: </p>
2098: <table class="menu" border="0" cellspacing="0">
2099: <tr><td align="left" valign="top"><a href="#SEC16">3.6.1 Quick start for disk image creation</a></td><td> </td><td align="left" valign="top"></td></tr>
2100: <tr><td align="left" valign="top"><a href="#SEC17">3.6.2 Snapshot mode</a></td><td> </td><td align="left" valign="top"></td></tr>
2101: <tr><td align="left" valign="top"><a href="#SEC18">3.6.3 VM snapshots</a></td><td> </td><td align="left" valign="top"></td></tr>
2102: <tr><td align="left" valign="top"><a href="#SEC19">3.6.4 <code>qemu-img</code> Invocation</a></td><td> </td><td align="left" valign="top"> qemu-img Invocation
2103: </td></tr>
2104: <tr><td align="left" valign="top"><a href="#SEC20">3.6.5 <code>qemu-nbd</code> Invocation</a></td><td> </td><td align="left" valign="top"> qemu-nbd Invocation
2105: </td></tr>
2106: <tr><td align="left" valign="top"><a href="#SEC21">3.6.6 Using host drives</a></td><td> </td><td align="left" valign="top"></td></tr>
2107: <tr><td align="left" valign="top"><a href="#SEC25">3.6.7 Virtual FAT disk images</a></td><td> </td><td align="left" valign="top"></td></tr>
2108: <tr><td align="left" valign="top"><a href="#SEC26">3.6.8 NBD access</a></td><td> </td><td align="left" valign="top"></td></tr>
2109: </table>
2110:
2111: <hr size="6">
2112: <a name="disk_005fimages_005fquickstart"></a>
2113: <a name="SEC16"></a>
2114: <table cellpadding="1" cellspacing="1" border="0">
2115: <tr><td valign="middle" align="left">[<a href="#SEC15" title="Previous section in reading order"> < </a>]</td>
2116: <td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> > </a>]</td>
2117: <td valign="middle" align="left"> </td>
2118: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2119: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2120: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2121: <td valign="middle" align="left"> </td>
2122: <td valign="middle" align="left"> </td>
2123: <td valign="middle" align="left"> </td>
2124: <td valign="middle" align="left"> </td>
2125: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2126: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2127: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2128: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2129: </tr></table>
2130: <h3 class="subsection"> 3.6.1 Quick start for disk image creation </h3>
2131:
2132: <p>You can create a disk image with the command:
2133: </p><table><tr><td> </td><td><pre class="example">qemu-img create myimage.img mysize
2134: </pre></td></tr></table>
2135: <p>where <var>myimage.img</var> is the disk image filename and <var>mysize</var> is its
2136: size in kilobytes. You can add an <code>M</code> suffix to give the size in
2137: megabytes and a <code>G</code> suffix for gigabytes.
2138: </p>
2139: <p>See <a href="#SEC19"><code>qemu-img</code> Invocation</a> for more information.
2140: </p>
2141: <hr size="6">
2142: <a name="disk_005fimages_005fsnapshot_005fmode"></a>
2143: <a name="SEC17"></a>
2144: <table cellpadding="1" cellspacing="1" border="0">
2145: <tr><td valign="middle" align="left">[<a href="#SEC16" title="Previous section in reading order"> < </a>]</td>
2146: <td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> > </a>]</td>
2147: <td valign="middle" align="left"> </td>
2148: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2149: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2150: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2151: <td valign="middle" align="left"> </td>
2152: <td valign="middle" align="left"> </td>
2153: <td valign="middle" align="left"> </td>
2154: <td valign="middle" align="left"> </td>
2155: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2156: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2157: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2158: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2159: </tr></table>
2160: <h3 class="subsection"> 3.6.2 Snapshot mode </h3>
2161:
2162: <p>If you use the option ‘<samp>-snapshot</samp>’, all disk images are
2163: considered as read only. When sectors in written, they are written in
2164: a temporary file created in ‘<tt>/tmp</tt>’. You can however force the
2165: write back to the raw disk images by using the <code>commit</code> monitor
2166: command (or <C-a s> in the serial console).
2167: </p>
2168: <hr size="6">
2169: <a name="vm_005fsnapshots"></a>
2170: <a name="SEC18"></a>
2171: <table cellpadding="1" cellspacing="1" border="0">
2172: <tr><td valign="middle" align="left">[<a href="#SEC17" title="Previous section in reading order"> < </a>]</td>
2173: <td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> > </a>]</td>
2174: <td valign="middle" align="left"> </td>
2175: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2176: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2177: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2178: <td valign="middle" align="left"> </td>
2179: <td valign="middle" align="left"> </td>
2180: <td valign="middle" align="left"> </td>
2181: <td valign="middle" align="left"> </td>
2182: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2183: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2184: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2185: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2186: </tr></table>
2187: <h3 class="subsection"> 3.6.3 VM snapshots </h3>
2188:
2189: <p>VM snapshots are snapshots of the complete virtual machine including
2190: CPU state, RAM, device state and the content of all the writable
2191: disks. In order to use VM snapshots, you must have at least one non
2192: removable and writable block device using the <code>qcow2</code> disk image
2193: format. Normally this device is the first virtual hard drive.
2194: </p>
2195: <p>Use the monitor command <code>savevm</code> to create a new VM snapshot or
2196: replace an existing one. A human readable name can be assigned to each
2197: snapshot in addition to its numerical ID.
2198: </p>
2199: <p>Use <code>loadvm</code> to restore a VM snapshot and <code>delvm</code> to remove
2200: a VM snapshot. <code>info snapshots</code> lists the available snapshots
2201: with their associated information:
2202: </p>
2203: <table><tr><td> </td><td><pre class="example">(qemu) info snapshots
2204: Snapshot devices: hda
2205: Snapshot list (from hda):
2206: ID TAG VM SIZE DATE VM CLOCK
2207: 1 start 41M 2006-08-06 12:38:02 00:00:14.954
2208: 2 40M 2006-08-06 12:43:29 00:00:18.633
2209: 3 msys 40M 2006-08-06 12:44:04 00:00:23.514
2210: </pre></td></tr></table>
2211:
2212: <p>A VM snapshot is made of a VM state info (its size is shown in
2213: <code>info snapshots</code>) and a snapshot of every writable disk image.
2214: The VM state info is stored in the first <code>qcow2</code> non removable
2215: and writable block device. The disk image snapshots are stored in
2216: every disk image. The size of a snapshot in a disk image is difficult
2217: to evaluate and is not shown by <code>info snapshots</code> because the
2218: associated disk sectors are shared among all the snapshots to save
2219: disk space (otherwise each snapshot would need a full copy of all the
2220: disk images).
2221: </p>
2222: <p>When using the (unrelated) <code>-snapshot</code> option
2223: (<a href="#SEC17">Snapshot mode</a>), you can always make VM snapshots,
2224: but they are deleted as soon as you exit QEMU.
2225: </p>
2226: <p>VM snapshots currently have the following known limitations:
2227: </p><ul class="toc">
2228: <li>
2229: They cannot cope with removable devices if they are removed or
2230: inserted after a snapshot is done.
2231: </li><li>
2232: A few device drivers still have incomplete snapshot support so their
2233: state is not saved or restored properly (in particular USB).
2234: </li></ul>
2235:
2236: <hr size="6">
2237: <a name="qemu_005fimg_005finvocation"></a>
2238: <a name="SEC19"></a>
2239: <table cellpadding="1" cellspacing="1" border="0">
2240: <tr><td valign="middle" align="left">[<a href="#SEC18" title="Previous section in reading order"> < </a>]</td>
2241: <td valign="middle" align="left">[<a href="#SEC20" title="Next section in reading order"> > </a>]</td>
2242: <td valign="middle" align="left"> </td>
2243: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2244: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2245: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2246: <td valign="middle" align="left"> </td>
2247: <td valign="middle" align="left"> </td>
2248: <td valign="middle" align="left"> </td>
2249: <td valign="middle" align="left"> </td>
2250: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2251: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2252: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2253: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2254: </tr></table>
2255: <h3 class="subsection"> 3.6.4 <code>qemu-img</code> Invocation </h3>
2256:
2257: <table><tr><td> </td><td><pre class="example">usage: qemu-img command [command options]
2258: </pre></td></tr></table>
2259:
2260:
2261: <p>The following commands are supported:
2262: </p><dl compact="compact">
2263: <dt> ‘<samp>create [-e] [-6] [-F <var>base_fmt</var>] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>’</dt>
2264: <dt> ‘<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
2265: <dt> ‘<samp>convert [-c] [-e] [-6] [-f <var>fmt</var>] [-O <var>output_fmt</var>] [-B <var>output_base_image</var>] <var>filename</var> [<var>filename2</var> [...]] <var>output_filename</var></samp>’</dt>
2266: <dt> ‘<samp>info [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
2267: <dt> ‘<samp>snapshot [-l | -a <var>snapshot</var> | -c <var>snapshot</var> | -d <var>snapshot</var>] <var>filename</var></samp>’</dt>
2268: </dl>
2269:
2270: <p>Command parameters:
2271: </p><dl compact="compact">
2272: <dt> <var>filename</var></dt>
2273: <dd><p> is a disk image filename
2274: </p></dd>
2275: <dt> <var>base_image</var></dt>
2276: <dd><p>is the read-only disk image which is used as base for a copy on
2277: write image; the copy on write image only stores the modified data
2278: </p></dd>
2279: <dt> <var>output_base_image</var></dt>
2280: <dd><p>forces the output image to be created as a copy on write
2281: image of the specified base image; <code>output_base_image</code> should have the same
2282: content as the input's base image, however the path, image format, etc may
2283: differ
2284: </p></dd>
2285: <dt> <var>base_fmt</var></dt>
2286: <dd><p>is the disk image format of <var>base_image</var>. for more information look at <var>fmt</var>
2287: </p></dd>
2288: <dt> <var>fmt</var></dt>
2289: <dd><p>is the disk image format. It is guessed automatically in most cases. The following formats are supported:
2290: </p>
2291: <dl compact="compact">
2292: <dt> <code>raw</code></dt>
2293: <dd>
2294: <p>Raw disk image format (default). This format has the advantage of
2295: being simple and easily exportable to all other emulators. If your
2296: file system supports <em>holes</em> (for example in ext2 or ext3 on
2297: Linux or NTFS on Windows), then only the written sectors will reserve
2298: space. Use <code>qemu-img info</code> to know the real size used by the
2299: image or <code>ls -ls</code> on Unix/Linux.
2300: </p>
2301: </dd>
2302: <dt> <code>qcow2</code></dt>
2303: <dd><p>QEMU image format, the most versatile format. Use it to have smaller
2304: images (useful if your filesystem does not supports holes, for example
2305: on Windows), optional AES encryption, zlib based compression and
2306: support of multiple VM snapshots.
2307: </p></dd>
2308: <dt> <code>qcow</code></dt>
2309: <dd><p>Old QEMU image format. Left for compatibility.
2310: </p></dd>
2311: <dt> <code>cow</code></dt>
2312: <dd><p>User Mode Linux Copy On Write image format. Used to be the only growable
2313: image format in QEMU. It is supported only for compatibility with
2314: previous versions. It does not work on win32.
2315: </p></dd>
2316: <dt> <code>vmdk</code></dt>
2317: <dd><p>VMware 3 and 4 compatible image format.
2318: </p></dd>
2319: <dt> <code>cloop</code></dt>
2320: <dd><p>Linux Compressed Loop image, useful only to reuse directly compressed
2321: CD-ROM images present for example in the Knoppix CD-ROMs.
2322: </p></dd>
2323: </dl>
2324:
2325: </dd>
2326: <dt> <var>size</var></dt>
2327: <dd><p>is the disk image size in kilobytes. Optional suffixes <code>M</code>
2328: (megabyte, 1024 * 1024) and <code>G</code> (gigabyte, 1024 * 1024 * 1024)
2329: are supported and any <code>k</code> or <code>K</code> is ignored.
2330: </p>
2331: </dd>
2332: <dt> <var>output_filename</var></dt>
2333: <dd><p>is the destination disk image filename
2334: </p>
2335: </dd>
2336: <dt> <var>output_fmt</var></dt>
2337: <dd><p> is the destination format
2338: </p>
2339: </dd>
2340: <dt> <var>-c</var></dt>
2341: <dd><p>indicates that target image must be compressed (qcow format only)
2342: </p></dd>
2343: <dt> <var>-e</var></dt>
2344: <dd><p>indicates that the target image must be encrypted (qcow format only)
2345: </p></dd>
2346: <dt> <var>-6</var></dt>
2347: <dd><p>indicates that the target image must use compatibility level 6 (vmdk format only)
2348: </p></dd>
2349: <dt> <var>-h</var></dt>
2350: <dd><p>with or without a command shows help and lists the supported formats
2351: </p></dd>
2352: </dl>
2353:
2354: <p>Parameters to snapshot subcommand:
2355: </p>
2356: <dl compact="compact">
2357: <dt> ‘<samp>snapshot</samp>’</dt>
2358: <dd><p>is the name of the snapshot to create, apply or delete
2359: </p></dd>
2360: <dt> ‘<samp>-a</samp>’</dt>
2361: <dd><p>applies a snapshot (revert disk to saved state)
2362: </p></dd>
2363: <dt> ‘<samp>-c</samp>’</dt>
2364: <dd><p>creates a snapshot
2365: </p></dd>
2366: <dt> ‘<samp>-d</samp>’</dt>
2367: <dd><p>deletes a snapshot
2368: </p></dd>
2369: <dt> ‘<samp>-l</samp>’</dt>
2370: <dd><p>lists all snapshots in the given image
2371: </p></dd>
2372: </dl>
2373:
2374: <p>Command description:
2375: </p>
2376: <dl compact="compact">
2377: <dt> ‘<samp>create [-6] [-e] [-b <var>base_image</var>] [-f <var>fmt</var>] <var>filename</var> [<var>size</var>]</samp>’</dt>
2378: <dd>
2379: <p>Create the new disk image <var>filename</var> of size <var>size</var> and format
2380: <var>fmt</var>.
2381: </p>
2382: <p>If <var>base_image</var> is specified, then the image will record only the
2383: differences from <var>base_image</var>. No size needs to be specified in
2384: this case. <var>base_image</var> will never be modified unless you use the
2385: <code>commit</code> monitor command.
2386: </p>
2387: </dd>
2388: <dt> ‘<samp>commit [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
2389: <dd>
2390: <p>Commit the changes recorded in <var>filename</var> in its base image.
2391: </p>
2392: </dd>
2393: <dt> ‘<samp>convert [-c] [-e] [-f <var>fmt</var>] <var>filename</var> [-O <var>output_fmt</var>] <var>output_filename</var></samp>’</dt>
2394: <dd>
2395: <p>Convert the disk image <var>filename</var> to disk image <var>output_filename</var>
2396: using format <var>output_fmt</var>. It can be optionally encrypted
2397: (<code>-e</code> option) or compressed (<code>-c</code> option).
2398: </p>
2399: <p>Only the format <code>qcow</code> supports encryption or compression. The
2400: compression is read-only. It means that if a compressed sector is
2401: rewritten, then it is rewritten as uncompressed data.
2402: </p>
2403: <p>Encryption uses the AES format which is very secure (128 bit keys). Use
2404: a long password (16 characters) to get maximum protection.
2405: </p>
2406: <p>Image conversion is also useful to get smaller image when using a
2407: growable format such as <code>qcow</code> or <code>cow</code>: the empty sectors
2408: are detected and suppressed from the destination image.
2409: </p>
2410: </dd>
2411: <dt> ‘<samp>info [-f <var>fmt</var>] <var>filename</var></samp>’</dt>
2412: <dd>
2413: <p>Give information about the disk image <var>filename</var>. Use it in
2414: particular to know the size reserved on disk which can be different
2415: from the displayed size. If VM snapshots are stored in the disk image,
2416: they are displayed too.
2417: </p>
2418: </dd>
2419: <dt> ‘<samp>snapshot [-l | -a <var>snapshot</var> | -c <var>snapshot</var> | -d <var>snapshot</var> ] <var>filename</var></samp>’</dt>
2420: <dd>
2421: <p>List, apply, create or delete snapshots in image <var>filename</var>.
2422: </p></dd>
2423: </dl>
2424:
2425:
2426:
2427: <hr size="6">
2428: <a name="qemu_005fnbd_005finvocation"></a>
2429: <a name="SEC20"></a>
2430: <table cellpadding="1" cellspacing="1" border="0">
2431: <tr><td valign="middle" align="left">[<a href="#SEC19" title="Previous section in reading order"> < </a>]</td>
2432: <td valign="middle" align="left">[<a href="#SEC21" title="Next section in reading order"> > </a>]</td>
2433: <td valign="middle" align="left"> </td>
2434: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2435: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2436: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2437: <td valign="middle" align="left"> </td>
2438: <td valign="middle" align="left"> </td>
2439: <td valign="middle" align="left"> </td>
2440: <td valign="middle" align="left"> </td>
2441: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2442: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2443: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2444: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2445: </tr></table>
2446: <h3 class="subsection"> 3.6.5 <code>qemu-nbd</code> Invocation </h3>
2447:
2448: <table><tr><td> </td><td><pre class="example">usage: qemu-nbd [OPTION]... <var>filename</var>
2449: </pre></td></tr></table>
2450:
2451:
2452: <p>Export Qemu disk image using NBD protocol.
2453: </p>
2454:
2455: <dl compact="compact">
2456: <dt> ‘<samp><var>filename</var></samp>’</dt>
2457: <dd><p> is a disk image filename
2458: </p></dd>
2459: <dt> ‘<samp>-p, --port=<var>port</var></samp>’</dt>
2460: <dd><p> port to listen on (default ‘<samp>1024</samp>’)
2461: </p></dd>
2462: <dt> ‘<samp>-o, --offset=<var>offset</var></samp>’</dt>
2463: <dd><p> offset into the image
2464: </p></dd>
2465: <dt> ‘<samp>-b, --bind=<var>iface</var></samp>’</dt>
2466: <dd><p> interface to bind to (default ‘<samp>0.0.0.0</samp>’)
2467: </p></dd>
2468: <dt> ‘<samp>-k, --socket=<var>path</var></samp>’</dt>
2469: <dd><p> Use a unix socket with path <var>path</var>
2470: </p></dd>
2471: <dt> ‘<samp>-r, --read-only</samp>’</dt>
2472: <dd><p> export read-only
2473: </p></dd>
2474: <dt> ‘<samp>-P, --partition=<var>num</var></samp>’</dt>
2475: <dd><p> only expose partition <var>num</var>
2476: </p></dd>
2477: <dt> ‘<samp>-s, --snapshot</samp>’</dt>
2478: <dd><p> use snapshot file
2479: </p></dd>
2480: <dt> ‘<samp>-n, --nocache</samp>’</dt>
2481: <dd><p> disable host cache
2482: </p></dd>
2483: <dt> ‘<samp>-c, --connect</samp>’</dt>
2484: <dd><p> connect FILE to NBD device DEV
2485: </p></dd>
2486: <dt> ‘<samp>-d, --disconnect</samp>’</dt>
2487: <dd><p> disconnect the specified device
2488: </p></dd>
2489: <dt> ‘<samp>-e, --shared=<var>num</var></samp>’</dt>
2490: <dd><p> device can be shared by <var>num</var> clients (default ‘<samp>1</samp>’)
2491: </p></dd>
2492: <dt> ‘<samp>-t, --persistent</samp>’</dt>
2493: <dd><p> don't exit on the last connection
2494: </p></dd>
2495: <dt> ‘<samp>-v, --verbose</samp>’</dt>
2496: <dd><p> display extra debugging information
2497: </p></dd>
2498: <dt> ‘<samp>-h, --help</samp>’</dt>
2499: <dd><p> display this help and exit
2500: </p></dd>
2501: <dt> ‘<samp>-V, --version</samp>’</dt>
2502: <dd><p> output version information and exit
2503: </p></dd>
2504: </dl>
2505:
2506:
2507:
2508: <hr size="6">
2509: <a name="host_005fdrives"></a>
2510: <a name="SEC21"></a>
2511: <table cellpadding="1" cellspacing="1" border="0">
2512: <tr><td valign="middle" align="left">[<a href="#SEC20" title="Previous section in reading order"> < </a>]</td>
2513: <td valign="middle" align="left">[<a href="#SEC22" title="Next section in reading order"> > </a>]</td>
2514: <td valign="middle" align="left"> </td>
2515: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2516: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2517: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2518: <td valign="middle" align="left"> </td>
2519: <td valign="middle" align="left"> </td>
2520: <td valign="middle" align="left"> </td>
2521: <td valign="middle" align="left"> </td>
2522: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2523: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2524: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2525: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2526: </tr></table>
2527: <h3 class="subsection"> 3.6.6 Using host drives </h3>
2528:
2529: <p>In addition to disk image files, QEMU can directly access host
2530: devices. We describe here the usage for QEMU version >= 0.8.3.
2531: </p>
2532: <hr size="6">
2533: <a name="SEC22"></a>
2534: <table cellpadding="1" cellspacing="1" border="0">
2535: <tr><td valign="middle" align="left">[<a href="#SEC21" title="Previous section in reading order"> < </a>]</td>
2536: <td valign="middle" align="left">[<a href="#SEC23" title="Next section in reading order"> > </a>]</td>
2537: <td valign="middle" align="left"> </td>
2538: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2539: <td valign="middle" align="left">[<a href="#SEC21" title="Up section"> Up </a>]</td>
2540: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2541: <td valign="middle" align="left"> </td>
2542: <td valign="middle" align="left"> </td>
2543: <td valign="middle" align="left"> </td>
2544: <td valign="middle" align="left"> </td>
2545: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2546: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2547: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2548: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2549: </tr></table>
2550: <h4 class="subsubsection"> 3.6.6.1 Linux </h4>
2551:
2552: <p>On Linux, you can directly use the host device filename instead of a
2553: disk image filename provided you have enough privileges to access
2554: it. For example, use ‘<tt>/dev/cdrom</tt>’ to access to the CDROM or
2555: ‘<tt>/dev/fd0</tt>’ for the floppy.
2556: </p>
2557: <dl compact="compact">
2558: <dt> <code>CD</code></dt>
2559: <dd><p>You can specify a CDROM device even if no CDROM is loaded. QEMU has
2560: specific code to detect CDROM insertion or removal. CDROM ejection by
2561: the guest OS is supported. Currently only data CDs are supported.
2562: </p></dd>
2563: <dt> <code>Floppy</code></dt>
2564: <dd><p>You can specify a floppy device even if no floppy is loaded. Floppy
2565: removal is currently not detected accurately (if you change floppy
2566: without doing floppy access while the floppy is not loaded, the guest
2567: OS will think that the same floppy is loaded).
2568: </p></dd>
2569: <dt> <code>Hard disks</code></dt>
2570: <dd><p>Hard disks can be used. Normally you must specify the whole disk
2571: (‘<tt>/dev/hdb</tt>’ instead of ‘<tt>/dev/hdb1</tt>’) so that the guest OS can
2572: see it as a partitioned disk. WARNING: unless you know what you do, it
2573: is better to only make READ-ONLY accesses to the hard disk otherwise
2574: you may corrupt your host data (use the ‘<samp>-snapshot</samp>’ command
2575: line option or modify the device permissions accordingly).
2576: </p></dd>
2577: </dl>
2578:
2579: <hr size="6">
2580: <a name="SEC23"></a>
2581: <table cellpadding="1" cellspacing="1" border="0">
2582: <tr><td valign="middle" align="left">[<a href="#SEC22" title="Previous section in reading order"> < </a>]</td>
2583: <td valign="middle" align="left">[<a href="#SEC24" title="Next section in reading order"> > </a>]</td>
2584: <td valign="middle" align="left"> </td>
2585: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2586: <td valign="middle" align="left">[<a href="#SEC21" title="Up section"> Up </a>]</td>
2587: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2588: <td valign="middle" align="left"> </td>
2589: <td valign="middle" align="left"> </td>
2590: <td valign="middle" align="left"> </td>
2591: <td valign="middle" align="left"> </td>
2592: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2593: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2594: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2595: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2596: </tr></table>
2597: <h4 class="subsubsection"> 3.6.6.2 Windows </h4>
2598:
2599: <dl compact="compact">
2600: <dt> <code>CD</code></dt>
2601: <dd><p>The preferred syntax is the drive letter (e.g. ‘<tt>d:</tt>’). The
2602: alternate syntax ‘<tt>\\.\d:</tt>’ is supported. ‘<tt>/dev/cdrom</tt>’ is
2603: supported as an alias to the first CDROM drive.
2604: </p>
2605: <p>Currently there is no specific code to handle removable media, so it
2606: is better to use the <code>change</code> or <code>eject</code> monitor commands to
2607: change or eject media.
2608: </p></dd>
2609: <dt> <code>Hard disks</code></dt>
2610: <dd><p>Hard disks can be used with the syntax: ‘<tt>\\.\PhysicalDrive<var>N</var></tt>’
2611: where <var>N</var> is the drive number (0 is the first hard disk).
2612: </p>
2613: <p>WARNING: unless you know what you do, it is better to only make
2614: READ-ONLY accesses to the hard disk otherwise you may corrupt your
2615: host data (use the ‘<samp>-snapshot</samp>’ command line so that the
2616: modifications are written in a temporary file).
2617: </p></dd>
2618: </dl>
2619:
2620:
2621: <hr size="6">
2622: <a name="SEC24"></a>
2623: <table cellpadding="1" cellspacing="1" border="0">
2624: <tr><td valign="middle" align="left">[<a href="#SEC23" title="Previous section in reading order"> < </a>]</td>
2625: <td valign="middle" align="left">[<a href="#SEC25" title="Next section in reading order"> > </a>]</td>
2626: <td valign="middle" align="left"> </td>
2627: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2628: <td valign="middle" align="left">[<a href="#SEC21" title="Up section"> Up </a>]</td>
2629: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2630: <td valign="middle" align="left"> </td>
2631: <td valign="middle" align="left"> </td>
2632: <td valign="middle" align="left"> </td>
2633: <td valign="middle" align="left"> </td>
2634: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2635: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2636: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2637: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2638: </tr></table>
2639: <h4 class="subsubsection"> 3.6.6.3 Mac OS X </h4>
2640:
2641: <p>‘<tt>/dev/cdrom</tt>’ is an alias to the first CDROM.
2642: </p>
2643: <p>Currently there is no specific code to handle removable media, so it
2644: is better to use the <code>change</code> or <code>eject</code> monitor commands to
2645: change or eject media.
2646: </p>
2647: <hr size="6">
2648: <a name="disk_005fimages_005ffat_005fimages"></a>
2649: <a name="SEC25"></a>
2650: <table cellpadding="1" cellspacing="1" border="0">
2651: <tr><td valign="middle" align="left">[<a href="#SEC24" title="Previous section in reading order"> < </a>]</td>
2652: <td valign="middle" align="left">[<a href="#SEC26" title="Next section in reading order"> > </a>]</td>
2653: <td valign="middle" align="left"> </td>
2654: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2655: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2656: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2657: <td valign="middle" align="left"> </td>
2658: <td valign="middle" align="left"> </td>
2659: <td valign="middle" align="left"> </td>
2660: <td valign="middle" align="left"> </td>
2661: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2662: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2663: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2664: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2665: </tr></table>
2666: <h3 class="subsection"> 3.6.7 Virtual FAT disk images </h3>
2667:
2668: <p>QEMU can automatically create a virtual FAT disk image from a
2669: directory tree. In order to use it, just type:
2670: </p>
2671: <table><tr><td> </td><td><pre class="example">qemu linux.img -hdb fat:/my_directory
2672: </pre></td></tr></table>
2673:
2674: <p>Then you access access to all the files in the ‘<tt>/my_directory</tt>’
2675: directory without having to copy them in a disk image or to export
2676: them via SAMBA or NFS. The default access is <em>read-only</em>.
2677: </p>
2678: <p>Floppies can be emulated with the <code>:floppy:</code> option:
2679: </p>
2680: <table><tr><td> </td><td><pre class="example">qemu linux.img -fda fat:floppy:/my_directory
2681: </pre></td></tr></table>
2682:
2683: <p>A read/write support is available for testing (beta stage) with the
2684: <code>:rw:</code> option:
2685: </p>
2686: <table><tr><td> </td><td><pre class="example">qemu linux.img -fda fat:floppy:rw:/my_directory
2687: </pre></td></tr></table>
2688:
2689: <p>What you should <em>never</em> do:
2690: </p><ul class="toc">
2691: <li> use non-ASCII filenames ;
2692: </li><li> use "-snapshot" together with ":rw:" ;
2693: </li><li> expect it to work when loadvm'ing ;
2694: </li><li> write to the FAT directory on the host system while accessing it with the guest system.
2695: </li></ul>
2696:
2697: <hr size="6">
2698: <a name="disk_005fimages_005fnbd"></a>
2699: <a name="SEC26"></a>
2700: <table cellpadding="1" cellspacing="1" border="0">
2701: <tr><td valign="middle" align="left">[<a href="#SEC25" title="Previous section in reading order"> < </a>]</td>
2702: <td valign="middle" align="left">[<a href="#SEC27" title="Next section in reading order"> > </a>]</td>
2703: <td valign="middle" align="left"> </td>
2704: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2705: <td valign="middle" align="left">[<a href="#SEC15" title="Up section"> Up </a>]</td>
2706: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2707: <td valign="middle" align="left"> </td>
2708: <td valign="middle" align="left"> </td>
2709: <td valign="middle" align="left"> </td>
2710: <td valign="middle" align="left"> </td>
2711: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2712: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2713: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2714: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2715: </tr></table>
2716: <h3 class="subsection"> 3.6.8 NBD access </h3>
2717:
2718: <p>QEMU can access directly to block device exported using the Network Block Device
2719: protocol.
2720: </p>
2721: <table><tr><td> </td><td><pre class="example">qemu linux.img -hdb nbd:my_nbd_server.mydomain.org:1024
2722: </pre></td></tr></table>
2723:
2724: <p>If the NBD server is located on the same host, you can use an unix socket instead
2725: of an inet socket:
2726: </p>
2727: <table><tr><td> </td><td><pre class="example">qemu linux.img -hdb nbd:unix:/tmp/my_socket
2728: </pre></td></tr></table>
2729:
2730: <p>In this case, the block device must be exported using qemu-nbd:
2731: </p>
2732: <table><tr><td> </td><td><pre class="example">qemu-nbd --socket=/tmp/my_socket my_disk.qcow2
2733: </pre></td></tr></table>
2734:
2735: <p>The use of qemu-nbd allows to share a disk between several guests:
2736: </p><table><tr><td> </td><td><pre class="example">qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
2737: </pre></td></tr></table>
2738:
2739: <p>and then you can use it with two guests:
2740: </p><table><tr><td> </td><td><pre class="example">qemu linux1.img -hdb nbd:unix:/tmp/my_socket
2741: qemu linux2.img -hdb nbd:unix:/tmp/my_socket
2742: </pre></td></tr></table>
2743:
2744: <hr size="6">
2745: <a name="pcsys_005fnetwork"></a>
2746: <a name="SEC27"></a>
2747: <table cellpadding="1" cellspacing="1" border="0">
2748: <tr><td valign="middle" align="left">[<a href="#SEC26" title="Previous section in reading order"> < </a>]</td>
2749: <td valign="middle" align="left">[<a href="#SEC28" title="Next section in reading order"> > </a>]</td>
2750: <td valign="middle" align="left"> </td>
2751: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2752: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2753: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2754: <td valign="middle" align="left"> </td>
2755: <td valign="middle" align="left"> </td>
2756: <td valign="middle" align="left"> </td>
2757: <td valign="middle" align="left"> </td>
2758: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2759: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2760: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2761: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2762: </tr></table>
2763: <h2 class="section"> 3.7 Network emulation </h2>
2764:
2765: <p>QEMU can simulate several network cards (PCI or ISA cards on the PC
2766: target) and can connect them to an arbitrary number of Virtual Local
2767: Area Networks (VLANs). Host TAP devices can be connected to any QEMU
2768: VLAN. VLAN can be connected between separate instances of QEMU to
2769: simulate large networks. For simpler usage, a non privileged user mode
2770: network stack can replace the TAP device to have a basic network
2771: connection.
2772: </p>
2773: <hr size="6">
2774: <a name="SEC28"></a>
2775: <table cellpadding="1" cellspacing="1" border="0">
2776: <tr><td valign="middle" align="left">[<a href="#SEC27" title="Previous section in reading order"> < </a>]</td>
2777: <td valign="middle" align="left">[<a href="#SEC29" title="Next section in reading order"> > </a>]</td>
2778: <td valign="middle" align="left"> </td>
2779: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2780: <td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2781: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2782: <td valign="middle" align="left"> </td>
2783: <td valign="middle" align="left"> </td>
2784: <td valign="middle" align="left"> </td>
2785: <td valign="middle" align="left"> </td>
2786: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2787: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2788: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2789: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2790: </tr></table>
2791: <h3 class="subsection"> 3.7.1 VLANs </h3>
2792:
2793: <p>QEMU simulates several VLANs. A VLAN can be symbolised as a virtual
2794: connection between several network devices. These devices can be for
2795: example QEMU virtual Ethernet cards or virtual Host ethernet devices
2796: (TAP devices).
2797: </p>
2798: <hr size="6">
2799: <a name="SEC29"></a>
2800: <table cellpadding="1" cellspacing="1" border="0">
2801: <tr><td valign="middle" align="left">[<a href="#SEC28" title="Previous section in reading order"> < </a>]</td>
2802: <td valign="middle" align="left">[<a href="#SEC30" title="Next section in reading order"> > </a>]</td>
2803: <td valign="middle" align="left"> </td>
2804: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2805: <td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2806: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2807: <td valign="middle" align="left"> </td>
2808: <td valign="middle" align="left"> </td>
2809: <td valign="middle" align="left"> </td>
2810: <td valign="middle" align="left"> </td>
2811: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2812: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2813: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2814: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2815: </tr></table>
2816: <h3 class="subsection"> 3.7.2 Using TAP network interfaces </h3>
2817:
2818: <p>This is the standard way to connect QEMU to a real network. QEMU adds
2819: a virtual network device on your host (called <code>tapN</code>), and you
2820: can then configure it as if it was a real ethernet card.
2821: </p>
2822: <hr size="6">
2823: <a name="SEC30"></a>
2824: <table cellpadding="1" cellspacing="1" border="0">
2825: <tr><td valign="middle" align="left">[<a href="#SEC29" title="Previous section in reading order"> < </a>]</td>
2826: <td valign="middle" align="left">[<a href="#SEC31" title="Next section in reading order"> > </a>]</td>
2827: <td valign="middle" align="left"> </td>
2828: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2829: <td valign="middle" align="left">[<a href="#SEC29" title="Up section"> Up </a>]</td>
2830: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2831: <td valign="middle" align="left"> </td>
2832: <td valign="middle" align="left"> </td>
2833: <td valign="middle" align="left"> </td>
2834: <td valign="middle" align="left"> </td>
2835: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2836: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2837: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2838: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2839: </tr></table>
2840: <h4 class="subsubsection"> 3.7.2.1 Linux host </h4>
2841:
2842: <p>As an example, you can download the ‘<tt>linux-test-xxx.tar.gz</tt>’
2843: archive and copy the script ‘<tt>qemu-ifup</tt>’ in ‘<tt>/etc</tt>’ and
2844: configure properly <code>sudo</code> so that the command <code>ifconfig</code>
2845: contained in ‘<tt>qemu-ifup</tt>’ can be executed as root. You must verify
2846: that your host kernel supports the TAP network interfaces: the
2847: device ‘<tt>/dev/net/tun</tt>’ must be present.
2848: </p>
2849: <p>See <a href="#SEC10">Invocation</a> to have examples of command lines using the
2850: TAP network interfaces.
2851: </p>
2852: <hr size="6">
2853: <a name="SEC31"></a>
2854: <table cellpadding="1" cellspacing="1" border="0">
2855: <tr><td valign="middle" align="left">[<a href="#SEC30" title="Previous section in reading order"> < </a>]</td>
2856: <td valign="middle" align="left">[<a href="#SEC32" title="Next section in reading order"> > </a>]</td>
2857: <td valign="middle" align="left"> </td>
2858: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2859: <td valign="middle" align="left">[<a href="#SEC29" title="Up section"> Up </a>]</td>
2860: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2861: <td valign="middle" align="left"> </td>
2862: <td valign="middle" align="left"> </td>
2863: <td valign="middle" align="left"> </td>
2864: <td valign="middle" align="left"> </td>
2865: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2866: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2867: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2868: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2869: </tr></table>
2870: <h4 class="subsubsection"> 3.7.2.2 Windows host </h4>
2871:
2872: <p>There is a virtual ethernet driver for Windows 2000/XP systems, called
2873: TAP-Win32. But it is not included in standard QEMU for Windows,
2874: so you will need to get it separately. It is part of OpenVPN package,
2875: so download OpenVPN from : <a href="http://openvpn.net/">http://openvpn.net/</a>.
2876: </p>
2877: <hr size="6">
2878: <a name="SEC32"></a>
2879: <table cellpadding="1" cellspacing="1" border="0">
2880: <tr><td valign="middle" align="left">[<a href="#SEC31" title="Previous section in reading order"> < </a>]</td>
2881: <td valign="middle" align="left">[<a href="#SEC33" title="Next section in reading order"> > </a>]</td>
2882: <td valign="middle" align="left"> </td>
2883: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2884: <td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2885: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2886: <td valign="middle" align="left"> </td>
2887: <td valign="middle" align="left"> </td>
2888: <td valign="middle" align="left"> </td>
2889: <td valign="middle" align="left"> </td>
2890: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2891: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2892: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2893: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2894: </tr></table>
2895: <h3 class="subsection"> 3.7.3 Using the user mode network stack </h3>
2896:
2897: <p>By using the option ‘<samp>-net user</samp>’ (default configuration if no
2898: ‘<samp>-net</samp>’ option is specified), QEMU uses a completely user mode
2899: network stack (you don't need root privilege to use the virtual
2900: network). The virtual network configuration is the following:
2901: </p>
2902: <table><tr><td> </td><td><pre class="example">
2903: QEMU VLAN <------> Firewall/DHCP server <-----> Internet
2904: | (10.0.2.2)
2905: |
2906: ----> DNS server (10.0.2.3)
2907: |
2908: ----> SMB server (10.0.2.4)
2909: </pre></td></tr></table>
2910:
2911: <p>The QEMU VM behaves as if it was behind a firewall which blocks all
2912: incoming connections. You can use a DHCP client to automatically
2913: configure the network in the QEMU VM. The DHCP server assign addresses
2914: to the hosts starting from 10.0.2.15.
2915: </p>
2916: <p>In order to check that the user mode network is working, you can ping
2917: the address 10.0.2.2 and verify that you got an address in the range
2918: 10.0.2.x from the QEMU virtual DHCP server.
2919: </p>
2920: <p>Note that <code>ping</code> is not supported reliably to the internet as it
2921: would require root privileges. It means you can only ping the local
2922: router (10.0.2.2).
2923: </p>
2924: <p>When using the built-in TFTP server, the router is also the TFTP
2925: server.
2926: </p>
2927: <p>When using the ‘<samp>-redir</samp>’ option, TCP or UDP connections can be
2928: redirected from the host to the guest. It allows for example to
2929: redirect X11, telnet or SSH connections.
2930: </p>
2931: <hr size="6">
2932: <a name="SEC33"></a>
2933: <table cellpadding="1" cellspacing="1" border="0">
2934: <tr><td valign="middle" align="left">[<a href="#SEC32" title="Previous section in reading order"> < </a>]</td>
2935: <td valign="middle" align="left">[<a href="#SEC34" title="Next section in reading order"> > </a>]</td>
2936: <td valign="middle" align="left"> </td>
2937: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2938: <td valign="middle" align="left">[<a href="#SEC27" title="Up section"> Up </a>]</td>
2939: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2940: <td valign="middle" align="left"> </td>
2941: <td valign="middle" align="left"> </td>
2942: <td valign="middle" align="left"> </td>
2943: <td valign="middle" align="left"> </td>
2944: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2945: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2946: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2947: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2948: </tr></table>
2949: <h3 class="subsection"> 3.7.4 Connecting VLANs between QEMU instances </h3>
2950:
2951: <p>Using the ‘<samp>-net socket</samp>’ option, it is possible to make VLANs
2952: that span several QEMU instances. See <a href="#SEC10">Invocation</a> to have a
2953: basic example.
2954: </p>
2955: <hr size="6">
2956: <a name="direct_005flinux_005fboot"></a>
2957: <a name="SEC34"></a>
2958: <table cellpadding="1" cellspacing="1" border="0">
2959: <tr><td valign="middle" align="left">[<a href="#SEC33" title="Previous section in reading order"> < </a>]</td>
2960: <td valign="middle" align="left">[<a href="#SEC35" title="Next section in reading order"> > </a>]</td>
2961: <td valign="middle" align="left"> </td>
2962: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2963: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
2964: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
2965: <td valign="middle" align="left"> </td>
2966: <td valign="middle" align="left"> </td>
2967: <td valign="middle" align="left"> </td>
2968: <td valign="middle" align="left"> </td>
2969: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2970: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
2971: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
2972: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
2973: </tr></table>
2974: <h2 class="section"> 3.8 Direct Linux Boot </h2>
2975:
2976: <p>This section explains how to launch a Linux kernel inside QEMU without
2977: having to make a full bootable image. It is very useful for fast Linux
2978: kernel testing.
2979: </p>
2980: <p>The syntax is:
2981: </p><table><tr><td> </td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda"
2982: </pre></td></tr></table>
2983:
2984: <p>Use ‘<samp>-kernel</samp>’ to provide the Linux kernel image and
2985: ‘<samp>-append</samp>’ to give the kernel command line arguments. The
2986: ‘<samp>-initrd</samp>’ option can be used to provide an INITRD image.
2987: </p>
2988: <p>When using the direct Linux boot, a disk image for the first hard disk
2989: ‘<tt>hda</tt>’ is required because its boot sector is used to launch the
2990: Linux kernel.
2991: </p>
2992: <p>If you do not need graphical output, you can disable it and redirect
2993: the virtual serial port and the QEMU monitor to the console with the
2994: ‘<samp>-nographic</samp>’ option. The typical command line is:
2995: </p><table><tr><td> </td><td><pre class="example">qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
2996: -append "root=/dev/hda console=ttyS0" -nographic
2997: </pre></td></tr></table>
2998:
2999: <p>Use <Ctrl-a c> to switch between the serial console and the
3000: monitor (see section <a href="#SEC11">Keys</a>).
3001: </p>
3002: <hr size="6">
3003: <a name="pcsys_005fusb"></a>
3004: <a name="SEC35"></a>
3005: <table cellpadding="1" cellspacing="1" border="0">
3006: <tr><td valign="middle" align="left">[<a href="#SEC34" title="Previous section in reading order"> < </a>]</td>
3007: <td valign="middle" align="left">[<a href="#SEC36" title="Next section in reading order"> > </a>]</td>
3008: <td valign="middle" align="left"> </td>
3009: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3010: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
3011: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3012: <td valign="middle" align="left"> </td>
3013: <td valign="middle" align="left"> </td>
3014: <td valign="middle" align="left"> </td>
3015: <td valign="middle" align="left"> </td>
3016: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3017: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3018: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3019: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3020: </tr></table>
3021: <h2 class="section"> 3.9 USB emulation </h2>
3022:
3023: <p>QEMU emulates a PCI UHCI USB controller. You can virtually plug
3024: virtual USB devices or real host USB devices (experimental, works only
3025: on Linux hosts). Qemu will automatically create and connect virtual USB hubs
3026: as necessary to connect multiple USB devices.
3027: </p>
3028: <table class="menu" border="0" cellspacing="0">
3029: <tr><td align="left" valign="top"><a href="#SEC36">3.9.1 Connecting USB devices</a></td><td> </td><td align="left" valign="top">
3030: </td></tr>
3031: <tr><td align="left" valign="top"><a href="#SEC37">3.9.2 Using host USB devices on a Linux host</a></td><td> </td><td align="left" valign="top">
3032: </td></tr>
3033: </table>
3034: <hr size="6">
3035: <a name="usb_005fdevices"></a>
3036: <a name="SEC36"></a>
3037: <table cellpadding="1" cellspacing="1" border="0">
3038: <tr><td valign="middle" align="left">[<a href="#SEC35" title="Previous section in reading order"> < </a>]</td>
3039: <td valign="middle" align="left">[<a href="#SEC37" title="Next section in reading order"> > </a>]</td>
3040: <td valign="middle" align="left"> </td>
3041: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3042: <td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
3043: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3044: <td valign="middle" align="left"> </td>
3045: <td valign="middle" align="left"> </td>
3046: <td valign="middle" align="left"> </td>
3047: <td valign="middle" align="left"> </td>
3048: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3049: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3050: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3051: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3052: </tr></table>
3053: <h3 class="subsection"> 3.9.1 Connecting USB devices </h3>
3054:
3055: <p>USB devices can be connected with the ‘<samp>-usbdevice</samp>’ commandline option
3056: or the <code>usb_add</code> monitor command. Available devices are:
3057: </p>
3058: <dl compact="compact">
3059: <dt> <code>mouse</code></dt>
3060: <dd><p>Virtual Mouse. This will override the PS/2 mouse emulation when activated.
3061: </p></dd>
3062: <dt> <code>tablet</code></dt>
3063: <dd><p>Pointer device that uses absolute coordinates (like a touchscreen).
3064: This means qemu is able to report the mouse position without having
3065: to grab the mouse. Also overrides the PS/2 mouse emulation when activated.
3066: </p></dd>
3067: <dt> <code>disk:<var>file</var></code></dt>
3068: <dd><p>Mass storage device based on <var>file</var> (see section <a href="#SEC15">Disk Images</a>)
3069: </p></dd>
3070: <dt> <code>host:<var>bus.addr</var></code></dt>
3071: <dd><p>Pass through the host device identified by <var>bus.addr</var>
3072: (Linux only)
3073: </p></dd>
3074: <dt> <code>host:<var>vendor_id:product_id</var></code></dt>
3075: <dd><p>Pass through the host device identified by <var>vendor_id:product_id</var>
3076: (Linux only)
3077: </p></dd>
3078: <dt> <code>wacom-tablet</code></dt>
3079: <dd><p>Virtual Wacom PenPartner tablet. This device is similar to the <code>tablet</code>
3080: above but it can be used with the tslib library because in addition to touch
3081: coordinates it reports touch pressure.
3082: </p></dd>
3083: <dt> <code>keyboard</code></dt>
3084: <dd><p>Standard USB keyboard. Will override the PS/2 keyboard (if present).
3085: </p></dd>
3086: <dt> <code>serial:[vendorid=<var>vendor_id</var>][,product_id=<var>product_id</var>]:<var>dev</var></code></dt>
3087: <dd><p>Serial converter. This emulates an FTDI FT232BM chip connected to host character
3088: device <var>dev</var>. The available character devices are the same as for the
3089: <code>-serial</code> option. The <code>vendorid</code> and <code>productid</code> options can be
3090: used to override the default 0403:6001. For instance,
3091: </p><table><tr><td> </td><td><pre class="example">usb_add serial:productid=FA00:tcp:192.168.0.2:4444
3092: </pre></td></tr></table>
3093: <p>will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virtual
3094: serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00).
3095: </p></dd>
3096: <dt> <code>braille</code></dt>
3097: <dd><p>Braille device. This will use BrlAPI to display the braille output on a real
3098: or fake device.
3099: </p></dd>
3100: <dt> <code>net:<var>options</var></code></dt>
3101: <dd><p>Network adapter that supports CDC ethernet and RNDIS protocols. <var>options</var>
3102: specifies NIC options as with <code>-net nic,</code><var>options</var> (see description).
3103: For instance, user-mode networking can be used with
3104: </p><table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -net user,vlan=0 -usbdevice net:vlan=0
3105: </pre></td></tr></table>
3106: <p>Currently this cannot be used in machines that support PCI NICs.
3107: </p></dd>
3108: <dt> <code>bt[:<var>hci-type</var>]</code></dt>
3109: <dd><p>Bluetooth dongle whose type is specified in the same format as with
3110: the ‘<samp>-bt hci</samp>’ option, see <a href="#bt_002dhcis">allowed HCI types</a>. If
3111: no type is given, the HCI logic corresponds to <code>-bt hci,vlan=0</code>.
3112: This USB device implements the USB Transport Layer of HCI. Example
3113: usage:
3114: </p><table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -usbdevice bt:hci,vlan=3 -bt device:keyboard,vlan=3
3115: </pre></td></tr></table>
3116: </dd>
3117: </dl>
3118:
3119: <hr size="6">
3120: <a name="host_005fusb_005fdevices"></a>
3121: <a name="SEC37"></a>
3122: <table cellpadding="1" cellspacing="1" border="0">
3123: <tr><td valign="middle" align="left">[<a href="#SEC36" title="Previous section in reading order"> < </a>]</td>
3124: <td valign="middle" align="left">[<a href="#SEC38" title="Next section in reading order"> > </a>]</td>
3125: <td valign="middle" align="left"> </td>
3126: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3127: <td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
3128: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3129: <td valign="middle" align="left"> </td>
3130: <td valign="middle" align="left"> </td>
3131: <td valign="middle" align="left"> </td>
3132: <td valign="middle" align="left"> </td>
3133: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3134: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3135: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3136: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3137: </tr></table>
3138: <h3 class="subsection"> 3.9.2 Using host USB devices on a Linux host </h3>
3139:
3140: <p>WARNING: this is an experimental feature. QEMU will slow down when
3141: using it. USB devices requiring real time streaming (i.e. USB Video
3142: Cameras) are not supported yet.
3143: </p>
3144: <ol>
3145: <li> If you use an early Linux 2.4 kernel, verify that no Linux driver
3146: is actually using the USB device. A simple way to do that is simply to
3147: disable the corresponding kernel module by renaming it from ‘<tt>mydriver.o</tt>’
3148: to ‘<tt>mydriver.o.disabled</tt>’.
3149:
3150: </li><li> Verify that ‘<tt>/proc/bus/usb</tt>’ is working (most Linux distributions should enable it by default). You should see something like that:
3151: <table><tr><td> </td><td><pre class="example">ls /proc/bus/usb
3152: 001 devices drivers
3153: </pre></td></tr></table>
3154:
3155: </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:
3156: <table><tr><td> </td><td><pre class="example">chown -R myuid /proc/bus/usb
3157: </pre></td></tr></table>
3158:
3159: </li><li> Launch QEMU and do in the monitor:
3160: <table><tr><td> </td><td><pre class="example">info usbhost
3161: Device 1.2, speed 480 Mb/s
3162: Class 00: USB device 1234:5678, USB DISK
3163: </pre></td></tr></table>
3164: <p>You should see the list of the devices you can use (Never try to use
3165: hubs, it won't work).
3166: </p>
3167: </li><li> Add the device in QEMU by using:
3168: <table><tr><td> </td><td><pre class="example">usb_add host:1234:5678
3169: </pre></td></tr></table>
3170:
3171: <p>Normally the guest OS should report that a new USB device is
3172: plugged. You can use the option ‘<samp>-usbdevice</samp>’ to do the same.
3173: </p>
3174: </li><li> Now you can try to use the host USB device in QEMU.
3175:
3176: </li></ol>
3177:
3178: <p>When relaunching QEMU, you may have to unplug and plug again the USB
3179: device to make it work again (this is a bug).
3180: </p>
3181: <hr size="6">
3182: <a name="vnc_005fsecurity"></a>
3183: <a name="SEC38"></a>
3184: <table cellpadding="1" cellspacing="1" border="0">
3185: <tr><td valign="middle" align="left">[<a href="#SEC37" title="Previous section in reading order"> < </a>]</td>
3186: <td valign="middle" align="left">[<a href="#SEC39" title="Next section in reading order"> > </a>]</td>
3187: <td valign="middle" align="left"> </td>
3188: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3189: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
3190: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3191: <td valign="middle" align="left"> </td>
3192: <td valign="middle" align="left"> </td>
3193: <td valign="middle" align="left"> </td>
3194: <td valign="middle" align="left"> </td>
3195: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3196: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3197: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3198: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3199: </tr></table>
3200: <h2 class="section"> 3.10 VNC security </h2>
3201:
3202: <p>The VNC server capability provides access to the graphical console
3203: of the guest VM across the network. This has a number of security
3204: considerations depending on the deployment scenarios.
3205: </p>
3206: <table class="menu" border="0" cellspacing="0">
3207: <tr><td align="left" valign="top"><a href="#SEC39">3.10.1 Without passwords</a></td><td> </td><td align="left" valign="top">
3208: </td></tr>
3209: <tr><td align="left" valign="top"><a href="#SEC40">3.10.2 With passwords</a></td><td> </td><td align="left" valign="top">
3210: </td></tr>
3211: <tr><td align="left" valign="top"><a href="#SEC41">3.10.3 With x509 certificates</a></td><td> </td><td align="left" valign="top">
3212: </td></tr>
3213: <tr><td align="left" valign="top"><a href="#SEC42">3.10.4 With x509 certificates and client verification</a></td><td> </td><td align="left" valign="top">
3214: </td></tr>
3215: <tr><td align="left" valign="top"><a href="#SEC43">3.10.5 With x509 certificates, client verification and passwords</a></td><td> </td><td align="left" valign="top">
3216: </td></tr>
3217: <tr><td align="left" valign="top"><a href="#SEC44">3.10.6 With SASL authentication</a></td><td> </td><td align="left" valign="top">
3218: </td></tr>
3219: <tr><td align="left" valign="top"><a href="#SEC45">3.10.7 With x509 certificates and SASL authentication</a></td><td> </td><td align="left" valign="top">
3220: </td></tr>
3221: <tr><td align="left" valign="top"><a href="#SEC46">3.10.8 Generating certificates for VNC</a></td><td> </td><td align="left" valign="top">
3222: </td></tr>
3223: <tr><td align="left" valign="top"><a href="#SEC50">3.10.9 Configuring SASL mechanisms</a></td><td> </td><td align="left" valign="top">
3224: </td></tr>
3225: </table>
3226: <hr size="6">
3227: <a name="vnc_005fsec_005fnone"></a>
3228: <a name="SEC39"></a>
3229: <table cellpadding="1" cellspacing="1" border="0">
3230: <tr><td valign="middle" align="left">[<a href="#SEC38" title="Previous section in reading order"> < </a>]</td>
3231: <td valign="middle" align="left">[<a href="#SEC40" title="Next section in reading order"> > </a>]</td>
3232: <td valign="middle" align="left"> </td>
3233: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3234: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3235: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3236: <td valign="middle" align="left"> </td>
3237: <td valign="middle" align="left"> </td>
3238: <td valign="middle" align="left"> </td>
3239: <td valign="middle" align="left"> </td>
3240: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3241: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3242: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3243: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3244: </tr></table>
3245: <h3 class="subsection"> 3.10.1 Without passwords </h3>
3246:
3247: <p>The simplest VNC server setup does not include any form of authentication.
3248: For this setup it is recommended to restrict it to listen on a UNIX domain
3249: socket only. For example
3250: </p>
3251: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
3252: </pre></td></tr></table>
3253:
3254: <p>This ensures that only users on local box with read/write access to that
3255: path can access the VNC server. To securely access the VNC server from a
3256: remote machine, a combination of netcat+ssh can be used to provide a secure
3257: tunnel.
3258: </p>
3259: <hr size="6">
3260: <a name="vnc_005fsec_005fpassword"></a>
3261: <a name="SEC40"></a>
3262: <table cellpadding="1" cellspacing="1" border="0">
3263: <tr><td valign="middle" align="left">[<a href="#SEC39" title="Previous section in reading order"> < </a>]</td>
3264: <td valign="middle" align="left">[<a href="#SEC41" title="Next section in reading order"> > </a>]</td>
3265: <td valign="middle" align="left"> </td>
3266: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3267: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3268: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3269: <td valign="middle" align="left"> </td>
3270: <td valign="middle" align="left"> </td>
3271: <td valign="middle" align="left"> </td>
3272: <td valign="middle" align="left"> </td>
3273: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3274: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3275: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3276: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3277: </tr></table>
3278: <h3 class="subsection"> 3.10.2 With passwords </h3>
3279:
3280: <p>The VNC protocol has limited support for password based authentication. Since
3281: the protocol limits passwords to 8 characters it should not be considered
3282: to provide high security. The password can be fairly easily brute-forced by
3283: a client making repeat connections. For this reason, a VNC server using password
3284: authentication should be restricted to only listen on the loopback interface
3285: or UNIX domain sockets. Password authentication is requested with the <code>password</code>
3286: option, and then once QEMU is running the password is set with the monitor. Until
3287: the monitor is used to set the password all clients will be rejected.
3288: </p>
3289: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password -monitor stdio
3290: (qemu) change vnc password
3291: Password: ********
3292: (qemu)
3293: </pre></td></tr></table>
3294:
3295: <hr size="6">
3296: <a name="vnc_005fsec_005fcertificate"></a>
3297: <a name="SEC41"></a>
3298: <table cellpadding="1" cellspacing="1" border="0">
3299: <tr><td valign="middle" align="left">[<a href="#SEC40" title="Previous section in reading order"> < </a>]</td>
3300: <td valign="middle" align="left">[<a href="#SEC42" title="Next section in reading order"> > </a>]</td>
3301: <td valign="middle" align="left"> </td>
3302: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3303: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3304: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3305: <td valign="middle" align="left"> </td>
3306: <td valign="middle" align="left"> </td>
3307: <td valign="middle" align="left"> </td>
3308: <td valign="middle" align="left"> </td>
3309: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3310: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3311: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3312: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3313: </tr></table>
3314: <h3 class="subsection"> 3.10.3 With x509 certificates </h3>
3315:
3316: <p>The QEMU VNC server also implements the VeNCrypt extension allowing use of
3317: TLS for encryption of the session, and x509 certificates for authentication.
3318: The use of x509 certificates is strongly recommended, because TLS on its
3319: own is susceptible to man-in-the-middle attacks. Basic x509 certificate
3320: support provides a secure session, but no authentication. This allows any
3321: client to connect, and provides an encrypted session.
3322: </p>
3323: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio
3324: </pre></td></tr></table>
3325:
3326: <p>In the above example <code>/etc/pki/qemu</code> should contain at least three files,
3327: <code>ca-cert.pem</code>, <code>server-cert.pem</code> and <code>server-key.pem</code>. Unprivileged
3328: users will want to use a private directory, for example <code>$HOME/.pki/qemu</code>.
3329: NB the <code>server-key.pem</code> file should be protected with file mode 0600 to
3330: only be readable by the user owning it.
3331: </p>
3332: <hr size="6">
3333: <a name="vnc_005fsec_005fcertificate_005fverify"></a>
3334: <a name="SEC42"></a>
3335: <table cellpadding="1" cellspacing="1" border="0">
3336: <tr><td valign="middle" align="left">[<a href="#SEC41" title="Previous section in reading order"> < </a>]</td>
3337: <td valign="middle" align="left">[<a href="#SEC43" title="Next section in reading order"> > </a>]</td>
3338: <td valign="middle" align="left"> </td>
3339: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3340: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3341: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3342: <td valign="middle" align="left"> </td>
3343: <td valign="middle" align="left"> </td>
3344: <td valign="middle" align="left"> </td>
3345: <td valign="middle" align="left"> </td>
3346: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3347: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3348: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3349: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3350: </tr></table>
3351: <h3 class="subsection"> 3.10.4 With x509 certificates and client verification </h3>
3352:
3353: <p>Certificates can also provide a means to authenticate the client connecting.
3354: The server will request that the client provide a certificate, which it will
3355: then validate against the CA certificate. This is a good choice if deploying
3356: in an environment with a private internal certificate authority.
3357: </p>
3358: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio
3359: </pre></td></tr></table>
3360:
3361:
3362: <hr size="6">
3363: <a name="vnc_005fsec_005fcertificate_005fpw"></a>
3364: <a name="SEC43"></a>
3365: <table cellpadding="1" cellspacing="1" border="0">
3366: <tr><td valign="middle" align="left">[<a href="#SEC42" title="Previous section in reading order"> < </a>]</td>
3367: <td valign="middle" align="left">[<a href="#SEC44" title="Next section in reading order"> > </a>]</td>
3368: <td valign="middle" align="left"> </td>
3369: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3370: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3371: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3372: <td valign="middle" align="left"> </td>
3373: <td valign="middle" align="left"> </td>
3374: <td valign="middle" align="left"> </td>
3375: <td valign="middle" align="left"> </td>
3376: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3377: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3378: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3379: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3380: </tr></table>
3381: <h3 class="subsection"> 3.10.5 With x509 certificates, client verification and passwords </h3>
3382:
3383: <p>Finally, the previous method can be combined with VNC password authentication
3384: to provide two layers of authentication for clients.
3385: </p>
3386: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio
3387: (qemu) change vnc password
3388: Password: ********
3389: (qemu)
3390: </pre></td></tr></table>
3391:
3392:
3393: <hr size="6">
3394: <a name="vnc_005fsec_005fsasl"></a>
3395: <a name="SEC44"></a>
3396: <table cellpadding="1" cellspacing="1" border="0">
3397: <tr><td valign="middle" align="left">[<a href="#SEC43" title="Previous section in reading order"> < </a>]</td>
3398: <td valign="middle" align="left">[<a href="#SEC45" title="Next section in reading order"> > </a>]</td>
3399: <td valign="middle" align="left"> </td>
3400: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3401: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3402: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3403: <td valign="middle" align="left"> </td>
3404: <td valign="middle" align="left"> </td>
3405: <td valign="middle" align="left"> </td>
3406: <td valign="middle" align="left"> </td>
3407: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3408: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3409: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3410: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3411: </tr></table>
3412: <h3 class="subsection"> 3.10.6 With SASL authentication </h3>
3413:
3414: <p>The SASL authentication method is a VNC extension, that provides an
3415: easily extendable, pluggable authentication method. This allows for
3416: integration with a wide range of authentication mechanisms, such as
3417: PAM, GSSAPI/Kerberos, LDAP, SQL databases, one-time keys and more.
3418: The strength of the authentication depends on the exact mechanism
3419: configured. If the chosen mechanism also provides a SSF layer, then
3420: it will encrypt the datastream as well.
3421: </p>
3422: <p>Refer to the later docs on how to choose the exact SASL mechanism
3423: used for authentication, but assuming use of one supporting SSF,
3424: then QEMU can be launched with:
3425: </p>
3426: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,sasl -monitor stdio
3427: </pre></td></tr></table>
3428:
3429: <hr size="6">
3430: <a name="vnc_005fsec_005fcertificate_005fsasl"></a>
3431: <a name="SEC45"></a>
3432: <table cellpadding="1" cellspacing="1" border="0">
3433: <tr><td valign="middle" align="left">[<a href="#SEC44" title="Previous section in reading order"> < </a>]</td>
3434: <td valign="middle" align="left">[<a href="#SEC46" title="Next section in reading order"> > </a>]</td>
3435: <td valign="middle" align="left"> </td>
3436: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3437: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3438: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3439: <td valign="middle" align="left"> </td>
3440: <td valign="middle" align="left"> </td>
3441: <td valign="middle" align="left"> </td>
3442: <td valign="middle" align="left"> </td>
3443: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3444: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3445: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3446: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3447: </tr></table>
3448: <h3 class="subsection"> 3.10.7 With x509 certificates and SASL authentication </h3>
3449:
3450: <p>If the desired SASL authentication mechanism does not supported
3451: SSF layers, then it is strongly advised to run it in combination
3452: with TLS and x509 certificates. This provides securely encrypted
3453: data stream, avoiding risk of compromising of the security
3454: credentials. This can be enabled, by combining the 'sasl' option
3455: with the aforementioned TLS + x509 options:
3456: </p>
3457: <table><tr><td> </td><td><pre class="example">qemu [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio
3458: </pre></td></tr></table>
3459:
3460:
3461: <hr size="6">
3462: <a name="vnc_005fgenerate_005fcert"></a>
3463: <a name="SEC46"></a>
3464: <table cellpadding="1" cellspacing="1" border="0">
3465: <tr><td valign="middle" align="left">[<a href="#SEC45" title="Previous section in reading order"> < </a>]</td>
3466: <td valign="middle" align="left">[<a href="#SEC47" title="Next section in reading order"> > </a>]</td>
3467: <td valign="middle" align="left"> </td>
3468: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3469: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3470: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3471: <td valign="middle" align="left"> </td>
3472: <td valign="middle" align="left"> </td>
3473: <td valign="middle" align="left"> </td>
3474: <td valign="middle" align="left"> </td>
3475: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3476: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3477: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3478: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3479: </tr></table>
3480: <h3 class="subsection"> 3.10.8 Generating certificates for VNC </h3>
3481:
3482: <p>The GNU TLS packages provides a command called <code>certtool</code> which can
3483: be used to generate certificates and keys in PEM format. At a minimum it
3484: is neccessary to setup a certificate authority, and issue certificates to
3485: each server. If using certificates for authentication, then each client
3486: will also need to be issued a certificate. The recommendation is for the
3487: server to keep its certificates in either <code>/etc/pki/qemu</code> or for
3488: unprivileged users in <code>$HOME/.pki/qemu</code>.
3489: </p>
3490: <table class="menu" border="0" cellspacing="0">
3491: <tr><td align="left" valign="top"><a href="#SEC47">3.10.8.1 Setup the Certificate Authority</a></td><td> </td><td align="left" valign="top">
3492: </td></tr>
3493: <tr><td align="left" valign="top"><a href="#SEC48">3.10.8.2 Issuing server certificates</a></td><td> </td><td align="left" valign="top">
3494: </td></tr>
3495: <tr><td align="left" valign="top"><a href="#SEC49">3.10.8.3 Issuing client certificates</a></td><td> </td><td align="left" valign="top">
3496: </td></tr>
3497: </table>
3498: <hr size="6">
3499: <a name="vnc_005fgenerate_005fca"></a>
3500: <a name="SEC47"></a>
3501: <table cellpadding="1" cellspacing="1" border="0">
3502: <tr><td valign="middle" align="left">[<a href="#SEC46" title="Previous section in reading order"> < </a>]</td>
3503: <td valign="middle" align="left">[<a href="#SEC48" title="Next section in reading order"> > </a>]</td>
3504: <td valign="middle" align="left"> </td>
3505: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3506: <td valign="middle" align="left">[<a href="#SEC46" title="Up section"> Up </a>]</td>
3507: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3508: <td valign="middle" align="left"> </td>
3509: <td valign="middle" align="left"> </td>
3510: <td valign="middle" align="left"> </td>
3511: <td valign="middle" align="left"> </td>
3512: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3513: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3514: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3515: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3516: </tr></table>
3517: <h4 class="subsubsection"> 3.10.8.1 Setup the Certificate Authority </h4>
3518:
3519: <p>This step only needs to be performed once per organization / organizational
3520: unit. First the CA needs a private key. This key must be kept VERY secret
3521: and secure. If this key is compromised the entire trust chain of the certificates
3522: issued with it is lost.
3523: </p>
3524: <table><tr><td> </td><td><pre class="example"># certtool --generate-privkey > ca-key.pem
3525: </pre></td></tr></table>
3526:
3527: <p>A CA needs to have a public certificate. For simplicity it can be a self-signed
3528: certificate, or one issue by a commercial certificate issuing authority. To
3529: generate a self-signed certificate requires one core piece of information, the
3530: name of the organization.
3531: </p>
3532: <table><tr><td> </td><td><pre class="example"># cat > ca.info <<EOF
3533: cn = Name of your organization
3534: ca
3535: cert_signing_key
3536: EOF
3537: # certtool --generate-self-signed \
3538: --load-privkey ca-key.pem
3539: --template ca.info \
3540: --outfile ca-cert.pem
3541: </pre></td></tr></table>
3542:
3543: <p>The <code>ca-cert.pem</code> file should be copied to all servers and clients wishing to utilize
3544: TLS support in the VNC server. The <code>ca-key.pem</code> must not be disclosed/copied at all.
3545: </p>
3546: <hr size="6">
3547: <a name="vnc_005fgenerate_005fserver"></a>
3548: <a name="SEC48"></a>
3549: <table cellpadding="1" cellspacing="1" border="0">
3550: <tr><td valign="middle" align="left">[<a href="#SEC47" title="Previous section in reading order"> < </a>]</td>
3551: <td valign="middle" align="left">[<a href="#SEC49" title="Next section in reading order"> > </a>]</td>
3552: <td valign="middle" align="left"> </td>
3553: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3554: <td valign="middle" align="left">[<a href="#SEC46" title="Up section"> Up </a>]</td>
3555: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3556: <td valign="middle" align="left"> </td>
3557: <td valign="middle" align="left"> </td>
3558: <td valign="middle" align="left"> </td>
3559: <td valign="middle" align="left"> </td>
3560: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3561: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3562: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3563: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3564: </tr></table>
3565: <h4 class="subsubsection"> 3.10.8.2 Issuing server certificates </h4>
3566:
3567: <p>Each server (or host) needs to be issued with a key and certificate. When connecting
3568: the certificate is sent to the client which validates it against the CA certificate.
3569: The core piece of information for a server certificate is the hostname. This should
3570: be the fully qualified hostname that the client will connect with, since the client
3571: will typically also verify the hostname in the certificate. On the host holding the
3572: secure CA private key:
3573: </p>
3574: <table><tr><td> </td><td><pre class="example"># cat > server.info <<EOF
3575: organization = Name of your organization
3576: cn = server.foo.example.com
3577: tls_www_server
3578: encryption_key
3579: signing_key
3580: EOF
3581: # certtool --generate-privkey > server-key.pem
3582: # certtool --generate-certificate \
3583: --load-ca-certificate ca-cert.pem \
3584: --load-ca-privkey ca-key.pem \
3585: --load-privkey server server-key.pem \
3586: --template server.info \
3587: --outfile server-cert.pem
3588: </pre></td></tr></table>
3589:
3590: <p>The <code>server-key.pem</code> and <code>server-cert.pem</code> files should now be securely copied
3591: to the server for which they were generated. The <code>server-key.pem</code> is security
3592: sensitive and should be kept protected with file mode 0600 to prevent disclosure.
3593: </p>
3594: <hr size="6">
3595: <a name="vnc_005fgenerate_005fclient"></a>
3596: <a name="SEC49"></a>
3597: <table cellpadding="1" cellspacing="1" border="0">
3598: <tr><td valign="middle" align="left">[<a href="#SEC48" title="Previous section in reading order"> < </a>]</td>
3599: <td valign="middle" align="left">[<a href="#SEC50" title="Next section in reading order"> > </a>]</td>
3600: <td valign="middle" align="left"> </td>
3601: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3602: <td valign="middle" align="left">[<a href="#SEC46" title="Up section"> Up </a>]</td>
3603: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3604: <td valign="middle" align="left"> </td>
3605: <td valign="middle" align="left"> </td>
3606: <td valign="middle" align="left"> </td>
3607: <td valign="middle" align="left"> </td>
3608: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3609: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3610: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3611: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3612: </tr></table>
3613: <h4 class="subsubsection"> 3.10.8.3 Issuing client certificates </h4>
3614:
3615: <p>If the QEMU VNC server is to use the <code>x509verify</code> option to validate client
3616: certificates as its authentication mechanism, each client also needs to be issued
3617: a certificate. The client certificate contains enough metadata to uniquely identify
3618: the client, typically organization, state, city, building, etc. On the host holding
3619: the secure CA private key:
3620: </p>
3621: <table><tr><td> </td><td><pre class="example"># cat > client.info <<EOF
3622: country = GB
3623: state = London
3624: locality = London
3625: organiazation = Name of your organization
3626: cn = client.foo.example.com
3627: tls_www_client
3628: encryption_key
3629: signing_key
3630: EOF
3631: # certtool --generate-privkey > client-key.pem
3632: # certtool --generate-certificate \
3633: --load-ca-certificate ca-cert.pem \
3634: --load-ca-privkey ca-key.pem \
3635: --load-privkey client-key.pem \
3636: --template client.info \
3637: --outfile client-cert.pem
3638: </pre></td></tr></table>
3639:
3640: <p>The <code>client-key.pem</code> and <code>client-cert.pem</code> files should now be securely
3641: copied to the client for which they were generated.
3642: </p>
3643:
3644: <hr size="6">
3645: <a name="vnc_005fsetup_005fsasl"></a>
3646: <table cellpadding="1" cellspacing="1" border="0">
3647: <tr><td valign="middle" align="left">[<a href="#SEC49" title="Previous section in reading order"> < </a>]</td>
3648: <td valign="middle" align="left">[<a href="#SEC51" title="Next section in reading order"> > </a>]</td>
3649: <td valign="middle" align="left"> </td>
3650: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3651: <td valign="middle" align="left">[<a href="#SEC38" title="Up section"> Up </a>]</td>
3652: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3653: <td valign="middle" align="left"> </td>
3654: <td valign="middle" align="left"> </td>
3655: <td valign="middle" align="left"> </td>
3656: <td valign="middle" align="left"> </td>
3657: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3658: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3659: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3660: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3661: </tr></table>
3662:
3663: <a name="SEC50"></a>
3664: <h3 class="subsection"> 3.10.9 Configuring SASL mechanisms </h3>
3665:
3666: <p>The following documentation assumes use of the Cyrus SASL implementation on a
3667: Linux host, but the principals should apply to any other SASL impl. When SASL
3668: is enabled, the mechanism configuration will be loaded from system default
3669: SASL service config /etc/sasl2/qemu.conf. If running QEMU as an
3670: unprivileged user, an environment variable SASL_CONF_PATH can be used
3671: to make it search alternate locations for the service config.
3672: </p>
3673: <p>The default configuration might contain
3674: </p>
3675: <table><tr><td> </td><td><pre class="example">mech_list: digest-md5
3676: sasldb_path: /etc/qemu/passwd.db
3677: </pre></td></tr></table>
3678:
3679: <p>This says to use the 'Digest MD5' mechanism, which is similar to the HTTP
3680: Digest-MD5 mechanism. The list of valid usernames & passwords is maintained
3681: in the /etc/qemu/passwd.db file, and can be updated using the saslpasswd2
3682: command. While this mechanism is easy to configure and use, it is not
3683: considered secure by modern standards, so only suitable for developers /
3684: ad-hoc testing.
3685: </p>
3686: <p>A more serious deployment might use Kerberos, which is done with the 'gssapi'
3687: mechanism
3688: </p>
3689: <table><tr><td> </td><td><pre class="example">mech_list: gssapi
3690: keytab: /etc/qemu/krb5.tab
3691: </pre></td></tr></table>
3692:
3693: <p>For this to work the administrator of your KDC must generate a Kerberos
3694: principal for the server, with a name of 'qemu/[email protected]'
3695: replacing 'somehost.example.com' with the fully qualified host name of the
3696: machine running QEMU, and 'EXAMPLE.COM' with the Keberos Realm.
3697: </p>
3698: <p>Other configurations will be left as an exercise for the reader. It should
3699: be noted that only Digest-MD5 and GSSAPI provides a SSF layer for data
3700: encryption. For all other mechanisms, VNC should always be configured to
3701: use TLS and x509 certificates to protect security credentials from snooping.
3702: </p>
3703: <hr size="6">
3704: <a name="gdb_005fusage"></a>
3705: <a name="SEC51"></a>
3706: <table cellpadding="1" cellspacing="1" border="0">
3707: <tr><td valign="middle" align="left">[<a href="#SEC50" title="Previous section in reading order"> < </a>]</td>
3708: <td valign="middle" align="left">[<a href="#SEC52" title="Next section in reading order"> > </a>]</td>
3709: <td valign="middle" align="left"> </td>
3710: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3711: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
3712: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3713: <td valign="middle" align="left"> </td>
3714: <td valign="middle" align="left"> </td>
3715: <td valign="middle" align="left"> </td>
3716: <td valign="middle" align="left"> </td>
3717: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3718: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3719: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3720: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3721: </tr></table>
3722: <h2 class="section"> 3.11 GDB usage </h2>
3723:
3724: <p>QEMU has a primitive support to work with gdb, so that you can do
3725: 'Ctrl-C' while the virtual machine is running and inspect its state.
3726: </p>
3727: <p>In order to use gdb, launch qemu with the '-s' option. It will wait for a
3728: gdb connection:
3729: </p><table><tr><td> </td><td><pre class="example">> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
3730: -append "root=/dev/hda"
3731: Connected to host network interface: tun0
3732: Waiting gdb connection on port 1234
3733: </pre></td></tr></table>
3734:
3735: <p>Then launch gdb on the 'vmlinux' executable:
3736: </p><table><tr><td> </td><td><pre class="example">> gdb vmlinux
3737: </pre></td></tr></table>
3738:
3739: <p>In gdb, connect to QEMU:
3740: </p><table><tr><td> </td><td><pre class="example">(gdb) target remote localhost:1234
3741: </pre></td></tr></table>
3742:
3743: <p>Then you can use gdb normally. For example, type 'c' to launch the kernel:
3744: </p><table><tr><td> </td><td><pre class="example">(gdb) c
3745: </pre></td></tr></table>
3746:
3747: <p>Here are some useful tips in order to use gdb on system code:
3748: </p>
3749: <ol>
3750: <li>
3751: Use <code>info reg</code> to display all the CPU registers.
3752: </li><li>
3753: Use <code>x/10i $eip</code> to display the code at the PC position.
3754: </li><li>
3755: Use <code>set architecture i8086</code> to dump 16 bit code. Then use
3756: <code>x/10i $cs*16+$eip</code> to dump the code at the PC position.
3757: </li></ol>
3758:
3759: <p>Advanced debugging options:
3760: </p>
3761: <p>The default single stepping behavior is step with the IRQs and timer service routines off. It is set this way because when gdb executes a single step it expects to advance beyond the current instruction. With the IRQs and and timer service routines on, a single step might jump into the one of the interrupt or exception vectors instead of executing the current instruction. This means you may hit the same breakpoint a number of times before executing the instruction gdb wants to have executed. Because there are rare circumstances where you want to single step into an interrupt vector the behavior can be controlled from GDB. There are three commands you can query and set the single step behavior:
3762: </p><dl compact="compact">
3763: <dt> <code>maintenance packet qqemu.sstepbits</code></dt>
3764: <dd>
3765: <p>This will display the MASK bits used to control the single stepping IE:
3766: </p><table><tr><td> </td><td><pre class="example">(gdb) maintenance packet qqemu.sstepbits
3767: sending: "qqemu.sstepbits"
3768: received: "ENABLE=1,NOIRQ=2,NOTIMER=4"
3769: </pre></td></tr></table>
3770: </dd>
3771: <dt> <code>maintenance packet qqemu.sstep</code></dt>
3772: <dd>
3773: <p>This will display the current value of the mask used when single stepping IE:
3774: </p><table><tr><td> </td><td><pre class="example">(gdb) maintenance packet qqemu.sstep
3775: sending: "qqemu.sstep"
3776: received: "0x7"
3777: </pre></td></tr></table>
3778: </dd>
3779: <dt> <code>maintenance packet Qqemu.sstep=HEX_VALUE</code></dt>
3780: <dd>
3781: <p>This will change the single step mask, so if wanted to enable IRQs on the single step, but not timers, you would use:
3782: </p><table><tr><td> </td><td><pre class="example">(gdb) maintenance packet Qqemu.sstep=0x5
3783: sending: "qemu.sstep=0x5"
3784: received: "OK"
3785: </pre></td></tr></table>
3786: </dd>
3787: </dl>
3788:
3789: <hr size="6">
3790: <a name="pcsys_005fos_005fspecific"></a>
3791: <a name="SEC52"></a>
3792: <table cellpadding="1" cellspacing="1" border="0">
3793: <tr><td valign="middle" align="left">[<a href="#SEC51" title="Previous section in reading order"> < </a>]</td>
3794: <td valign="middle" align="left">[<a href="#SEC53" title="Next section in reading order"> > </a>]</td>
3795: <td valign="middle" align="left"> </td>
3796: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3797: <td valign="middle" align="left">[<a href="#SEC7" title="Up section"> Up </a>]</td>
3798: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3799: <td valign="middle" align="left"> </td>
3800: <td valign="middle" align="left"> </td>
3801: <td valign="middle" align="left"> </td>
3802: <td valign="middle" align="left"> </td>
3803: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3804: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3805: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3806: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3807: </tr></table>
3808: <h2 class="section"> 3.12 Target OS specific information </h2>
3809:
3810: <hr size="6">
3811: <a name="SEC53"></a>
3812: <table cellpadding="1" cellspacing="1" border="0">
3813: <tr><td valign="middle" align="left">[<a href="#SEC52" title="Previous section in reading order"> < </a>]</td>
3814: <td valign="middle" align="left">[<a href="#SEC54" title="Next section in reading order"> > </a>]</td>
3815: <td valign="middle" align="left"> </td>
3816: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3817: <td valign="middle" align="left">[<a href="#SEC52" title="Up section"> Up </a>]</td>
3818: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3819: <td valign="middle" align="left"> </td>
3820: <td valign="middle" align="left"> </td>
3821: <td valign="middle" align="left"> </td>
3822: <td valign="middle" align="left"> </td>
3823: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3824: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3825: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3826: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3827: </tr></table>
3828: <h3 class="subsection"> 3.12.1 Linux </h3>
3829:
3830: <p>To have access to SVGA graphic modes under X11, use the <code>vesa</code> or
3831: the <code>cirrus</code> X11 driver. For optimal performances, use 16 bit
3832: color depth in the guest and the host OS.
3833: </p>
3834: <p>When using a 2.6 guest Linux kernel, you should add the option
3835: <code>clock=pit</code> on the kernel command line because the 2.6 Linux
3836: kernels make very strict real time clock checks by default that QEMU
3837: cannot simulate exactly.
3838: </p>
3839: <p>When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is
3840: not activated because QEMU is slower with this patch. The QEMU
3841: Accelerator Module is also much slower in this case. Earlier Fedora
3842: Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate this
3843: patch by default. Newer kernels don't have it.
3844: </p>
3845: <hr size="6">
3846: <a name="SEC54"></a>
3847: <table cellpadding="1" cellspacing="1" border="0">
3848: <tr><td valign="middle" align="left">[<a href="#SEC53" title="Previous section in reading order"> < </a>]</td>
3849: <td valign="middle" align="left">[<a href="#SEC55" title="Next section in reading order"> > </a>]</td>
3850: <td valign="middle" align="left"> </td>
3851: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3852: <td valign="middle" align="left">[<a href="#SEC52" title="Up section"> Up </a>]</td>
3853: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3854: <td valign="middle" align="left"> </td>
3855: <td valign="middle" align="left"> </td>
3856: <td valign="middle" align="left"> </td>
3857: <td valign="middle" align="left"> </td>
3858: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3859: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3860: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3861: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3862: </tr></table>
3863: <h3 class="subsection"> 3.12.2 Windows </h3>
3864:
3865: <p>If you have a slow host, using Windows 95 is better as it gives the
3866: best speed. Windows 2000 is also a good choice.
3867: </p>
3868: <hr size="6">
3869: <a name="SEC55"></a>
3870: <table cellpadding="1" cellspacing="1" border="0">
3871: <tr><td valign="middle" align="left">[<a href="#SEC54" title="Previous section in reading order"> < </a>]</td>
3872: <td valign="middle" align="left">[<a href="#SEC56" title="Next section in reading order"> > </a>]</td>
3873: <td valign="middle" align="left"> </td>
3874: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3875: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
3876: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3877: <td valign="middle" align="left"> </td>
3878: <td valign="middle" align="left"> </td>
3879: <td valign="middle" align="left"> </td>
3880: <td valign="middle" align="left"> </td>
3881: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3882: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3883: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3884: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3885: </tr></table>
3886: <h4 class="subsubsection"> 3.12.2.1 SVGA graphic modes support </h4>
3887:
3888: <p>QEMU emulates a Cirrus Logic GD5446 Video
3889: card. All Windows versions starting from Windows 95 should recognize
3890: and use this graphic card. For optimal performances, use 16 bit color
3891: depth in the guest and the host OS.
3892: </p>
3893: <p>If you are using Windows XP as guest OS and if you want to use high
3894: resolution modes which the Cirrus Logic BIOS does not support (i.e. >=
3895: 1280x1024x16), then you should use the VESA VBE virtual graphic card
3896: (option ‘<samp>-std-vga</samp>’).
3897: </p>
3898: <hr size="6">
3899: <a name="SEC56"></a>
3900: <table cellpadding="1" cellspacing="1" border="0">
3901: <tr><td valign="middle" align="left">[<a href="#SEC55" title="Previous section in reading order"> < </a>]</td>
3902: <td valign="middle" align="left">[<a href="#SEC57" title="Next section in reading order"> > </a>]</td>
3903: <td valign="middle" align="left"> </td>
3904: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3905: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
3906: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3907: <td valign="middle" align="left"> </td>
3908: <td valign="middle" align="left"> </td>
3909: <td valign="middle" align="left"> </td>
3910: <td valign="middle" align="left"> </td>
3911: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3912: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3913: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3914: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3915: </tr></table>
3916: <h4 class="subsubsection"> 3.12.2.2 CPU usage reduction </h4>
3917:
3918: <p>Windows 9x does not correctly use the CPU HLT
3919: instruction. The result is that it takes host CPU cycles even when
3920: idle. You can install the utility from
3921: <a href="http://www.user.cityline.ru/~maxamn/amnhltm.zip">http://www.user.cityline.ru/~maxamn/amnhltm.zip</a> to solve this
3922: problem. Note that no such tool is needed for NT, 2000 or XP.
3923: </p>
3924: <hr size="6">
3925: <a name="SEC57"></a>
3926: <table cellpadding="1" cellspacing="1" border="0">
3927: <tr><td valign="middle" align="left">[<a href="#SEC56" title="Previous section in reading order"> < </a>]</td>
3928: <td valign="middle" align="left">[<a href="#SEC58" title="Next section in reading order"> > </a>]</td>
3929: <td valign="middle" align="left"> </td>
3930: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3931: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
3932: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3933: <td valign="middle" align="left"> </td>
3934: <td valign="middle" align="left"> </td>
3935: <td valign="middle" align="left"> </td>
3936: <td valign="middle" align="left"> </td>
3937: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3938: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3939: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3940: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3941: </tr></table>
3942: <h4 class="subsubsection"> 3.12.2.3 Windows 2000 disk full problem </h4>
3943:
3944: <p>Windows 2000 has a bug which gives a disk full problem during its
3945: installation. When installing it, use the ‘<samp>-win2k-hack</samp>’ QEMU
3946: option to enable a specific workaround. After Windows 2000 is
3947: installed, you no longer need this option (this option slows down the
3948: IDE transfers).
3949: </p>
3950: <hr size="6">
3951: <a name="SEC58"></a>
3952: <table cellpadding="1" cellspacing="1" border="0">
3953: <tr><td valign="middle" align="left">[<a href="#SEC57" title="Previous section in reading order"> < </a>]</td>
3954: <td valign="middle" align="left">[<a href="#SEC59" title="Next section in reading order"> > </a>]</td>
3955: <td valign="middle" align="left"> </td>
3956: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3957: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
3958: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3959: <td valign="middle" align="left"> </td>
3960: <td valign="middle" align="left"> </td>
3961: <td valign="middle" align="left"> </td>
3962: <td valign="middle" align="left"> </td>
3963: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3964: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3965: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3966: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3967: </tr></table>
3968: <h4 class="subsubsection"> 3.12.2.4 Windows 2000 shutdown </h4>
3969:
3970: <p>Windows 2000 cannot automatically shutdown in QEMU although Windows 98
3971: can. It comes from the fact that Windows 2000 does not automatically
3972: use the APM driver provided by the BIOS.
3973: </p>
3974: <p>In order to correct that, do the following (thanks to Struan
3975: Bartlett): go to the Control Panel => Add/Remove Hardware & Next =>
3976: Add/Troubleshoot a device => Add a new device & Next => No, select the
3977: hardware from a list & Next => NT Apm/Legacy Support & Next => Next
3978: (again) a few times. Now the driver is installed and Windows 2000 now
3979: correctly instructs QEMU to shutdown at the appropriate moment.
3980: </p>
3981: <hr size="6">
3982: <a name="SEC59"></a>
3983: <table cellpadding="1" cellspacing="1" border="0">
3984: <tr><td valign="middle" align="left">[<a href="#SEC58" title="Previous section in reading order"> < </a>]</td>
3985: <td valign="middle" align="left">[<a href="#SEC60" title="Next section in reading order"> > </a>]</td>
3986: <td valign="middle" align="left"> </td>
3987: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
3988: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
3989: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
3990: <td valign="middle" align="left"> </td>
3991: <td valign="middle" align="left"> </td>
3992: <td valign="middle" align="left"> </td>
3993: <td valign="middle" align="left"> </td>
3994: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
3995: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
3996: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
3997: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
3998: </tr></table>
3999: <h4 class="subsubsection"> 3.12.2.5 Share a directory between Unix and Windows </h4>
4000:
4001: <p>See <a href="#SEC10">Invocation</a> about the help of the option ‘<samp>-smb</samp>’.
4002: </p>
4003: <hr size="6">
4004: <a name="SEC60"></a>
4005: <table cellpadding="1" cellspacing="1" border="0">
4006: <tr><td valign="middle" align="left">[<a href="#SEC59" title="Previous section in reading order"> < </a>]</td>
4007: <td valign="middle" align="left">[<a href="#SEC61" title="Next section in reading order"> > </a>]</td>
4008: <td valign="middle" align="left"> </td>
4009: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4010: <td valign="middle" align="left">[<a href="#SEC54" title="Up section"> Up </a>]</td>
4011: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
4012: <td valign="middle" align="left"> </td>
4013: <td valign="middle" align="left"> </td>
4014: <td valign="middle" align="left"> </td>
4015: <td valign="middle" align="left"> </td>
4016: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4017: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4018: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4019: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4020: </tr></table>
4021: <h4 class="subsubsection"> 3.12.2.6 Windows XP security problem </h4>
4022:
4023: <p>Some releases of Windows XP install correctly but give a security
4024: error when booting:
4025: </p><table><tr><td> </td><td><pre class="example">A problem is preventing Windows from accurately checking the
4026: license for this computer. Error code: 0x800703e6.
4027: </pre></td></tr></table>
4028:
4029: <p>The workaround is to install a service pack for XP after a boot in safe
4030: mode. Then reboot, and the problem should go away. Since there is no
4031: network while in safe mode, its recommended to download the full
4032: installation of SP1 or SP2 and transfer that via an ISO or using the
4033: vvfat block device ("-hdb fat:directory_which_holds_the_SP").
4034: </p>
4035: <hr size="6">
4036: <a name="SEC61"></a>
4037: <table cellpadding="1" cellspacing="1" border="0">
4038: <tr><td valign="middle" align="left">[<a href="#SEC60" title="Previous section in reading order"> < </a>]</td>
4039: <td valign="middle" align="left">[<a href="#SEC62" title="Next section in reading order"> > </a>]</td>
4040: <td valign="middle" align="left"> </td>
4041: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4042: <td valign="middle" align="left">[<a href="#SEC52" title="Up section"> Up </a>]</td>
4043: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
4044: <td valign="middle" align="left"> </td>
4045: <td valign="middle" align="left"> </td>
4046: <td valign="middle" align="left"> </td>
4047: <td valign="middle" align="left"> </td>
4048: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4049: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4050: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4051: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4052: </tr></table>
4053: <h3 class="subsection"> 3.12.3 MS-DOS and FreeDOS </h3>
4054:
4055: <hr size="6">
4056: <a name="SEC62"></a>
4057: <table cellpadding="1" cellspacing="1" border="0">
4058: <tr><td valign="middle" align="left">[<a href="#SEC61" title="Previous section in reading order"> < </a>]</td>
4059: <td valign="middle" align="left">[<a href="#SEC63" title="Next section in reading order"> > </a>]</td>
4060: <td valign="middle" align="left"> </td>
4061: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4062: <td valign="middle" align="left">[<a href="#SEC61" title="Up section"> Up </a>]</td>
4063: <td valign="middle" align="left">[<a href="#SEC63" title="Next chapter"> >> </a>]</td>
4064: <td valign="middle" align="left"> </td>
4065: <td valign="middle" align="left"> </td>
4066: <td valign="middle" align="left"> </td>
4067: <td valign="middle" align="left"> </td>
4068: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4069: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4070: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4071: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4072: </tr></table>
4073: <h4 class="subsubsection"> 3.12.3.1 CPU usage reduction </h4>
4074:
4075: <p>DOS does not correctly use the CPU HLT instruction. The result is that
4076: it takes host CPU cycles even when idle. You can install the utility
4077: from <a href="http://www.vmware.com/software/dosidle210.zip">http://www.vmware.com/software/dosidle210.zip</a> to solve this
4078: problem.
4079: </p>
4080: <hr size="6">
4081: <a name="QEMU-System-emulator-for-non-PC-targets"></a>
4082: <a name="SEC63"></a>
4083: <table cellpadding="1" cellspacing="1" border="0">
4084: <tr><td valign="middle" align="left">[<a href="#SEC62" title="Previous section in reading order"> < </a>]</td>
4085: <td valign="middle" align="left">[<a href="#SEC64" title="Next section in reading order"> > </a>]</td>
4086: <td valign="middle" align="left"> </td>
4087: <td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4088: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
4089: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4090: <td valign="middle" align="left"> </td>
4091: <td valign="middle" align="left"> </td>
4092: <td valign="middle" align="left"> </td>
4093: <td valign="middle" align="left"> </td>
4094: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4095: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4096: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4097: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4098: </tr></table>
4099: <h1 class="chapter"> 4. QEMU System emulator for non PC targets </h1>
4100:
4101: <p>QEMU is a generic emulator and it emulates many non PC
4102: machines. Most of the options are similar to the PC emulator. The
4103: differences are mentioned in the following sections.
4104: </p>
4105: <table class="menu" border="0" cellspacing="0">
4106: <tr><td align="left" valign="top"><a href="#SEC64">4.1 QEMU PowerPC System emulator</a></td><td> </td><td align="left" valign="top">
4107: </td></tr>
4108: <tr><td align="left" valign="top"><a href="#SEC65">4.2 Sparc32 System emulator</a></td><td> </td><td align="left" valign="top">
4109: </td></tr>
4110: <tr><td align="left" valign="top"><a href="#SEC66">4.3 Sparc64 System emulator</a></td><td> </td><td align="left" valign="top">
4111: </td></tr>
4112: <tr><td align="left" valign="top"><a href="#SEC67">4.4 MIPS System emulator</a></td><td> </td><td align="left" valign="top">
4113: </td></tr>
4114: <tr><td align="left" valign="top"><a href="#SEC68">4.5 ARM System emulator</a></td><td> </td><td align="left" valign="top">
4115: </td></tr>
4116: <tr><td align="left" valign="top"><a href="#SEC69">4.6 ColdFire System emulator</a></td><td> </td><td align="left" valign="top">
4117: </td></tr>
4118: </table>
4119:
4120: <hr size="6">
4121: <a name="QEMU-PowerPC-System-emulator"></a>
4122: <a name="SEC64"></a>
4123: <table cellpadding="1" cellspacing="1" border="0">
4124: <tr><td valign="middle" align="left">[<a href="#SEC63" title="Previous section in reading order"> < </a>]</td>
4125: <td valign="middle" align="left">[<a href="#SEC65" title="Next section in reading order"> > </a>]</td>
4126: <td valign="middle" align="left"> </td>
4127: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4128: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4129: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4130: <td valign="middle" align="left"> </td>
4131: <td valign="middle" align="left"> </td>
4132: <td valign="middle" align="left"> </td>
4133: <td valign="middle" align="left"> </td>
4134: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4135: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4136: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4137: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4138: </tr></table>
4139: <h2 class="section"> 4.1 QEMU PowerPC System emulator </h2>
4140:
4141: <p>Use the executable ‘<tt>qemu-system-ppc</tt>’ to simulate a complete PREP
4142: or PowerMac PowerPC system.
4143: </p>
4144: <p>QEMU emulates the following PowerMac peripherals:
4145: </p>
4146: <ul class="toc">
4147: <li>-
4148: UniNorth or Grackle PCI Bridge
4149: </li><li>-
4150: PCI VGA compatible card with VESA Bochs Extensions
4151: </li><li>-
4152: 2 PMAC IDE interfaces with hard disk and CD-ROM support
4153: </li><li>-
4154: NE2000 PCI adapters
4155: </li><li>-
4156: Non Volatile RAM
4157: </li><li>-
4158: VIA-CUDA with ADB keyboard and mouse.
4159: </li></ul>
4160:
4161: <p>QEMU emulates the following PREP peripherals:
4162: </p>
4163: <ul class="toc">
4164: <li>-
4165: PCI Bridge
4166: </li><li>-
4167: PCI VGA compatible card with VESA Bochs Extensions
4168: </li><li>-
4169: 2 IDE interfaces with hard disk and CD-ROM support
4170: </li><li>-
4171: Floppy disk
4172: </li><li>-
4173: NE2000 network adapters
4174: </li><li>-
4175: Serial port
4176: </li><li>-
4177: PREP Non Volatile RAM
4178: </li><li>-
4179: PC compatible keyboard and mouse.
4180: </li></ul>
4181:
4182: <p>QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at
4183: <a href="http://perso.magic.fr/l_indien/OpenHackWare/index.htm">http://perso.magic.fr/l_indien/OpenHackWare/index.htm</a>.
4184: </p>
4185: <p>Since version 0.9.1, QEMU uses OpenBIOS <a href="http://www.openbios.org/">http://www.openbios.org/</a>
4186: for the g3beige and mac99 PowerMac machines. OpenBIOS is a free (GPL
4187: v2) portable firmware implementation. The goal is to implement a 100%
4188: IEEE 1275-1994 (referred to as Open Firmware) compliant firmware.
4189: </p>
4190:
4191: <p>The following options are specific to the PowerPC emulation:
4192: </p>
4193: <dl compact="compact">
4194: <dt> ‘<samp>-g WxH[xDEPTH]</samp>’</dt>
4195: <dd>
4196: <p>Set the initial VGA graphic mode. The default is 800x600x15.
4197: </p>
4198: </dd>
4199: <dt> ‘<samp>-prom-env string</samp>’</dt>
4200: <dd>
4201: <p>Set OpenBIOS variables in NVRAM, for example:
4202: </p>
4203: <table><tr><td> </td><td><pre class="example">qemu-system-ppc -prom-env 'auto-boot?=false' \
4204: -prom-env 'boot-device=hd:2,\yaboot' \
4205: -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
4206: </pre></td></tr></table>
4207:
4208: <p>These variables are not used by Open Hack'Ware.
4209: </p>
4210: </dd>
4211: </dl>
4212:
4213:
4214:
4215: <p>More information is available at
4216: <a href="http://perso.magic.fr/l_indien/qemu-ppc/">http://perso.magic.fr/l_indien/qemu-ppc/</a>.
4217: </p>
4218: <hr size="6">
4219: <a name="Sparc32-System-emulator"></a>
4220: <a name="SEC65"></a>
4221: <table cellpadding="1" cellspacing="1" border="0">
4222: <tr><td valign="middle" align="left">[<a href="#SEC64" title="Previous section in reading order"> < </a>]</td>
4223: <td valign="middle" align="left">[<a href="#SEC66" title="Next section in reading order"> > </a>]</td>
4224: <td valign="middle" align="left"> </td>
4225: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4226: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4227: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4228: <td valign="middle" align="left"> </td>
4229: <td valign="middle" align="left"> </td>
4230: <td valign="middle" align="left"> </td>
4231: <td valign="middle" align="left"> </td>
4232: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4233: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4234: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4235: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4236: </tr></table>
4237: <h2 class="section"> 4.2 Sparc32 System emulator </h2>
4238:
4239: <p>Use the executable ‘<tt>qemu-system-sparc</tt>’ to simulate the following
4240: Sun4m architecture machines:
4241: </p><ul class="toc">
4242: <li>-
4243: SPARCstation 4
4244: </li><li>-
4245: SPARCstation 5
4246: </li><li>-
4247: SPARCstation 10
4248: </li><li>-
4249: SPARCstation 20
4250: </li><li>-
4251: SPARCserver 600MP
4252: </li><li>-
4253: SPARCstation LX
4254: </li><li>-
4255: SPARCstation Voyager
4256: </li><li>-
4257: SPARCclassic
4258: </li><li>-
4259: SPARCbook
4260: </li></ul>
4261:
4262: <p>The emulation is somewhat complete. SMP up to 16 CPUs is supported,
4263: but Linux limits the number of usable CPUs to 4.
4264: </p>
4265: <p>It's also possible to simulate a SPARCstation 2 (sun4c architecture),
4266: SPARCserver 1000, or SPARCcenter 2000 (sun4d architecture), but these
4267: emulators are not usable yet.
4268: </p>
4269: <p>QEMU emulates the following sun4m/sun4c/sun4d peripherals:
4270: </p>
4271: <ul class="toc">
4272: <li>-
4273: IOMMU or IO-UNITs
4274: </li><li>-
4275: TCX Frame buffer
4276: </li><li>-
4277: Lance (Am7990) Ethernet
4278: </li><li>-
4279: Non Volatile RAM M48T02/M48T08
4280: </li><li>-
4281: Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard
4282: and power/reset logic
4283: </li><li>-
4284: ESP SCSI controller with hard disk and CD-ROM support
4285: </li><li>-
4286: Floppy drive (not on SS-600MP)
4287: </li><li>-
4288: CS4231 sound device (only on SS-5, not working yet)
4289: </li></ul>
4290:
4291: <p>The number of peripherals is fixed in the architecture. Maximum
4292: memory size depends on the machine type, for SS-5 it is 256MB and for
4293: others 2047MB.
4294: </p>
4295: <p>Since version 0.8.2, QEMU uses OpenBIOS
4296: <a href="http://www.openbios.org/">http://www.openbios.org/</a>. OpenBIOS is a free (GPL v2) portable
4297: firmware implementation. The goal is to implement a 100% IEEE
4298: 1275-1994 (referred to as Open Firmware) compliant firmware.
4299: </p>
4300: <p>A sample Linux 2.6 series kernel and ram disk image are available on
4301: the QEMU web site. There are still issues with NetBSD and OpenBSD, but
4302: some kernel versions work. Please note that currently Solaris kernels
4303: don't work probably due to interface issues between OpenBIOS and
4304: Solaris.
4305: </p>
4306:
4307: <p>The following options are specific to the Sparc32 emulation:
4308: </p>
4309: <dl compact="compact">
4310: <dt> ‘<samp>-g WxHx[xDEPTH]</samp>’</dt>
4311: <dd>
4312: <p>Set the initial TCX graphic mode. The default is 1024x768x8, currently
4313: the only other possible mode is 1024x768x24.
4314: </p>
4315: </dd>
4316: <dt> ‘<samp>-prom-env string</samp>’</dt>
4317: <dd>
4318: <p>Set OpenBIOS variables in NVRAM, for example:
4319: </p>
4320: <table><tr><td> </td><td><pre class="example">qemu-system-sparc -prom-env 'auto-boot?=false' \
4321: -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
4322: </pre></td></tr></table>
4323:
4324: </dd>
4325: <dt> ‘<samp>-M [SS-4|SS-5|SS-10|SS-20|SS-600MP|LX|Voyager|SPARCClassic|SPARCbook|SS-2|SS-1000|SS-2000]</samp>’</dt>
4326: <dd>
4327: <p>Set the emulated machine type. Default is SS-5.
4328: </p>
4329: </dd>
4330: </dl>
4331:
4332:
4333: <hr size="6">
4334: <a name="Sparc64-System-emulator"></a>
4335: <a name="SEC66"></a>
4336: <table cellpadding="1" cellspacing="1" border="0">
4337: <tr><td valign="middle" align="left">[<a href="#SEC65" title="Previous section in reading order"> < </a>]</td>
4338: <td valign="middle" align="left">[<a href="#SEC67" title="Next section in reading order"> > </a>]</td>
4339: <td valign="middle" align="left"> </td>
4340: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4341: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4342: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4343: <td valign="middle" align="left"> </td>
4344: <td valign="middle" align="left"> </td>
4345: <td valign="middle" align="left"> </td>
4346: <td valign="middle" align="left"> </td>
4347: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4348: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4349: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4350: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4351: </tr></table>
4352: <h2 class="section"> 4.3 Sparc64 System emulator </h2>
4353:
4354: <p>Use the executable ‘<tt>qemu-system-sparc64</tt>’ to simulate a Sun4u
4355: (UltraSPARC PC-like machine), Sun4v (T1 PC-like machine), or generic
4356: Niagara (T1) machine. The emulator is not usable for anything yet, but
4357: it can launch some kernels.
4358: </p>
4359: <p>QEMU emulates the following peripherals:
4360: </p>
4361: <ul class="toc">
4362: <li>-
4363: UltraSparc IIi APB PCI Bridge
4364: </li><li>-
4365: PCI VGA compatible card with VESA Bochs Extensions
4366: </li><li>-
4367: PS/2 mouse and keyboard
4368: </li><li>-
4369: Non Volatile RAM M48T59
4370: </li><li>-
4371: PC-compatible serial ports
4372: </li><li>-
4373: 2 PCI IDE interfaces with hard disk and CD-ROM support
4374: </li><li>-
4375: Floppy disk
4376: </li></ul>
4377:
4378:
4379: <p>The following options are specific to the Sparc64 emulation:
4380: </p>
4381: <dl compact="compact">
4382: <dt> ‘<samp>-prom-env string</samp>’</dt>
4383: <dd>
4384: <p>Set OpenBIOS variables in NVRAM, for example:
4385: </p>
4386: <table><tr><td> </td><td><pre class="example">qemu-system-sparc64 -prom-env 'auto-boot?=false'
4387: </pre></td></tr></table>
4388:
4389: </dd>
4390: <dt> ‘<samp>-M [sun4u|sun4v|Niagara]</samp>’</dt>
4391: <dd>
4392: <p>Set the emulated machine type. The default is sun4u.
4393: </p>
4394: </dd>
4395: </dl>
4396:
4397:
4398: <hr size="6">
4399: <a name="MIPS-System-emulator"></a>
4400: <a name="SEC67"></a>
4401: <table cellpadding="1" cellspacing="1" border="0">
4402: <tr><td valign="middle" align="left">[<a href="#SEC66" title="Previous section in reading order"> < </a>]</td>
4403: <td valign="middle" align="left">[<a href="#SEC68" title="Next section in reading order"> > </a>]</td>
4404: <td valign="middle" align="left"> </td>
4405: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4406: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4407: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4408: <td valign="middle" align="left"> </td>
4409: <td valign="middle" align="left"> </td>
4410: <td valign="middle" align="left"> </td>
4411: <td valign="middle" align="left"> </td>
4412: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4413: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4414: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4415: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4416: </tr></table>
4417: <h2 class="section"> 4.4 MIPS System emulator </h2>
4418:
4419: <p>Four executables cover simulation of 32 and 64-bit MIPS systems in
4420: both endian options, ‘<tt>qemu-system-mips</tt>’, ‘<tt>qemu-system-mipsel</tt>’
4421: ‘<tt>qemu-system-mips64</tt>’ and ‘<tt>qemu-system-mips64el</tt>’.
4422: Five different machine types are emulated:
4423: </p>
4424: <ul class="toc">
4425: <li>-
4426: A generic ISA PC-like machine "mips"
4427: </li><li>-
4428: The MIPS Malta prototype board "malta"
4429: </li><li>-
4430: An ACER Pica "pica61". This machine needs the 64-bit emulator.
4431: </li><li>-
4432: MIPS emulator pseudo board "mipssim"
4433: </li><li>-
4434: A MIPS Magnum R4000 machine "magnum". This machine needs the 64-bit emulator.
4435: </li></ul>
4436:
4437: <p>The generic emulation is supported by Debian 'Etch' and is able to
4438: install Debian into a virtual disk image. The following devices are
4439: emulated:
4440: </p>
4441: <ul class="toc">
4442: <li>-
4443: A range of MIPS CPUs, default is the 24Kf
4444: </li><li>-
4445: PC style serial port
4446: </li><li>-
4447: PC style IDE disk
4448: </li><li>-
4449: NE2000 network card
4450: </li></ul>
4451:
4452: <p>The Malta emulation supports the following devices:
4453: </p>
4454: <ul class="toc">
4455: <li>-
4456: Core board with MIPS 24Kf CPU and Galileo system controller
4457: </li><li>-
4458: PIIX4 PCI/USB/SMbus controller
4459: </li><li>-
4460: The Multi-I/O chip's serial device
4461: </li><li>-
4462: PCnet32 PCI network card
4463: </li><li>-
4464: Malta FPGA serial device
4465: </li><li>-
4466: Cirrus (default) or any other PCI VGA graphics card
4467: </li></ul>
4468:
4469: <p>The ACER Pica emulation supports:
4470: </p>
4471: <ul class="toc">
4472: <li>-
4473: MIPS R4000 CPU
4474: </li><li>-
4475: PC-style IRQ and DMA controllers
4476: </li><li>-
4477: PC Keyboard
4478: </li><li>-
4479: IDE controller
4480: </li></ul>
4481:
4482: <p>The mipssim pseudo board emulation provides an environment similiar
4483: to what the proprietary MIPS emulator uses for running Linux.
4484: It supports:
4485: </p>
4486: <ul class="toc">
4487: <li>-
4488: A range of MIPS CPUs, default is the 24Kf
4489: </li><li>-
4490: PC style serial port
4491: </li><li>-
4492: MIPSnet network emulation
4493: </li></ul>
4494:
4495: <p>The MIPS Magnum R4000 emulation supports:
4496: </p>
4497: <ul class="toc">
4498: <li>-
4499: MIPS R4000 CPU
4500: </li><li>-
4501: PC-style IRQ controller
4502: </li><li>-
4503: PC Keyboard
4504: </li><li>-
4505: SCSI controller
4506: </li><li>-
4507: G364 framebuffer
4508: </li></ul>
4509:
4510:
4511: <hr size="6">
4512: <a name="ARM-System-emulator"></a>
4513: <a name="SEC68"></a>
4514: <table cellpadding="1" cellspacing="1" border="0">
4515: <tr><td valign="middle" align="left">[<a href="#SEC67" title="Previous section in reading order"> < </a>]</td>
4516: <td valign="middle" align="left">[<a href="#SEC69" title="Next section in reading order"> > </a>]</td>
4517: <td valign="middle" align="left"> </td>
4518: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4519: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4520: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4521: <td valign="middle" align="left"> </td>
4522: <td valign="middle" align="left"> </td>
4523: <td valign="middle" align="left"> </td>
4524: <td valign="middle" align="left"> </td>
4525: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4526: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4527: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4528: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4529: </tr></table>
4530: <h2 class="section"> 4.5 ARM System emulator </h2>
4531:
4532: <p>Use the executable ‘<tt>qemu-system-arm</tt>’ to simulate a ARM
4533: machine. The ARM Integrator/CP board is emulated with the following
4534: devices:
4535: </p>
4536: <ul class="toc">
4537: <li>-
4538: ARM926E, ARM1026E, ARM946E, ARM1136 or Cortex-A8 CPU
4539: </li><li>-
4540: Two PL011 UARTs
4541: </li><li>-
4542: SMC 91c111 Ethernet adapter
4543: </li><li>-
4544: PL110 LCD controller
4545: </li><li>-
4546: PL050 KMI with PS/2 keyboard and mouse.
4547: </li><li>-
4548: PL181 MultiMedia Card Interface with SD card.
4549: </li></ul>
4550:
4551: <p>The ARM Versatile baseboard is emulated with the following devices:
4552: </p>
4553: <ul class="toc">
4554: <li>-
4555: ARM926E, ARM1136 or Cortex-A8 CPU
4556: </li><li>-
4557: PL190 Vectored Interrupt Controller
4558: </li><li>-
4559: Four PL011 UARTs
4560: </li><li>-
4561: SMC 91c111 Ethernet adapter
4562: </li><li>-
4563: PL110 LCD controller
4564: </li><li>-
4565: PL050 KMI with PS/2 keyboard and mouse.
4566: </li><li>-
4567: PCI host bridge. Note the emulated PCI bridge only provides access to
4568: PCI memory space. It does not provide access to PCI IO space.
4569: This means some devices (eg. ne2k_pci NIC) are not usable, and others
4570: (eg. rtl8139 NIC) are only usable when the guest drivers use the memory
4571: mapped control registers.
4572: </li><li>-
4573: PCI OHCI USB controller.
4574: </li><li>-
4575: LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices.
4576: </li><li>-
4577: PL181 MultiMedia Card Interface with SD card.
4578: </li></ul>
4579:
4580: <p>The ARM RealView Emulation baseboard is emulated with the following devices:
4581: </p>
4582: <ul class="toc">
4583: <li>-
4584: ARM926E, ARM1136, ARM11MPCORE(x4) or Cortex-A8 CPU
4585: </li><li>-
4586: ARM AMBA Generic/Distributed Interrupt Controller
4587: </li><li>-
4588: Four PL011 UARTs
4589: </li><li>-
4590: SMC 91c111 Ethernet adapter
4591: </li><li>-
4592: PL110 LCD controller
4593: </li><li>-
4594: PL050 KMI with PS/2 keyboard and mouse
4595: </li><li>-
4596: PCI host bridge
4597: </li><li>-
4598: PCI OHCI USB controller
4599: </li><li>-
4600: LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices
4601: </li><li>-
4602: PL181 MultiMedia Card Interface with SD card.
4603: </li></ul>
4604:
4605: <p>The XScale-based clamshell PDA models ("Spitz", "Akita", "Borzoi"
4606: and "Terrier") emulation includes the following peripherals:
4607: </p>
4608: <ul class="toc">
4609: <li>-
4610: Intel PXA270 System-on-chip (ARM V5TE core)
4611: </li><li>-
4612: NAND Flash memory
4613: </li><li>-
4614: IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in "Akita"
4615: </li><li>-
4616: On-chip OHCI USB controller
4617: </li><li>-
4618: On-chip LCD controller
4619: </li><li>-
4620: On-chip Real Time Clock
4621: </li><li>-
4622: TI ADS7846 touchscreen controller on SSP bus
4623: </li><li>-
4624: Maxim MAX1111 analog-digital converter on I<em>^2</em>C bus
4625: </li><li>-
4626: GPIO-connected keyboard controller and LEDs
4627: </li><li>-
4628: Secure Digital card connected to PXA MMC/SD host
4629: </li><li>-
4630: Three on-chip UARTs
4631: </li><li>-
4632: WM8750 audio CODEC on I<em>^2</em>C and I<em>^2</em>S busses
4633: </li></ul>
4634:
4635: <p>The Palm Tungsten|E PDA (codename "Cheetah") emulation includes the
4636: following elements:
4637: </p>
4638: <ul class="toc">
4639: <li>-
4640: Texas Instruments OMAP310 System-on-chip (ARM 925T core)
4641: </li><li>-
4642: ROM and RAM memories (ROM firmware image can be loaded with -option-rom)
4643: </li><li>-
4644: On-chip LCD controller
4645: </li><li>-
4646: On-chip Real Time Clock
4647: </li><li>-
4648: TI TSC2102i touchscreen controller / analog-digital converter / Audio
4649: CODEC, connected through MicroWire and I<em>^2</em>S busses
4650: </li><li>-
4651: GPIO-connected matrix keypad
4652: </li><li>-
4653: Secure Digital card connected to OMAP MMC/SD host
4654: </li><li>-
4655: Three on-chip UARTs
4656: </li></ul>
4657:
4658: <p>Nokia N800 and N810 internet tablets (known also as RX-34 and RX-44 / 48)
4659: emulation supports the following elements:
4660: </p>
4661: <ul class="toc">
4662: <li>-
4663: Texas Instruments OMAP2420 System-on-chip (ARM 1136 core)
4664: </li><li>-
4665: RAM and non-volatile OneNAND Flash memories
4666: </li><li>-
4667: Display connected to EPSON remote framebuffer chip and OMAP on-chip
4668: display controller and a LS041y3 MIPI DBI-C controller
4669: </li><li>-
4670: TI TSC2301 (in N800) and TI TSC2005 (in N810) touchscreen controllers
4671: driven through SPI bus
4672: </li><li>-
4673: National Semiconductor LM8323-controlled qwerty keyboard driven
4674: through I<em>^2</em>C bus
4675: </li><li>-
4676: Secure Digital card connected to OMAP MMC/SD host
4677: </li><li>-
4678: Three OMAP on-chip UARTs and on-chip STI debugging console
4679: </li><li>-
4680: A Bluetooth(R) transciever and HCI connected to an UART
4681: </li><li>-
4682: Mentor Graphics "Inventra" dual-role USB controller embedded in a TI
4683: TUSB6010 chip - only USB host mode is supported
4684: </li><li>-
4685: TI TMP105 temperature sensor driven through I<em>^2</em>C bus
4686: </li><li>-
4687: TI TWL92230C power management companion with an RTC on I<em>^2</em>C bus
4688: </li><li>-
4689: Nokia RETU and TAHVO multi-purpose chips with an RTC, connected
4690: through CBUS
4691: </li></ul>
4692:
4693: <p>The Luminary Micro Stellaris LM3S811EVB emulation includes the following
4694: devices:
4695: </p>
4696: <ul class="toc">
4697: <li>-
4698: Cortex-M3 CPU core.
4699: </li><li>-
4700: 64k Flash and 8k SRAM.
4701: </li><li>-
4702: Timers, UARTs, ADC and I<em>^2</em>C interface.
4703: </li><li>-
4704: OSRAM Pictiva 96x16 OLED with SSD0303 controller on I<em>^2</em>C bus.
4705: </li></ul>
4706:
4707: <p>The Luminary Micro Stellaris LM3S6965EVB emulation includes the following
4708: devices:
4709: </p>
4710: <ul class="toc">
4711: <li>-
4712: Cortex-M3 CPU core.
4713: </li><li>-
4714: 256k Flash and 64k SRAM.
4715: </li><li>-
4716: Timers, UARTs, ADC, I<em>^2</em>C and SSI interfaces.
4717: </li><li>-
4718: OSRAM Pictiva 128x64 OLED with SSD0323 controller connected via SSI.
4719: </li></ul>
4720:
4721: <p>The Freecom MusicPal internet radio emulation includes the following
4722: elements:
4723: </p>
4724: <ul class="toc">
4725: <li>-
4726: Marvell MV88W8618 ARM core.
4727: </li><li>-
4728: 32 MB RAM, 256 KB SRAM, 8 MB flash.
4729: </li><li>-
4730: Up to 2 16550 UARTs
4731: </li><li>-
4732: MV88W8xx8 Ethernet controller
4733: </li><li>-
4734: MV88W8618 audio controller, WM8750 CODEC and mixer
4735: </li><li>-
4736: 128�64 display with brightness control
4737: </li><li>-
4738: 2 buttons, 2 navigation wheels with button function
4739: </li></ul>
4740:
4741: <p>The Siemens SX1 models v1 and v2 (default) basic emulation.
4742: The emulaton includes the following elements:
4743: </p>
4744: <ul class="toc">
4745: <li>-
4746: Texas Instruments OMAP310 System-on-chip (ARM 925T core)
4747: </li><li>-
4748: ROM and RAM memories (ROM firmware image can be loaded with -pflash)
4749: V1
4750: 1 Flash of 16MB and 1 Flash of 8MB
4751: V2
4752: 1 Flash of 32MB
4753: </li><li>-
4754: On-chip LCD controller
4755: </li><li>-
4756: On-chip Real Time Clock
4757: </li><li>-
4758: Secure Digital card connected to OMAP MMC/SD host
4759: </li><li>-
4760: Three on-chip UARTs
4761: </li></ul>
4762:
4763: <p>A Linux 2.6 test image is available on the QEMU web site. More
4764: information is available in the QEMU mailing-list archive.
4765: </p>
4766:
4767: <p>The following options are specific to the ARM emulation:
4768: </p>
4769: <dl compact="compact">
4770: <dt> ‘<samp>-semihosting</samp>’</dt>
4771: <dd><p>Enable semihosting syscall emulation.
4772: </p>
4773: <p>On ARM this implements the "Angel" interface.
4774: </p>
4775: <p>Note that this allows guest direct access to the host filesystem,
4776: so should only be used with trusted guest OS.
4777: </p>
4778: </dd>
4779: </dl>
4780:
4781: <hr size="6">
4782: <a name="ColdFire-System-emulator"></a>
4783: <a name="SEC69"></a>
4784: <table cellpadding="1" cellspacing="1" border="0">
4785: <tr><td valign="middle" align="left">[<a href="#SEC68" title="Previous section in reading order"> < </a>]</td>
4786: <td valign="middle" align="left">[<a href="#SEC70" title="Next section in reading order"> > </a>]</td>
4787: <td valign="middle" align="left"> </td>
4788: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4789: <td valign="middle" align="left">[<a href="#SEC63" title="Up section"> Up </a>]</td>
4790: <td valign="middle" align="left">[<a href="#SEC70" title="Next chapter"> >> </a>]</td>
4791: <td valign="middle" align="left"> </td>
4792: <td valign="middle" align="left"> </td>
4793: <td valign="middle" align="left"> </td>
4794: <td valign="middle" align="left"> </td>
4795: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4796: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4797: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4798: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4799: </tr></table>
4800: <h2 class="section"> 4.6 ColdFire System emulator </h2>
4801:
4802: <p>Use the executable ‘<tt>qemu-system-m68k</tt>’ to simulate a ColdFire machine.
4803: The emulator is able to boot a uClinux kernel.
4804: </p>
4805: <p>The M5208EVB emulation includes the following devices:
4806: </p>
4807: <ul class="toc">
4808: <li>-
4809: MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC).
4810: </li><li>-
4811: Three Two on-chip UARTs.
4812: </li><li>-
4813: Fast Ethernet Controller (FEC)
4814: </li></ul>
4815:
4816: <p>The AN5206 emulation includes the following devices:
4817: </p>
4818: <ul class="toc">
4819: <li>-
4820: MCF5206 ColdFire V2 Microprocessor.
4821: </li><li>-
4822: Two on-chip UARTs.
4823: </li></ul>
4824:
4825:
4826: <p>The following options are specific to the ARM emulation:
4827: </p>
4828: <dl compact="compact">
4829: <dt> ‘<samp>-semihosting</samp>’</dt>
4830: <dd><p>Enable semihosting syscall emulation.
4831: </p>
4832: <p>On M68K this implements the "ColdFire GDB" interface used by libgloss.
4833: </p>
4834: <p>Note that this allows guest direct access to the host filesystem,
4835: so should only be used with trusted guest OS.
4836: </p>
4837: </dd>
4838: </dl>
4839:
4840: <hr size="6">
4841: <a name="QEMU-User-space-emulator"></a>
4842: <a name="SEC70"></a>
4843: <table cellpadding="1" cellspacing="1" border="0">
4844: <tr><td valign="middle" align="left">[<a href="#SEC69" title="Previous section in reading order"> < </a>]</td>
4845: <td valign="middle" align="left">[<a href="#SEC71" title="Next section in reading order"> > </a>]</td>
4846: <td valign="middle" align="left"> </td>
4847: <td valign="middle" align="left">[<a href="#SEC63" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4848: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
4849: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
4850: <td valign="middle" align="left"> </td>
4851: <td valign="middle" align="left"> </td>
4852: <td valign="middle" align="left"> </td>
4853: <td valign="middle" align="left"> </td>
4854: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4855: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4856: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4857: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4858: </tr></table>
4859: <h1 class="chapter"> 5. QEMU User space emulator </h1>
4860:
4861: <table class="menu" border="0" cellspacing="0">
4862: <tr><td align="left" valign="top"><a href="#SEC71">5.1 Supported Operating Systems</a></td><td> </td><td align="left" valign="top">
4863: </td></tr>
4864: <tr><td align="left" valign="top"><a href="#SEC72">5.2 Linux User space emulator</a></td><td> </td><td align="left" valign="top">
4865: </td></tr>
4866: <tr><td align="left" valign="top"><a href="#SEC77">5.3 Mac OS X/Darwin User space emulator</a></td><td> </td><td align="left" valign="top">
4867: </td></tr>
4868: <tr><td align="left" valign="top"><a href="#SEC81">5.4 BSD User space emulator</a></td><td> </td><td align="left" valign="top">
4869: </td></tr>
4870: </table>
4871:
4872: <hr size="6">
4873: <a name="Supported-Operating-Systems"></a>
4874: <a name="SEC71"></a>
4875: <table cellpadding="1" cellspacing="1" border="0">
4876: <tr><td valign="middle" align="left">[<a href="#SEC70" title="Previous section in reading order"> < </a>]</td>
4877: <td valign="middle" align="left">[<a href="#SEC72" title="Next section in reading order"> > </a>]</td>
4878: <td valign="middle" align="left"> </td>
4879: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4880: <td valign="middle" align="left">[<a href="#SEC70" title="Up section"> Up </a>]</td>
4881: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
4882: <td valign="middle" align="left"> </td>
4883: <td valign="middle" align="left"> </td>
4884: <td valign="middle" align="left"> </td>
4885: <td valign="middle" align="left"> </td>
4886: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4887: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4888: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4889: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4890: </tr></table>
4891: <h2 class="section"> 5.1 Supported Operating Systems </h2>
4892:
4893: <p>The following OS are supported in user space emulation:
4894: </p>
4895: <ul class="toc">
4896: <li>-
4897: Linux (referred as qemu-linux-user)
4898: </li><li>-
4899: Mac OS X/Darwin (referred as qemu-darwin-user)
4900: </li><li>-
4901: BSD (referred as qemu-bsd-user)
4902: </li></ul>
4903:
4904: <hr size="6">
4905: <a name="Linux-User-space-emulator"></a>
4906: <a name="SEC72"></a>
4907: <table cellpadding="1" cellspacing="1" border="0">
4908: <tr><td valign="middle" align="left">[<a href="#SEC71" title="Previous section in reading order"> < </a>]</td>
4909: <td valign="middle" align="left">[<a href="#SEC73" title="Next section in reading order"> > </a>]</td>
4910: <td valign="middle" align="left"> </td>
4911: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4912: <td valign="middle" align="left">[<a href="#SEC70" title="Up section"> Up </a>]</td>
4913: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
4914: <td valign="middle" align="left"> </td>
4915: <td valign="middle" align="left"> </td>
4916: <td valign="middle" align="left"> </td>
4917: <td valign="middle" align="left"> </td>
4918: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4919: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4920: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4921: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4922: </tr></table>
4923: <h2 class="section"> 5.2 Linux User space emulator </h2>
4924:
4925: <table class="menu" border="0" cellspacing="0">
4926: <tr><td align="left" valign="top"><a href="#SEC73">5.2.1 Quick Start</a></td><td> </td><td align="left" valign="top">
4927: </td></tr>
4928: <tr><td align="left" valign="top"><a href="#SEC74">5.2.2 Wine launch</a></td><td> </td><td align="left" valign="top">
4929: </td></tr>
4930: <tr><td align="left" valign="top"><a href="#SEC75">5.2.3 Command line options</a></td><td> </td><td align="left" valign="top">
4931: </td></tr>
4932: <tr><td align="left" valign="top"><a href="#SEC76">5.2.4 Other binaries</a></td><td> </td><td align="left" valign="top">
4933: </td></tr>
4934: </table>
4935:
4936: <hr size="6">
4937: <a name="Quick-Start"></a>
4938: <a name="SEC73"></a>
4939: <table cellpadding="1" cellspacing="1" border="0">
4940: <tr><td valign="middle" align="left">[<a href="#SEC72" title="Previous section in reading order"> < </a>]</td>
4941: <td valign="middle" align="left">[<a href="#SEC74" title="Next section in reading order"> > </a>]</td>
4942: <td valign="middle" align="left"> </td>
4943: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
4944: <td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
4945: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
4946: <td valign="middle" align="left"> </td>
4947: <td valign="middle" align="left"> </td>
4948: <td valign="middle" align="left"> </td>
4949: <td valign="middle" align="left"> </td>
4950: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
4951: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
4952: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
4953: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
4954: </tr></table>
4955: <h3 class="subsection"> 5.2.1 Quick Start </h3>
4956:
4957: <p>In order to launch a Linux process, QEMU needs the process executable
4958: itself and all the target (x86) dynamic libraries used by it.
4959: </p>
4960: <ul class="toc">
4961: <li> On x86, you can just try to launch any process by using the native
4962: libraries:
4963:
4964: <table><tr><td> </td><td><pre class="example">qemu-i386 -L / /bin/ls
4965: </pre></td></tr></table>
4966:
4967: <p><code>-L /</code> tells that the x86 dynamic linker must be searched with a
4968: ‘<tt>/</tt>’ prefix.
4969: </p>
4970: </li><li> Since QEMU is also a linux process, you can launch qemu with
4971: qemu (NOTE: you can only do that if you compiled QEMU from the sources):
4972:
4973: <table><tr><td> </td><td><pre class="example">qemu-i386 -L / qemu-i386 -L / /bin/ls
4974: </pre></td></tr></table>
4975:
4976: </li><li> On non x86 CPUs, you need first to download at least an x86 glibc
4977: (‘<tt>qemu-runtime-i386-XXX-.tar.gz</tt>’ on the QEMU web page). Ensure that
4978: <code>LD_LIBRARY_PATH</code> is not set:
4979:
4980: <table><tr><td> </td><td><pre class="example">unset LD_LIBRARY_PATH
4981: </pre></td></tr></table>
4982:
4983: <p>Then you can launch the precompiled ‘<tt>ls</tt>’ x86 executable:
4984: </p>
4985: <table><tr><td> </td><td><pre class="example">qemu-i386 tests/i386/ls
4986: </pre></td></tr></table>
4987: <p>You can look at ‘<tt>qemu-binfmt-conf.sh</tt>’ so that
4988: QEMU is automatically launched by the Linux kernel when you try to
4989: launch x86 executables. It requires the <code>binfmt_misc</code> module in the
4990: Linux kernel.
4991: </p>
4992: </li><li> The x86 version of QEMU is also included. You can try weird things such as:
4993: <table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \
4994: /usr/local/qemu-i386/bin/ls-i386
4995: </pre></td></tr></table>
4996:
4997: </li></ul>
4998:
4999: <hr size="6">
5000: <a name="Wine-launch"></a>
5001: <a name="SEC74"></a>
5002: <table cellpadding="1" cellspacing="1" border="0">
5003: <tr><td valign="middle" align="left">[<a href="#SEC73" title="Previous section in reading order"> < </a>]</td>
5004: <td valign="middle" align="left">[<a href="#SEC75" title="Next section in reading order"> > </a>]</td>
5005: <td valign="middle" align="left"> </td>
5006: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5007: <td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
5008: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5009: <td valign="middle" align="left"> </td>
5010: <td valign="middle" align="left"> </td>
5011: <td valign="middle" align="left"> </td>
5012: <td valign="middle" align="left"> </td>
5013: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5014: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5015: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5016: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5017: </tr></table>
5018: <h3 class="subsection"> 5.2.2 Wine launch </h3>
5019:
5020: <ul class="toc">
5021: <li> Ensure that you have a working QEMU with the x86 glibc
5022: distribution (see previous section). In order to verify it, you must be
5023: able to do:
5024:
5025: <table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/bin/ls-i386
5026: </pre></td></tr></table>
5027:
5028: </li><li> Download the binary x86 Wine install
5029: (‘<tt>qemu-XXX-i386-wine.tar.gz</tt>’ on the QEMU web page).
5030:
5031: </li><li> Configure Wine on your account. Look at the provided script
5032: ‘<tt>/usr/local/qemu-i386/bin/wine-conf.sh</tt>’. Your previous
5033: <code>${HOME}/.wine</code> directory is saved to <code>${HOME}/.wine.org</code>.
5034:
5035: </li><li> Then you can try the example ‘<tt>putty.exe</tt>’:
5036:
5037: <table><tr><td> </td><td><pre class="example">qemu-i386 /usr/local/qemu-i386/wine/bin/wine \
5038: /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe
5039: </pre></td></tr></table>
5040:
5041: </li></ul>
5042:
5043: <hr size="6">
5044: <a name="Command-line-options"></a>
5045: <a name="SEC75"></a>
5046: <table cellpadding="1" cellspacing="1" border="0">
5047: <tr><td valign="middle" align="left">[<a href="#SEC74" title="Previous section in reading order"> < </a>]</td>
5048: <td valign="middle" align="left">[<a href="#SEC76" title="Next section in reading order"> > </a>]</td>
5049: <td valign="middle" align="left"> </td>
5050: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5051: <td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
5052: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5053: <td valign="middle" align="left"> </td>
5054: <td valign="middle" align="left"> </td>
5055: <td valign="middle" align="left"> </td>
5056: <td valign="middle" align="left"> </td>
5057: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5058: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5059: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5060: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5061: </tr></table>
5062: <h3 class="subsection"> 5.2.3 Command line options </h3>
5063:
5064: <table><tr><td> </td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] [-cpu model] [-g port] program [arguments...]
5065: </pre></td></tr></table>
5066:
5067: <dl compact="compact">
5068: <dt> ‘<samp>-h</samp>’</dt>
5069: <dd><p>Print the help
5070: </p></dd>
5071: <dt> ‘<samp>-L path</samp>’</dt>
5072: <dd><p>Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
5073: </p></dd>
5074: <dt> ‘<samp>-s size</samp>’</dt>
5075: <dd><p>Set the x86 stack size in bytes (default=524288)
5076: </p></dd>
5077: <dt> ‘<samp>-cpu model</samp>’</dt>
5078: <dd><p>Select CPU model (-cpu ? for list and additional feature selection)
5079: </p></dd>
5080: </dl>
5081:
5082: <p>Debug options:
5083: </p>
5084: <dl compact="compact">
5085: <dt> ‘<samp>-d</samp>’</dt>
5086: <dd><p>Activate log (logfile=/tmp/qemu.log)
5087: </p></dd>
5088: <dt> ‘<samp>-p pagesize</samp>’</dt>
5089: <dd><p>Act as if the host page size was 'pagesize' bytes
5090: </p></dd>
5091: <dt> ‘<samp>-g port</samp>’</dt>
5092: <dd><p>Wait gdb connection to port
5093: </p></dd>
5094: <dt> ‘<samp>-singlestep</samp>’</dt>
5095: <dd><p>Run the emulation in single step mode.
5096: </p></dd>
5097: </dl>
5098:
5099: <p>Environment variables:
5100: </p>
5101: <dl compact="compact">
5102: <dt> <code>QEMU_STRACE</code></dt>
5103: <dd><p>Print system calls and arguments similar to the 'strace' program
5104: (NOTE: the actual 'strace' program will not work because the user
5105: space emulator hasn't implemented ptrace). At the moment this is
5106: incomplete. All system calls that don't have a specific argument
5107: format are printed with information for six arguments. Many
5108: flag-style arguments don't have decoders and will show up as numbers.
5109: </p></dd>
5110: </dl>
5111:
5112: <hr size="6">
5113: <a name="Other-binaries"></a>
5114: <a name="SEC76"></a>
5115: <table cellpadding="1" cellspacing="1" border="0">
5116: <tr><td valign="middle" align="left">[<a href="#SEC75" title="Previous section in reading order"> < </a>]</td>
5117: <td valign="middle" align="left">[<a href="#SEC77" title="Next section in reading order"> > </a>]</td>
5118: <td valign="middle" align="left"> </td>
5119: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5120: <td valign="middle" align="left">[<a href="#SEC72" title="Up section"> Up </a>]</td>
5121: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5122: <td valign="middle" align="left"> </td>
5123: <td valign="middle" align="left"> </td>
5124: <td valign="middle" align="left"> </td>
5125: <td valign="middle" align="left"> </td>
5126: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5127: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5128: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5129: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5130: </tr></table>
5131: <h3 class="subsection"> 5.2.4 Other binaries </h3>
5132:
5133: <p><code>qemu-arm</code> is also capable of running ARM "Angel" semihosted ELF
5134: binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
5135: configurations), and arm-uclinux bFLT format binaries.
5136: </p>
5137: <p><code>qemu-m68k</code> is capable of running semihosted binaries using the BDM
5138: (m5xxx-ram-hosted.ld) or m68k-sim (sim.ld) syscall interfaces, and
5139: coldfire uClinux bFLT format binaries.
5140: </p>
5141: <p>The binary format is detected automatically.
5142: </p>
5143: <p><code>qemu-sparc</code> can execute Sparc32 binaries (Sparc32 CPU, 32 bit ABI).
5144: </p>
5145: <p><code>qemu-sparc32plus</code> can execute Sparc32 and SPARC32PLUS binaries
5146: (Sparc64 CPU, 32 bit ABI).
5147: </p>
5148: <p><code>qemu-sparc64</code> can execute some Sparc64 (Sparc64 CPU, 64 bit ABI) and
5149: SPARC32PLUS binaries (Sparc64 CPU, 32 bit ABI).
5150: </p>
5151: <hr size="6">
5152: <a name="Mac-OS-X_002fDarwin-User-space-emulator"></a>
5153: <a name="SEC77"></a>
5154: <table cellpadding="1" cellspacing="1" border="0">
5155: <tr><td valign="middle" align="left">[<a href="#SEC76" title="Previous section in reading order"> < </a>]</td>
5156: <td valign="middle" align="left">[<a href="#SEC78" title="Next section in reading order"> > </a>]</td>
5157: <td valign="middle" align="left"> </td>
5158: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5159: <td valign="middle" align="left">[<a href="#SEC70" title="Up section"> Up </a>]</td>
5160: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5161: <td valign="middle" align="left"> </td>
5162: <td valign="middle" align="left"> </td>
5163: <td valign="middle" align="left"> </td>
5164: <td valign="middle" align="left"> </td>
5165: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5166: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5167: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5168: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5169: </tr></table>
5170: <h2 class="section"> 5.3 Mac OS X/Darwin User space emulator </h2>
5171:
5172: <table class="menu" border="0" cellspacing="0">
5173: <tr><td align="left" valign="top"><a href="#SEC78">5.3.1 Mac OS X/Darwin Status</a></td><td> </td><td align="left" valign="top">
5174: </td></tr>
5175: <tr><td align="left" valign="top"><a href="#SEC79">5.3.2 Quick Start</a></td><td> </td><td align="left" valign="top">
5176: </td></tr>
5177: <tr><td align="left" valign="top"><a href="#SEC80">5.3.3 Command line options</a></td><td> </td><td align="left" valign="top">
5178: </td></tr>
5179: </table>
5180:
5181: <hr size="6">
5182: <a name="Mac-OS-X_002fDarwin-Status"></a>
5183: <a name="SEC78"></a>
5184: <table cellpadding="1" cellspacing="1" border="0">
5185: <tr><td valign="middle" align="left">[<a href="#SEC77" title="Previous section in reading order"> < </a>]</td>
5186: <td valign="middle" align="left">[<a href="#SEC79" title="Next section in reading order"> > </a>]</td>
5187: <td valign="middle" align="left"> </td>
5188: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5189: <td valign="middle" align="left">[<a href="#SEC77" title="Up section"> Up </a>]</td>
5190: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5191: <td valign="middle" align="left"> </td>
5192: <td valign="middle" align="left"> </td>
5193: <td valign="middle" align="left"> </td>
5194: <td valign="middle" align="left"> </td>
5195: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5196: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5197: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5198: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5199: </tr></table>
5200: <h3 class="subsection"> 5.3.1 Mac OS X/Darwin Status </h3>
5201:
5202: <ul class="toc">
5203: <li>-
5204: target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
5205: </li><li>-
5206: target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
5207: </li><li>-
5208: target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1]
5209: </li><li>-
5210: target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported.
5211: </li></ul>
5212:
5213: <p>[1] If you're host commpage can be executed by qemu.
5214: </p>
5215: <hr size="6">
5216: <a name="Mac-OS-X_002fDarwin-Quick-Start"></a>
5217: <a name="SEC79"></a>
5218: <table cellpadding="1" cellspacing="1" border="0">
5219: <tr><td valign="middle" align="left">[<a href="#SEC78" title="Previous section in reading order"> < </a>]</td>
5220: <td valign="middle" align="left">[<a href="#SEC80" title="Next section in reading order"> > </a>]</td>
5221: <td valign="middle" align="left"> </td>
5222: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5223: <td valign="middle" align="left">[<a href="#SEC77" title="Up section"> Up </a>]</td>
5224: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5225: <td valign="middle" align="left"> </td>
5226: <td valign="middle" align="left"> </td>
5227: <td valign="middle" align="left"> </td>
5228: <td valign="middle" align="left"> </td>
5229: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5230: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5231: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5232: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5233: </tr></table>
5234: <h3 class="subsection"> 5.3.2 Quick Start </h3>
5235:
5236: <p>In order to launch a Mac OS X/Darwin process, QEMU needs the process executable
5237: itself and all the target dynamic libraries used by it. If you don't have the FAT
5238: libraries (you're running Mac OS X/ppc) you'll need to obtain it from a Mac OS X
5239: CD or compile them by hand.
5240: </p>
5241: <ul class="toc">
5242: <li> On x86, you can just try to launch any process by using the native
5243: libraries:
5244:
5245: <table><tr><td> </td><td><pre class="example">qemu-i386 /bin/ls
5246: </pre></td></tr></table>
5247:
5248: <p>or to run the ppc version of the executable:
5249: </p>
5250: <table><tr><td> </td><td><pre class="example">qemu-ppc /bin/ls
5251: </pre></td></tr></table>
5252:
5253: </li><li> On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker)
5254: are installed:
5255:
5256: <table><tr><td> </td><td><pre class="example">qemu-i386 -L /opt/x86_root/ /bin/ls
5257: </pre></td></tr></table>
5258:
5259: <p><code>-L /opt/x86_root/</code> tells that the dynamic linker (dyld) path is in
5260: ‘<tt>/opt/x86_root/usr/bin/dyld</tt>’.
5261: </p>
5262: </li></ul>
5263:
5264: <hr size="6">
5265: <a name="Mac-OS-X_002fDarwin-Command-line-options"></a>
5266: <a name="SEC80"></a>
5267: <table cellpadding="1" cellspacing="1" border="0">
5268: <tr><td valign="middle" align="left">[<a href="#SEC79" title="Previous section in reading order"> < </a>]</td>
5269: <td valign="middle" align="left">[<a href="#SEC81" title="Next section in reading order"> > </a>]</td>
5270: <td valign="middle" align="left"> </td>
5271: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5272: <td valign="middle" align="left">[<a href="#SEC77" title="Up section"> Up </a>]</td>
5273: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5274: <td valign="middle" align="left"> </td>
5275: <td valign="middle" align="left"> </td>
5276: <td valign="middle" align="left"> </td>
5277: <td valign="middle" align="left"> </td>
5278: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5279: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5280: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5281: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5282: </tr></table>
5283: <h3 class="subsection"> 5.3.3 Command line options </h3>
5284:
5285: <table><tr><td> </td><td><pre class="example">usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
5286: </pre></td></tr></table>
5287:
5288: <dl compact="compact">
5289: <dt> ‘<samp>-h</samp>’</dt>
5290: <dd><p>Print the help
5291: </p></dd>
5292: <dt> ‘<samp>-L path</samp>’</dt>
5293: <dd><p>Set the library root path (default=/)
5294: </p></dd>
5295: <dt> ‘<samp>-s size</samp>’</dt>
5296: <dd><p>Set the stack size in bytes (default=524288)
5297: </p></dd>
5298: </dl>
5299:
5300: <p>Debug options:
5301: </p>
5302: <dl compact="compact">
5303: <dt> ‘<samp>-d</samp>’</dt>
5304: <dd><p>Activate log (logfile=/tmp/qemu.log)
5305: </p></dd>
5306: <dt> ‘<samp>-p pagesize</samp>’</dt>
5307: <dd><p>Act as if the host page size was 'pagesize' bytes
5308: </p></dd>
5309: <dt> ‘<samp>-singlestep</samp>’</dt>
5310: <dd><p>Run the emulation in single step mode.
5311: </p></dd>
5312: </dl>
5313:
5314: <hr size="6">
5315: <a name="BSD-User-space-emulator"></a>
5316: <a name="SEC81"></a>
5317: <table cellpadding="1" cellspacing="1" border="0">
5318: <tr><td valign="middle" align="left">[<a href="#SEC80" title="Previous section in reading order"> < </a>]</td>
5319: <td valign="middle" align="left">[<a href="#SEC82" title="Next section in reading order"> > </a>]</td>
5320: <td valign="middle" align="left"> </td>
5321: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5322: <td valign="middle" align="left">[<a href="#SEC70" title="Up section"> Up </a>]</td>
5323: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5324: <td valign="middle" align="left"> </td>
5325: <td valign="middle" align="left"> </td>
5326: <td valign="middle" align="left"> </td>
5327: <td valign="middle" align="left"> </td>
5328: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5329: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5330: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5331: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5332: </tr></table>
5333: <h2 class="section"> 5.4 BSD User space emulator </h2>
5334:
5335: <table class="menu" border="0" cellspacing="0">
5336: <tr><td align="left" valign="top"><a href="#SEC82">5.4.1 BSD Status</a></td><td> </td><td align="left" valign="top">
5337: </td></tr>
5338: <tr><td align="left" valign="top"><a href="#SEC83">5.4.2 Quick Start</a></td><td> </td><td align="left" valign="top">
5339: </td></tr>
5340: <tr><td align="left" valign="top"><a href="#SEC84">5.4.3 Command line options</a></td><td> </td><td align="left" valign="top">
5341: </td></tr>
5342: </table>
5343:
5344: <hr size="6">
5345: <a name="BSD-Status"></a>
5346: <a name="SEC82"></a>
5347: <table cellpadding="1" cellspacing="1" border="0">
5348: <tr><td valign="middle" align="left">[<a href="#SEC81" title="Previous section in reading order"> < </a>]</td>
5349: <td valign="middle" align="left">[<a href="#SEC83" title="Next section in reading order"> > </a>]</td>
5350: <td valign="middle" align="left"> </td>
5351: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5352: <td valign="middle" align="left">[<a href="#SEC81" title="Up section"> Up </a>]</td>
5353: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5354: <td valign="middle" align="left"> </td>
5355: <td valign="middle" align="left"> </td>
5356: <td valign="middle" align="left"> </td>
5357: <td valign="middle" align="left"> </td>
5358: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5359: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5360: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5361: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5362: </tr></table>
5363: <h3 class="subsection"> 5.4.1 BSD Status </h3>
5364:
5365: <ul class="toc">
5366: <li>-
5367: target Sparc64 on Sparc64: Some trivial programs work.
5368: </li></ul>
5369:
5370: <hr size="6">
5371: <a name="BSD-Quick-Start"></a>
5372: <a name="SEC83"></a>
5373: <table cellpadding="1" cellspacing="1" border="0">
5374: <tr><td valign="middle" align="left">[<a href="#SEC82" title="Previous section in reading order"> < </a>]</td>
5375: <td valign="middle" align="left">[<a href="#SEC84" title="Next section in reading order"> > </a>]</td>
5376: <td valign="middle" align="left"> </td>
5377: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5378: <td valign="middle" align="left">[<a href="#SEC81" title="Up section"> Up </a>]</td>
5379: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5380: <td valign="middle" align="left"> </td>
5381: <td valign="middle" align="left"> </td>
5382: <td valign="middle" align="left"> </td>
5383: <td valign="middle" align="left"> </td>
5384: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5385: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5386: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5387: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5388: </tr></table>
5389: <h3 class="subsection"> 5.4.2 Quick Start </h3>
5390:
5391: <p>In order to launch a BSD process, QEMU needs the process executable
5392: itself and all the target dynamic libraries used by it.
5393: </p>
5394: <ul class="toc">
5395: <li> On Sparc64, you can just try to launch any process by using the native
5396: libraries:
5397:
5398: <table><tr><td> </td><td><pre class="example">qemu-sparc64 /bin/ls
5399: </pre></td></tr></table>
5400:
5401: </li></ul>
5402:
5403: <hr size="6">
5404: <a name="BSD-Command-line-options"></a>
5405: <a name="SEC84"></a>
5406: <table cellpadding="1" cellspacing="1" border="0">
5407: <tr><td valign="middle" align="left">[<a href="#SEC83" title="Previous section in reading order"> < </a>]</td>
5408: <td valign="middle" align="left">[<a href="#SEC85" title="Next section in reading order"> > </a>]</td>
5409: <td valign="middle" align="left"> </td>
5410: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5411: <td valign="middle" align="left">[<a href="#SEC81" title="Up section"> Up </a>]</td>
5412: <td valign="middle" align="left">[<a href="#SEC85" title="Next chapter"> >> </a>]</td>
5413: <td valign="middle" align="left"> </td>
5414: <td valign="middle" align="left"> </td>
5415: <td valign="middle" align="left"> </td>
5416: <td valign="middle" align="left"> </td>
5417: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5418: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5419: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5420: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5421: </tr></table>
5422: <h3 class="subsection"> 5.4.3 Command line options </h3>
5423:
5424: <table><tr><td> </td><td><pre class="example">usage: qemu-sparc64 [-h] [-d] [-L path] [-s size] [-bsd type] program [arguments...]
5425: </pre></td></tr></table>
5426:
5427: <dl compact="compact">
5428: <dt> ‘<samp>-h</samp>’</dt>
5429: <dd><p>Print the help
5430: </p></dd>
5431: <dt> ‘<samp>-L path</samp>’</dt>
5432: <dd><p>Set the library root path (default=/)
5433: </p></dd>
5434: <dt> ‘<samp>-s size</samp>’</dt>
5435: <dd><p>Set the stack size in bytes (default=524288)
5436: </p></dd>
5437: <dt> ‘<samp>-bsd type</samp>’</dt>
5438: <dd><p>Set the type of the emulated BSD Operating system. Valid values are
5439: FreeBSD, NetBSD and OpenBSD (default).
5440: </p></dd>
5441: </dl>
5442:
5443: <p>Debug options:
5444: </p>
5445: <dl compact="compact">
5446: <dt> ‘<samp>-d</samp>’</dt>
5447: <dd><p>Activate log (logfile=/tmp/qemu.log)
5448: </p></dd>
5449: <dt> ‘<samp>-p pagesize</samp>’</dt>
5450: <dd><p>Act as if the host page size was 'pagesize' bytes
5451: </p></dd>
5452: <dt> ‘<samp>-singlestep</samp>’</dt>
5453: <dd><p>Run the emulation in single step mode.
5454: </p></dd>
5455: </dl>
5456:
5457: <hr size="6">
5458: <a name="compilation"></a>
5459: <a name="SEC85"></a>
5460: <table cellpadding="1" cellspacing="1" border="0">
5461: <tr><td valign="middle" align="left">[<a href="#SEC84" title="Previous section in reading order"> < </a>]</td>
5462: <td valign="middle" align="left">[<a href="#SEC86" title="Next section in reading order"> > </a>]</td>
5463: <td valign="middle" align="left"> </td>
5464: <td valign="middle" align="left">[<a href="#SEC70" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5465: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
5466: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5467: <td valign="middle" align="left"> </td>
5468: <td valign="middle" align="left"> </td>
5469: <td valign="middle" align="left"> </td>
5470: <td valign="middle" align="left"> </td>
5471: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5472: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5473: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5474: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5475: </tr></table>
5476: <h1 class="chapter"> 6. Compilation from the sources </h1>
5477:
5478: <table class="menu" border="0" cellspacing="0">
5479: <tr><td align="left" valign="top"><a href="#SEC86">6.1 Linux/Unix</a></td><td> </td><td align="left" valign="top">
5480: </td></tr>
5481: <tr><td align="left" valign="top"><a href="#SEC89">6.2 Windows</a></td><td> </td><td align="left" valign="top">
5482: </td></tr>
5483: <tr><td align="left" valign="top"><a href="#SEC90">6.3 Cross compilation for Windows with Linux</a></td><td> </td><td align="left" valign="top">
5484: </td></tr>
5485: <tr><td align="left" valign="top"><a href="#SEC91">6.4 Mac OS X</a></td><td> </td><td align="left" valign="top">
5486: </td></tr>
5487: </table>
5488:
5489: <hr size="6">
5490: <a name="Linux_002fUnix"></a>
5491: <a name="SEC86"></a>
5492: <table cellpadding="1" cellspacing="1" border="0">
5493: <tr><td valign="middle" align="left">[<a href="#SEC85" title="Previous section in reading order"> < </a>]</td>
5494: <td valign="middle" align="left">[<a href="#SEC87" title="Next section in reading order"> > </a>]</td>
5495: <td valign="middle" align="left"> </td>
5496: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5497: <td valign="middle" align="left">[<a href="#SEC85" title="Up section"> Up </a>]</td>
5498: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5499: <td valign="middle" align="left"> </td>
5500: <td valign="middle" align="left"> </td>
5501: <td valign="middle" align="left"> </td>
5502: <td valign="middle" align="left"> </td>
5503: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5504: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5505: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5506: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5507: </tr></table>
5508: <h2 class="section"> 6.1 Linux/Unix </h2>
5509:
5510: <hr size="6">
5511: <a name="SEC87"></a>
5512: <table cellpadding="1" cellspacing="1" border="0">
5513: <tr><td valign="middle" align="left">[<a href="#SEC86" title="Previous section in reading order"> < </a>]</td>
5514: <td valign="middle" align="left">[<a href="#SEC88" title="Next section in reading order"> > </a>]</td>
5515: <td valign="middle" align="left"> </td>
5516: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5517: <td valign="middle" align="left">[<a href="#SEC86" title="Up section"> Up </a>]</td>
5518: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5519: <td valign="middle" align="left"> </td>
5520: <td valign="middle" align="left"> </td>
5521: <td valign="middle" align="left"> </td>
5522: <td valign="middle" align="left"> </td>
5523: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5524: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5525: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5526: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5527: </tr></table>
5528: <h3 class="subsection"> 6.1.1 Compilation </h3>
5529:
5530: <p>First you must decompress the sources:
5531: </p><table><tr><td> </td><td><pre class="example">cd /tmp
5532: tar zxvf qemu-x.y.z.tar.gz
5533: cd qemu-x.y.z
5534: </pre></td></tr></table>
5535:
5536: <p>Then you configure QEMU and build it (usually no options are needed):
5537: </p><table><tr><td> </td><td><pre class="example">./configure
5538: make
5539: </pre></td></tr></table>
5540:
5541: <p>Then type as root user:
5542: </p><table><tr><td> </td><td><pre class="example">make install
5543: </pre></td></tr></table>
5544: <p>to install QEMU in ‘<tt>/usr/local</tt>’.
5545: </p>
5546: <hr size="6">
5547: <a name="SEC88"></a>
5548: <table cellpadding="1" cellspacing="1" border="0">
5549: <tr><td valign="middle" align="left">[<a href="#SEC87" title="Previous section in reading order"> < </a>]</td>
5550: <td valign="middle" align="left">[<a href="#SEC89" title="Next section in reading order"> > </a>]</td>
5551: <td valign="middle" align="left"> </td>
5552: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5553: <td valign="middle" align="left">[<a href="#SEC86" title="Up section"> Up </a>]</td>
5554: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5555: <td valign="middle" align="left"> </td>
5556: <td valign="middle" align="left"> </td>
5557: <td valign="middle" align="left"> </td>
5558: <td valign="middle" align="left"> </td>
5559: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5560: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5561: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5562: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5563: </tr></table>
5564: <h3 class="subsection"> 6.1.2 GCC version </h3>
5565:
5566: <p>In order to compile QEMU successfully, it is very important that you
5567: have the right tools. The most important one is gcc. On most hosts and
5568: in particular on x86 ones, <em>gcc 4.x is not supported</em>. If your
5569: Linux distribution includes a gcc 4.x compiler, you can usually
5570: install an older version (it is invoked by <code>gcc32</code> or
5571: <code>gcc34</code>). The QEMU configure script automatically probes for
5572: these older versions so that usually you don't have to do anything.
5573: </p>
5574: <hr size="6">
5575: <a name="Windows"></a>
5576: <a name="SEC89"></a>
5577: <table cellpadding="1" cellspacing="1" border="0">
5578: <tr><td valign="middle" align="left">[<a href="#SEC88" title="Previous section in reading order"> < </a>]</td>
5579: <td valign="middle" align="left">[<a href="#SEC90" title="Next section in reading order"> > </a>]</td>
5580: <td valign="middle" align="left"> </td>
5581: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5582: <td valign="middle" align="left">[<a href="#SEC85" title="Up section"> Up </a>]</td>
5583: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5584: <td valign="middle" align="left"> </td>
5585: <td valign="middle" align="left"> </td>
5586: <td valign="middle" align="left"> </td>
5587: <td valign="middle" align="left"> </td>
5588: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5589: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5590: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5591: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5592: </tr></table>
5593: <h2 class="section"> 6.2 Windows </h2>
5594:
5595: <ul class="toc">
5596: <li> Install the current versions of MSYS and MinGW from
5597: <a href="http://www.mingw.org/">http://www.mingw.org/</a>. You can find detailed installation
5598: instructions in the download section and the FAQ.
5599:
5600: </li><li> Download
5601: the MinGW development library of SDL 1.2.x
5602: (‘<tt>SDL-devel-1.2.x-mingw32.tar.gz</tt>’) from
5603: <a href="http://www.libsdl.org">http://www.libsdl.org</a>. Unpack it in a temporary place, and
5604: unpack the archive ‘<tt>i386-mingw32msvc.tar.gz</tt>’ in the MinGW tool
5605: directory. Edit the ‘<tt>sdl-config</tt>’ script so that it gives the
5606: correct SDL directory when invoked.
5607:
5608: </li><li> Extract the current version of QEMU.
5609:
5610: </li><li> Start the MSYS shell (file ‘<tt>msys.bat</tt>’).
5611:
5612: </li><li> Change to the QEMU directory. Launch ‘<tt>./configure</tt>’ and
5613: ‘<tt>make</tt>’. If you have problems using SDL, verify that
5614: ‘<tt>sdl-config</tt>’ can be launched from the MSYS command line.
5615:
5616: </li><li> You can install QEMU in ‘<tt>Program Files/Qemu</tt>’ by typing
5617: ‘<tt>make install</tt>’. Don't forget to copy ‘<tt>SDL.dll</tt>’ in
5618: ‘<tt>Program Files/Qemu</tt>’.
5619:
5620: </li></ul>
5621:
5622: <hr size="6">
5623: <a name="Cross-compilation-for-Windows-with-Linux"></a>
5624: <a name="SEC90"></a>
5625: <table cellpadding="1" cellspacing="1" border="0">
5626: <tr><td valign="middle" align="left">[<a href="#SEC89" title="Previous section in reading order"> < </a>]</td>
5627: <td valign="middle" align="left">[<a href="#SEC91" title="Next section in reading order"> > </a>]</td>
5628: <td valign="middle" align="left"> </td>
5629: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5630: <td valign="middle" align="left">[<a href="#SEC85" title="Up section"> Up </a>]</td>
5631: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5632: <td valign="middle" align="left"> </td>
5633: <td valign="middle" align="left"> </td>
5634: <td valign="middle" align="left"> </td>
5635: <td valign="middle" align="left"> </td>
5636: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5637: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5638: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5639: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5640: </tr></table>
5641: <h2 class="section"> 6.3 Cross compilation for Windows with Linux </h2>
5642:
5643: <ul class="toc">
5644: <li>
5645: Install the MinGW cross compilation tools available at
5646: <a href="http://www.mingw.org/">http://www.mingw.org/</a>.
5647:
5648: </li><li>
5649: Install the Win32 version of SDL (<a href="http://www.libsdl.org">http://www.libsdl.org</a>) by
5650: unpacking ‘<tt>i386-mingw32msvc.tar.gz</tt>’. Set up the PATH environment
5651: variable so that ‘<tt>i386-mingw32msvc-sdl-config</tt>’ can be launched by
5652: the QEMU configuration script.
5653:
5654: </li><li>
5655: Configure QEMU for Windows cross compilation:
5656: <table><tr><td> </td><td><pre class="example">./configure --enable-mingw32
5657: </pre></td></tr></table>
5658: <p>If necessary, you can change the cross-prefix according to the prefix
5659: chosen for the MinGW tools with –cross-prefix. You can also use
5660: –prefix to set the Win32 install path.
5661: </p>
5662: </li><li> You can install QEMU in the installation directory by typing
5663: ‘<tt>make install</tt>’. Don't forget to copy ‘<tt>SDL.dll</tt>’ in the
5664: installation directory.
5665:
5666: </li></ul>
5667:
5668: <p>Note: Currently, Wine does not seem able to launch
5669: QEMU for Win32.
5670: </p>
5671: <hr size="6">
5672: <a name="Mac-OS-X"></a>
5673: <a name="SEC91"></a>
5674: <table cellpadding="1" cellspacing="1" border="0">
5675: <tr><td valign="middle" align="left">[<a href="#SEC90" title="Previous section in reading order"> < </a>]</td>
5676: <td valign="middle" align="left">[<a href="#SEC92" title="Next section in reading order"> > </a>]</td>
5677: <td valign="middle" align="left"> </td>
5678: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5679: <td valign="middle" align="left">[<a href="#SEC85" title="Up section"> Up </a>]</td>
5680: <td valign="middle" align="left">[<a href="#SEC92" title="Next chapter"> >> </a>]</td>
5681: <td valign="middle" align="left"> </td>
5682: <td valign="middle" align="left"> </td>
5683: <td valign="middle" align="left"> </td>
5684: <td valign="middle" align="left"> </td>
5685: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5686: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5687: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5688: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5689: </tr></table>
5690: <h2 class="section"> 6.4 Mac OS X </h2>
5691:
5692: <p>The Mac OS X patches are not fully merged in QEMU, so you should look
5693: at the QEMU mailing list archive to have all the necessary
5694: information.
5695: </p>
5696: <hr size="6">
5697: <a name="Index"></a>
5698: <a name="SEC92"></a>
5699: <table cellpadding="1" cellspacing="1" border="0">
5700: <tr><td valign="middle" align="left">[<a href="#SEC91" title="Previous section in reading order"> < </a>]</td>
5701: <td valign="middle" align="left">[ > ]</td>
5702: <td valign="middle" align="left"> </td>
5703: <td valign="middle" align="left">[<a href="#SEC85" title="Beginning of this chapter or previous chapter"> << </a>]</td>
5704: <td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td>
5705: <td valign="middle" align="left">[ >> ]</td>
5706: <td valign="middle" align="left"> </td>
5707: <td valign="middle" align="left"> </td>
5708: <td valign="middle" align="left"> </td>
5709: <td valign="middle" align="left"> </td>
5710: <td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5711: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5712: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5713: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5714: </tr></table>
5715: <h1 class="chapter"> 7. Index </h1>
5716:
5717: <hr size="6">
5718: <a name="SEC_Contents"></a>
5719: <table cellpadding="1" cellspacing="1" border="0">
5720: <tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5721: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5722: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5723: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5724: </tr></table>
5725: <h1>Table of Contents</h1>
5726: <div class="contents">
5727:
5728: <ul class="toc">
5729: <li><a name="TOC1" href="#SEC1">1. Introduction</a>
5730: <ul class="toc">
5731: <li><a name="TOC2" href="#SEC2">1.1 Features</a></li>
5732: </ul></li>
5733: <li><a name="TOC3" href="#SEC3">2. Installation</a>
5734: <ul class="toc">
5735: <li><a name="TOC4" href="#SEC4">2.1 Linux</a></li>
5736: <li><a name="TOC5" href="#SEC5">2.2 Windows</a></li>
5737: <li><a name="TOC6" href="#SEC6">2.3 Mac OS X</a></li>
5738: </ul></li>
5739: <li><a name="TOC7" href="#SEC7">3. QEMU PC System emulator</a>
5740: <ul class="toc">
5741: <li><a name="TOC8" href="#SEC8">3.1 Introduction</a></li>
5742: <li><a name="TOC9" href="#SEC9">3.2 Quick Start</a></li>
5743: <li><a name="TOC10" href="#SEC10">3.3 Invocation</a></li>
5744: <li><a name="TOC11" href="#SEC11">3.4 Keys</a></li>
5745: <li><a name="TOC12" href="#SEC12">3.5 QEMU Monitor</a>
5746: <ul class="toc">
5747: <li><a name="TOC13" href="#SEC13">3.5.1 Commands</a></li>
5748: <li><a name="TOC14" href="#SEC14">3.5.2 Integer expressions</a></li>
5749: </ul></li>
5750: <li><a name="TOC15" href="#SEC15">3.6 Disk Images</a>
5751: <ul class="toc">
5752: <li><a name="TOC16" href="#SEC16">3.6.1 Quick start for disk image creation</a></li>
5753: <li><a name="TOC17" href="#SEC17">3.6.2 Snapshot mode</a></li>
5754: <li><a name="TOC18" href="#SEC18">3.6.3 VM snapshots</a></li>
5755: <li><a name="TOC19" href="#SEC19">3.6.4 <code>qemu-img</code> Invocation</a></li>
5756: <li><a name="TOC20" href="#SEC20">3.6.5 <code>qemu-nbd</code> Invocation</a></li>
5757: <li><a name="TOC21" href="#SEC21">3.6.6 Using host drives</a>
5758: <ul class="toc">
5759: <li><a name="TOC22" href="#SEC22">3.6.6.1 Linux</a></li>
5760: <li><a name="TOC23" href="#SEC23">3.6.6.2 Windows</a></li>
5761: <li><a name="TOC24" href="#SEC24">3.6.6.3 Mac OS X</a></li>
5762: </ul></li>
5763: <li><a name="TOC25" href="#SEC25">3.6.7 Virtual FAT disk images</a></li>
5764: <li><a name="TOC26" href="#SEC26">3.6.8 NBD access</a></li>
5765: </ul></li>
5766: <li><a name="TOC27" href="#SEC27">3.7 Network emulation</a>
5767: <ul class="toc">
5768: <li><a name="TOC28" href="#SEC28">3.7.1 VLANs</a></li>
5769: <li><a name="TOC29" href="#SEC29">3.7.2 Using TAP network interfaces</a>
5770: <ul class="toc">
5771: <li><a name="TOC30" href="#SEC30">3.7.2.1 Linux host</a></li>
5772: <li><a name="TOC31" href="#SEC31">3.7.2.2 Windows host</a></li>
5773: </ul></li>
5774: <li><a name="TOC32" href="#SEC32">3.7.3 Using the user mode network stack</a></li>
5775: <li><a name="TOC33" href="#SEC33">3.7.4 Connecting VLANs between QEMU instances</a></li>
5776: </ul></li>
5777: <li><a name="TOC34" href="#SEC34">3.8 Direct Linux Boot</a></li>
5778: <li><a name="TOC35" href="#SEC35">3.9 USB emulation</a>
5779: <ul class="toc">
5780: <li><a name="TOC36" href="#SEC36">3.9.1 Connecting USB devices</a></li>
5781: <li><a name="TOC37" href="#SEC37">3.9.2 Using host USB devices on a Linux host</a></li>
5782: </ul></li>
5783: <li><a name="TOC38" href="#SEC38">3.10 VNC security</a>
5784: <ul class="toc">
5785: <li><a name="TOC39" href="#SEC39">3.10.1 Without passwords</a></li>
5786: <li><a name="TOC40" href="#SEC40">3.10.2 With passwords</a></li>
5787: <li><a name="TOC41" href="#SEC41">3.10.3 With x509 certificates</a></li>
5788: <li><a name="TOC42" href="#SEC42">3.10.4 With x509 certificates and client verification</a></li>
5789: <li><a name="TOC43" href="#SEC43">3.10.5 With x509 certificates, client verification and passwords</a></li>
5790: <li><a name="TOC44" href="#SEC44">3.10.6 With SASL authentication</a></li>
5791: <li><a name="TOC45" href="#SEC45">3.10.7 With x509 certificates and SASL authentication</a></li>
5792: <li><a name="TOC46" href="#SEC46">3.10.8 Generating certificates for VNC</a>
5793: <ul class="toc">
5794: <li><a name="TOC47" href="#SEC47">3.10.8.1 Setup the Certificate Authority</a></li>
5795: <li><a name="TOC48" href="#SEC48">3.10.8.2 Issuing server certificates</a></li>
5796: <li><a name="TOC49" href="#SEC49">3.10.8.3 Issuing client certificates</a></li>
5797: </ul></li>
5798: <li><a name="TOC50" href="#SEC50">3.10.9 Configuring SASL mechanisms</a></li>
5799: </ul></li>
5800: <li><a name="TOC51" href="#SEC51">3.11 GDB usage</a></li>
5801: <li><a name="TOC52" href="#SEC52">3.12 Target OS specific information</a>
5802: <ul class="toc">
5803: <li><a name="TOC53" href="#SEC53">3.12.1 Linux</a></li>
5804: <li><a name="TOC54" href="#SEC54">3.12.2 Windows</a>
5805: <ul class="toc">
5806: <li><a name="TOC55" href="#SEC55">3.12.2.1 SVGA graphic modes support</a></li>
5807: <li><a name="TOC56" href="#SEC56">3.12.2.2 CPU usage reduction</a></li>
5808: <li><a name="TOC57" href="#SEC57">3.12.2.3 Windows 2000 disk full problem</a></li>
5809: <li><a name="TOC58" href="#SEC58">3.12.2.4 Windows 2000 shutdown</a></li>
5810: <li><a name="TOC59" href="#SEC59">3.12.2.5 Share a directory between Unix and Windows</a></li>
5811: <li><a name="TOC60" href="#SEC60">3.12.2.6 Windows XP security problem</a></li>
5812: </ul></li>
5813: <li><a name="TOC61" href="#SEC61">3.12.3 MS-DOS and FreeDOS</a>
5814: <ul class="toc">
5815: <li><a name="TOC62" href="#SEC62">3.12.3.1 CPU usage reduction</a></li>
5816: </ul>
5817: </li>
5818: </ul>
5819: </li>
5820: </ul></li>
5821: <li><a name="TOC63" href="#SEC63">4. QEMU System emulator for non PC targets</a>
5822: <ul class="toc">
5823: <li><a name="TOC64" href="#SEC64">4.1 QEMU PowerPC System emulator</a></li>
5824: <li><a name="TOC65" href="#SEC65">4.2 Sparc32 System emulator</a></li>
5825: <li><a name="TOC66" href="#SEC66">4.3 Sparc64 System emulator</a></li>
5826: <li><a name="TOC67" href="#SEC67">4.4 MIPS System emulator</a></li>
5827: <li><a name="TOC68" href="#SEC68">4.5 ARM System emulator</a></li>
5828: <li><a name="TOC69" href="#SEC69">4.6 ColdFire System emulator</a></li>
5829: </ul></li>
5830: <li><a name="TOC70" href="#SEC70">5. QEMU User space emulator</a>
5831: <ul class="toc">
5832: <li><a name="TOC71" href="#SEC71">5.1 Supported Operating Systems</a></li>
5833: <li><a name="TOC72" href="#SEC72">5.2 Linux User space emulator</a>
5834: <ul class="toc">
5835: <li><a name="TOC73" href="#SEC73">5.2.1 Quick Start</a></li>
5836: <li><a name="TOC74" href="#SEC74">5.2.2 Wine launch</a></li>
5837: <li><a name="TOC75" href="#SEC75">5.2.3 Command line options</a></li>
5838: <li><a name="TOC76" href="#SEC76">5.2.4 Other binaries</a></li>
5839: </ul></li>
5840: <li><a name="TOC77" href="#SEC77">5.3 Mac OS X/Darwin User space emulator</a>
5841: <ul class="toc">
5842: <li><a name="TOC78" href="#SEC78">5.3.1 Mac OS X/Darwin Status</a></li>
5843: <li><a name="TOC79" href="#SEC79">5.3.2 Quick Start</a></li>
5844: <li><a name="TOC80" href="#SEC80">5.3.3 Command line options</a></li>
5845: </ul></li>
5846: <li><a name="TOC81" href="#SEC81">5.4 BSD User space emulator</a>
5847: <ul class="toc">
5848: <li><a name="TOC82" href="#SEC82">5.4.1 BSD Status</a></li>
5849: <li><a name="TOC83" href="#SEC83">5.4.2 Quick Start</a></li>
5850: <li><a name="TOC84" href="#SEC84">5.4.3 Command line options</a></li>
5851: </ul>
5852: </li>
5853: </ul></li>
5854: <li><a name="TOC85" href="#SEC85">6. Compilation from the sources</a>
5855: <ul class="toc">
5856: <li><a name="TOC86" href="#SEC86">6.1 Linux/Unix</a>
5857: <ul class="toc">
5858: <li><a name="TOC87" href="#SEC87">6.1.1 Compilation</a></li>
5859: <li><a name="TOC88" href="#SEC88">6.1.2 GCC version</a></li>
5860: </ul></li>
5861: <li><a name="TOC89" href="#SEC89">6.2 Windows</a></li>
5862: <li><a name="TOC90" href="#SEC90">6.3 Cross compilation for Windows with Linux</a></li>
5863: <li><a name="TOC91" href="#SEC91">6.4 Mac OS X</a></li>
5864: </ul></li>
5865: <li><a name="TOC92" href="#SEC92">7. Index</a></li>
5866: </ul>
5867: </div>
5868: <hr size="1">
5869: <a name="SEC_About"></a>
5870: <table cellpadding="1" cellspacing="1" border="0">
5871: <tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td>
5872: <td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
5873: <td valign="middle" align="left">[<a href="#SEC92" title="Index">Index</a>]</td>
5874: <td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
5875: </tr></table>
5876: <h1>About This Document</h1>
5877: <p>
5878: This document was generated by <em>Anthony Liguori</em> on <em>May, 1 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78</em></a>.
5879: </p>
5880: <p>
5881: The buttons in the navigation panels have the following meaning:
5882: </p>
5883: <table border="1">
5884: <tr>
5885: <th> Button </th>
5886: <th> Name </th>
5887: <th> Go to </th>
5888: <th> From 1.2.3 go to</th>
5889: </tr>
5890: <tr>
5891: <td align="center"> [ < ] </td>
5892: <td align="center">Back</td>
5893: <td>Previous section in reading order</td>
5894: <td>1.2.2</td>
5895: </tr>
5896: <tr>
5897: <td align="center"> [ > ] </td>
5898: <td align="center">Forward</td>
5899: <td>Next section in reading order</td>
5900: <td>1.2.4</td>
5901: </tr>
5902: <tr>
5903: <td align="center"> [ << ] </td>
5904: <td align="center">FastBack</td>
5905: <td>Beginning of this chapter or previous chapter</td>
5906: <td>1</td>
5907: </tr>
5908: <tr>
5909: <td align="center"> [ Up ] </td>
5910: <td align="center">Up</td>
5911: <td>Up section</td>
5912: <td>1.2</td>
5913: </tr>
5914: <tr>
5915: <td align="center"> [ >> ] </td>
5916: <td align="center">FastForward</td>
5917: <td>Next chapter</td>
5918: <td>2</td>
5919: </tr>
5920: <tr>
5921: <td align="center"> [Top] </td>
5922: <td align="center">Top</td>
5923: <td>Cover (top) of document</td>
5924: <td> </td>
5925: </tr>
5926: <tr>
5927: <td align="center"> [Contents] </td>
5928: <td align="center">Contents</td>
5929: <td>Table of contents</td>
5930: <td> </td>
5931: </tr>
5932: <tr>
5933: <td align="center"> [Index] </td>
5934: <td align="center">Index</td>
5935: <td>Index</td>
5936: <td> </td>
5937: </tr>
5938: <tr>
5939: <td align="center"> [ ? ] </td>
5940: <td align="center">About</td>
5941: <td>About (help)</td>
5942: <td> </td>
5943: </tr>
5944: </table>
5945:
5946: <p>
5947: 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:
5948: </p>
5949:
5950: <ul>
5951: <li> 1. Section One
5952: <ul>
5953: <li>1.1 Subsection One-One
5954: <ul>
5955: <li>...</li>
5956: </ul>
5957: </li>
5958: <li>1.2 Subsection One-Two
5959: <ul>
5960: <li>1.2.1 Subsubsection One-Two-One</li>
5961: <li>1.2.2 Subsubsection One-Two-Two</li>
5962: <li>1.2.3 Subsubsection One-Two-Three
5963: <strong><== Current Position </strong></li>
5964: <li>1.2.4 Subsubsection One-Two-Four</li>
5965: </ul>
5966: </li>
5967: <li>1.3 Subsection One-Three
5968: <ul>
5969: <li>...</li>
5970: </ul>
5971: </li>
5972: <li>1.4 Subsection One-Four</li>
5973: </ul>
5974: </li>
5975: </ul>
5976:
5977: <hr size="1">
5978: <p>
5979: <font size="-1">
5980: This document was generated by <em>Anthony Liguori</em> on <em>May, 1 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78</em></a>.
5981: </font>
5982: <br>
5983:
5984: </p>
5985: </body>
5986: </html>
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.