Qemu

From LQWiki
Jump to navigation Jump to search

QEMU is a processor emulator using dynamic translation to achieve good emulation speed. As QEMU requires no host kernel patches to run, it is very safe and relatively easy to use.

For alternative technologies, have a look at Virtualization.

Examples

Howto

Install it

Install it as described at installing SoftWare.

Run it

Use an image from a bootable media, let's say it is named bootable.img. Start qemu like this:

qemu bootable.img

and be surprised it already works !

To install a Linux from CD into your qemu machine, first create a virtual harddisk for qemu. In this example we create a 10G harddisk empty in a file named qemudisk.img:

dd if=/dev/zero of=qemudisk.img bs=1024 count=10000000

Put bootable Linux installation media into your CDROM. start qemu like this:

qemu -cdrom /dev/cdrom -hda qemudisk.img -boot d -m512

Qemu will then use qemudisk.img as its hard drive, use only 512 MB of your RAM, and take your CD drive as its own. It will boot the installation CD of your Linux distribution and install it into the virtual disk qemudisk.img.

Transfer files

Speed it up

To speed up QEmu,

modprobe kqemu
  • set up a communication device for qemu
mknod /dev/kqemu c 250 0

Start qemu again.

External links