This document details the creation and operation of virtual images using Qemu .
CREATING VIRTUAL HARD DISK
To create a virtual disk from Qemu to act as the hard disk for the virtual system give the following command
qemu-img create -f qcow minix.img 2G
here â��f stands for the format which in this case in qcow which is a Qemu format other formats are also available.
is the disk image format. It is guessed automatically in most cases. The following formats are supported:
Raw disk image format (default). This format has the advantage of being simple and easily exportable to all other emulators. If your file system supports holes (for example in ext2 or ext3 on Linux or NTFS on Windows), then only the written sectors will reserve space. Use qemu-img info to know the real size used by the image or ls -ls on Unix/Linux.
QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption, zlib based compression and support of multiple VM snapshots.
Old QEMU image format. Left for compatibility.
User Mode Linux Copy On Write image format. Used to be the only growable image format in QEMU. It is supported only for compatibility with previous versions. It does not work on win32.
VMware 3 and 4 compatible image format.
Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM images present for example in the Knoppix CD-ROMs.
For installation using iso image on your hard disk it is preferred that you place them where qemu is so thet you donâ��t have any path issues.
The following command
qemu -L . -hda solaris.img -cdrom sol-10-u3-ga-x86-v1.iso -boot d -m 256
starts the installation on the virtaul hard isk by the name solaris.img the â��L option followed by a .(dot) specifies that the boot images ( such as PC Boot) are in the same directory.
-cdrom tells Qemu to use the iso as a cdrom.
Boot d is used for installation mode to tell it to boot from cdrom
-m 256 specifies how much memory should be allocated for this virtual machine.
RUNNING THE VIRTUAL MACHINE
Run the following command to test your virtual machine.
qemu -hda solaris.img -m 256 -boot c
ISSUES AND RESOLUTION
Regarding multiple isoâ��s.
To change a floppy and a CD-ROM image, please use QEMU Monitor. To see the Monitor, press Ctrl-Alt-2 keys together. To go back to the guest OS, press Ctrl-Alt-1 keys.
Please use slash instead of back slash in a QEMU Monitor.
(qemu) change fda filename.img
(qemu) change fda d:/tmp/yourfile.img
(qemu) eject cdrom
(qemu) change cdrom filename.iso
(qemu) eject cdrom
(qemu) change cdrom d:/tmp/yourcdrom.iso
You can see a status of block device.
(qemu) info block
For physical cdrom give the cdrom drive letter
eject -f cdrom
change cdrom /dev/cdrom
(or change cdrom \\.\E: )