First you create a disk image for your Linux (the disk image will be used to store data for the virtual hard drive in qemu). For example, to create a disk image (named diskc.img) of 2GB:
qemu-img create diskc.img 2G
Download Linux ISO (CD-ROM image) files. The following command boots up your linux CD-ROM so that you can install on to your just created disk image diskc.img:
qemu -L ./bios -cdrom ../iso/linux/debian-31r2-i386-netinst.iso -hda diskc.img -boot d
or if you have physical cds you want to install from:
(windows host)
qemu -L ./bios -cdrom //./D: -hda diskc.img -boot d
where D in //./D: is the drive letter of the host cdrom with the linux install disc in it.
(*nix host)
qemu -cdrom /dev/cdrom -hda diskc.img -boot d
where /dev/cdrom is the node in /dev/ representing your host's cdrom device
You might need to put in -L bios. This is to indicate to QEMU where the folder the bios/rom images are. Besides, your disk image (diskc.img) is passed to QEMU by -hda diskc.img . If you want to put in more than 2 disk images, use -hdb diskd.img ,...).
After finishing the installation, you can start booting from your disk image:
qemu -L ./bios -hda diskc.img -boot c
Notes:
The bios path specifier '-L <path>' is typically only required when qemu is run on a Windows host.
If your installation requires multiple cdrom discs then you will need to use the eject and change commands. These can be issued at the qemu monitor (when vm is in focus use ctrl-alt-2). ie:
(qemu) eject cdrom when working with iso images (qemu) change cdrom filename.iso when working with physical cdrom drive on Linux host (qemu) change cdrom /dev/cdrom when working with physical cdrom drive on Windows host (drive letter) (qemu) change cdrom //./D:
See http://qemu-buch.de/d/Quickstart for further information.
Hosted by http://qemu-buch.de