Virtual Windows98

From VistApedia
Jump to: navigation, search

Ok, you have to be a masochist (or perhaps merely an incorrigible flinty cheapskate). Windows 98 is insecure, slow and inefficient, and, well, is Windows (I am an unabashed Linux proponent).

On the other hand, Windows 98SE is the only Windows OS that can be used without constantly contacting Microsoft (which consumes a huge amount of network time in aggregate). It also does not require registration/activation to run and is not linked to specific hardware, as are other versions of Windows. It also allows the modicum of networking required for CPRS.

Further, many old computers have a copy lying around (with a license) that can be co-opted for the purposes of using in a virtual machine. Our organization had a closetful of old unused computers with Windows 98 licenses, gathering dust.

Using Windows 98SE in VirtualBox

VirtualBox doesn't really like Windows 98. The guest additions don't work well (if at all), and there are no intrinsic device drivers in VirtualBox to support the antique Windows 98 drivers.

With a few tweaks, however, Windows 98 can be made to run in a VirtualBox virtual machine suitably enough to run CPRS.

  • Install VirtualBox.
In my (K)Ubuntu system, I used
sudo apt-get install virtualbox-ose virtualbox-ose-source virtualbox-guest-additions
I happen to use Kubuntu, so I use the QT addition:
sudo apt-get install sudo apt-get install virtualbox-ose-qt
  • Start VirtualBox and create a Windows98 virtual machine. I name it Win98SE_CPRS.
  • I give the virtual machine 1024 RAM and 2 Gb virtual hard drive space. In retrospect, I note that my entire virtual machine (once all the Windows updates and modules are installed) only requires (less than) 400 Mb, so 2 Gb may be overkill. However, this allows some swap space for the Windows 98 virtual memory manager (Start menu -> Settings -> Control Panel -> System -> Performance -> Virtual Memory). Nevertheless, a 1 Gb virtual hard disk may be sufficient. It depends on how much RAM is allocated -- the more RAM is available, the less virtual memory is needed.
  • With only 1024 Mb RAM, Windows startup is quite slow, but the CPRS clients run fine (since they are very efficient).
  • After frequent usage, I ended up giving the virtual machine 1536 Mb RAM (my laptop has 3 Gb pre-installed, so this represented 50% of the RAM) and used a 2 Gb virtual hard drive. (This worked out for me because I later placed the virtual machine on a 4 Gb USB flash drive.) The decision on how much RAM to use has to be made in the beginning, though, because once Windows 98 is installed, it doesn't like to have the virtual machine memory changed (unlike later versions of Windows, which can adapt).

Install Windows 98SE in the virtual machine

  • Place the Win98SE setup disk in the CD-ROM drive and start the virtual machine. Install Windows98 from the CD as usual. (All installation (including disk formatting) occurs completely within the virtual hard drive, so it does not affect the host Linux operating system.) I do a custom install and don't include all the "extra" programs (Imaging, Paint, Online Services, etc.) to save space. Internet Explorer, VPN, and the networking modules are required, so I leave those alone.
  • I use a login name and networking name of client9260, without a password. (Later this allows network logins with Astronaut SSH to be a little more streamlined.) I don't use a password so that automatic startups can proceed without user intervention.
