3 Ways You Can Run MS-DOS Games and Apps in Linux
Whatsapp Pinterest
Advertisement

MS-DOS (Microsoft Disk Operating System, often used interchangeably with “DOS”) is often linked with acute nostalgia. An old word processor, or maybe some DOS game that provided hours of pure, non-internet based entertainment. But what options do we have for igniting that old flame on Linux? Fortunately, quite a few!

FreeDOS

FreeDOS is a complete, free, DOS-compatible operating system. Any program that works on MS-DOS should also run on FreeDOS. Along with being completely free to download and use, it can also be shared for anyone to enjoy!

MS-DOS was last released in 1994 which was nearly a quarter of a century ago. The current version of FreeDOS was released in December 2016. This indicates that the team is still keeping the project up to date, for the greater benefit of the human race.

You will need to download FreeDOS for use in our first two methods.

1. VirtualBox

If your machine has some resources running spare Oracle’s VirtualBox is a great free bit of virtualization software How to Use VirtualBox: User's Guide How to Use VirtualBox: User's Guide With VirtualBox you can easily install and test multiple operating systems. We'll show you how to set up Windows 10 and Ubuntu Linux as a virtual machine. Read More . It allows installing virtual machines, DOS included, on your host computer. The only consideration being that your host’s resources will be shared with the virtualized machine, however, DOS is not going to be greedy.

You can download VirtualBox for your respective operating system and launch the installer through your GUI. If you prefer command line type:

sudo apt install virtualbox
sudo apt install virtualbox-guest-dkms

Creating a virtual machine How to Set Up a Windows Virtual Machine in Linux How to Set Up a Windows Virtual Machine in Linux Many home users prefer to run a dual-boot setup when both Windows and Linux are needed, but if you'd rather run Windows inside Linux, here's how to set that up. Read More is very straightforward. After launching VirtualBox click on New. Give your machine a Name and leave the RAM set to 512MB. Select Create a virtual hard disk now, and ensure VHD is selected under Hard disk file type. Leave the disk set to Dynamically allocated and give it a size (1GB or 2GB is ample).

Click Create to end the wizard and create your machine.

Next click on Settings > Storage > Controller: IDE > Empty. In the Attributes section, there is a CD icon with a drop-down arrow that will allow you to browse for your FreeDOS ISO that was just downloaded. Click the OK button to end the wizard.

Now click on Start from the VirtualBox home screen to launch the FreeDOS installer!

run ms-dos games apps on linux

Installing FreeDOS

Your install wizard should start, and through a series of easy selections, you can get FreeDOS installed. Select Install to hard disk, then accept the disclaimer followed by Partition drive C. Then like the old days we need to reboot for the partitions to take effect.

run ms-dos games apps on linux

After a quick reboot select Install to hard disk followed by your preferred language and accept the disclaimer again. Select the option to Erase and format the drive, and finally the actual install can begin.

run ms-dos games apps on linux

Once you’ve chosen your keyboard layout, select Full Installation followed by Yes – please install FreeDOS. Definitely one of the more polite install wizards. Your install should now commence.

After the install completes you need to remove the ISO from the virtual machine so that the machine boots directly into FreeDOS. From the same screen, we mounted the ISO above; you can unmount it before clicking reboot in the install wizard.

run ms-dos games apps on linux

If you did all the above correctly, which I’m sure you did, the screen you’re now presented with should be a familiar site.

Transferring Files for Virtualbox

Before transferring files to your virtual machine, make sure to shut it down completely and for good measure, quit Virtualbox while you’re at it. The DOS shutdown command, in case you may have forgotten is in fact, shutdown.

FreeDOS’s method of mounting a drive didn’t seem to be too consistent. This was using libguesftfs-tools. The workaround was using the qemu-nbd command. To install this run the following in a terminal:

sudo apt install qemu

This installs QEMU along with its tools. Now run the following commands:

sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 <vhd-file>

By default, your VirtualBox directory should be in your home folder. Replace <vhd-file> in the command above with the path to your virtual machine. Now run the following command to mount the device:

sudo mount /dev/nbd0p1 /Path-of-your-choice

Now copy your favorite programs and files to your virtual machine. Once completed, unmount the virtual machine by running:

sudo umount /Path-of-your-choice
sudo qemu-nbd -d /dev/nbd0

2. Quick EMUlator (QEMU)

Similar to Virtualbox, QEMU is an open source hypervisor 3 Ways to Run a Virtual Machine on Linux 3 Ways to Run a Virtual Machine on Linux If you want to run a second operating system on your Linux machine without rebooting to switch between them, a virtual machine is your only answer. Read More that can run FreeDOS as a guest operating system. The steps are quite similar to the above method, however, it can be accomplished in just a few terminal commands. First, install QEMU by running:

