A little dust on the bottle

A little dust on the bottle

There is plenty of enterprise grade hardware out there that is still fully functional and far more robust than your average consumer may ever need. In particular, older enterprise network equipment is dirt cheap and plentiful on Ebay, and for a home lab this kind of gear is an absolute godsend. I have a older 48 port HP Procurve managed switch that despite it's age, offers some really advanced networking capabilities like VLAN trunking and LACP that you just can't get out of even some top of the line consumer grade hardware. I have a colleague who recently took a foray into the world of fibre channel SANs. While the gear we're working with may be long since out of of support, it doesn't mean it doesn't still work perfectly. The fact is, other than getting incrementally faster with subsequent generations, networking technology doesn't really change all that much; ethernet and fibre channel protocols aren't going away any time soon. However, the tools to manage hardware like this is generally tied to the tech that was available when it was new. If you go back more than about a decade, your options for managing older network gear generally fall back to just a few options; Serial (either RS232 or ethernet) to USB or Java web plugins, either of which present their own sets of challenges.

It's been quite a while since the last time I saw a serial port on a computer. The last computer I personally owned that had one was my old IBM Thinkpad T42p, which I bought new about 20 years ago. These days, your options there are going to be USB adapters, but as I found out the hard way, not all adapters work in all cases. Luckily for me, the standard lavendar Cisco console cable happens to work with my HP switch. Accessing the switch console is fiddly. I've found through much trial and error that it will only work with a handful of terminal emulators on Linux, (xterm generally being the "most compatible") and only when the the terminal size is set at EXACTLY 80 columns x 24 rows. I can access the switch console using screen, eg;

sudo screen /dev/ttyUSB0 9600

It's kind of annoying though, because there are certain things that you can do in the console menu, but some other things require you to drop out of the console menu to the CLI which presents new problems; documentation on HP switches pre-Aruba is few and far between. As time goes by, more and more of the tribal knowledge of how to configure these aging switches is lost to the great bitbucket in the sky.

Generally speaking though, you can achieve most (if not all) of the things you may want to do with this switch far easier with the web UI, but... that presents a whole new set of challenges an order of magnitude larger. My HP ProCurve 2510G-48 switch was first released in 2006. You know what the dominant OS at the time was? Windows XP (Vista wouldn't be released until the following year). So to manage my old switch using the web UI, I have to use a Windows XP. Furthermore, I have to hunt down the magic combination of 32 bit Firefox and Java 8 JRE that still work with XP, which is no small feat. As time goes by, a lot of legacy software just tends to disappear as it drifts off into obscurity, or because software vendors aggressively remove or paywall access to old versions of software (I'm looking you, Oracle).

Then comes the challenge of how you would even run Windows XP in this day and age. Hardware support for the aging 32 bit operating system is going to be virtually non-existent on any reasonably modern hardware, and I really don't feel like having a massive gaping security hole in my network running 24x7 anyway. The logical choice is to virtualize XP and only fire up the VM when needed, but then you have to figure out how you can shoehorn a 25 year old operating system into a modern virtualization platform. Believe me when I say, it was not exactly a straightforward process, at least not on Openshift Virtualization (which is my only virt platform these days).

Deploying Windows XP in a VM

Whether it's to manage old network gear, play some retro games or just simply for nostalgic reasons, spinning up a Windows XP VM - while entirely possible - isn't exactly the easiest thing to do.

On Openshift Virtualization, the first hurdle you're going to run into is hardware support. Keeping in mind that Windows XP is a 32 bit operating system that predates UEFI with extremely limited hardware support out of the box, just getting past the installer is a challenge in and of itself.

The very first thing you're going to need to do is patch your HyperConverged instance to enable the legacy pc-i440fx machine. In the past all you needed to do was patch your HyperConverged instance with the following

oc annotate --overwrite -n openshift-cnv hco kubevirt-hyperconverged kubevirt.kubevirt.io/jsonpatch='[{"op": "add", "path": "/spec/configuration/emulatedMachines", "value": ["q35*", "pc-q35*", "pc-i440fx*"] }]'

However, with OCP 4.14 and later, you need to apply this patch

