[d28198d3] | 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 |
|
---|
[2f6053d] | 7 | <!ENTITY qemu-download-http "http://wiki.qemu.org/download/qemu-&qemu-version;.tar.bz2">
|
---|
| 8 | <!ENTITY qemu-download-ftp " ">
|
---|
[10f9bb45] | 9 | <!ENTITY qemu-md5sum "f469f2330bbe76e3e39db10e9ac4f8db">
|
---|
| 10 | <!ENTITY qemu-size "25 MB">
|
---|
| 11 | <!ENTITY qemu-buildsize "419 MB (with tests)">
|
---|
| 12 | <!ENTITY qemu-time "2.4 SBU (with tests)">
|
---|
[d28198d3] | 13 | ]>
|
---|
| 14 |
|
---|
[2f6053d] | 15 | <sect1 id="qemu" xreflabel="qemu-&qemu-version;">
|
---|
| 16 | <?dbhtml filename="qemu.html"?>
|
---|
[d28198d3] | 17 |
|
---|
| 18 | <sect1info>
|
---|
[c4a1934a] | 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
[d28198d3] | 21 | </sect1info>
|
---|
| 22 |
|
---|
[2f6053d] | 23 | <title>qemu-&qemu-version;</title>
|
---|
[d28198d3] | 24 |
|
---|
[2f6053d] | 25 | <indexterm zone="qemu">
|
---|
| 26 | <primary sortas="a-qemu">qemu</primary>
|
---|
[d28198d3] | 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[2f6053d] | 30 | <title>Introduction to qemu</title>
|
---|
[d28198d3] | 31 |
|
---|
[2f6053d] | 32 | <para><application>qemu</application> is a full virtualization solution
|
---|
[d28198d3] | 33 | for Linux on x86 hardware containing virtualization extensions (Intel VT or
|
---|
| 34 | AMD-V).</para>
|
---|
| 35 |
|
---|
[90cb5d6] | 36 | &lfs78_checked;
|
---|
[27643d0f] | 37 |
|
---|
[d28198d3] | 38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 39 | <itemizedlist spacing="compact">
|
---|
| 40 | <listitem>
|
---|
[2f6053d] | 41 | <para>Download (HTTP): <ulink url="&qemu-download-http;"/></para>
|
---|
[d28198d3] | 42 | </listitem>
|
---|
| 43 | <listitem>
|
---|
[2f6053d] | 44 | <para>Download (FTP): <ulink url="&qemu-download-ftp;"/></para>
|
---|
[d28198d3] | 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
[2f6053d] | 47 | <para>Download MD5 sum: &qemu-md5sum;</para>
|
---|
[d28198d3] | 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
[2f6053d] | 50 | <para>Download size: &qemu-size;</para>
|
---|
[d28198d3] | 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
[2f6053d] | 53 | <para>Estimated disk space required: &qemu-buildsize;</para>
|
---|
[d28198d3] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[2f6053d] | 56 | <para>Estimated build time: &qemu-time;</para>
|
---|
[d28198d3] | 57 | </listitem>
|
---|
| 58 | </itemizedlist>
|
---|
[54f740f] | 59 |
|
---|
[2f6053d] | 60 | <bridgehead renderas="sect3">Qemu Dependencies</bridgehead>
|
---|
[d28198d3] | 61 |
|
---|
| 62 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 63 | <para role="required">
|
---|
[aa4778c4] | 64 | <xref linkend="glib2"/>,
|
---|
[c41b38f] | 65 | <xref linkend="python2"/>, and
|
---|
[d28198d3] | 66 | <xref linkend="x-window-system"/>
|
---|
| 67 | </para>
|
---|
| 68 |
|
---|
[c41b38f] | 69 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 70 | <para role="recommended">
|
---|
| 71 | <xref linkend="sdl"/>
|
---|
| 72 | </para>
|
---|
| 73 |
|
---|
[d28198d3] | 74 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 75 | <para role="optional">
|
---|
| 76 | <xref linkend="alsa"/>,
|
---|
[8ade43b] | 77 | <xref linkend="bluez"/>,
|
---|
[d28198d3] | 78 | <xref linkend="check"/>,
|
---|
| 79 | <xref linkend="curl"/>,
|
---|
[8ade43b] | 80 | <xref linkend="cyrus-sasl"/>,
|
---|
[10f9bb45] | 81 | <xref linkend="gnutls"/>,
|
---|
[8ade43b] | 82 | <xref linkend="gtk2"/>,
|
---|
| 83 | <xref linkend="gtk3"/>,
|
---|
| 84 | <xref linkend="libusb"/>,
|
---|
[10f9bb45] | 85 | <xref linkend="libgcrypt"/>,
|
---|
[8ade43b] | 86 | <xref linkend="lzo"/>,
|
---|
[10f9bb45] | 87 | <xref linkend="nettle"/>,
|
---|
[8ade43b] | 88 | <xref linkend="nss"/> (for libcacard.so),
|
---|
[10f9bb45] | 89 | <xref linkend="mesa"/>,
|
---|
| 90 | <xref linkend="sdl"/>,
|
---|
| 91 | <xref linkend="vte"/>,
|
---|
| 92 | <ulink url="http://www.libssh2.org">libssh2</ulink>
|
---|
[d28198d3] | 93 | </para>
|
---|
| 94 |
|
---|
[9b13441] | 95 | <note>
|
---|
| 96 | <para>
|
---|
| 97 | This optional dependencies list is not comprehensive. See the output of
|
---|
| 98 | <command>./configure --help</command> for a more complete list.
|
---|
| 99 | </para>
|
---|
| 100 | </note>
|
---|
| 101 |
|
---|
[d28198d3] | 102 | <para condition="html" role="usernotes">User Notes:
|
---|
[2f6053d] | 103 | <ulink url="&blfs-wiki;/qemu"/></para>
|
---|
[d28198d3] | 104 |
|
---|
| 105 | </sect2>
|
---|
| 106 |
|
---|
[2f6053d] | 107 | <sect2 id='qemu-prereq'>
|
---|
[1eb4fcf] | 108 | <title>KVM Prerequisites</title>
|
---|
[d28198d3] | 109 |
|
---|
[2f6053d] | 110 | <para>Before building <application>qemu</application>, check to see if
|
---|
[d28198d3] | 111 | your processor supports Virtualization Technology (VT):</para>
|
---|
| 112 |
|
---|
| 113 | <screen><userinput>egrep '^flags.*(vmx|svm)' /proc/cpuinfo</userinput></screen>
|
---|
| 114 |
|
---|
| 115 | <para>If you get any output, you have VT technology (vmx for Intel
|
---|
| 116 | processors and svm for AMD processors). You then need to go into your
|
---|
| 117 | system BIOS and ensure it is enabled. After enabing, reboot back to your
|
---|
| 118 | LFS instance.</para>
|
---|
| 119 |
|
---|
| 120 | </sect2>
|
---|
| 121 |
|
---|
[2f6053d] | 122 | <sect2 role="kernel" id='qemu-kernel'>
|
---|
[d28198d3] | 123 | <title>Kernel Configuration</title>
|
---|
| 124 |
|
---|
[421128a1] | 125 | <para>Enable the following options in the kernel configuration and
|
---|
| 126 | recompile the kernel if necessary:</para>
|
---|
[d28198d3] | 127 |
|
---|
[421128a1] | 128 | <screen><literal>[*] Virtualization: ---> [CONFIG_VIRTUALIZATION]
|
---|
| 129 | <*/M> Kernel-based Virtual Machine (KVM) support [CONFIG_KVM]
|
---|
| 130 | <*/M> KVM for Intel processors support [CONFIG_KVM_INTEL]
|
---|
| 131 | <*/M> KVM for AMD processors support [CONFIG_KVM_AMD]</literal></screen>
|
---|
[d28198d3] | 132 |
|
---|
[2f6053d] | 133 | <indexterm zone="qemu qemu-kernel">
|
---|
| 134 | <primary sortas="d-qemu">qemu</primary>
|
---|
[d28198d3] | 135 | </indexterm>
|
---|
| 136 |
|
---|
| 137 | <para>The Intel or AMD settings are not both required, but the one matching
|
---|
| 138 | your system processor is required.</para>
|
---|
| 139 |
|
---|
[9b13441] | 140 | <para>For networking, check that <xref linkend='bridgeutils'/> is installed
|
---|
| 141 | and the following options in the kernel configuration are enabled:</para>
|
---|
| 142 |
|
---|
[421128a1] | 143 | <screen><literal>[*] Networking support ---> [CONFIG_NET]
|
---|
[9b13441] | 144 | Networking options --->
|
---|
[421128a1] | 145 | <*/M> 802.1d Ethernet Bridging [CONFIG_BRIDGE]
|
---|
[9b13441] | 146 | Device Drivers --->
|
---|
[421128a1] | 147 | [*] Network device support ---> [CONFIG_NETDEVICES]
|
---|
| 148 | <*/M> Universal TUN/TAP device driver support [CONFIG_TUN]</literal></screen>
|
---|
[d28198d3] | 149 |
|
---|
| 150 | </sect2>
|
---|
| 151 |
|
---|
| 152 | <sect2 role="installation">
|
---|
[2f6053d] | 153 | <title>Installation of qemu</title>
|
---|
[0d7900a] | 154 |
|
---|
[2f6053d] | 155 | <para>Install <application>qemu</application> by running the following
|
---|
[d28198d3] | 156 | commands:</para>
|
---|
| 157 |
|
---|
[aa9028e] | 158 | <note><para>Qemu is capable of running many targets. The build process
|
---|
[10f9bb45] | 159 | is also capable of building multiple targets at one time in a
|
---|
[aa9028e] | 160 | comma delimited list assigned to <option>--target-list</option>. Run
|
---|
| 161 | <command>./configure --help</command> to get a complete list of
|
---|
| 162 | available targets.</para></note>
|
---|
| 163 |
|
---|
| 164 |
|
---|
| 165 | <screen><userinput>if [ $(uname -m) = i686 ]; then
|
---|
| 166 | QEMU_ARCH=i386-softmmu
|
---|
| 167 | else
|
---|
| 168 | QEMU_ARCH=x86_64-softmmu
|
---|
| 169 | fi
|
---|
| 170 |
|
---|
[10f9bb45] | 171 | mkdir -vp build &&
|
---|
| 172 | cd build &&
|
---|
| 173 |
|
---|
[252e5bf] | 174 | ../configure --prefix=/usr \
|
---|
| 175 | --sysconfdir=/etc \
|
---|
| 176 | --target-list=$QEMU_ARCH \
|
---|
| 177 | --audio-drv-list=alsa \
|
---|
| 178 | --docdir=/usr/share/doc/qemu-&qemu-version; &&
|
---|
| 179 |
|
---|
[aa9028e] | 180 | unset QEMU_ARCH &&
|
---|
| 181 |
|
---|
[9b13441] | 182 | make</userinput></screen>
|
---|
[d28198d3] | 183 |
|
---|
[bfdd32ae] | 184 | <para>To run the built in tests, run <command>make V=1 -k check</command>.
|
---|
| 185 | One test is known to fail.</para>
|
---|
[d28198d3] | 186 |
|
---|
| 187 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 188 |
|
---|
[9b13441] | 189 | <screen role="root"><userinput>make install &&
|
---|
[5ee1266] | 190 | [ -e /usr/lib/libcacard.so ] &&
|
---|
| 191 | chmod -v 755 /usr/lib/libcacard.so</userinput></screen>
|
---|
[9a04a8e9] | 192 |
|
---|
| 193 | <para>
|
---|
| 194 | You will need a dedicated group that will contain users (other than root)
|
---|
[5ee1266] | 195 | allowed to access the KVM device. Create this group by running the
|
---|
| 196 | following command as the
|
---|
| 197 | <systemitem class="username">root</systemitem> user:
|
---|
[9a04a8e9] | 198 | </para>
|
---|
| 199 |
|
---|
[92cd4cad] | 200 | <screen role="root"><userinput>groupadd -g 61 kvm</userinput></screen>
|
---|
[9a04a8e9] | 201 |
|
---|
| 202 | <para>
|
---|
| 203 | Add any users that might use the KVM device to that group:
|
---|
| 204 | </para>
|
---|
| 205 |
|
---|
| 206 | <screen role="root"><userinput>usermod -a -G kvm <replaceable><username></replaceable></userinput></screen>
|
---|
| 207 |
|
---|
| 208 | <para>
|
---|
[6463c3c] | 209 | You will also need to add a Udev rule so that the KVM device gets correct
|
---|
[9a04a8e9] | 210 | permissions:
|
---|
| 211 | </para>
|
---|
| 212 |
|
---|
| 213 | <screen role="root"><userinput>cat > /lib/udev/rules.d/65-kvm.rules << "EOF"
|
---|
[009eb04] | 214 | <literal>KERNEL=="kvm", GROUP="kvm", MODE="0660"</literal>
|
---|
[9a04a8e9] | 215 | EOF</userinput></screen>
|
---|
| 216 |
|
---|
[2f6053d] | 217 | <note><!--<para>The main program <command>qemu-system-x86_64</command> doesn't
|
---|
[d28198d3] | 218 | make a distinction between i386 and x86_64 so even on an i386 system you
|
---|
| 219 | should use <emphasis>qemu-system-x86_64</emphasis></para>
|
---|
[2f6053d] | 220 | -->
|
---|
[0d7900a] | 221 |
|
---|
[d28198d3] | 222 | <para>For convenience you may want to create a symbolic link to run
|
---|
[aa9028e] | 223 | the installed program. For instance:</para>
|
---|
[d28198d3] | 224 |
|
---|
[10f9bb45] | 225 | <screen role="root"><userinput>ln -sv qemu-system-`uname -m` /usr/bin/qemu</userinput></screen>
|
---|
[d28198d3] | 226 | </note>
|
---|
| 227 |
|
---|
| 228 | </sect2>
|
---|
| 229 |
|
---|
[6a54383] | 230 | <sect2 role="commands">
|
---|
| 231 | <title>Command Explanations</title>
|
---|
| 232 |
|
---|
[9b13441] | 233 | <para>
|
---|
[10f9bb45] | 234 | <parameter>--audio-drv-list=alsa</parameter>: This switch sets the audio
|
---|
| 235 | driver to ALSA. For other drivers see the --audio-drv-list list in
|
---|
[9b13441] | 236 | <command>configure</command>'s help output. The default audio driver is
|
---|
| 237 | OSS.
|
---|
| 238 | </para>
|
---|
[6a54383] | 239 |
|
---|
[9b13441] | 240 | </sect2>
|
---|
[6a54383] | 241 |
|
---|
[d28198d3] | 242 | <sect2 role="configuration">
|
---|
[2f6053d] | 243 | <title>Configuring qemu</title>
|
---|
[d28198d3] | 244 |
|
---|
| 245 | <para>To generate an image, run:</para>
|
---|
| 246 |
|
---|
| 247 | <screen><userinput>qemu-img create -f qcow2 vdisk.img 10G</userinput></screen>
|
---|
| 248 |
|
---|
| 249 | <para>Adjust the virtual disk size and image filename as desired. The
|
---|
| 250 | actual size of the file will be less than specified, but will expand as it
|
---|
| 251 | is used.</para>
|
---|
| 252 |
|
---|
| 253 | <note><para>The following instructions assume you have created the optional
|
---|
| 254 | symbolic link, <userinput>qemu</userinput>. Additionally, you must run
|
---|
[10f9bb45] | 255 | <userinput>qemu</userinput> from an X Window System based terminal
|
---|
[aa9028e] | 256 | (either locally or over ssh).</para></note>
|
---|
[d28198d3] | 257 |
|
---|
| 258 | <para>To install an operating system, download an iso of your choice or use
|
---|
[1659792] | 259 | a pre-installed cdrom device. For the purposes of this example, use
|
---|
[d28198d3] | 260 | Fedora 16 that is downloaded as
|
---|
| 261 | <filename>Fedora-16-x86_64-Live-LXDE.iso</filename> in the current
|
---|
| 262 | directory. Run the following:</para>
|
---|
| 263 |
|
---|
[2f6053d] | 264 | <screen><userinput>qemu -enable-kvm -hda vdisk.img \
|
---|
[0d7900a] | 265 | -cdrom Fedora-16-x86_64-Live-LXDE.iso \
|
---|
[d28198d3] | 266 | -boot d \
|
---|
| 267 | -m 384</userinput></screen>
|
---|
| 268 |
|
---|
| 269 | <para>Follow the normal installation procedures for the chosen
|
---|
[2f6053d] | 270 | distribution. The -boot option specifies the boot order of drives as a
|
---|
| 271 | string of drive letters. Valid drive letters are: a, b (floppy 1 and 2), c
|
---|
| 272 | (first hard disk), d (first CD-ROM). The -m option is the amount of memory
|
---|
| 273 | to use for the virtual machine. If you have sufficient memory (2G or
|
---|
| 274 | more), 1G is a reasonable value. For computers with 512MB of RAM it's safe
|
---|
| 275 | to use -m 192, or even -m 128 (the default). The -enable-kvm option allows
|
---|
[f584e7c] | 276 | for hardware acceleration. Without this switch, the emulation is
|
---|
[2f6053d] | 277 | relatively slow.</para>
|
---|
[d28198d3] | 278 |
|
---|
| 279 | <para>To run the newly installed operating system, run:</para>
|
---|
| 280 |
|
---|
[2f6053d] | 281 | <screen><userinput>qemu -enable-kvm vdisk.img -m 384</userinput></screen>
|
---|
[d28198d3] | 282 |
|
---|
[855c1f7] | 283 | <para>You may have problem with <parameter>-enable-kvm</parameter>. Also,
|
---|
| 284 | you may want to define audio and video drivers, number of cpu cores and
|
---|
| 285 | threads. An alternative command to install the operating system is (see qemu
|
---|
| 286 | man page for the parameters definitions):</para>
|
---|
| 287 |
|
---|
| 288 | <screen><userinput>qemu -enable-kvm \
|
---|
| 289 | -cdrom /home/fernando/ISO/linuxmint-17.1-mate-32bit.iso \
|
---|
| 290 | -boot order=d \
|
---|
| 291 | -m 1G,slots=3,maxmem=4G \
|
---|
| 292 | -machine smm=off \
|
---|
| 293 | -soundhw es1370 \
|
---|
| 294 | -cpu host \
|
---|
| 295 | -smp cores=4,threads=2 \
|
---|
| 296 | -vga std \
|
---|
| 297 | vdisk.img</userinput></screen>
|
---|
| 298 |
|
---|
| 299 | <para>One parameter not appearing in the qemu man page is
|
---|
| 300 | <parameter>-machine smm=off</parameter>, and is used to allow
|
---|
| 301 | <parameter>-enable-kvm</parameter> in some systems. In order to run the
|
---|
[577d43d] | 302 | machine, you can alternatively issue:</para>
|
---|
[855c1f7] | 303 |
|
---|
| 304 | <screen><userinput>qemu -enable-kvm \
|
---|
| 305 | -machine smm=off \
|
---|
| 306 | -boot order=d \
|
---|
| 307 | -m 1G,slots=3,maxmem=4G \
|
---|
| 308 | -soundhw es1370 \
|
---|
| 309 | -cpu host \
|
---|
| 310 | -smp cores=4,threads=2 \
|
---|
| 311 | -vga vmware \
|
---|
| 312 | -hda vdisk.img</userinput></screen>
|
---|
| 313 |
|
---|
| 314 | <para>Sometimes, you want the machine to have different screen sizes than
|
---|
| 315 | the ones natively offered by the virtual grahics card. The example below is
|
---|
| 316 | for qemu vmware graphics card, which uses <xref
|
---|
| 317 | linkend="xorg-vmmouse-driver"/> and is set to give maximum screen size of
|
---|
| 318 | 1600x900. As the <systemitem class="username">root</systemitem> user,
|
---|
| 319 | issue:</para>
|
---|
| 320 |
|
---|
| 321 | <screen role="root"><userinput>cat > /usr/share/X11/xorg.conf.d/20-vmware.conf << "EOF"
|
---|
[577d43d] | 322 | <literal>Section "Monitor"
|
---|
| 323 | Identifier "Monitor0"
|
---|
| 324 | # cvt 1600 900
|
---|
| 325 | # 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz
|
---|
| 326 | Modeline "1600x900" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
|
---|
| 327 | Option "PreferredMode" "1600x900"
|
---|
| 328 | HorizSync 1-200
|
---|
| 329 | VertRefresh 1-200
|
---|
[855c1f7] | 330 | EndSection
|
---|
| 331 |
|
---|
[577d43d] | 332 | Section "Device"
|
---|
[855c1f7] | 333 | Identifier "VMware SVGA II Adapter"
|
---|
| 334 | Option "Monitor" "default"
|
---|
| 335 | Driver "vmware"
|
---|
| 336 | EndSection
|
---|
| 337 |
|
---|
[577d43d] | 338 | Section "Screen"
|
---|
[855c1f7] | 339 | Identifier "Default Screen"
|
---|
| 340 | Device "VMware SVGA II Adapter"
|
---|
| 341 | Monitor "Monitor0"
|
---|
| 342 |
|
---|
| 343 | SubSection "Display"
|
---|
| 344 | Depth 24
|
---|
| 345 | Modes "1600x900" "1440x900" "1366x768" "1280x720" "800x480"
|
---|
| 346 | EndSubSection
|
---|
| 347 |
|
---|
| 348 | EndSection</literal>
|
---|
| 349 | EOF</userinput></screen>
|
---|
| 350 |
|
---|
| 351 | <para>New sizes will be available besides the native ones. You need to
|
---|
| 352 | restart X in order to have the new sizes available.</para>
|
---|
| 353 |
|
---|
| 354 | <para><!--To add networking to the instance add "-net nic -net user" to the
|
---|
| 355 | command above. -->qemu provides a DHCP server for the VM and, depending on
|
---|
[d28198d3] | 356 | the client system, sets up networking though the host.</para>
|
---|
| 357 |
|
---|
| 358 | <para>One problem with the above networking solution is that it does not
|
---|
[0d7900a] | 359 | provide the ability to connect with the local network. To do that, there are
|
---|
[d28198d3] | 360 | several additional steps that need to be done, all as the <systemitem
|
---|
| 361 | class="username">root</systemitem> user:</para>
|
---|
| 362 |
|
---|
| 363 | <itemizedlist spacing="compact">
|
---|
| 364 | <listitem>
|
---|
| 365 | <para>Set up bridging with <xref linkend='bridgeutils'/>.</para>
|
---|
| 366 | </listitem>
|
---|
| 367 |
|
---|
| 368 | <listitem>
|
---|
| 369 | <para>Allow the host system to forward IP packets.</para>
|
---|
| 370 |
|
---|
[58196bbf] | 371 | <screen role="root"><userinput>sysctl -w net.ipv4.ip_forward=1</userinput></screen>
|
---|
[0d7900a] | 372 |
|
---|
| 373 | <para>To make this permanent, add the command to
|
---|
[f584e7c] | 374 | <filename>/etc/sysctl.conf:</filename></para>
|
---|
[d28198d3] | 375 |
|
---|
[58196bbf] | 376 | <screen role="root"><userinput>cat >> /etc/sysctl.conf << EOF
|
---|
[0d7900a] | 377 | net.ipv4.ip_forward=1
|
---|
[d28198d3] | 378 | EOF</userinput></screen>
|
---|
| 379 |
|
---|
| 380 | </listitem>
|
---|
| 381 |
|
---|
[670f775] | 382 | <listitem>
|
---|
[5ee1266] | 383 | <para>Allow the network connection when running as a part of the
|
---|
[670f775] | 384 | kvm group:</para>
|
---|
| 385 |
|
---|
| 386 | <screen role="root"><userinput>chgrp kvm /usr/libexec/qemu-bridge-helper &&
|
---|
| 387 | chmod 4750 /usr/libexec/qemu-bridge-helper</userinput></screen>
|
---|
| 388 |
|
---|
| 389 | </listitem>
|
---|
| 390 |
|
---|
| 391 | <listitem>
|
---|
| 392 | <para>Set up a required configuration file:</para>
|
---|
| 393 |
|
---|
| 394 | <screen role="root"><userinput>echo 'allow br0' > /etc/qemu/bridge.conf</userinput></screen>
|
---|
| 395 |
|
---|
| 396 | </listitem>
|
---|
| 397 |
|
---|
| 398 | <!--
|
---|
[d28198d3] | 399 | <listitem>
|
---|
[0d7900a] | 400 | <para>Create scripts for qemu to attach the client network
|
---|
[d28198d3] | 401 | device, usually visible as tap0, to the host bridge.</para>
|
---|
| 402 |
|
---|
[58196bbf] | 403 | <screen role="root"><userinput>cat > /etc/qemu-ifup << EOF
|
---|
[d28198d3] | 404 | #!/bin/bash
|
---|
| 405 |
|
---|
| 406 | switch=br0
|
---|
| 407 |
|
---|
[71e6ae5] | 408 | if [ -n "\$1" ]; then
|
---|
[d28198d3] | 409 | # Add new tap0 interface to bridge
|
---|
[71e6ae5] | 410 | /sbin/ip link set \$1 up
|
---|
[d28198d3] | 411 | sleep 0.5s
|
---|
[71e6ae5] | 412 | /usr/sbin/brctl addif \$switch \$1
|
---|
[d28198d3] | 413 | else
|
---|
| 414 | echo "Error: no interface specified"
|
---|
| 415 | exit 1
|
---|
| 416 | fi
|
---|
| 417 |
|
---|
[0d7900a] | 418 | exit 0
|
---|
[71e6ae5] | 419 | EOF
|
---|
| 420 |
|
---|
| 421 | chmod +x /etc/qemu-ifup</userinput></screen>
|
---|
[d28198d3] | 422 |
|
---|
[58196bbf] | 423 | <screen role="root"><userinput>cat > /etc/qemu-ifdown << EOF
|
---|
[d28198d3] | 424 | #!/bin/bash
|
---|
| 425 |
|
---|
| 426 | switch=br0
|
---|
| 427 |
|
---|
[71e6ae5] | 428 | if [ -n "\$1" ]; then
|
---|
[d28198d3] | 429 | # Remove tap0 interface from bridge
|
---|
[71e6ae5] | 430 | /usr/sbin/brctl delif \$switch \$1
|
---|
[d28198d3] | 431 | else
|
---|
| 432 | echo "Error: no interface specified"
|
---|
| 433 | exit 1
|
---|
| 434 | fi
|
---|
| 435 |
|
---|
[0d7900a] | 436 | exit 0
|
---|
[71e6ae5] | 437 | EOF
|
---|
| 438 |
|
---|
| 439 | chmod +x /etc/qemu-ifdown</userinput></screen>
|
---|
[d28198d3] | 440 |
|
---|
| 441 | </listitem>
|
---|
[71e6ae5] | 442 | </itemizedlist>
|
---|
| 443 |
|
---|
[e88d7000] | 444 | <note><para>The backslashes in the above script are for convenience
|
---|
[71e6ae5] | 445 | for cut/paste operations. The backslashes should <emphasis>not</emphasis>
|
---|
| 446 | appear in the final scripts.</para></note>
|
---|
[d28198d3] | 447 |
|
---|
[670f775] | 448 | <itemizedlist spacing="compact"> -->
|
---|
[d28198d3] | 449 | <listitem>
|
---|
[670f775] | 450 | <!--<para>Start qemu with "-net nic -net tap" options. </para>-->
|
---|
| 451 | <para>Start qemu with "-net nic -net bridge" options. </para>
|
---|
[d28198d3] | 452 | </listitem>
|
---|
| 453 |
|
---|
| 454 | <listitem>
|
---|
[0d7900a] | 455 | <para>If a connection, such as ssh, from the local network to the
|
---|
[670f775] | 456 | client VM is desired, the client should be configured
|
---|
[d28198d3] | 457 | with a static IP address.</para>
|
---|
| 458 | </listitem>
|
---|
| 459 |
|
---|
| 460 | </itemizedlist>
|
---|
| 461 |
|
---|
| 462 | </sect2>
|
---|
| 463 |
|
---|
| 464 | <sect2 role="content">
|
---|
| 465 | <title>Contents</title>
|
---|
| 466 |
|
---|
| 467 | <segmentedlist>
|
---|
[9b13441] | 468 | <segtitle>Installed Programs</segtitle>
|
---|
| 469 | <segtitle>Installed Library</segtitle>
|
---|
[d28198d3] | 470 | <segtitle>Installed Directories</segtitle>
|
---|
| 471 |
|
---|
| 472 | <seglistitem>
|
---|
[9b13441] | 473 | <seg>
|
---|
[10f9bb45] | 474 | ivshmem-client,
|
---|
| 475 | ivshmem-server,
|
---|
| 476 | qemu (symlink),
|
---|
[9b13441] | 477 | qemu-ga,
|
---|
| 478 | qemu-img,
|
---|
| 479 | qemu-io,
|
---|
| 480 | qemu-nbd,
|
---|
[10f9bb45] | 481 | qemu-system-<arch>,
|
---|
[9b13441] | 482 | virtfs-proxy-helper, and
|
---|
| 483 | vscclient
|
---|
| 484 | </seg>
|
---|
[8ade43b] | 485 | <seg>libcacard.so</seg>
|
---|
[9b13441] | 486 | <seg>
|
---|
[10f9bb45] | 487 | /etc/qemu and
|
---|
[9b13441] | 488 | /usr/share/doc/qemu-&qemu-version;
|
---|
| 489 | </seg>
|
---|
[d28198d3] | 490 | </seglistitem>
|
---|
| 491 | </segmentedlist>
|
---|
| 492 |
|
---|
| 493 | <variablelist>
|
---|
| 494 | <bridgehead renderas="sect3">Short Description</bridgehead>
|
---|
| 495 | <?dbfo list-presentation="list"?>
|
---|
| 496 | <?dbhtml list-presentation="table"?>
|
---|
| 497 |
|
---|
| 498 | <varlistentry id="qemu-ga">
|
---|
| 499 | <term><command>qemu-ga</command></term>
|
---|
| 500 | <listitem>
|
---|
| 501 | <para>implements support for QMP (QEMU Monitor Protocol) commands and
|
---|
| 502 | events that terminate and originate respectively within the guest
|
---|
| 503 | using an agent built as part of QEMU.</para>
|
---|
[2f6053d] | 504 | <indexterm zone="qemu qemu-ga">
|
---|
[d28198d3] | 505 | <primary sortas="b-qemu-ga">qemu-ga</primary>
|
---|
| 506 | </indexterm>
|
---|
| 507 | </listitem>
|
---|
| 508 | </varlistentry>
|
---|
| 509 |
|
---|
| 510 | <varlistentry id="qemu-img">
|
---|
| 511 | <term><command>qemu-img</command></term>
|
---|
| 512 | <listitem>
|
---|
| 513 | <para>provides commands to manage QEMU disk images.</para>
|
---|
[2f6053d] | 514 | <indexterm zone="qemu qemu-img">
|
---|
[d28198d3] | 515 | <primary sortas="b-qemu-img">qemu-img</primary>
|
---|
| 516 | </indexterm>
|
---|
| 517 | </listitem>
|
---|
| 518 | </varlistentry>
|
---|
| 519 |
|
---|
| 520 | <varlistentry id="qemu-io">
|
---|
| 521 | <term><command>qemu-io</command></term>
|
---|
| 522 | <listitem>
|
---|
| 523 | <para>is a diagnostic and manipulation program for (virtual) memory
|
---|
| 524 | media. It is still at an early stage of development.</para>
|
---|
[2f6053d] | 525 | <indexterm zone="qemu qemu-io">
|
---|
[d28198d3] | 526 | <primary sortas="b-qemu-io">qemu-io</primary>
|
---|
| 527 | </indexterm>
|
---|
| 528 | </listitem>
|
---|
| 529 | </varlistentry>
|
---|
| 530 |
|
---|
| 531 | <varlistentry id="qemu-nbd">
|
---|
| 532 | <term><command>qemu-nbd</command></term>
|
---|
| 533 | <listitem>
|
---|
| 534 | <para>exports Qemu disk images using the QEMU Disk Network Block
|
---|
| 535 | Device (NBD) protocol.</para>
|
---|
[2f6053d] | 536 | <indexterm zone="qemu qemu-nbd">
|
---|
[d28198d3] | 537 | <primary sortas="b-qemu-nbd">qemu-nbd</primary>
|
---|
| 538 | </indexterm>
|
---|
| 539 | </listitem>
|
---|
| 540 | </varlistentry>
|
---|
| 541 |
|
---|
| 542 | <varlistentry id="qemu-system">
|
---|
| 543 | <term><command>qemu-system-x86_64</command></term>
|
---|
| 544 | <listitem>
|
---|
| 545 | <para>is the QEMU PC System emulator.</para>
|
---|
[2f6053d] | 546 | <indexterm zone="qemu qemu-system">
|
---|
[d28198d3] | 547 | <primary sortas="b-qemu-system">qemu-system-x86_64</primary>
|
---|
| 548 | </indexterm>
|
---|
| 549 | </listitem>
|
---|
| 550 | </varlistentry>
|
---|
[8ade43b] | 551 |
|
---|
[72d90b67] | 552 | <varlistentry id="virtfs-proxy-helper">
|
---|
| 553 | <term><command>virtfs-proxy-helper</command></term>
|
---|
| 554 | <listitem>
|
---|
| 555 | <para>creates a socket pair or a named socket. QEMU and proxy helper
|
---|
| 556 | communicate using this socket. QEMU proxy fs driver sends
|
---|
| 557 | filesystem request to proxy helper and receives the response
|
---|
| 558 | from it.</para>
|
---|
| 559 | <indexterm zone="qemu virtfs-proxy-helper">
|
---|
| 560 | <primary sortas="b-virtfs-proxy-helper">virtfs-proxy-helper</primary>
|
---|
| 561 | </indexterm>
|
---|
| 562 | </listitem>
|
---|
| 563 | </varlistentry>
|
---|
| 564 |
|
---|
| 565 | <varlistentry id="vscclient">
|
---|
| 566 | <term><command>vscclient</command></term>
|
---|
| 567 | <listitem>
|
---|
| 568 | <para>implements a sockets interface to the virtual CCID reader
|
---|
| 569 | on the guest.</para>
|
---|
| 570 | <indexterm zone="qemu vscclient">
|
---|
| 571 | <primary sortas="b-vscclient">vscclient</primary>
|
---|
| 572 | </indexterm>
|
---|
| 573 | </listitem>
|
---|
| 574 | </varlistentry>
|
---|
| 575 |
|
---|
[9b13441] | 576 | <varlistentry id="libcacard">
|
---|
| 577 | <term><filename class="libraryfile">libcacard.so</filename></term>
|
---|
| 578 | <listitem>
|
---|
| 579 | <para>is the Virtual Smart Card Emulator library.</para>
|
---|
| 580 | <indexterm zone="qemu libcacard">
|
---|
| 581 | <primary sortas="c-libcacard">libcacard.so</primary>
|
---|
| 582 | </indexterm>
|
---|
| 583 | </listitem>
|
---|
| 584 | </varlistentry>
|
---|
[8ade43b] | 585 |
|
---|
[d28198d3] | 586 | </variablelist>
|
---|
| 587 |
|
---|
| 588 | </sect2>
|
---|
| 589 |
|
---|
| 590 | </sect1>
|
---|