QEMU is free and open source (FOSS) hardware virtualization toll developed by Fabrice Bellard distributed under GPL license. It supports a wide range of operating systems including Windows and MacOS. Bochs, PearPC, etc. are similar, but do not have many of its features, such as high-speed and cross-platform features. It is like VirtualBox and VMware virtualization software but natively it is command based tool unlike the two mentioned. To get the near-native speed of hardware in a virtualization environment one can use it with the KVM with the help of hardware extensions such as Intel VT-x.
qemu of 0.9.1 and earlier can use the kqemu accelerator. In the version after qemu1.0, kqemu cannot be used , mainly using the qemu- kvm acceleration module, and the acceleration effect and stability are significantly better than kqemu.
Mode of operation
QEMU has two main modes of operation:
User mode simulation mode.
A Linux program compiled with a central processor. The Wine and Dosemu is its main goal.
System mode simulation mode, which is the system mode.
QEMU can simulate the entire computer system, including the central processing unit and other peripheral devices. It makes it easy to test and debug programs written across platforms. It can also be used to virtualize several different virtual computers on a single host.
The main part of QEMU is released under the LGPL, while its system mode simulation is released under the GPL; and the kqemu accelerator is released under free but closed source conditions. The kqemu allows QEMU to be simulated to near real speed, but it is useless if the virtual operating system is Microsoft Windows 98 or below.
QEMU Software advantages
- Multiple architectures are supported by default.
- Can simulate IA-32 ( x86 ) PC, AMD 64 PC, MIPS R4000, Sun SPARC sun3 and PowerPC (PReP and Power Macintosh) architecture
- Scalable to customize new instruction sets
- Open source, portable, fast simulation
- On the x86 architecture that supports hardware virtualization, one can use KVM to accelerate with the kernel ksm large page backup memory, which is much faster than VMware ESX.
- Increased simulation speed, some programs can even run in real time
- Programs that can run Linux on other platforms
- Can store and restore operating status (such as running programs)
- Virtual network card
QEMU virtualization Software disadvantages
- Imperfect support for Microsoft Windows and certain host operating systems.
- Support for less common architectures
- Unless you use the kqemu or KVM accelerator, its simulation speed is still not as good as other virtual software, such as VMware.
- Difficult to install and use than other simulation software such as VirtualBox.
The following instructions can create a 500MB “qcow” format hard disk image.
Qemu-img create -f qcow c.img 500M
The following instructions will cause the virtual machine to run in 128MB of memory, using c.img, which uses the hard disk image created by the above instructions and linux.iso as the CD image.
Note that if you are using a physical optical drive, change the -cdrom linux.iso parameter to -cdrom /dev/cdrom or the CD-ROM you are using.
Qemu -clock dynticks -rtc-td-hack -localtime -hda c.img -cdrom linux.iso -boot d -m 128 -enable-audio -localtime
If you want to use the full-screen driver operating system by default, you can add the “-full-screen” parameter to the above command. If you want to leave the full screen at runtime, use the key combination Ctrl-Alt-F.
Qemu Parameter introduction
-L dir points to the directory where the BIOS and VGA BIOS are located
-hda/-hdb/-hdd/-hdc “filename” Use “filename” as the hard disk 0/1/2/3 image.
-cdrom “filename” Use “filename” as the CD image (the file should be of ISO type).
Users of Windows can use the physical CD by the following instructions:
-cdrom //./x: -> x for disc name/location
For example: -cdrom //./e: -> Use E: for the disc
-fda/-fdb “filename” Use “filename” as the disk 0/1 image.
-boot [a|d|c] Use disk <a>, disc <d>, or hard disk <c> to boot.
-m size specifies the size of the memory in megabytes.
-soundhw ? List all available sound cards
-soundhw all Use all sound cards
-usb allows the use of usb devices.
The -usbdevice name adds a usb device “name”.
-net nic Create a new network card.
For more commands see the official Qemu page
The kqemu acceleration module is a closed source add-on designed by Fabrice Bellard for the Linux kernel to speed up the QEMU subsystem. Simulate x86 operating systems on x86 hardware up to real machine speed.
QEMU supports the following disk image formats:
- Bochs – Read-only
- Linux cloop – Read-only
- .hdd, .hds – Read-only
- QEMU- .qcow2, .qed, .qcow, .cow
- .vdi, .vhd, Virtual VFAT, .vmdk, .img, and .iso