QEMU

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 207.225.170.173 (talk) at 05:23, 1 May 2006 (→‎Disadvantages of QEMU). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Jump to navigation Jump to search
QEMU
Developer(s)Fabrice Bellard
Stable release
0.8.0 / December 19, 2005
Repository
Operating systemWindows, Linux, FreeBSD, Mac OS X
TypeEmulator
LicenseVarious
Websitehttp://www.qemu.com

QEMU is free software written by Fabrice Bellard that implements a fast processor emulator, allowing a user to run one operating system within another one. It is similar to projects such as Bochs, VMware Workstation and PearPC, but has several features these lack, including increased speed on x86, and support for multiple architectures in-progress. By using dynamic translation it achieves a reasonable speed while being easy to port on new host CPUs. QEMU has two operating modes:

User mode emulation
QEMU can launch Linux processes compiled for one CPU on another CPU. Linux system calls are converted because of endianness and 32/64 bit mismatches. Wine and Dosemu are the main targets for QEMU.
System mode emulation
QEMU emulates a full system, including a processor and various peripherials. It enables easier testing and debugging of system code. It can also be used to provide virtual hosting of several virtual PCs on a single server.

The majority of the program is under the LGPL, with the system mode emulation under the GPL.

Fabrice Bellard also wrote a closed source, currently free-of-charge, Linux kernel module (with preliminary ports to FreeBSD and Windows) named kqemu or QEMU Accelerator, which speeds up i386 emulation on i386 platforms to a level where the loss of speed is negligible even compared to native execution. This is accomplished by running user mode and virtual 8086 mode code directly on the host computer's CPU, and using processor and peripheral emulation only for kernel mode (Kernel mode kqemu is in cvs, so this will change soon. But currently it might need some more testing and debugging.) and real mode code. This is similar to what VMware Workstation and Virtual PC do. As a result, real mode DOS will not speed up much if at all as a guest OS, whereas Windows 2000 will run at close to native speeds. (Note, however, that as soon as a memory manager is used with DOS, most of DOS code is actually run in a virtual 8086 mode task, and should theoretically benefit from kqemu's speedup.)

Advantages of QEMU

  • Absolutely Free and Open Source, not Cripple Ware; this is not true for such products as VMware.
  • Supports emulating IA-32 (x86) PCs, AMD64 PCs, MIPS R4000, Sun's SPARC sun4m, Sun's SPARC sun4u, ARM Integrator/CP board, SH4 SHIX board, ARM Versatile/AB board and PowerPC (PReP and Power Macintosh) architectures(see homepage for complete list).
  • SMP support.
  • Implement Copy-On-Write disk image formats, can be used to backup disk images and run multiple instance of a single VM while using very little disk space.
  • Supports many disk image formats, including grow-able disk images (their size increase as non empty sectors are written), compressed and encrypted disk images.
  • Can save and restore the state of the machine (programs running, etc.)
  • Virtual network card emulation.
  • Performance is comparable to VMware when the "free but closed sourced" kqemu kernel module is used.
  • Command line tools allow a full control of Qemu without having to run X11.
  • Guest and Host OS do not need to be modified or patched
  • Runs Microsoft Windows Versions 2000 and below( -win2k-hack is required for installation only; this opting is not required after the install, and will significantly slow the system).
  • Bypass of Microsoft Windows piracy protection (For instance the same Windows 2000 disk Image will run under many different architectures and operating system types)

Disadvantages of QEMU

  • As of version .80 Qemu is unable to run newer versions of Microsoft Windows as a guest. (such as Windows XP, Windows 2003 and Windows Vista)
  • Though Qemu is able to emulate many architectures Qemu the application only runs reliably under x86, x86_64 and PPC.
  • No special device drivers (graphics, sound, IO) for guests are available.
  • Large overhead for multimedia applications due to emulation.
  • NO 3D Acceleration available
  • Incomplete support for less frequently-used architectures.
  • More overhead than sysems such as Xen: [1]

Example of QEMU's usage

This command will create a 500MB hard disk image in QEMU's "qcow" format

qemu-img create -f qcow c.img 500M

In this command the -f option is for the disk image format. The following formats are supported: raw, qcow, cow, vmdk and cloop. See also: .img and .iso.

The following command will start a virtual machine with 128MB of memory, using the c.img file created with the previous command and booting from a CD-ROM image linux.iso. The virtual machine will have audio support and use the system's clock to run in "real time." Note that one could also replace the -cdrom linux.iso parameter with -cdrom /dev/cdrom or whatever one's CD-ROM device is, and physically boot from installation medium and install to the image specified after -hda, in this case c.img.

qemu -hda c.img -cdrom linux.iso -boot d -m 128 -soundhw sb16 -localtime

This will create a virtual machine with 64MB of memory, booting from c.img and using the system's CD-ROM drive. The virtual machine will run in full-screen mode.

qemu -hda c.img -cdrom /dev/cdrom -boot c -m 64 -full-screen

While a virtual machine is running, press Ctrl-Alt-2 to access the "QEMU console", which lets one control the virtual machine (for example, changing disk images, rebooting, quitting QEMU, etc.) and Ctrl-Alt-1 to switch back to your emulation. Ctrl-Alt-F toggles between full-screen and windowed mode.

File:Qemu-fc4-winxp.png
QEMU with kqemu running Windows XP as guest OS on Fedora Core 4

kqemu versus QVM86

Fabrice Bellard has stated his willingness to open-source the kqemu QEMU Accelerator module if a company steps up to sponsor it. This has so far not happened, and kqemu remains proprietary. It is free to use, but one is not allowed to distribute it to other people without an explicit authorisation. Distributors wishing to include the QEMU accelerator on CDs, ISO images or packages must contact the author to know the exact terms.

Meanwhile, a GPL licensed module purporting to perform the same task, QVM86 has appeared.

kqemu has been licensed by Win4Lin for use in their Win4Lin Pro Desktop product.

See also