What is QEMU ?

QEMU is an emulator for PC systems, it runs on x86 systems.
Our QEMU version was specially adapted for IPFire.
It provides the ability to emulate one or more operating systems. . The great advantage of QEMU is that it can emulate other processors (like ARM) and even VMware images can be imported.
With enough computing power and memory - MEMORY . MEMORY and MEMORY you are able to emulate all existing OSses: Windows, Linux, Unix, what ever you want.
Allow at least (at least !) 256 MB for your host system (IPFire) to keep the system running.

remember:
It doesnt matter how strong your CPU is, if your machine has less than 2 gigs , you wont have much fun with it - in Germany we call that DIA show ;-) ( one picture per second)

QEMU is a brilliant idea (thanks a lot to the developers), but its memory consuming - memory eating

Preparation

First, install this Addon, like always (;-)) Addons via Pakfire.
After your successful installation, create a virtual disk" with 8 GB (this is as an example that may be suitable for a basic XP installation, if you try to install a full debian - 64 gb disk space may find your acceptance) with the following command:

qemu-img create /PATH/DATEINAME.img 8GB

it takes time - get a coffee - spend some time with your wife or children - it takes time

YEPP Done.
Now we are ready to install the operating system:

To access your QEMU virtual machine, VNC may be a good idea.
Start the viewer and see:

me ( heisenberg - as the translator of this page) may give you this as an additional information:
if you are a windows kid - you may try dameware (http://www.dameware.com/) - its free for 30 days - and yes (excuse me again) i fucking love it (oh yess - i do) - but feel free to make your own decision)

install an operating system with QEMU

Start QEMU with the following options:

qemu -vnc :1 -hda /mnt/harddisk/testimage.img
-cdrom /mnt/harddisk/ubuntu-7.10-desktop-i386.iso -no-acpi
-m 256 -net nic -net user -boot d -no-kqemu -usbdevice tablet &

Remember that this is an example - change it to your needs:
In this example(!) the QEMU-harddisk (testimage.img) and the UBUNTU ISO (ubuntu-7.10-desktop-i386.iso) will be accesesed via a second harddisk which is mounted via ExtraHD - if you like just use your favourite CD/DVD-image as your ISO.image to boot from.

How to use the start parameters
-vnc :1 instructs the integrated VNC-server to send its output over port 5901 \ - be aware of your firewall settings
-no-acpi starts QEMU without any ACPI features
-m 256 allocates 256 MB MEMORY to your virtual machine; \ default is 128 MB, 512 MB for XP will be fine
-net nic emulates a Realtek RTL 8029(AS) PCI Ethernet
-net nic,model=rtl8139 emulates a Realtek RTL 8139 PCI Ethernet
-net user allows NAT on the network interface card
-boot d boots from drive D: ( your CDRom maybe)
-no-kqemu the EMU will start in normal mode (suitable for an installation \ - forget this in "productive mode" - see above: "the DIA show")
-usbdevice tablet emulates a HID-mouse
-daemonize executes QEMU in the background
-redir tcp:3389::3389 allows the use of the RDP protocol for Windows clients \ -> access it on a win machine via: mstsc /V:IP_ADRESS /console
-soundhw es1370,sb16,adlib only one possible soundcard
-localtime gets the system time from the host system
-kernel-kqemu instructs QEMU to use the kernel driver

the "-daemonize" option is a good option to keep your system running stable

on some test systems we run QEMU with the option "-&" but they result in an unstable system.

and ! as always ! - be part of the system - share your knowledge - and let us know if you find a good combination of parameters

Tuning and features

Well, there are not much options to pimp / extend your performance.
The most important option is the -kernel-kqemu" which instructs QEMU to use the kernel driver and it increases speed. Why ?: KQEMU places a large virtual file under /dev/shm. To continue (if you know what you are doing) disable all the options that are not needed, or do not activate the start.

If you want to give some more memory to the virtual machine, change /dev/shm.

If you want to run it as a server under QEMU please consider the following points:
The example shown below is used for the blue (blue0) interface and may be adjusted for your own setup.

The following steps are required:

  1. Load the script to /etc/init.d

Therefor switch to the directory /etc/init.d/ with a:

cd /etc/init.d/

and load the bridge script with:

wget http://people.ipfire.org/~rowie/qemu/bridge

After a successful download the rights of the owner and the symlinks are need to be changed:

ln -s /etc/init.d/bridge /etc/rc.d/rc3.d/S19bridge
chmod 754 /etc/init.d/bridge

  1. Reboot IPFire

After a reboot the modules needed to be loaded again and QEMU needs to be started manually.

modprobe kvm_intel
qemu -vnc :1 -hda /pfad zum image -m 1536 -k de-ch -net nic,model=virtio -net tap,
ifname=tap0,script=no -soundhw ac97 -boot c -usbdevice tablet -enable-kvm -daemonize

I am using kvm and virtio drivers! if you are using some different ones you need to adjust it accordingly !!!

if you find errors , mostly after a reboot, you may find this interesting:

use a terminal session
the vmmon error:
sudo modprobe vmmon
the vmci error:
sudo modprobe vmci
your virtual machine starts, but with network error:
sudo modprobe vmnet
still does not work ?
change to /usr/bin (if you installed it by standard you will find it here - others: find this file and execute)
vmware-netcfg
a window will open - change your first network card to something different like: from auto to ethX - or back
do not think . just do it - this will initzialize your network again
if you dont trust - change it from auto to ethX- accept - and change it back to the original, BUT ACCEPT - to initialize
and it will work
enjoy
cheers Heisenberg

The "usual" start of QEMU

For normal operation of QEMU, the following parameters should be quite sufficient:

qemu -vnc :1 -hda /mnt/harddisk/testimage.img -m 256 -net nic -net user -boot c
-kernel-kqemu -usbdevice tablet &

Emulated hardware

  • IDE-Controller up to 4 IDE Festplatten (or Disk-Images)
  • Floppy Drive
  • CDROM
  • Soundblaster 16 soundcard (aternativ ES1370)
  • Cirrus Logic grafik card 5446 PCI (alternativ VESA-VGA)
  • Standard PS2 Rad-mouse
  • Realtek RTL 8029(AS) PCI Ethernet
  • serial interface (COM 1)
  • Parallel port (LPT 1)
  • USB-UHCI (Intel SB82371)
  • Gameport Joystick
Other commands

qemu-img create -f vmdk playdisk.vmdk 6000000

Creates a blank hard disk image VMWare formated) with 6GB memory.

  • http://wiki.qemu.org/Main_Page