How To Play Games on Linux using DOSBox

What is DOSBox?

From the DOSBox wiki:

DOSBox emulates an Intel x86 PC, complete with soundgraphicsmousejoystickmodem, etc., necessary for running many old MS-DOS games that simply cannot be run on modern PCs and operating systems, such as Microsoft Windows XP, Windows Vista, Linux and FreeBSD. However, it is not restricted to running only games. In theory, any MS-DOS or PC-DOS (referred to commonly as "DOS") application should run in DOSBox, but the emphasis has been on getting DOS games to run smoothly, which means that communication, networking and printer support are still in early development.
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.
DOSBox has a lively, user-supported community forum hosted at VOGONS (Very Old Games On New Systems). Feel very very free to drop by if you have questions about DOSBox!

Installing DOSBox

Use your favourity package manager to install DOSBox and its dependencies. For instance, on Debian:

pallando:/home/andrew# apt-get install dosbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
The following NEW packages will be installed:
  dosbox libsdl-sound1.2
0 upgraded, 2 newly installed, 0 to remove and 41 not upgraded.
Need to get 0B/761kB of archives.
After this operation, 2261kB of additional disk space will be used.
Do you want to continue [Y/n]? 
Selecting previously deselected package libsdl-sound1.2.
(Reading database ... 125324 files and directories currently installed.)
Unpacking libsdl-sound1.2 (from .../libsdl-sound1.2_1.0.3-2_i386.deb) ...
Selecting previously deselected package dosbox.
Unpacking dosbox (from .../dosbox_0.72-1.1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for menu ...
Setting up libsdl-sound1.2 (1.0.3-2) ...
Setting up dosbox (0.72-1.1) ...
Processing triggers for menu ...

Make the DOSBox window bigger

DOSBox should work right away. You can start the DOSBox emulator using the dosbox command. But the window will be very small. I like to make the window bigger by modifying the config file. Here's how to make the window bigger.

Copy the example config file to your user directory and uncompress it:

andrew@pallando:~$ cp /usr/share/doc/dosbox/dosbox.conf.example.gz .dosboxrc.gz
andrew@pallando:~$ gzip -d .dosboxrc.gz 

Now you can edit your .dosboxrc file in your favourite text editor. There are three lines which you need to change:


I changed these lines to:


Download Some Games

Maybe you still have a bunch of old CD or floppies. Odds are you lost them over the years. With a little help from google you can download many old DOS games. Here are a few links to get you started:

Ultima IV Master of Orion Warcraft 2

Unzip, Mount and Play!

Typically the game will be downloaded as a zip file. So first unzip the file

cd andrew@pallando:~/Downloads$ unzip

Then start dosbox. Within dosbox, mount the Warcraft 2 directory as c: using this command in the dosbox window (change the path to the correct path for your Warcraft 2 directory):

mount c: “/home/andrew/Downloads/Warcraft 2”

Then change to the C: drive in dosbox (c:) and start warcraft (war2.exe)

Useful Way to Automount the Current Directory

Here's a useful addition to the .dosboxrc file which will automount the current directory when you start dosbox. Open .dosboxrc in your favourite text editor. Go to the bottom of the file. The last section in the config file should start with the [autoexec] title. Here is my [autoexec] section:

# Lines in this section will be run at startup.
@echo off
mount c: "."

The @echo off command tells dosbox not to show these commands on the screen. The mount c: “.” command tells dosbox to mount the current directory as c:. The path command adds the c:\bin directory to the path. So for instance, after I download and unzip warcraft I cd into the Warcraft 2 directory, then use the dosbox command and Warcraft 2 is automatically mounted as my C: drive in dosbox. If I run dosbox from my master-of-orion directory, then master of orion is automatically my C: drive, etc.

I hope you enjoy some great old games!

AGH, Dec 2010