sudo apt install qemu

Now we need to create a virtual hard drive to install FreeDOS. We can do this by typing:

qemu-img create dos.img 500M

Now we create our virtual machine in a single swoop by running:

qemu-system-i386 -cdrom FD12CD.iso -m 32 -hda dos.img -k en-us -rtc base=localtime -soundhw sb16,adlib -device cirrus-vga -boot order=d

There are quite a few parameters in the command. You’re basically:

  • Selecting the FreeDOS ISO
  • Setting the RAM size
  • Selecting the virtual drive we created above
  • Setting a keyboard layout
  • Ensuring the time matches the host
  • Choosing a common sound card
  • Choosing a common graphics card
  • Setting the boot order

FreeDOS should open in a new window and the install wizard in exactly the same way as the Virtualbox method above. After the install completes, we don’t require the ISO any longer and can boot directly into our installed image by running:

qemu-system-i386 -m 32 -hda dos.img -k en-us -rtc base=localtime -soundhw sb16,adlib -device cirrus-vga -boot order=c

run ms-dos games apps on linux

Transferring Files for QEMU

Fortunately, this part is much simpler. All we need to do is create a folder and include that folder in our command we use to launch our QEMU FreeDOS machine. First close your QEMU window then type:

mkdir dosfiles

Now copy any files or folders you’d like to see in your virtual machine into the dosfiles folder. When you’re done, type:

qemu-system-i386 -m 16 -k en-us -rtc base=localtime -soundhw sb16,adlib -device cirrus-vga -display gtk -hda dos.img -drive file=fat:rw:dosfiles/ -boot order=c

As you can see the new part of the command is the -drive parameter which uses the dosfiles folder we created. It will also mount it to the next drive letter available, which is in our case D. If you’d like to see your dosfiles folder inside FreeDOS simply type:

D:

Once again, DOS away to your heart’s content!

3. DOSBox

If all of this seems like a little overkill and you just want to run the odd game, and you’re more of a GUI person, then you could get DOSBox How to Play Retro Games on Any Platform With DOSBox How to Play Retro Games on Any Platform With DOSBox Want to play retro PC games on your computer, phone, or game console? Here's everything you need to know to get started with DOSBox, including the best games to emulate! Read More . By their own admission, DOSBox’s developers state: “DOSBox also comes with its own DOS-like command prompt. It is still quite rudimentary and lacks many of the features found in MS-DOS, but it is sufficient for installing and running most DOS games.”

So much of their emphasis has been placed on games, and if that’s all you require DOSBox may be enough. Before we begin, create a folder on your Linux machine and move your DOS programs in there. Our example uses /dosbox/dosfiles.

run ms-dos games apps on linux

Now go to the Ubuntu Software and download the DOSBox emulator. Once you launch DOSBox you can mount the folder you just created above by typing the following in the DOSBox console:

mount c ~/dosbox/dosfiles
C:

All your files should now be visible, your games playable, and the nostalgia kicking in!

run ms-dos games apps on linux

You Can Still Run DOS!

Whether you like it or not, MS-DOS has been a huge part of the computing world. Many of the games we know and love stemmed from the MS-DOS glory days. You may be surprised to know that many companies still use MS-DOS programs to run their entire businesses. The good news is that Linux offers many options for making MS-DOS happen as we’ve demonstrated.

Don’t be limited to MS-DOS, either. Other classic operating systems can be installed or emulated on Linux 5 Retro Operating Systems You Can Revisit with Ease on Linux 5 Retro Operating Systems You Can Revisit with Ease on Linux You probably already know you can play old games on your Linux device, thanks to emulator collections like MAME, but did you know that various emulators are available for running full applications? Here's how. Read More .

What are your favorite DOS games? How do you run DOS on Linux? Do you think we’ll ever be rid of DOS? Let us know in the comments below!

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Gazoo
    January 30, 2018 at 10:20 pm

    I should also mention that dosemu appears to be making a comeback on github (stsp/dosemu2) with the last commit on 22jan18. I haven't tested this yet (I still have the very old, original, version). There's still lots of work to be done but it'll be interesting how this fairs in the future.

  2. Gazoo
    January 30, 2018 at 10:12 pm

    Great run-down on getting DOS/FreeDOS running within Linux. Like most people who still work/play with DOS, my goto is DOSBox.

    The QEMU method sounds interesting. It's the only method I haven't tackled yet. Thanks for the write-up on this as QEMU looks difficult to setup for the uninitiated. Curious to see it's performance vs using VirtualBox.

    • Eric Nicholls
      February 6, 2018 at 2:43 am

      Isn't dos box better.