Virtual hell


By admin - Posted on 21 October 2008

The downside of finally retiring my wife's old Windows 2000 system is it was the only remaining Windows box in the house. As much as I would prefer to use Linux exclusively, there are a few sites that were built with no regard to compatibility with anything other than Microsoft products. Every once in a while I need to access one of these sites like when I do my State of Colorado income taxes each year. The apparently easy solution with my Athlon64 X2 desktop is to run Windows as a virtual machine.

The easy part was getting the virtual machine up and running. The hard part was in getting all of the various Windows updates applied. I don't know if the problems I ran into were due to running Windows in a virtual machine (I doubt it) or are just a normal part of updating an older release of Windows with the many patches and fixes that have been released in the mean time. Either way, this is what I went through to get a fully updated version of Windows 2000 running in a virtual machine.

Installation and background

First off, here is a little background. I decided to work with Windows 2000 since I have a legal copy complete with the installation key sticker on an old computer case somewhere in my basement. The most recent media I have is for service pack 2 (SP2) so that determined my starting point. Since this was going to be Windows under Linux, I ended up using qemu for virtualization instead of Xen. Maybe I'll try Ubuntu Linux under Xen at some point in the future.

The qemu wiki has excellent documentation on how to do the initial set up and installation of say Windows into a qemu virtual instance. I also found the qemu forums to be very helpful. Based on these sources, I set up my qemu virtual instance as follows:

Command to create initial disk image for installing a guest OS:

qemu-img create -f qcow w2k.img 10G

Command to install W2K:

qemu -cdrom /dev/hdb -win2k-hack -usb -usbdevice tablet -hda w2k.img -m 256 -localtime -soundhw es1370 -boot d &

-cdron can also have something like /dev/hdb

-usb -usbdevice tablet makes the mouse seamless

-hda points to the disk imag: w2k.img (created in the previous step)

-m 256 gives the virtual machine 256 MB of RAM

-localtime gets the time right on systems running UTC

-soundhw es1370 causes qemu to provide a virtual interface to es1370 sound hardware. The result is usually passable.

-boot d tells the virtual machine to boot from drive D:

Leaving off the "-boot d" causes the virtual instance to attempt to boot. The "-boot d" only gives you a chance to boot from the CD drive. The system will attempt to boot from the image anyway unless you strike a key. It should be noted that the CD drive is probed and the command will fail if no CD is present even if you actually want to boot from the installed image.

Upgrading

My W2K Installation media is for SP2 so I had two levels of service packs plus a several separate fixes to install. According to the Microsoft support site, I should be able to just upgrade to SP4. That didn't work and provided me with one of the more inane error messages I have ever run into: "An error in updating your system has occurred." I checked the various system logs using the event viewer and got no additional information. Google searches based on the error message text and upgrading W2K from SP2 t SP4 also didn't provide any useful information.

At this point I decided to try updating to SP3 as an intermediate step. I pulled down a copy of the SP3 update package (executable) and attempted to install it. Everything appeared to go well until after the system rebooted at the end on the install process. Instead of the normal windows login box, I got an error message saying that msgina.dll had failed to load and there was no way to login.

The work-around here was to boot from the installation CD in recovery mode and then replace the new version of msgina.dll with the one on the installation media. This allowed me to reboot the system and then log in.

About this time I decided I should probably checkpoint my attempts at getting W2K updated. I was wasting quite a bit of time re-installing from scratch each time I got so far into the upgrade process and the upgrade failed. Different system behavior after some attempts led me to believe that some changes had been committed even if the update failed. Getting a little ahead of myself, by the time I finished with a fully updated version of W2K SP4, my checkpoint directory looked like:

[dave@fraud ~]# ls -lh /share/dave
total 6.7G
-rw-r--r-- 1 dave ssh_access 461M Apr 17 22:57 w2k-sp2-ie61.img.bz2
-rw-r--r-- 1 dave ssh_access 331M Apr 16 23:06 w2k-sp2.img.bz2
-rw-r--r-- 1 dave ssh_access 1.1G Apr 21 00:15 w2k-sp3-ie61-bits.img.bz2
-rw-r--r-- 1 dave ssh_access 1016M Apr 18 10:48 w2k-sp3-ie61.img.bz2
-rw-r--r-- 1 dave ssh_access 1.3G Apr 21 13:02 w2k-sp4-all-updates.img.bz2
-rw-r--r-- 1 dave ssh_access 1.2G Apr 21 08:54 w2k-sp4-ie61.img.bz2
-rw-r--r-- 1 dave ssh_access 1.4G Apr 21 16:24 w2k-sp4-MSworks.img.bz2

You will note that bzip2 was fairly successful at shrinking the sparse, 10GB disk images to something reasonable.

The next step was to go from SP3 to SP4. Here the install appeared to work but it broke encrypted web access (HTTPS) with Internet Explorer. This showed up as Internet Explorer reporting a 0-bit "cipher strength" as well as me being unable to access HTTPS web sites. I tried several different ways of applying SP4 but always with the same result. Attempts to apply SP4 and then apply later hot fixes often resulted in a "File is corrupt" message.

One of the folks on the qemu forums suggested that I look at a particular Microsoft knowledge base article. I pointed out the the article appeared to apply to every version of Microsoft Windows from Windows 95 on except Windows 2000. After a few more unsuccessful attempts to upgrade from SP3 to SP4 I went back to the article and decided to see if the manual fix suggested for Windows ME would work. This consisted of replacing the SP4 versions of schannel.dll, rsabase.dll, rsaenh.dll and secur32.dll with the previous versions. I also ran regsvr32 for each file since some of the knowledge base articles had this step. No idea what it does but the command succeeded for some and not for others.

This approach worked. After creating yet another back-up image I then proceeded to apply the remaining hot fix updates and install the software we wanted to still have access to.

W2K starting up under qemu

Other notes

Several times qemu would hang or not load. Since I could always kill the session this wasn't a huge deal but sometimes it would grab the sound device and not let go when it crashed. I found the relatively painless solution for this was to restart the qemu service:

service qemu restart

I would also like to install Microsoft Office 97. I can't get past the original installation screen. The error message is "Inf Parser Object Your setup files may be damaged."