So here’s the sumup of my (now working and with plenty of free space) Windows XP install within QEMU. Well, for starters the XP disc I had was an upgrade disc and as I noted before it did not like the media I provided as proof of upgradability. So, I wound up having to go the really long route… The Windows98 SE install would not upgrade to XP for me. Bad install errors that were dealt with by knowledge base articles, but the KB fixes did not solve the problem.
So…. I installed Windows 95B (Which wouldn’t upgrade directly), then Win98 upgrade (first edition), then XP upgrade. It’s very nasty overall, not the “pristine XP install” I had hoped for at this point, but a) it’s a working XP install and b) I don’t have a full install disc and don’t plan on buying one anytime soon. If b) changes I’ll go through another install and try that.
Well, after I had the pristine install I ran out of space real quick getting updates. I had to migrate to a larger disc image. (Actually at this point I made a copy of my disc image and tried two approaches – both worked.)
First approach, was to create a new empty 4GB image.
qemu-img create -f raw winxpbig 4G
Then I booted with a Windows 98 boot floppy to format the image as Fat32 like this…
qemu -fda win98boot.img -hda winxpbig -boot a
then I had to fdisk and then reboot for the format.
(Just a note formatting a disk when it’s in a standalone file is ridiculously fast.)
Next I mounted both images, winxpold and winxpbig (they need to be raw images to mount)
That’s not as easy as mounting any file as a loopback device, there is a certain offset (master boot record info)
(Created the new /mnt/directories first of course and mounted the filesystems as root (only root can mount a loopback filesystem.))
mount -o loop,32256 -t vfat winxpold /mnt/winxpold
mount -o loop,32256 -t vfat winxpbig /mnt/winxpbig
After that I copied everything from old to big….
cp /mnt/winxpold/* -a /mnt/winxpbig/
Next, I had to do two tricks to get the new image working. I tried booting up with the xp install cd and running fixboot and it reported success but did not work, so I booted from a win98 floppy and sys’ed the drive (probably not a good thing as it then tried a win98 boot.) I rebooted with the xp disc and did fixmbr (which gave a stern warning before proceeding) and then fixboot. After running BOTH we were good to boot.
This is booting the image from the xp cdrom ( in my cd drive…)
qemu -hda winxpbig -cdrom /dev/hdc -boot d -m 256 -user-net
(Install really doesn’t need user-net and the recovery console doesn’t need 256 MB of memory.)
To boot normally…
qemu -hda winxpbig -boot c -m 256 -user-net
(boot c is not necessary if there’s only hda given) -m 256 gives 256MB of memory and -user-net gives basic networking. Essentially the virtual machine will live in a firewalled subnet and be given an address automatically. The qemu host uses 10.0.2.1 10.0.2.2 and 10.0.2.3 (not sure what .1 is used for, .2 is the gateway and dhcp server, .3 is supposed to be the samba server if chosen.) (I’ve found that the hosts networking services can most all be accessed at .2)
So the OTHER approach was resizing the existing image. I had to make sure it was a raw image first and then used dd to add space from /dev/zero up to 4GB, I had to do the recovery console boot as well, fixmbr and fixboot and then that install was good to go as well.
All told with all current updates the installs take around 3 GB each (3.2 or so.) Now that you have a “pristine” image, there are a couple options for keeping it “pristine” one is to make a copy and back it up as is, the other is to create a second file to keep changes in.
qemu create -b winxpbig -f qcow winxpbigworking 2G
The above command uses the basefile winxpbig to create a qcom image called winxpbigworking which is basically a growable 2GB worth of “scratch” area that can be used without touching the original image for changes. After that’s made you just…
qemu -hda winxpbigworking -m 256 -user-net
and you’re working off the scratch file. Changes can be commited back to the original (but I don’t know what happens if there is 1GB of changes and only 800 MB of free space, I haven’t experimented that much.)
So, that gives a bit of my qemu adventures of the last week. Again, it’s avery handy tool for either running a windows variant, or testing out a new linux distro, or livecd. There are some features that I’m looking to try out with the tun based networking. (For one I’m curious to have a virtual network setup.)
Related PostsRelated Posts
- Qemu revisited I mentioned Qemu a short while back. I've used it in the past for testing linux livecds. After doing the writeup though I was encouraged to look at it again and see if/how much it's improved since I last got an update. Wow.... For starters, I spent a bit of......
- Exploit out for MS06-040 The big computer security news of the day is the release of exploit code publicly for MS06-040. The patch of course was released Tuesday and it is fairly critical to get the update installed. This is "wormable" It CURRENTLY affects all Windows 2000 systems and XP (with no service pack)......
- How to Remove SoftStronghold | Soft Stronghold Removal Guide SoftStronghold is the latest rogue antivirus application in the LONG line of Wini rogues... Softveteran was the most recent (see the softveteran removal guide) but.... SoftCop (see the SoftCop removal guide.) But, the line goes much further back.... Softsoldier (How to remove SoftSoldier), ( TrustFighter TrustFighter Removal Guide, TrustSoldier removal......
- Reformat Hard Drive And Install Windows 7 There are Two Main Types to reformat hard drive and install Windows 7 A reinstall allows you to keep all your software and personal settings. This method is of interest because you may unintentionally keep the actual glitch that you're attempting to completely eliminate. Our recommended Method: Do a full......
- How to Do Home Window Installation Replacing and installing windows can seem like a daunting and expensive task, but it can actually be incredibly simple to do yourself. When you do your own home window installation, you’ll be greatly cutting down on the costs since most of the cost of having windows installed is the labor.......
- Download Microsoft Windows 7 RC Hi Folks, Microsoft has released Windows 7 RC. Here's what you need to know: This is pre-release software, so please read the following to get an idea of the risks and key things you need to know before you try the RC. You don't need to rush to get the......
- Qemu Windows XP install
- Boot discs
- Qemu revisited
- Qemu 0.8.1 speed improvement with -kernel-kqemu and kqemu 1.3.0pre7
- The 2nd journey begins… Mandriva 2006 upgrade 2 – Part 10