<HTML> <HEAD> <!-- Created by texi2html 1.56k from kqemu-doc.texi on 6 February 2007 --> <TITLE>QEMU Accelerator User Documentation</TITLE> </HEAD> <BODY> <H1>QEMU Accelerator User Documentation</H1> <P> <P><HR><P> <H1>Table of Contents</H1> <UL> <LI><A NAME="TOC1" HREF="kqemu-doc.html#SEC1">1. Introduction</A> <LI><A NAME="TOC2" HREF="kqemu-doc.html#SEC2">2. Installation</A> <UL> <LI><A NAME="TOC3" HREF="kqemu-doc.html#SEC3">2.1 KQEMU Compilation (Linux only)</A> <LI><A NAME="TOC4" HREF="kqemu-doc.html#SEC4">2.2 QEMU Accelerator Installation for Linux</A> <LI><A NAME="TOC5" HREF="kqemu-doc.html#SEC5">2.3 QEMU Accelerator Installation for Windows</A> </UL> <LI><A NAME="TOC6" HREF="kqemu-doc.html#SEC6">3. Usage</A> <LI><A NAME="TOC7" HREF="kqemu-doc.html#SEC7">4. Full virtualization mode</A> <UL> <LI><A NAME="TOC8" HREF="kqemu-doc.html#SEC8">4.1 Introduction</A> <LI><A NAME="TOC9" HREF="kqemu-doc.html#SEC9">4.2 Full virtualization and Linux guests</A> <LI><A NAME="TOC10" HREF="kqemu-doc.html#SEC10">4.3 Full virtualization and Windows guests</A> </UL> </UL> <P><HR><P> <P> QEMU Accelerator User Documentation <H1><A NAME="SEC1" HREF="kqemu-doc.html#TOC1">1. Introduction</A></H1> <P> QEMU Accelerator (KQEMU) is a driver allowing the QEMU PC emulator to run much faster when emulating a PC on an x86 host. <P> KQEMU is supported on x86 or x86_64 Linux 2.4 or 2.6 hosts. Experimental versions are available for FreeBSD and Windows NT/2000/2003/XP. <H1><A NAME="SEC2" HREF="kqemu-doc.html#TOC2">2. Installation</A></H1> <H2><A NAME="SEC3" HREF="kqemu-doc.html#TOC3">2.1 KQEMU Compilation (Linux only)</A></H2> <P> First ensure that you have a recent version of QEMU (>= 0.8.1) with the KQEMU support enabled (this is the default). <P> Then decompress the KQEMU sources: <PRE> cd /tmp tar zxvf kqemu-x.y.z.tar.gz cd kqemu-x.y.z </PRE> <P> Then you configure KQEMU and build it (usually no options are needed): <PRE> ./configure make </PRE> <P> Then type as root user: <PRE> make install </PRE> <P> to install KQEMU in <TT>`/usr/local'</TT>. <H2><A NAME="SEC4" HREF="kqemu-doc.html#TOC4">2.2 QEMU Accelerator Installation for Linux</A></H2> <P> If you use x86 Linux, the compilation of the QEMU Accelerator Kernel Module (KQEMU) is automatically activated provided you have the necessary kernel headers. If nonetheless the compilation fails, you can disable its compilation with the <SAMP>`--disable-kqemu'</SAMP> configure option. <P> Note that KQEMU cannot currently work if the Xen virtualizer is running on your host. <P> If you are using a 2.6 host kernel, then all the necessary kernel headers should be already installed. If you are using a 2.4 kernel, then you should verify that properly configured kernel sources are installed and compiled. On a Redhat 9 distribution for example, the following must be done: <PRE> 1) Install the kernel-source-xxx package 2) cd /usr/src/linux-xxx 3) make distclean 4) Copy /boot/config-vvv in .config (use uname -r to know your configuration name 'vvv') 5) Edit the Makefile to change the EXTRAVERSION line to match your current configuration name: EXTRAVERSION = -custom to EXTRAVERSION = -8 # This is an example, it can be -8smp too 5) make menuconfig # Just save the configuration 6) make dep bzImage </PRE> <P> The installation of KQEMU is not fully automatic because it is highly distribution dependent. When launching <PRE> make install </PRE> <P> KQEMU is installed in /lib/modules/<VAR>kernel_version</VAR>/misc. <P> If you want that KQEMU is installed automatically at boot time, you can add <PRE> # Load the KQEMU kernel module /sbin/modprobe kqemu </PRE> <P> in <TT>`/etc/rc.d/rc.local'</TT>. <P> By default, kqemu assumes that your distribution uses <CODE>udev</CODE> to have the device <TT>`/dev/kqemu'</TT> automatically created. It is usually necessary to change the device access rights set by udev. With the Fedora Core >= 4, you can do: <PRE> echo 'KERNEL=="kqemu", NAME="%k", MODE="0666"' \ > /etc/udev/rules.d/60-kqemu.rules </PRE> <P> If you don't want to use udev, you can specify a specific major number for the <TT>`/dev/kqemu'</TT> device: <PRE> /sbin/modprobe kqemu major=250 </PRE> <P> The device should be created with something like: <PRE> mknod /dev/kqemu c 250 0 chmod 666 /dev/kqemu </PRE> <H2><A NAME="SEC5" HREF="kqemu-doc.html#TOC5">2.3 QEMU Accelerator Installation for Windows</A></H2> <P> Right click on <TT>`kqemu.inf'</TT> in Explorer and choose Install. <P> In order to start kqemu, you must do: <PRE> net start kqemu </PRE> <H1><A NAME="SEC6" HREF="kqemu-doc.html#TOC6">3. Usage</A></H1> <P> When QEMU is compiled with KQEMU support, the following option is added to QEMU: <DL COMPACT> <DT><SAMP>`-no-kqemu'</SAMP> <DD> Disable the usage of the QEMU Accelerator module (KQEMU). QEMU will work as usual but will be slower. This option can be useful to determine if emulation problems are coming from KQEMU. <DT><SAMP>`-kernel-kqemu'</SAMP> <DD> Enable full virtualization mode for best performances. This mode only works with the following guest OSes: Linux 2.4, Linux 2.6, Windows 2000 and Windows XP. WARNING: for Windows 2000/XP, you cannot use it during installation. See the next chapter for more information about full virtualization. </DL> <P> When using KQEMU on a Linux or FreeBSD host, QEMU will create a big hidden file containing the RAM of the virtual machine. For best performance, it is important that this file is kept in RAM and not on the hard disk. QEMU uses the <TT>`/dev/shm'</TT> directory to create this file because <CODE>tmpfs</CODE> is usually mounted on it (check with the shell command <CODE>df</CODE>). Otherwise <TT>`/tmp'</TT> is used as fallback. You can use the <VAR>QEMU_TMPDIR</VAR> shell variable to set a new directory for the QEMU RAM file. <P> KQEMU has only been tested with Linux 2.4, Linux 2.6 and Windows 2000/XP as guest OSes. If your guest OS do not work with KQEMU, you can dynamically disable KQEMU with the <SAMP>`-no-kqemu'</SAMP> option. <P> If you use kqemu on an x86_64 host, you must use <TT>`qemu-system-x86_64'</TT> instead of <TT>`qemu'</TT>. <P> To see if kqemu is enabled and working correctly, use the QEMU monitor command: <PRE> info kqemu </PRE> <H1><A NAME="SEC7" HREF="kqemu-doc.html#TOC7">4. Full virtualization mode</A></H1> <H2><A NAME="SEC8" HREF="kqemu-doc.html#TOC8">4.1 Introduction</A></H2> <P> This mode is activated with the <SAMP>`-kernel-kqemu'</SAMP> QEMU option. It is supported for 32 bit guest OSes. The support for 64 bit guest OSes is experimental (linux 2.6.18 for x86_64 is known to work). When KQEMU runs in full virtualization mode, both guest kernel and user code are executed directly on the host CPU. In normal mode, only the user code is executed directly and the kernel code is still dynamically translated by QEMU. <P> The full virtualization mode cannot work with all OSes because it makes some assumptions about the x86 instructions that the guest OS uses. Note that even if some assumptions are made on the guest OS, the full virtualization mode is secure by design: all the code is executed in user mode on the host processor which means it cannot break the host OS. <P> The requirements for a guest OS to work in full virtualization mode are very simple and most recent OSes (such as Linux or Windows 2000/XP) fulfill them. Interested OS writers can read the KQEMU technical specification to learn more. <H2><A NAME="SEC9" HREF="kqemu-doc.html#TOC9">4.2 Full virtualization and Linux guests</A></H2> <UL> <LI>Best performances are achieved with Linux 2.4 kernels. Linux 2.6 works but the performance gains are small. <LI>64 bit guest Linux kernel is experimental. </UL> <H2><A NAME="SEC10" HREF="kqemu-doc.html#TOC10">4.3 Full virtualization and Windows guests</A></H2> <UL> <LI>Do not use full virtualization when installing Windows. You can enable it after Windows is installed. <LI>Only Windows XP/2000 are known to work in full virtualization mode. </UL> <P><HR><P> This document was generated on 6 February 2007 using <A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A> 1.56k. </BODY> </HTML>