Trying to run QEMU with a file as hda

Posted by Felix on Super User See other posts from Super User or by Felix
Published on 2010-04-05T23:09:23Z Indexed on 2010/04/05 23:13 UTC
Read the original article Hit count: 498

Filed under:
|
|
|

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:

EXT2 errors

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.

© Super User or respective owner

Related posts about qemu

Related posts about memorystick