Make sure Windows bootup does not require a user logon password (so automatic logons can proceed):
Start menu -> Settings -> Control Panel -> Network -> Primary Network Logon: Windows Logon
  • I could not get the VirtualBox guest additions to work properly with Windows 98, so I could not get folder sharing between the Windows guest OS and the Kubuntu host OS to function properly. I therefore used a CD as a medium to transfer files between the two operating systems. Initially I copied five sets of files onto the CD:
  • The astronaut_clients.x.x.x.x.exe CPRS client package for Windows
  • The Mozilla Firefox 2.0.0.20 web browser (Firefox 3 doesn't work on Win98) or Opera (msimg32.dll required from the C:\Windows\system32 folder of a newer edition of Windows).
  • Windows98 VESA graphics drivers from this website. (Windows 98 does not have a native utility to unzip files, so I unzipped the VESA-driver zip file in (K)Ubuntu first, then copied the unzipped 081021 folder onto the CD.)
  • Internet Explorer 6 SP1 (see below). Although it is less secure than Firefox, TMG-CPRS requires it, so I installed it.
  • puttygen.exe and pscp.exe from the PuTTY download page. These are used to create a secure SSH key pair and copy the public key to the OpenSSH server.
I copied these files from the CD into the My Documents folder of Windows 98 in the virtual machine.
  • The default driver in Windows 98SE that can be accommodated by VirtualBox is VGA, which is insufficient. I therefore installed the VESA drivers that I copied in the previous step:
Start menu -> Settings -> Control Panel -> Display -> Settings -> Advanced -> Adapter -> Change -> Next -> Search for a better driver... -> Specify a location -> Browse -> "C:\My Documents\081021\Vbe9x\Uni"
A restart is required. I found that a 800x600 screen area size (in Windows) works best when using VirtualBox in windowed mode ("Adjust Window Size"), or 1024x768 when using VirtualBox in Fullscreen Mode. YMMV.
  • TMG-CPRS requires a more modern version of Internet Explorer than is supplied with Windows 98. Internet Explorer 6 SP1 is the latest version of IE compatible with Windows 98. I had previously downloaded a full version of IE6 (onto a Windows machine) using these instructions and burned it onto the CD (as above). (It could also be done directly in the Windows 98 virtual machine.) Install IE6 in the virtual machine. I use a minimal custom installation (to avoid installing MediaPlayer and other modules), but that is merely my preference. (I do install Shockwave, since it is hard to find websites on the Internet that don't use flash, anymore.) Be prepared -- IE6 installation takes a long time.
  • It is probably best to update IE6 as far as possible.
  • I installed Firefox (or Opera), but this is optional (if you don't mind IE6). (For Opera, I placed the msimg32.dll file in C:\Windows). Besides, this is a virtual machine, so I use the browser in the host OS anyway. I really only want to run TMG-CPRS in the virtual machine.
  • The TMG-CPRS integrates a link to Internet Explorer, which is quite convenient, so I guarantee that it will be used. Therefore it is best to install some sort of virus checker and firewall in your virtual machine. Of course this will slow down Windows 98, so you will have to consider the trade-offs. I personally prefer an older version of ZoneAlarm (such as 6.5) as a firewall, and ClamAV as an anti-virus scanner. ClamAV does not include real-time virus scanning, but that is ok by me, since it is the real-time scanning that slows down the system considerably.
  • Install the Astronaut CPRS package. The Astronaut installer is not really made with Windows 98 in mind, so a good deal of tweaking is required, but I want to keep the installation consistent.

Environment variables in Windows 98

  • The Astronaut installer uses environment variables effectively. Unfortunately, Windows 98 doesn't use environment variables quite the same way as do later versions of Windows. While they can be set (see here), the Astronaut installer does not recognize this method.
  • It is possible to create all the environment variables that Astronaut uses, but I find it easier to ignore the environment variable system and merely edit the shortcuts by hand, as I would when installing into a protected environment. (The Astronaut shortcuts are installed to the C:\Windows\Start Menu\Programs\Astronaut folder in Windows 98).
  • I use a key pair instead of the less secure SSH password authentication that is the default with the Astronaut package. See these instructions to create the key pair, copy the public key to the VistA server, and then edit the Astronaut SSH shortcut to use the key for logging on.
  • After tweaking the Astronaut SSH shortcut, copy the revised shortcut into the Windows98 Start menu -> Programs -> StartUp folder (found at C:\Windows\Start Menu\Programs\StartUp), replacing the original that the Astronaut installer placed there.
  • After tweaking the remaining shortcuts in the C:\Windows\Start Menu\Programs\Astronaut folder, copy the appropriate revised desktop shortcuts to the desktop folder (C:Windows\Desktop) to replace the originals that the Astronaut installer placed there. (To see the C:\Windows\Desktop folder, you will have to enable hidden file viewing: Start menu -> Settings -> Control Panel -> View -> Folder options -> View -> Files and Folders -> Hidden files -> Show all files (ticked) .)

Streamlining the system

For added security and faster, smoother SSH negotiation, I recommend installing (and using) an SSH keypair for SSH authentication instead of the password authentication method used by default by the Astronaut installer.

Create a Linux shortcut to start the virtual machine automatically

  • Create a Menu Item / Shortcut in (K)Ubuntu Linux to start the virtual machine automatically. In the example below, the virtual machine I created in VirtualBox is named Win98SE_CPRS. In the Command: line of the Menu Item / Shortcut I use
virtualbox -startvm "Win98SE_CPRS"

Now, in summary, when this Menu item / Shortcut is invoked, VirtualBox starts the Windows 98 virtual machine. The Windows 98 virtual machine has been configured to logon (as client9260) automatically without a password. The (revised) Astronaut SSH shortcut has been placed in the Windows 98 Startup folder so that the SSH connection is made when Windows 98 starts. (Presumably, all Configuration has been tweaked so that no user input is required for the SSH negotiation).

Now all that is required is to start one of the clients (such as TMG-CPRS) that are on the Windows 98 desktop and login with the ACCESS CODE / VERIFY CODE.

That's the way I like it.

Copy the virtual machine to a USB flash drive

  • This is purely optional. I like having a mobile copy of the Astronaut CPRS files on a USB drive, but it is not necessary. I can also make multiple copies (for backup, of course, in case I lose one).
  • I use a 4 Gb USB flash drive, which (like most USB flash drives), only has a usable storage space of 3.5 Gb. A 2 Gb virtual hard drive can be accommodated on it, along with other files I routinely need to transport.
  • Copy the ~/.VirtualBox (or /home/user/.VirtualBox) directory to the USB flash drive and rename the folder VirtualBox (instead of .VirtualBox).
  • On a different machine (the copied virtual machine on the USB flash drive cannot be used on the same computer having the original virtual machine), plug in the USB drive.

Run a virtual machine using the virtual hard disk on the USB drive

  • On the new machine, start VirtualBox. Create a new Windows98 virtual machine. I name it Win98SE_CPRSUSB.
  • I like to give the virtual machine at least 1024 RAM, but my secondary computer only has 1 Gb RAM total, so I give the new virtual machine only 512 Mb RAM. (The virtual machine therefore runs quite slowly and this isn't enough memory for graphics or web browsing, so I don't recommend this, but it still functions.) It is not necessary to have the same amount of RAM as was given to the virtual machine on the original system.
  • Use the virtual hard drive copied onto the USB flash drive:
VirtualBox -> Create New Virtual Machine: Virtual Hard Disk -> Boot Hard Disk (Primary Master): (ticked) -> Use existing hard disk -> Browse (folder icon) -> Virtual Media Manager: Add -> (browse to the VirtualBox folder on your USB drive: Hard disks:) Win98SE_CPRS.vdi -> Select
  • Start the newly created virtual machine. It ought to work identically to the original virtual machine.

Copy the virtual hard disk from the USB flash drive to a new computer

There is a speed disadvantage to running programs from a USB drive. It is possible to merely copy the Win98SE_CPRS.vdi hard drive to the ~/.VirtualBox/HardDisks folder (/home/user/.VirtualBox in Linux or C:\Users\user\.VirtualBox in Windows) of the new computer and use it as the "Use existing hard disk" option in a new virtual machine, as above.

  • If the Windows98 virtual machine has already been created, select the new copied virtual hard disk to use with the existing virtual machine:
VirtualBox -> Machine -> Settings -> Hard Disks -> Add attachment (disk icon with green + symbol) -> Select -> Virtual Media Manager: Add -> Win98SE_CPRS.vdi -> Select.
  • Obviously, in a networked environment, it would be easy for a network administrator to push updated copies of the virtual hard drive to this location as needed.

Export a virtual appliance

VirtualBox allows the export of a virtual machine as an appliance in the Open Virtualization Format. An appliance in this format can then be imported into other virtualization systems (such as VMWare, using a special utility) that support this format, or by another user using VirtualBox.

  • Export the complete virtual machine:
VirtualBox -> File -> Export Appliance
  • I usually export to my USB drive. If not, copy the Win98SE_CPRS.ovf and Win98SE_CPRS.vmdk files to the USB flash drive.
  • Import the appliance to VirtualBox on a new computer:
VirtualBox -> File -> Import Appliance

This copies all the settings (e.g. amount of RAM to use for the new virtual machine) from those of the original virtual machine used to export the appliance. If this is not acceptable, use the method in the previous section.

This method is very quick and useful when the virtual machine is in a stable state that does not change much. My Astronaut CPRS virtual machine (using a Windows 98 guest OS) is stable and maximized for efficiency, with all the networking settings configured the way my organization uses them. In this state, it is ideal to be exported as an appliance.

Portable VirtualBox

There are several self-contained versions of VirtualBox that can run from a USB flash drive. (They mostly use PuppyLinux or Damn Small Linux as the OS on the USB drive, with the OpenSource version of VirtualBox). This is a very slow solution, since the native OS (usually Windows), the USB Linux OS, and the virtual machine OS must all run in RAM. Except for powerful computers with plenty of RAM, this solution (for me) is not ideal. Further, if the user does not have administrator rights on the computer, it is difficult to run Portable VirtualBox altogether.

Instead, I merely put copies of VirtualBox for Windows on the USB drive and install it on the computer I wish to run VirtualBox. (I don't need to do this in Linux, as VirtualBox installation from a package manager is usually trivial to accomplish).