oc annotate --overwrite -n openshift-cnv hco kubevirt-hyperconverged   kubevirt.kubevirt.io/jsonpatch='[                                                                                                                                       {"op": "add", "path": "/spec/configuration/architectureConfiguration", "value": {} },  
  {"op": "add", "path": "/spec/configuration/architectureConfiguration/amd64", "value": {} },  
  {"op": "add", "path": "/spec/configuration/architectureConfiguration/amd64/emulatedMachines", "value": ["q35*", "pc-q35*", "pc-i440fx-rhel7.6.0"] } ]'

Once the change has been rolled out, you can verify that it has been applied by checking the contents of your kubevirt instance, eg

oc get kubevirt kubevirt-kubevirt-hyperconverged -n openshift-cnv -oyaml | less
...
spec:
...
  configuration:
    architectureConfiguration:
      amd64:
        emulatedMachines:
        - q35*
        - pc-q35*
        - pc-i440fx-rhel7.6.0
        machineType: pc-q35-rhel9.2.0

Then you should be able to create a VM with the machine type pc-i440fx-rhel7.6.0. You can start from any template really, but I just ended up creating one from scratch without a template, eg;

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  annotations:
  labels:
    app: cursed
  name: cursed
  namespace: virtualization
spec:
  dataVolumeTemplates:
  - metadata:
      creationTimestamp: null
      name: cursed-cursed
    spec:
      preallocation: false
      source:
        blank: {}
      storage:
        resources:
          requests:
            storage: 60Gi
        storageClassName: zol-iscsi-stor01
  running: false
  template:
    metadata:
      creationTimestamp: null
      labels:
        kubevirt.io/domain: cursed
    spec:
      architecture: amd64
      domain:
        cpu:
          cores: 1
          sockets: 1
          threads: 1
        devices:
          disks:
          - disk:
              bus: sata
            name: cursed
          interfaces:
          - bridge: {}
            macAddress: 
            model: e1000e
            name: default
          rng: {}
        features:
          acpi: {}
          smm:
            enabled: true
        firmware:
          bootloader:
            bios: {}
        machine:
          type: pc-i440fx-rhel7.6.0
        memory:
          guest: 2Gi
        resources: {}
      networks:
      - multus:
          networkName: vlan20
        name: default
      terminationGracePeriodSeconds: 180
      volumes:
      - dataVolume:
          name: cursed-cursed
        name: cursed

After applying the vm.yaml file, it will also create the appropriate disk (assuming you have a default storage class for virtualization set).

I'm using bridged networking, which I won't cover how to set up. You can just use pod networking if you don't already have bridge networking set up on your cluster. Then you'll need to create your install media. You can grab a Windows XP SP3 iso from the web archive eg; https://archive.org/details/WinXPProSP3x86

You can use virtctl to upload the iso to a PVC to be added to your VM, eg

virtctl image-upload dv xp-iso --size=1Gi --image-path=en_windows_xp_professional_sp3_Nov_2013_Incl_SATA_Drivers.iso

Then you can add the disk to the VM like this

Then you can power on the VM and start the install. You may need to hit F6 as soon as you see this screen or the XP installer may fail to load the appropriate HCL and won't be able to see the disk. Once you get past this step, deploying Windows XP is pretty straightforward - just follow the normal install procedure.

Once you've successfully installed Windows XP, the next important thing you're going to need to do is sort out your networking. A VM is pretty useless if it can't talk to anything else. This driver disk will work for the Intel E1000E NIC https://archive.org/details/intel-pro1000-mt-desktop-82540em-winxp

Upload the Intel driver disk using virtctl, eg;

virtctl image-upload dv e1000e --size=1Gi --image-path=PRO2KXP_v14_0.iso

Then with the VM powered off, remove the XP install ISO and attach the Intel driver disk like this

Once you've booted into XP for the first time, navigate to My Computer > D: > and run the Intel Pro 1000MT installer wizard. Once the installer completes, you should have working network connection. You can verify by checking the device status in devmgmt.msc

