DOS Days

Virtualising DOS - Part 1

29th January 2023

I personally enjoy the challenges and rewards of putting together old hardware and using it almost daily to run games and programs, but I also recognise that's not for everyone. Over the past 20 years there have been huge leaps forward in bringing DOS support to the modern PC and other systems.

Creating an environment where multiple software-based operating systems can run simultaneously on a single modern operating system is referred to as 'virtualisation', since it provides 'virtual' machines of those OS's on a single physical computer. This is how most servers around the world operate, with enough power to be able to share the physical resources of a single computer across many virtual machines. The advantages of such an environment are many, such as economies of scale (less physical hardware needed), easier backup/restore capabilities, portability, reduced use of energy, etc.

In the case of DOS, these are sometimes called VDMs, or Virtual DOS Machines.

There are numerous tools available today that virtualise a DOS environment. I will cover three of them in this article, which are:

  • DOSBox
  • vDOS / vDosPlus
  • VirtualBox

Later I plan to explore the pros and cons of each, and provide some guidance on how to get DOS up and running for each, but for now here's a summary.

DOSBox

Many of you will be familiar with DOSBox, but I will assume you are not in order to provide complete coverage. Its development began way back in around 2000. At that time, the Windows operating systems had moved completely away from residing over the top of DOS, and so lost "true" 100% DOS compatibility. the last operating system to run on top of DOS was Windows 98, though Windows XP had pretty strong DOS emulation. Any Windows version more modern than XP still provides you access to a command window, but this is basic emulation at best, and cannot be relied upon to run any original DOS software.

The DOSBox project is open source and will compile on numerous modern operating systems including Windows, Mac OS/X, and Linux (Fedora, Debian, FreeBSD, and Gentoo). In addition there are versions compiled that run on RISC OS, OS/2, and BeOS. The DOSBox community have also developed front ends that provide easier access to executing your list of favourite programs and games.

While the DOSBox project did not start out with a focus on gaming, the more recent versions do, and now support the vast majority of games titles that were released during the DOS era (the latest version as of writing this article is version 0.74-3 which is fully-compatible with 91% of games).

The basic version does not support long filenames, but arguably this is a good thing, as it retains better compatibility with DOS of old with its 8.3 filenames. Iif that is something you need, you can get versions that support it. Because DOSBox does not actually run a real version of DOS, such as Microsoft MS-DOS, IBM PC-DOS or Digital Research DR-DOS, you do not require a licence for the originating OS. The downside is that you will not find any external DOS commands present in the DOSBox shell, and only the bare minimum of internal DOS commands to handle directories. There is no built-in text editor like the DOS EDIT tool, and no DEBUG or MORE commands either. The premise behind using DOSBox is to give you enough of a command interface to execute programs and little else.

But what it does, almost uniquely, is provide an excellent level of compatibility with the most common peripherals and expansion cards used during the 1980s and 1990s, with an emphasis on emulating all the hardware expected to be seen by DOS games. This includes:

  • Core emulation: 8088/8086, 80286 and 80386 instructions, DMA channels, interrupts and timers.
  • Sound card support: Tandy/PCjr, Disney/Covox, Ad Lib, Sound Blaster, Sound Blaster Pro, Sound Blaster 16, Gravis UltraSound, and an MPU-401 interface for connection to external General MIDI synthesizers.
  • Video support: Hercules, Tandy/PCjr, CGA, EGA, VGA, SVGA, VESA VBE 2.0 on various chipsets.
  • Up to two joysticks, with 4-axis support, specific compatibility for Thrustmaster FCS.
  • Memory: XMS, EMS, and UMBs.
  • Networking: IPX/SPX.
  • Media: Mount any local directory, USB drive, optical media, floppy drive, etc and have it visible to DOSBox.

Other benefits provided with DOSBox are its ability to adjust the CPU cycles on-the-fly. Most games will be automatically tuned correctly, but if not you can adjust manually to get things 'just right'. Another plus point is its ability to take screenshots and record video of the DOS window, and being able to scale the DOSBox window to your liking.

DOSBox is also able to run those early versions of Windows, up to and including Windows 98, which is a testament to its stability and overall emulation coverage of the physical hardware that these versions ran on.

vDosPlus (aka vDOS-lfn and vDOS)

vDosPlus (formerly vDos-lfn) is derived from vDos, created by Jos Schaars, which in turn was derived from DOSBox. vDosPlus adds long filename support, enhanced keyboard and mouse support, and visual display for bold and italic text. The folks behind vDosPlus explicitly state that it is NOT for gaming - it's essentially DOSBox but geared toward applications instead of games.

vDosPlus comes with built-in support for multiple monitors as well as XMS and EMS memory capabilities. It is highly configurable both visually and in terms of what a typical application will 'see' - the reported DOS version can be changed, for instance. It has the excellent 4DOS DOS extender automatically built-in which has been around since the DOS days and provides an additional set of useful tools at the command-line.

The text window of vDosPlus is fully scalable both in a window and full-screen through the use of TrueType fonts. One of the best features of vDosPlus are its ability to interact with the host operating system and make use of modern Windows-only printers, including printing to a PDF file. With 4DOS's capabilities to copy and paste to its own 'clipboard', you can also paste its contents to the host operating systems' clipboard for easy transferring of text between the virtual machine and your local environment.

At the time of this article, there are several 'forks' of the vDosPlus source code being actively maintained. The 2015.11.01 branch and the 2016.10.01 branch that are based on the vDos versions of the same. There are pros and cons to both of these, hence why they are maintained separately. The latest updates to vDosPlus are based on vDos 2017.08.01 which added, among other things, FPU (math coprocessor) support.

VirtualBox

VirtualBox by Oracle Corporation is much more than a VDM. It's a complete virtualisation platform, able to run more than 65 different "guest" operating systems, including Windows 10. So running a flavour of DOS is seemingly childs play by comparison.

DOS of course, is not really much of a priority for such a broad and powerful system, but it does work. If you do not have a licence for MS-DOS or other flavours, I recommend you use FreeDOS, which as the name implies, is free to download and use.

The FreeDOS project was started in 1994, founded by Jim Hall. An open source project, it is essentially a 100% free DOS-compatible operating system. There are VirtualBox images of a FreeDOS VDM available here: FreeDOS Virtual Machine Images for VirtualBox and VMware (osboxes.org).

At the time of this article, VirtualBox 7.0.6 is the latest version. The binaries are released under the terms of the GPL version 3. With VirtualBox, typically the entire virtual guest operating system is stored within a single file, called a .VDI file (VirtualBox Drive Image). You can very quickly create a new Virtual Machine, select that it's a DOS machine, add a virtual hard disk to the machine (point it to a .VDI file), and that's really all there is to the most basic setup needed.

Summary

So to summarise this initial look at virtualising DOS, each of the three options approach the creation and use of a DOS environment rather differently, and each has its place depending upon your typical use case. In its simplest form, the recommended choice is as follows:-

If you are looking to quickly get up and running to play DOS games, use DOSBox. If you are wanting to use DOS applications and have connectivity between them and your modern Windows environment to print, copy/paste, etc., then vDosPlus is the one to go for. For a general-purpose true Virtual Machine use that will have elements of both the above but may lack specific functionality you need, choose VirtualBox.

Head over to Part 2, where I take this a step further and actually run some tests on all three to see just how well they fare under specific use cases. This will hopefully uncover the strengths and weaknesses of each, and provide you with better guidance on what to choose.