How to install Windows 3.1 in QEMU
Windows 3.1 is an operating system created and released by Microsoft in April 1992. This release was notable as it was the first version of Windows to gain notable attention - previous releases were very niche and weren't widely used.
There were a few editions of Windows 3.1; Windows 3.1 for Central and Eastern Europe (adds Cyrillic support), Modular Windows (which ran on the Tandy VIS), embOS (embedded version), Windows 3.11 for Workgroups (adds networking support), Windows 3.11 (a very rare kernel update that didn't have the networking support), and finally, Windows 3.2, which is a Simplifed Chinese localization of 3.1.
This article will cover how to set up Windows 3.11 with mouse drivers, sound, network, and full graphics, but it should work for all versions of Windows 3.1.
Before you start
Windows 3.1 depends on DOS, and it must be installed before you can run it - the minimum being DOS 3.1 for Windows 3.1, and DOS 3.30 for Windows 3.11. See this page for more information. It will also work on DOS 6.22 and modern versions of FreeDOS.
386 enhanced mode works in QEMU but it can be a bit buggy on certain systems. If it freezes for you try running
WIN /S at the DOS prompt to disable it.
You can find the Windows 3.11 and MS-DOS floppy disks on either WinWorldPC or Kirsle.
Make an image by opening the Terminal (or Command Prompt) and typing this:
qemu-img create -f qcow2 win31.img 150M
You should see an output like this:
Now we're ready to go.
Next, we start QEMU like this:
qemu-system-i386 -cpu 486 -m 16 -hda win31.img -fda /path/to/DOS/disk1.img -nic user,model=rtl8139,ipv6=off -vga vmware -usb -device usb-tablet -device sb16
Breakdown of the above command:
qemu-system-i386 is the name of the QEMU emulator, obviously.
-cpu 486 specifies our CPU - in this case, the Intel 486. You can run
-cpu ? for a full list.
-m 16 sets the memory, in this case, 16 MB of RAM.
-hda win31.img is the hard drive.
-fda /path/to/DOS/disk1.img is adding a floppy drive, which needs to be changed to point to the first DOS floppy disk.
-nic user,model=rtl8139,ipv6=off adds a virtual NIC (in this case, the 10 mb/s Realtek 8139C+ Fast Ethernet card). We disable ipv6 since it won't work in 3.11.
-vga vmware adds an emulated VMWare SVGA card to the VM.
-usb adds a USB controller.
-device usb-tablet adds a USB tablet device. And finally,
-device sb16 adds a SoundBlaster 16 sound card to the system.
Once DOS is installed its recommended to install DOSIdle which will stop DOS from using all CPU when idle. To install it, download the linked file, start QEMU, press Ctrl-ALT-2 and type
change floppy0 /path/to/dosidle.img then press CTRL-ALT-1 to switch back. Load DOSIdle like so:
Next its time to install Windows 3.1. Insert the Windows 3.1 floppy in a similar manner to the DOSIdle floppy, by pressing Ctrl-Alt-2 (or going to the View -> compatmonitor0), typing
change floppy0 /path/to/WfW311-1.img, and pressing Ctrl-Alt-1 (or going to View -> VGA). With that, its time to load the setup:
If all goes well, you should see a screen like this:
Hit enter. Choose express setup. Change floppies as necessary, and fill out all the info (you don't need the Product Number). Skip installing the printer.
If you are installing Windows 3.1 without Workgroups/networking, you can skip these steps.
Eventually, you'll reach the "Network Setup" screen. Click on "Networks..." and make sure that "Install Microsoft Windows Network" is ticked.
Hit OK and then hit Continue. You'll then reach a screen like this:
Make sure "Unlisted or Updated Network Adapter" is selected, and click OK. Download the RTL8139 floppy disk driver, and insert it into QEMU (CTRL-ALT-2 ->
change floppy0 /path/to/rtl8139.img -> CTRL-ALT-1), set the path to "A:\", make sure "Realtek 8139 Fast Ethernet Adapter" comes up, and click OK.
You'll reach a window asking for the username, workgroup, etc. You can change the info or leave it as default, it doesn't matter too much. Finish off the rest of the install (you may have to insert the rtl8139.img floppy again a few times), skip the tutorial, and choose "Restart Computer". In the DOS prompt, type
WIN to start Windows. If all went well, you should be here:
This window above will set your password if its your first time logging in, so make sure its something you'll remember. You can just leave it blank if wanted. Next, we'll get TCP/IP working. Windows 3.11 didn't come with support for TCP/IP so we'll have to install it manually.
Download this floppy and save it somewhere. Insert it into QEMU (CTRL-ALT-2 ->
change floppy0 /path/to/tcpip.img -> CTRL-ALT-1). Go to Main -> Windows Setup (on the first bootup that should already be open) -> Options -> Change Network Settings
From here, click "Drivers..." and then click "Add Protocol...". Make sure "Unlisted or Updated Protocol" is selected, then hit OK. On the next window make sure "Microsoft TCP/IP-32 3.11b" is selected then hit OK.
If all goes well, it should install several applications, and TCP/IP should be ready to go. A configuration prompt will pop up. DHCP can be a bit finnicky, so if it doesn't work, you can try the following config:
- IP Address: 10.0.2.15
- Subnet Mask: 255.255.255.0
- Default Gateway: 10.0.2.2
Once this is all done, if everything worked as it should, you should have internet access!
The mouse setup is pretty simple. This step is optional.
Download the vmmouse floppy driver. Insert it into QEMU (CTRL-ALT-2 ->
change floppy0 /path/to/vmmouse.img -> CTRL-ALT-1). Go to Main -> Windows Setup -> Options -> Change System Settings. Click on the Mouse dropdown, and scroll down until you see "Other mouse (Requires disk from OEM)". Set the path to
A:\. You should see "VMware mouse" (even though we're on QEMU, the tablet device is backwards compatible with the VMware mouse). Select it and hit OK. Make sure its selected in the dropdown, hit OK, and restart Windows.
You should now have a smooth mouse!
Now we'll set up the generic SVGA driver which will allow for up to 256 colors. Download the SVGA floppy driver. Insert it into QEMU (CTRL-ALT-2 ->
change floppy0 /path/to/SVGA.img -> CTRL-ALT-1). Go to MS-DOS prompt, type
A:, and type
VGAPATCH P. This will patch the generic VGA driver to work with QEMU. Type
exit and go back to Windows. Go to Main -> Windows Setup -> Options -> Change System Settings, click on the "Display" dropdown, and scroll down until you see "Other display (requires disk from OEM)". Set the path to A: and select any resolution from ET4000 (not Super VGA!). You can go up to 1024x768 with 256 colors. I chose 800x600 with 256 colors.
Click OK, Click OK again, and restart Windows. If all went well, it should now work!
Sound Card setup
And finally, we'll set up the sound card. Fortunately, it's even easier than all the previous steps! Go to Main -> Control Panel -> Drivers -> Add... and scroll on the List of Drivers until you find Creative Labs Sound Blaster 1.5. Select it and hit OK.
Insert WfW 3.11 Disk 5 and hit OK. On the Sound Blaster Setup, choose Port 220 and Interrupt 5.
Ignore the warning, and restart Windows. If all goes well, you should hear the startup chime. You can double check by going to Control Panel -> Sound and testing one of the wav sounds.
That's it! We now have a full Windows 3.11 installation with networking, sound, a smooth mouse, and 4:3 256 color support! From here, you can install some abandonware, some games, or even just some old software your company still depends on for some reason. Enjoy.