1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY qemu-download-http "https://download.qemu-project.org/qemu-&qemu-version;.tar.xz">
|
---|
8 | <!ENTITY qemu-download-ftp " ">
|
---|
9 | <!ENTITY qemu-md5sum "bfb5b09a0d1f887c8c42a6d5f26971ab">
|
---|
10 | <!ENTITY qemu-size "120 MB">
|
---|
11 | <!ENTITY qemu-buildsize "2.4 GB">
|
---|
12 | <!ENTITY qemu-time "1.4 SBU (using parallelism=4; add 0.5 SBU for tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="qemu" xreflabel="qemu-&qemu-version;">
|
---|
16 | <?dbhtml filename="qemu.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <date>$Date$</date>
|
---|
20 | </sect1info>
|
---|
21 |
|
---|
22 | <title>qemu-&qemu-version;</title>
|
---|
23 |
|
---|
24 | <indexterm zone="qemu">
|
---|
25 | <primary sortas="a-qemu">qemu</primary>
|
---|
26 | </indexterm>
|
---|
27 |
|
---|
28 | <sect2 role="package">
|
---|
29 | <title>Introduction to qemu</title>
|
---|
30 |
|
---|
31 | <para>
|
---|
32 | <application>qemu</application> is a full virtualization solution for
|
---|
33 | Linux on x86 hardware containing virtualization extensions (Intel VT or
|
---|
34 | AMD-V).
|
---|
35 | </para>
|
---|
36 |
|
---|
37 | &lfs111_checked;
|
---|
38 |
|
---|
39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
40 | <itemizedlist spacing="compact">
|
---|
41 | <listitem>
|
---|
42 | <para>
|
---|
43 | Download (HTTP): <ulink url="&qemu-download-http;"/>
|
---|
44 | </para>
|
---|
45 | </listitem>
|
---|
46 | <listitem>
|
---|
47 | <para>
|
---|
48 | Download (FTP): <ulink url="&qemu-download-ftp;"/>
|
---|
49 | </para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download MD5 sum: &qemu-md5sum;
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download size: &qemu-size;
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Estimated disk space required: &qemu-buildsize;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Estimated build time: &qemu-time;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
73 | <bridgehead renderas="sect3">Qemu Dependencies</bridgehead>
|
---|
74 |
|
---|
75 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
76 | <para role="required">
|
---|
77 | <xref linkend="glib2"/>, and
|
---|
78 | <xref linkend="x-window-system"/>
|
---|
79 | </para>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
82 | <para role="recommended">
|
---|
83 | <xref linkend="alsa-lib"/> and
|
---|
84 | <xref linkend="sdl2"/>
|
---|
85 | </para>
|
---|
86 |
|
---|
87 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
88 | <para role="optional">
|
---|
89 | Depending on the sound system, various packages in <xref linkend="alsa"/>,
|
---|
90 | <xref linkend="python3"/>,
|
---|
91 | <xref linkend="pulseaudio"/>,
|
---|
92 | <xref linkend="bluez"/>,
|
---|
93 | <xref linkend="curl"/>,
|
---|
94 | <xref linkend="cyrus-sasl"/>,
|
---|
95 | <xref linkend="gnutls"/>,
|
---|
96 | <xref linkend="gtk2"/>,
|
---|
97 | <xref linkend="gtk3"/>,
|
---|
98 | <xref linkend="libusb"/>,
|
---|
99 | <xref linkend="libgcrypt"/>,
|
---|
100 | <xref linkend="libssh2"/>,
|
---|
101 | <xref linkend="lzo"/>,
|
---|
102 | <xref linkend="nettle"/>,
|
---|
103 | <xref linkend="mesa"/>,
|
---|
104 | <xref linkend="sdl"/>,
|
---|
105 | <xref role="nodep" linkend="vte"/> or <xref linkend="vte2"/>, and
|
---|
106 | <!-- libcacard has been a standalone project since qemu-2.5.-->
|
---|
107 | <ulink url="https://gitlab.freedesktop.org/spice/libcacard">libcacard</ulink>
|
---|
108 | </para>
|
---|
109 |
|
---|
110 | <bridgehead renderas="sect4">Optional dependencies for installing the documentation</bridgehead>
|
---|
111 | <para role="optional">
|
---|
112 | <ulink url="https://www.sphinx-doc.org/en/master/index.html">sphinx</ulink> with the
|
---|
113 | <ulink url="https://pypi.org/project/sphinx-rtd-theme/">sphinx-rtd-theme</ulink> theme
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | <note>
|
---|
117 | <para>
|
---|
118 | This optional dependencies list is not comprehensive. See the output of
|
---|
119 | <command>./configure --help</command> for a more complete list.
|
---|
120 | </para>
|
---|
121 | </note>
|
---|
122 |
|
---|
123 | <para condition="html" role="usernotes">User Notes:
|
---|
124 | <ulink url="&blfs-wiki;/qemu"/></para>
|
---|
125 |
|
---|
126 | </sect2>
|
---|
127 |
|
---|
128 | <sect2 id='qemu-prereq'>
|
---|
129 | <title>KVM Prerequisites</title>
|
---|
130 |
|
---|
131 | <para>
|
---|
132 | Before building <application>qemu</application>, check to see if
|
---|
133 | your processor supports Virtualization Technology (VT):
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <screen><userinput>egrep '^flags.*(vmx|svm)' /proc/cpuinfo</userinput></screen>
|
---|
137 |
|
---|
138 | <para>
|
---|
139 | If you get any output, you have VT technology (vmx for Intel
|
---|
140 | processors and svm for AMD processors). You then need to go into your
|
---|
141 | system BIOS and ensure it is enabled. After enabling, reboot back to your
|
---|
142 | LFS instance.
|
---|
143 | </para>
|
---|
144 |
|
---|
145 | </sect2>
|
---|
146 |
|
---|
147 | <sect2 role="kernel" id='qemu-kernel'>
|
---|
148 | <title>Kernel Configuration</title>
|
---|
149 |
|
---|
150 | <para>
|
---|
151 | Enable the following options in the kernel configuration and
|
---|
152 | recompile the kernel if necessary:
|
---|
153 | </para>
|
---|
154 |
|
---|
155 | <screen><literal>[*] Virtualization: ---> [CONFIG_VIRTUALIZATION]
|
---|
156 | <*/M> Kernel-based Virtual Machine (KVM) support [CONFIG_KVM]
|
---|
157 | <*/M> KVM for Intel (and compatible) processors support [CONFIG_KVM_INTEL]
|
---|
158 | <*/M> KVM for AMD processors support [CONFIG_KVM_AMD]</literal></screen>
|
---|
159 |
|
---|
160 | <indexterm zone="qemu qemu-kernel">
|
---|
161 | <primary sortas="d-qemu">qemu</primary>
|
---|
162 | </indexterm>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | The Intel or AMD settings are not both required, but the one matching
|
---|
166 | your system processor is required.
|
---|
167 | </para>
|
---|
168 |
|
---|
169 | <para>
|
---|
170 | To use the <quote>bridge</quote> network device, as explained below,
|
---|
171 | check that <xref linkend='bridgeutils'/> is installed
|
---|
172 | and the following options in the kernel configuration are enabled:
|
---|
173 | </para>
|
---|
174 |
|
---|
175 | <screen><literal>[*] Networking support ---> [CONFIG_NET]
|
---|
176 | Networking options --->
|
---|
177 | <*/M> 802.1d Ethernet Bridging [CONFIG_BRIDGE]
|
---|
178 | Device Drivers --->
|
---|
179 | [*] Network device support ---> [CONFIG_NETDEVICES]
|
---|
180 | <*/M> Universal TUN/TAP device driver support [CONFIG_TUN]</literal></screen>
|
---|
181 |
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 role="installation">
|
---|
185 | <title>Installation of qemu</title>
|
---|
186 | <!-- group kvm is created in lfs chapter 7 even for sysv
|
---|
187 | <para revision="sysv">
|
---|
188 | You will need a dedicated group that will contain users (other than root)
|
---|
189 | allowed to access the KVM device. Create this group by running the
|
---|
190 | following command as the
|
---|
191 | <systemitem class="username">root</systemitem> user:
|
---|
192 | </para>
|
---|
193 |
|
---|
194 | <screen role="root" revision="sysv"><userinput>groupadd -g 61 kvm</userinput></screen>
|
---|
195 | -->
|
---|
196 | <para>
|
---|
197 | Add any users that might use the KVM device to that group:
|
---|
198 | </para>
|
---|
199 |
|
---|
200 | <screen role="root"><userinput>usermod -a -G kvm <replaceable><username></replaceable></userinput></screen>
|
---|
201 |
|
---|
202 | <para>
|
---|
203 | Install <application>qemu</application> by running the following
|
---|
204 | commands:
|
---|
205 | </para>
|
---|
206 |
|
---|
207 | <note>
|
---|
208 | <para>
|
---|
209 | Qemu is capable of running many targets. The build process
|
---|
210 | is also capable of building multiple targets at one time in a
|
---|
211 | comma delimited list assigned to <option>--target-list</option>. Run
|
---|
212 | <command>./configure --help</command> to get a complete list of
|
---|
213 | available targets.
|
---|
214 | </para>
|
---|
215 | </note>
|
---|
216 |
|
---|
217 |
|
---|
218 | <screen><userinput>if [ $(uname -m) = i686 ]; then
|
---|
219 | QEMU_ARCH=i386-softmmu
|
---|
220 | else
|
---|
221 | QEMU_ARCH=x86_64-softmmu
|
---|
222 | fi
|
---|
223 |
|
---|
224 |
|
---|
225 | mkdir -vp build &&
|
---|
226 | cd build &&
|
---|
227 |
|
---|
228 | ../configure --prefix=/usr \
|
---|
229 | --sysconfdir=/etc \
|
---|
230 | --localstatedir=/var \
|
---|
231 | --target-list=$QEMU_ARCH \
|
---|
232 | --audio-drv-list=alsa \
|
---|
233 | --disable-pa \
|
---|
234 | --docdir=/usr/share/doc/qemu-&qemu-version; &&
|
---|
235 |
|
---|
236 | unset QEMU_ARCH &&
|
---|
237 |
|
---|
238 | make</userinput></screen>
|
---|
239 |
|
---|
240 | <para>
|
---|
241 | <application>qemu</application> uses <command>ninja</command> as
|
---|
242 | a subprocess when building. To run the tests, issue:
|
---|
243 | <command>ninja test</command>.
|
---|
244 | </para>
|
---|
245 |
|
---|
246 | <para>
|
---|
247 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
248 | </para>
|
---|
249 |
|
---|
250 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
251 |
|
---|
252 | <para>
|
---|
253 | You will also need to add an Udev rule so that the KVM device gets correct
|
---|
254 | permissions:
|
---|
255 | </para>
|
---|
256 |
|
---|
257 | <screen role="root"><userinput>cat > /lib/udev/rules.d/65-kvm.rules << "EOF"
|
---|
258 | <literal>KERNEL=="kvm", GROUP="kvm", MODE="0660"</literal>
|
---|
259 | EOF</userinput></screen>
|
---|
260 |
|
---|
261 | <para>
|
---|
262 | Change the permissions and ownership of a helper script, which is needed
|
---|
263 | when using the <quote>bridge</quote> network device (see below):
|
---|
264 | </para>
|
---|
265 |
|
---|
266 | <screen role="root"><userinput>chgrp kvm /usr/libexec/qemu-bridge-helper &&
|
---|
267 | chmod 4750 /usr/libexec/qemu-bridge-helper</userinput></screen>
|
---|
268 |
|
---|
269 | <note>
|
---|
270 | <para>
|
---|
271 | For convenience you may want to create a symbolic link to run
|
---|
272 | the installed program. For instance:
|
---|
273 | </para>
|
---|
274 |
|
---|
275 | <screen role="root"><userinput>ln -sv qemu-system-`uname -m` /usr/bin/qemu</userinput></screen>
|
---|
276 | </note>
|
---|
277 |
|
---|
278 | </sect2>
|
---|
279 |
|
---|
280 | <sect2 role="commands">
|
---|
281 | <title>Command Explanations</title>
|
---|
282 |
|
---|
283 | <!-- Not used anymore
|
---|
284 | <para>
|
---|
285 | <command>sed ... util/memfd.c</command>: This command fixes a conflict
|
---|
286 | introduced with glibc-2.27.
|
---|
287 | </para>
|
---|
288 | -->
|
---|
289 | <para>
|
---|
290 | <parameter>--audio-drv-list=alsa --disable-pa</parameter>: This switch sets the audio
|
---|
291 | driver to ALSA. See below for enabling other audio drivers.
|
---|
292 | </para>
|
---|
293 |
|
---|
294 | <para>
|
---|
295 | <option>--audio-drv-list=pa --disable-alsa</option>: This switch sets the audio
|
---|
296 | driver to pulseaudio. For other drivers see the --audio-drv-list list in
|
---|
297 | <command>configure</command>'s help output. The default audio driver is
|
---|
298 | OSS. To enable support for both alsa and pulseaudio, use
|
---|
299 | <option>--audio-drv-list=alsa,pa</option>.
|
---|
300 | </para>
|
---|
301 |
|
---|
302 | <!-- this appears to be rejected in 4.1.0
|
---|
303 | ERROR: unknown option \-\-with-gtkabi=3.0
|
---|
304 | <para>
|
---|
305 | <option>\-\-with-gtkabi=3.0</option>: builds with GTK+-3 if both GTK+-2
|
---|
306 | and GTK+-3 are installed.
|
---|
307 | </para> -->
|
---|
308 |
|
---|
309 | </sect2>
|
---|
310 |
|
---|
311 | <sect2 role="using">
|
---|
312 | <title>Using Qemu</title>
|
---|
313 |
|
---|
314 | <para>
|
---|
315 | Since using qemu means using a virtual computer, the steps to set up
|
---|
316 | the virtual machine are in close analogy with those to set up a real
|
---|
317 | computer. You'll need to decide about CPU, memory, disk, USB devices,
|
---|
318 | network card(s), screen size, etc. Once the <quote>hardware</quote> is
|
---|
319 | decided, you'll have for example to choose how to connect the machine
|
---|
320 | to internet, and/or to install an OS. In the following, we show basic
|
---|
321 | ways of performing those steps. But qemu is much more than this, and it
|
---|
322 | is strongly advised to read the qemu documentation in
|
---|
323 | <filename>/usr/share/doc/qemu-&qemu-version;/qemu-doc.html</filename>.
|
---|
324 | </para>
|
---|
325 |
|
---|
326 | <note>
|
---|
327 | <para>
|
---|
328 | It is standard practice to name the computer running qemu
|
---|
329 | <quote>host</quote> and the emulated machine running under qemu the
|
---|
330 | <quote>guest</quote>. We'll use those notations in the following.
|
---|
331 | </para>
|
---|
332 | </note>
|
---|
333 |
|
---|
334 | <note>
|
---|
335 | <para>
|
---|
336 | The following instructions assume the optional symbolic link,
|
---|
337 | <filename>qemu</filename>, has been created. Additionally,
|
---|
338 | <command>qemu</command> must be run from an X Window System based
|
---|
339 | terminal (either locally or over ssh).
|
---|
340 | </para>
|
---|
341 | </note>
|
---|
342 |
|
---|
343 | <bridgehead renderas="sect3">Disk</bridgehead>
|
---|
344 | <para>
|
---|
345 | A virtual disk may be set up in the following way:
|
---|
346 | </para>
|
---|
347 |
|
---|
348 | <screen><userinput>VDISK_SIZE=<replaceable>50G</replaceable>
|
---|
349 | VDISK_FILENAME=<replaceable>vdisk.img</replaceable>
|
---|
350 | qemu-img create -f qcow2 $VDISK_FILENAME $VDISK_SIZE</userinput></screen>
|
---|
351 |
|
---|
352 | <para>
|
---|
353 | The virtual disk size and filename should be adjusted as desired. The
|
---|
354 | actual size of the file will be less than specified, but will expand as
|
---|
355 | needed, so it is safe to put a high value.
|
---|
356 | </para>
|
---|
357 |
|
---|
358 | <bridgehead renderas="sect3">Operating System</bridgehead>
|
---|
359 | <para>
|
---|
360 | To install an operating system, download an iso image from your preferred
|
---|
361 | Linux distribution. For the purposes of this example, we'll use
|
---|
362 | <filename>Fedora-16-x86_64-Live-LXDE.iso</filename> in the current
|
---|
363 | directory. Run the following:
|
---|
364 | </para>
|
---|
365 |
|
---|
366 | <screen><userinput>qemu -enable-kvm \
|
---|
367 | -drive file=$VDISK_FILENAME \
|
---|
368 | -cdrom Fedora-16-x86_64-Live-LXDE.iso \
|
---|
369 | -boot d \
|
---|
370 | -m <replaceable>1G</replaceable></userinput></screen>
|
---|
371 |
|
---|
372 | <para>
|
---|
373 | Follow the normal installation procedures for the chosen distribution.
|
---|
374 | The <parameter>-boot</parameter> option specifies the boot order of
|
---|
375 | drives as a string of drive letters. Valid drive letters are: a, b
|
---|
376 | (floppy 1 and 2), c (first hard disk), d (first CD-ROM). The
|
---|
377 | <parameter>-m</parameter> option is the amount of memory to use for the
|
---|
378 | virtual machine. The choice depends on the load of the host. Modern
|
---|
379 | distributions should be comfortable with 1GB.
|
---|
380 | The <parameter>-enable-kvm</parameter> option allows hardware
|
---|
381 | acceleration. Without this switch, the emulation is much slower.
|
---|
382 | </para>
|
---|
383 |
|
---|
384 | <bridgehead renderas="sect3">Defining the virtual hardware</bridgehead>
|
---|
385 | <para>
|
---|
386 | The virtual machine hardware is defined by the qemu command line.
|
---|
387 | An example command is given below:
|
---|
388 | </para>
|
---|
389 |
|
---|
390 | <screen><userinput>qemu -enable-kvm \
|
---|
391 | -smp 4 \
|
---|
392 | -cpu host \
|
---|
393 | -m 1G \
|
---|
394 | -drive file=$VDISK_FILENAME \
|
---|
395 | -cdrom grub-img.iso \
|
---|
396 | -boot order=c,once=d,menu=on \
|
---|
397 | -net nic,netdev=net0 \
|
---|
398 | -netdev user,id=net0 \
|
---|
399 | -device ac97 \
|
---|
400 | -vga std \
|
---|
401 | -serial mon:stdio \
|
---|
402 | -name "fedora-16"</userinput></screen>
|
---|
403 |
|
---|
404 | <bridgehead renderas="sect3">Meaning of the command line options</bridgehead>
|
---|
405 | <para>
|
---|
406 | <parameter>-enable-kvm</parameter>: enable full KVM virtualization
|
---|
407 | support. On some hardware, it may be necessary to add the undocumented
|
---|
408 | <option>-machine smm=off</option> option in order to enable KVM.
|
---|
409 | </para>
|
---|
410 |
|
---|
411 | <para>
|
---|
412 | <parameter>-smp <N></parameter>: enable symmetric multiprocessing
|
---|
413 | with <N> CPUs.
|
---|
414 | </para>
|
---|
415 |
|
---|
416 | <para>
|
---|
417 | <parameter>-cpu <model></parameter>: simulate CPU <model>.
|
---|
418 | the list of supported models can be obtained with <option>-cpu
|
---|
419 | help</option>.
|
---|
420 | </para>
|
---|
421 |
|
---|
422 | <para>
|
---|
423 | <parameter>-drive file=<filename></parameter>: defines a virtual
|
---|
424 | disk whose image is stored in <filename><filename></filename>.
|
---|
425 | </para>
|
---|
426 |
|
---|
427 | <para>
|
---|
428 | <parameter>-cdrom grub-img.iso</parameter>: defines an iso formatted file
|
---|
429 | to use as a cdrom. Here we use a grub rescue disk, which may turn handy
|
---|
430 | when something goes wrong at boot time.
|
---|
431 | </para>
|
---|
432 |
|
---|
433 | <para>
|
---|
434 | <parameter>-boot order=c,once=d,menu=on</parameter>: defines the boot
|
---|
435 | order for the virtual BIOS.
|
---|
436 | </para>
|
---|
437 |
|
---|
438 | <para>
|
---|
439 | <parameter>-net nic,netdev=<netid></parameter>: defines a network
|
---|
440 | card connected to the network device with id <netid>.
|
---|
441 | </para>
|
---|
442 |
|
---|
443 | <para>
|
---|
444 | <parameter>-netdev user,id=<netid></parameter>: defines the
|
---|
445 | network <quote>user</quote> device. This is a virtual local network
|
---|
446 | with addresses 10.0.2.0/24, where the host has address 10.0.2.2 and
|
---|
447 | acts as a gateway to internet, and with a name server at address
|
---|
448 | 10.0.2.3, and an smb server at address 10.0.2.4. A builtin DHCP server
|
---|
449 | can allocate addresses between 10.0.2.15 and 10.0.2.31.
|
---|
450 | </para>
|
---|
451 |
|
---|
452 | <para>
|
---|
453 | <parameter>-soundhw <model></parameter>: defines the soundcard
|
---|
454 | model. The list may be obtained with <option>-soundhw help</option>.
|
---|
455 | </para>
|
---|
456 |
|
---|
457 | <para>
|
---|
458 | <parameter>-vga <type></parameter>: defines the type of vga card
|
---|
459 | to emulate.
|
---|
460 | </para>
|
---|
461 |
|
---|
462 | <para>
|
---|
463 | <parameter>-serial mon:stdio</parameter>: sends the serial port of the
|
---|
464 | guest (<filename>/dev/ttyS0</filename> on linux guests), multiplexed with
|
---|
465 | the qemu monitor, to the standard input and output of the qemu
|
---|
466 | process.
|
---|
467 | </para>
|
---|
468 |
|
---|
469 | <para>
|
---|
470 | <parameter>-name <name></parameter>: sets the name of the guest.
|
---|
471 | This name is displayed in the guest window caption. It may be useful
|
---|
472 | if you run several guests at the same time.
|
---|
473 | </para>
|
---|
474 |
|
---|
475 | <bridgehead renderas="sect3">Controlling the Emulated Display</bridgehead>
|
---|
476 | <para>
|
---|
477 | It may happen that the guest window displayed by qemu does not correspond
|
---|
478 | to the full capability of the emulated vga card. For example, the vmware
|
---|
479 | card is 1600x900 capable, but only 1024x768 is displayed by default.
|
---|
480 | A suitable Xorg configuration on the guest allows to use the full size
|
---|
481 | (Note that the Xorg video driver to use is <xref
|
---|
482 | linkend="xorg-vmware-driver"/>):
|
---|
483 | </para>
|
---|
484 |
|
---|
485 | <screen role="root"><userinput>cat > /usr/share/X11/xorg.conf.d/20-vmware.conf << "EOF"
|
---|
486 | <literal>Section "Monitor"
|
---|
487 | Identifier "Monitor0"
|
---|
488 | # cvt 1600 900
|
---|
489 | # 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz
|
---|
490 | Modeline "1600x900" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
|
---|
491 | Option "PreferredMode" "1600x900"
|
---|
492 | HorizSync 1-200
|
---|
493 | VertRefresh 1-200
|
---|
494 | EndSection
|
---|
495 |
|
---|
496 | Section "Device"
|
---|
497 | Identifier "VMware SVGA II Adapter"
|
---|
498 | Option "Monitor" "default"
|
---|
499 | Driver "vmware"
|
---|
500 | EndSection
|
---|
501 |
|
---|
502 | Section "Screen"
|
---|
503 | Identifier "Default Screen"
|
---|
504 | Device "VMware SVGA II Adapter"
|
---|
505 | Monitor "Monitor0"
|
---|
506 |
|
---|
507 | SubSection "Display"
|
---|
508 | Depth 24
|
---|
509 | Modes "1600x900" "1440x900" "1366x768" "1280x720" "800x480"
|
---|
510 | EndSubSection
|
---|
511 |
|
---|
512 | EndSection</literal>
|
---|
513 | EOF</userinput></screen>
|
---|
514 |
|
---|
515 | <para>
|
---|
516 | New sizes will be available besides the native ones. You need to
|
---|
517 | restart X in order to have the new sizes available.
|
---|
518 | </para>
|
---|
519 |
|
---|
520 | <bridgehead renderas="sect3">Networking</bridgehead>
|
---|
521 | <para>
|
---|
522 | The below solution for networking allows the guest to access the local
|
---|
523 | network through the host (and possibly to access internet through the
|
---|
524 | local routers), but the converse is not true. Not even the host can
|
---|
525 | access the guest, unless port forwarding is enabled. And in the case
|
---|
526 | several guests are running, they cannot communicate with each other.
|
---|
527 | Other network devices can be used for this purpose. For example, there
|
---|
528 | is the <quote>socket</quote> device, which allows several guests to
|
---|
529 | share a common virtual network. In the following, we describe in more
|
---|
530 | details how to set up the <quote>bridge</quote> device, which allows
|
---|
531 | the guests to appear as if connected to the local network. All the
|
---|
532 | commands below should be run as the <systemitem
|
---|
533 | class="username">root</systemitem> user.
|
---|
534 | </para>
|
---|
535 |
|
---|
536 | <para revision="sysv">
|
---|
537 | Set up bridging with <xref linkend="bridgeutils"/>. Only the physical
|
---|
538 | interface(s) should be set up at boot. The virtual interface(s) will be
|
---|
539 | added as needed when qemu is started.
|
---|
540 | </para>
|
---|
541 |
|
---|
542 | <para revision="systemd">
|
---|
543 | <!-- On SYS-V, IP_FORWARD is enabled by the bridge script. -->
|
---|
544 | Allow the host to forward IP packets:
|
---|
545 | </para>
|
---|
546 |
|
---|
547 | <screen role="root"
|
---|
548 | revision="systemd"><userinput>sysctl -w net.ipv4.ip_forward=1</userinput></screen>
|
---|
549 |
|
---|
550 | <para revision="systemd">
|
---|
551 | To make this permanent, add the command to
|
---|
552 | <filename>/etc/sysctl.d/60-net-forward.conf:</filename>
|
---|
553 | </para>
|
---|
554 |
|
---|
555 | <screen role="root"
|
---|
556 | revision="systemd"><userinput>cat >> /etc/sysctl.d/60-net-forward.conf << EOF
|
---|
557 | <literal>net.ipv4.ip_forward=1</literal>
|
---|
558 | EOF</userinput></screen>
|
---|
559 |
|
---|
560 | <para>
|
---|
561 | Set up a required configuration file:
|
---|
562 | </para>
|
---|
563 |
|
---|
564 | <!-- /etc/qemu has not been installed by "make install" since version 2.4 -->
|
---|
565 | <screen role="root"><userinput>install -vdm 755 /etc/qemu &&
|
---|
566 | echo allow br0 > /etc/qemu/bridge.conf</userinput></screen>
|
---|
567 |
|
---|
568 | <para>
|
---|
569 | In the command above, replace the switch <parameter>-netdev user,...
|
---|
570 | </parameter> with <parameter>-netdev bridge,id=net0</parameter>.
|
---|
571 | </para>
|
---|
572 |
|
---|
573 | </sect2>
|
---|
574 |
|
---|
575 | <sect2 role="content">
|
---|
576 | <title>Contents</title>
|
---|
577 |
|
---|
578 | <segmentedlist>
|
---|
579 | <segtitle>Installed Programs</segtitle>
|
---|
580 | <segtitle>Installed Library</segtitle>
|
---|
581 | <segtitle>Installed Directories</segtitle>
|
---|
582 |
|
---|
583 | <seglistitem>
|
---|
584 | <seg>
|
---|
585 | elf2dmp,
|
---|
586 | qemu (symlink),
|
---|
587 | qemu-edid,
|
---|
588 | qemu-ga,
|
---|
589 | qemu-img,
|
---|
590 | qemu-io,
|
---|
591 | qemu-keymap,
|
---|
592 | qemu-nbd,
|
---|
593 | qemu-pr-helper,
|
---|
594 | qemu-storage-daemon, and
|
---|
595 | qemu-system-<arch>
|
---|
596 | </seg>
|
---|
597 | <seg>None</seg>
|
---|
598 | <seg>
|
---|
599 | /usr/share/qemu and
|
---|
600 | /usr/share/doc/qemu-&qemu-version; (optional)
|
---|
601 | </seg>
|
---|
602 | </seglistitem>
|
---|
603 | </segmentedlist>
|
---|
604 |
|
---|
605 | <variablelist>
|
---|
606 | <bridgehead renderas="sect3">Short Description</bridgehead>
|
---|
607 | <?dbfo list-presentation="list"?>
|
---|
608 | <?dbhtml list-presentation="table"?>
|
---|
609 |
|
---|
610 | <varlistentry id="elf2dmp">
|
---|
611 | <term><command>elf2dmp</command></term>
|
---|
612 | <listitem>
|
---|
613 | <para>
|
---|
614 | Converts files from elf to dmp format
|
---|
615 | </para>
|
---|
616 | <indexterm zone="qemu elf2dmp">
|
---|
617 | <primary sortas="b-elf2dmp">elf2dmp</primary>
|
---|
618 | </indexterm>
|
---|
619 | </listitem>
|
---|
620 | </varlistentry>
|
---|
621 | <!--
|
---|
622 | <varlistentry id="ivshmem-client">
|
---|
623 | <term><command>ivshmem-client</command></term>
|
---|
624 | <listitem>
|
---|
625 | <para>
|
---|
626 | is a standalone client for using the ivshmem device
|
---|
627 | </para>
|
---|
628 | <indexterm zone="qemu ivshmem-client">
|
---|
629 | <primary sortas="b-ivshmem-client">ivshmem-client</primary>
|
---|
630 | </indexterm>
|
---|
631 | </listitem>
|
---|
632 | </varlistentry>
|
---|
633 |
|
---|
634 | <varlistentry id="ivshmem-server">
|
---|
635 | <term><command>ivshmem-server</command></term>
|
---|
636 | <listitem>
|
---|
637 | <para>
|
---|
638 | is an example server for the ivshmem device
|
---|
639 | </para>
|
---|
640 | <indexterm zone="qemu ivshmem-server">
|
---|
641 | <primary sortas="b-ivshmem-server">ivshmem-server</primary>
|
---|
642 | </indexterm>
|
---|
643 | </listitem>
|
---|
644 | </varlistentry>
|
---|
645 | -->
|
---|
646 | <varlistentry id="qemu-edid">
|
---|
647 | <term><command>qemu-edid</command></term>
|
---|
648 | <listitem>
|
---|
649 | <para>
|
---|
650 | is a test tool for the qemu EDID generator
|
---|
651 | </para>
|
---|
652 | <indexterm zone="qemu qemu-edid">
|
---|
653 | <primary sortas="b-qemu-edid">qemu-edid</primary>
|
---|
654 | </indexterm>
|
---|
655 | </listitem>
|
---|
656 | </varlistentry>
|
---|
657 |
|
---|
658 | <varlistentry id="qemu-ga">
|
---|
659 | <term><command>qemu-ga</command></term>
|
---|
660 | <listitem>
|
---|
661 | <para>
|
---|
662 | implements support for QMP (QEMU Monitor Protocol) commands and
|
---|
663 | events that terminate and originate respectively within the guest
|
---|
664 | using an agent built as part of QEMU
|
---|
665 | </para>
|
---|
666 | <indexterm zone="qemu qemu-ga">
|
---|
667 | <primary sortas="b-qemu-ga">qemu-ga</primary>
|
---|
668 | </indexterm>
|
---|
669 | </listitem>
|
---|
670 | </varlistentry>
|
---|
671 |
|
---|
672 | <varlistentry id="qemu-img">
|
---|
673 | <term><command>qemu-img</command></term>
|
---|
674 | <listitem>
|
---|
675 | <para>
|
---|
676 | provides commands to manage QEMU disk images
|
---|
677 | </para>
|
---|
678 | <indexterm zone="qemu qemu-img">
|
---|
679 | <primary sortas="b-qemu-img">qemu-img</primary>
|
---|
680 | </indexterm>
|
---|
681 | </listitem>
|
---|
682 | </varlistentry>
|
---|
683 |
|
---|
684 | <varlistentry id="qemu-io">
|
---|
685 | <term><command>qemu-io</command></term>
|
---|
686 | <listitem>
|
---|
687 | <para>
|
---|
688 | is a diagnostic and manipulation program for (virtual) memory
|
---|
689 | media. It is still at an early stage of development
|
---|
690 | </para>
|
---|
691 | <indexterm zone="qemu qemu-io">
|
---|
692 | <primary sortas="b-qemu-io">qemu-io</primary>
|
---|
693 | </indexterm>
|
---|
694 | </listitem>
|
---|
695 | </varlistentry>
|
---|
696 |
|
---|
697 | <varlistentry id="qemu-keymap">
|
---|
698 | <term><command>qemu-keymap</command></term>
|
---|
699 | <listitem>
|
---|
700 | <para>
|
---|
701 | generates qemu reverse keymaps from xkb keymaps,
|
---|
702 | which can be used with the qemu "-k" command line switch
|
---|
703 | </para>
|
---|
704 | <indexterm zone="qemu qemu-keymap">
|
---|
705 | <primary sortas="b-qemu-keymap">qemu-keymap</primary>
|
---|
706 | </indexterm>
|
---|
707 | </listitem>
|
---|
708 | </varlistentry>
|
---|
709 |
|
---|
710 |
|
---|
711 | <varlistentry id="qemu-nbd">
|
---|
712 | <term><command>qemu-nbd</command></term>
|
---|
713 | <listitem>
|
---|
714 | <para>
|
---|
715 | exports Qemu disk images using the QEMU Disk Network Block
|
---|
716 | Device (NBD) protocol
|
---|
717 | </para>
|
---|
718 | <indexterm zone="qemu qemu-nbd">
|
---|
719 | <primary sortas="b-qemu-nbd">qemu-nbd</primary>
|
---|
720 | </indexterm>
|
---|
721 | </listitem>
|
---|
722 | </varlistentry>
|
---|
723 |
|
---|
724 | <varlistentry id="qemu-pr-helper">
|
---|
725 | <term><command>qemu-pr-helper</command></term>
|
---|
726 | <listitem>
|
---|
727 | <para>
|
---|
728 | Implements the persistent reservation helper for QEMU
|
---|
729 | </para>
|
---|
730 | <indexterm zone="qemu qemu-pr-helper">
|
---|
731 | <primary sortas="b-qemu-pr-helper">qemu-pr-helper</primary>
|
---|
732 | </indexterm>
|
---|
733 | </listitem>
|
---|
734 | </varlistentry>
|
---|
735 |
|
---|
736 | <varlistentry id="qemu-storage-daemon">
|
---|
737 | <term><command>qemu-storage-daemon</command></term>
|
---|
738 | <listitem>
|
---|
739 | <para>
|
---|
740 | allows to modify disk images using the QEMU Monitor Protocol (QMP)
|
---|
741 | without running a VM
|
---|
742 | </para>
|
---|
743 | <indexterm zone="qemu qemu-storage-daemon">
|
---|
744 | <primary sortas="b-qemu-storage-daemon">qemu-storage-daemon</primary>
|
---|
745 | </indexterm>
|
---|
746 | </listitem>
|
---|
747 | </varlistentry>
|
---|
748 |
|
---|
749 | <varlistentry id="qemu-system">
|
---|
750 | <term><command>qemu-system-x86_64</command></term>
|
---|
751 | <listitem>
|
---|
752 | <para>
|
---|
753 | is the QEMU PC System emulator
|
---|
754 | </para>
|
---|
755 | <indexterm zone="qemu qemu-system">
|
---|
756 | <primary sortas="b-qemu-system">qemu-system-x86_64</primary>
|
---|
757 | </indexterm>
|
---|
758 | </listitem>
|
---|
759 | </varlistentry>
|
---|
760 | <!--
|
---|
761 | <varlistentry id="virtfs-proxy-helper">
|
---|
762 | <term><command>virtfs-proxy-helper</command></term>
|
---|
763 | <listitem>
|
---|
764 | <para>
|
---|
765 | creates a socket pair or a named socket. QEMU and the proxy helper
|
---|
766 | communicate using this socket. The QEMU proxy fs driver sends
|
---|
767 | filesystem requests to the proxy helper and receives the response
|
---|
768 | from it
|
---|
769 | </para>
|
---|
770 | <indexterm zone="qemu virtfs-proxy-helper">
|
---|
771 | <primary sortas="b-virtfs-proxy-helper">virtfs-proxy-helper</primary>
|
---|
772 | </indexterm>
|
---|
773 | </listitem>
|
---|
774 | </varlistentry>
|
---|
775 | -->
|
---|
776 | </variablelist>
|
---|
777 |
|
---|
778 | </sect2>
|
---|
779 |
|
---|
780 | </sect1>
|
---|