Trying to run QEMU with a file as hda
- by Felix
I'm trying to run QEMU and use a simple file on the host system as the guest's hard drive. Here's what I attempted so far:
$ dd if=/dev/zero of=/home/felix/vm/archlinux.img bs=1MB count=8192
8192+0 records in
8192+0 records out
8192000000 bytes (8.2 GB) copied, 86.6054 s, 94.6 MB/s
$ qemu -hda /home/felix/vm/archlinux.img -cdrom archlinux-2009.08-netinstall-i686.iso -boot d
Then I try to install Archlinux to that file. It goes pretty well (it's able to format it from what I can tell) until I start installing packages, when I get errors like this:
And, of course, everything goes downhill from there (unable to mount the partition, corrupted files, ...). What am I doing wrong?
Note: I'm just doing this for entertainment purposes. I don't intend to actually use this on servers or anything. The only use I can think of for this kind of installation would be to actually get an 8GB USB stick and dd that file to it and wham! You have a bootable stick with a fully fledged and customized OS, and without torturing the stick through the installation.