Unfortunately, the rest of those missing drivers you may be out of luck for. The last version of virtio-win that supports Windows XP is virtio-win-0.1.132 which you can grab from here https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.132-1/ However, I had no luck installing any of these drivers. The viostor and netkvm drivers may work for virtio disk and NIC, but I didn't have any luck with the rest of the missing drivers.

At this point since you have working ethernet, it's a lot easier to download something like Elaborate Bytes Virtual Clone Drive, but... since Internet Explorer 8 is absolutely ancient, the very first thing you're going to need to do is download a more modern browser like Firefox or Chrome to even be able to surf the web. In my experience, I had to download an outdated version of Chrome to even be able to get to Mozilla's website to download a slightly less outdated (but still very old) version of Firefox, and even then I ran into problems with SSL

The last version of Firefox that works on Windows XP is Firefox ESR 52.9.0 (32 bit) which luckily is the last version of Firefox that also supports the Java plugin I need in order to access my HP switch web UI.

Now back to addressing XP driver hell. Download a copy of Elby Virtual CloneDrive from https://www.elby.ch/en/products/vcd.html and install it

Then navigate to https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.132-1/ and download the ISO.

Once downloaded, use Virtual CloneDrive to mount the ISO image. Keep in mind, a lot of this abandonware is only kept around for archival reasons on FTP servers with connectivity akin to a couple of tin cans strung together, so downloads may take a while.

I did not have much luck with any of the missing drivers, but viostor and netkvm should work, which will provide your VM with better performance for disk and network. In order to get Windows XP to work with these drivers, I had to add an additional virtio disk and an additional virtio NIC and install the drivers manually. Then I shut down the VM, removed the new devices and changed the bus type to virtio for the rootdisk and default NIC.

Now, with (presumably) better performance out of my VM I can proceed with the next step, which is installing Java.

After some trial and error, I finally discovered that the last version of Java that will install properly and run on Windows XP is Java 8u151 32 bit. Oracle pay walls access to everything but the latest version of their JRE, so I had to do some digging to find a Java installer for Windows XP. Once again, Wayback Machine FTW! However, the ancient version of Firefox doesn't render the page correctly so the only way to get the download is to enter the full URL in your browser to trigger the download https://archive.org/download/Java-Archive/Java%20SE%208%20%288u202%20and%20earlier%29/8u151/JDK/jdk-8u151-windows-i586.exe

If you don't feel like typing that all in manually you can hit the handy 'Paste' button in the web console (this is actually one the coolest features we've added to OCP-V that really is a quality of life enhancement for VM admins).

Then once downloaded, proceed to install Java. It's going to throw an alert about requiring a newer version of Windows, but you can just click past it and finish the install.

Once Java 8 has been installed, before I can access my switch, I have to add it's IP address to Java. Navigate to Start > All Programs > Java > Configure Java to get to the Java Control Panel and click on the Security tab. Click Edit Site List down near the bottom and add the IP address of the switch (in my case 192.168.1.150).

At long last, we can finally log in to the switch management console. You'll be prompted to activate the Java plugin the first time, and then its going to squawk about needing to update. Just click 'later' and you can proceed to the web UI.

Going a little further, honestly I have no idea if it's even going to help in 2024, but the idea of running Windows XP without antivirus makes my skin crawl. There are a couple of decent free antivirus programs out there, Microsoft Defender, AVG and Avast! were all solid choices back in the day. No idea if their virus definitions have been updated any time recently but some protection is better than none at all. Of the three, Avast still seems to work on Windows XP, so I'd recommend grabbing a copy of it from avast.com (#WindowsProblems - I don't ever remember installing antivirus on a single Linux system...)

The last thing you'll probably want to do to give your Windows XP system a fighting chance (not really... it's hopeless) is to run updates. You'll quickly find that out of the box, Windows update is hopelessly broken in 2024 on Windows XP. There is an unofficial "SP4" for XP which is basically a rollup of all of the updates released after SP3, including all of the updates that were pushed to XP for POS systems after XP officially went end of life in 2014. Once again, archive.org comes to the rescue. You can grab the unofficial SP4 updates from here https://archive.org/details/xp-unofficial-sp4-jan2022_20220113

Good luck!