Will be writing this more as notes and less as a story.
Hardware and Drivers of the Host
AMD Ryzen 5950X
ZFS 2.3.0 (special metadata vdev and 8 disks in RAIDZ2)
Ubuntu 24.04 6.8.0-51-generic kernel
qemu-system-i386 -version = 8.2.2 (packaged /w ubuntu)
Each guest VM has its own ZFS dataset, recordsize=64K, compression=lz4, backing store is qcow2 (default qcow2 image settings)
I use xrdp and the Microsoft Remote Desktop client on my Mac to connect to an X11 session. Works great.
Disk Controllers and Settings
Recommend “pc-i440fx” machine type, at least to start with as it has the IDE controller. q35 does not have IDE (only an ICH9 AHCI SATA controller). Can only install /w IDE unless you can get the drivers slipstreamed or provide a driver floppy.
IDE works but is relatively slow. You’ll want to change that later to SCSI or use UniATA driver.
UniATA provides a “seat of the pants” performance boost over the native IDE drivers in NT. Didn’t benchmark. UniATA in theory supports AHCI but doesn’t seem to support the ICH9 AHCI controller in QEMU (the only SATA controller in QEMU AFAIK). So only IDE seems to work for UniATA.
Using IDE, I noticed that Windows NT did not take kindly to having the qcow2 disk extended – NTLDR would not even show the boot menu. I don’t understand why. Whatever disk size you choose at install you seem to be stuck with it, but note that NT will refuse to format more than (IIRC) a couple of gigs during setup. Maybe I was doing something stupid. YMMV.
(Note on above – If you can create a qcow2 and partition/format it NTFS elsewhere, then bring it back to Windows NT 4 setup, it will work. In my case, I had a 16GB NT 4 image from a previous install that I was able to just wipe out and install new on top of just fine.)
Windows NT will BSOD if the CPU type is anything higher than “pentium”
Have not thoroughly investigated but Windows NT setup complains about random corrupted filed throughout the setup process unless you do the following things: (1) 128MB of RAM and (2) the caching mode for both the IDE disk and IDE CD-ROM are set to “write-through”.
My preferred approach is to put the disk on the IDE controller, go through setup, then change the controller to lsilogic SCSI which there are NT 4 drivers for.
The “lsi” SCSI controller was known back then as Symbios Logic prior to being sold to LSI. You need the “Symbios PCI SCSI High Performance” driver. You can get it here: https://archive.org/details/SYMC8XX-bios-driver
There is a floppy disk containing the driver for the purposes of loading it during setup. For me, setup loads the driver but setup still fails to find any drives (despite the qcow2 disk image being connected to qemu and the LSI controller). YMMV, some people claim it works. I don’t know why it doesn’t work for me.
My approach as noted above is to install while the qcow2 is connected as an IDE disk, I load the driver using the floppy image, then once NT is installed, I edit c:\boot.ini as follows (below), then power down the VM and attach the qcow2 to the LSI SCSI controller.
(Note I tried changing from scsi(0) to scsi(1) but that didn’t work. Needs to be multi(0) to work.)
OLD:
[boot loader]
timeout=30
default=scsi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
scsi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation Version 4.00"
scsi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation Version 4.00 [VGA mode]" /basevideo /sos
NEW:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation Version 4.00"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation Version 4.00 [VGA mode]" /basevideo /sos
Networking
Qemu supports the AMD PCnet driver, and Windows NT supports this card out of the box. This is a simple 10 megabit card. You can roll with the PCnet card if you’re happy with it.
I ended up changing to the RTL8139 card as it is more performant (it is a 100 megabit card), but Windows NT does not have built in drivers. You can find a driver pack here: https://theretroweb.com/drivers/158
Other notes: I’d LOVE to have a gigabit card in Windows NT but can’t make it work. The E1000 device emulates an Intel 82540em (there is also a 82544gc variant of it you can select). Intel has e1000 drivers for NT, but it refuses to work with it.
There ARE vmxnet drivers (older variant of the VMWare paravirtulized Ethernet device) but qemu doesn’t support it. Qemu only supports vmxnet3.
Learn To Love The Keyboard (for a short while)
During NT setup, and before getting the mouse driver installed after setup, the Qemu mouse may be jumpy, erratic, and etc. Use the tab key, enter key, and such to navigate through the on-screen options instead of using the mouse.
tab – cycles through the different buttons on screen. a new button should be highlighted every time you press tab
shift+tab – like tab, but it goes in the opposite direction
arrow keys – sometimes the tab keys don’t do exactly what you expect or want them to do, sometimes you need to use the arrow keys to select what you want.
alt+tab – selects a different window and brings it into foreground focus
enter – like a mouse click
Getting Drivers into Windows NT
A few ideas:
If they’re small, make a floppy image for each one you need to present to the guest OS.
You can make an ISO image, then present the ISO to the guest’s CD-ROM drive.
(Note on that: installing some kinds of drivers often also requires Windows NT install additional things from the Windows NT setup disc. I recommend first copying the drivers off the CD-ROM onto your desktop rather than trying to install directly from the CD-ROM as you end up in a situation where it is going back and forth trying to copy files from your driver disc and the NT CD-ROM).
What I did: During NT installation, did not install networking. On first boot, insert an RTL8139 ISO into the CD-ROM, copy to desktop. Put the NT ISO back in. Installed the network card through Control Panel, which asks for both drivers and the NT CD-ROM. Reboot.
On next boot, I had a working network and could access my Samba shares. (Side note – IIRC you’ll need to enable insecure SMB 1 for NT. Do with caution. My home network is just for fun and I don’t let randos onto it, so no security issues with that.). I have a Samba share full of drivers and other useful things for retro OSes, which makes getting other drivers installed more of a breeze.
VMWare Drivers
Get the winPre2k.iso from https://archive.org/details/darwin_202204
Use 7Zip (or other tool) to extract the VMWare Tools.msi file.
From that, extract the Data1.cab file.
In the extracted cab folder, there will be many files with extensions like xyz.sysNT. Rename the <file>NT to <file>.
Mouse Driver
To make the mouse pointer move seamlessly in and out of the qemu window / spice viewer / virt-manager window the guest OS either needs a compatible PS/2 mouse driver, such as the VMWare Mouse driver, or it needs to support a USB graphics tablet that provides absolute mouse pointer positioning to the guest.
There are third party USB drivers for NT; I have no idea if the graphics tablet works with it. You can be the guinea pig for that if you’re curious.
I use the VMWare Mouse driver from winPre2k.iso
Graphics
Different people have different approaches to this. Some people like the UniVBE drivers. I haven’t even tried those.
I set the graphics card to “vmware” (In libvirt, the vmware graphics are known as “vmvga”). This makes the VGA controller look like a VMWare emulated graphics card that you can use the VMWare SVGA driver with. It work great!
As before, it’s on winPre2k.iso.
Sound
I had the most luck with Sound Blaster 16 (sb16 in qemu/libvirt).
I couldn’t get NT to see it with the default IRQ=5. In libvirt, I had to specify an alternate IRQ 7:
<sound model='sb16'>
<address type='isa' iobase='0x220' irq='0x7'/>
</sound>
Additionally, I disabled the parallel port, as I don’t have a need for it and it would otherwise use irq=7.
I also added the adlib card, which libvirt doesn’t support, but you can work-around that by using the qemu:commandline XML tag as below. Adlib will get you OPL-2 MIDI. I’d prefer OPL-3 but qemu doesn’t support that.
I believe you’ll need to add the xmlns: parameter to the domain tag at the top to get that to work.
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
.... snipped ....
<qemu:commandline>
<qemu:arg value='-parallel'/>
<qemu:arg value='none'/>
<qemu:arg value='-device'/>
<qemu:arg value='adlib,id=sound1,audiodev=audio1'/>
</qemu:commandline>
</domain>
Another note on sound. If you use virt-manager, the sound seems to sometimes not work. I don’t quite know why. For me, the sound is restored when I use the “spicy” spice client to connect to the VM, then exit spicy and go back to virt-manager.
Other sound cards: couldn’t get them to work. Couldn’t get AC97 or ES1370 drivers to work, despite such drivers existing. AC97 works in other guests on other versions of Windows.
There is a driver pack called snapaudio-winnt-1.1.2.exe that supposedly will work with these cards. I tried it with not much luck, I get some sound to come out but it’s choppy at best. You’re welcome to try! Otherwise sb16 is good enough!
As far as the SB16 driver: Windows NT has an SB 16 driver that works (Control Panel -> Multimedia -> Audio Devices). Make sure it selects the correct IRQ (does for me) and disable the MPU-401. There are newer Creative Labs drivers but these actually don’t work for me, I just use the Windows NT one, it’s fine.
For Adlib OPL-2, Control Panel -> Multimedia -> MIDI and add the “MIDI Synthesizer” driver. Needs no other special configuration.
Wrap Up
You should now have SCSI, network, mouse pointer, SVGA, and sound which are prerequisites for a usable enjoyable experience.
At this point, I suggest installing SP6A, then installing your favorite software. Have fun.