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