How to Install DOSBox for Linux to Play Old DOS Games

Dosbox Feature Shot

If you own copies of old DOS games like DOOM, you can still play these retro games on your PC with the help of an emulator. DOSBox is the best DOS emulator around. Most guides for DOSBox focus simply on installing the application and providing a couple of commands to get you going. However, this is likely to scare off new users, and there’s a nasty surprise awaiting DOS veterans as well.

This guide will not only cover how to install DOSBox for Linux but also how to automatically mount your C: drive. And for the newbies out there scared of DOS commands, it also lays out a recommendation for a classic piece of software to help you along!

Also read: How to Install and Play Old DOS Games in Windows

Installation of DOSBox for Linux

Installing DOSBox is easy as it’s in the repositories of almost every distribution and should be accessible under any package manager. If you prefer to install by command line:

# For Debian/Ubuntu-based systems:
sudo apt install dosbox
# For Fedora/RHEL/CentOS systems:
sudo dnf install dosbox
# For Arch-based systems:
sudo pacman -S dosbox

Once installed, the program should be in your system menu or can be started by entering:

dosbox

Usage of DOSBox for Linux

Once inside DOSBox, it’s easy to feel lost. Rather than launching with a prompt at “C:”, DOSBox starts its prompt at Z: (DOSBox’s internal virtual drive) with a recommendation on how to mount a new C: drive manually. This will scare off new computer users as well as annoy DOS veterans who just want a prompt at C: ready and waiting. To get around this, you need to edit DOSBox’s startup files.

Dosbox Mount Command

On a normal DOS installation this would just involve editing “autoexec.bat” on the root of your C: drive. However, DOSBox uses a local configuration file in a sub-directory of your home folder to organize its commands.

To access this file, first enable hidden files and folders in your file manager, then open the “.dosbox” directory in your home folder. This is presuming you have run DOSBox at least once. If not, run it and close it. There should be a file called “dosbox-0.74.conf.” (Your version number may differ.)

It’s worth scrolling through this text file to see all the available options for any future tweaking, but for now we’re only interested in the [autoexec] section at the end. As the comments will note, this is for any commands you want running automatically at startup. Any sane person will put their mount commands here. For now this area is blank, but you will enter new lines here in the steps to follow.

These steps presume anything you want on your C: drive will be stored in a directory called “dosbox” directly in your home folder. If you don’t already have such a directory, create it now and copy into it any DOS software you want to run. With the DOSBox configuration file, enter these two new lines under the [autoexec] section:

mount c ~/dosbox
c:
Dosbox Commands 1

Save the file. When you open DOSBox now it will automatically open at C:, ready to access everything in your dosbox folder.

DOS Basics for the Unafraid

Change directory:

cd wolf3d

Go back a directory:

cd ..

Browse a directory and view long file lists page by page:

dir /p

Start an executable program by entering the name of the file; the extension isn’t necessary. For instance, wolf3d.exe just needs:

wolf3d

But I Just Want To Play Games, Not Learn DOS!

Although it’s worth learning some basic DOS commands, it’s not strictly necessary. There was an enormous selection of software designed to create a friendly interface for anyone who didn’t want to learn how to use a DOS terminal. My personal recommendation would be The Norton Commander: an all time classic file manager that popularized twin-pane file browsing. It spawned a countless number of imitation projects, including Midnight Commander on Linux.

Dosbox Norton Commander

Use the arrow keys to browse through files, pressing Enter on any file you want to launch or directory you want to enter. To change between the two panes, press Tab. The function keys perform tasks like copying, renaming, deleting, and so on. Sadly, Norton Commander is an abandonware. There is no official link, but you should still be able to find it with Google search.

Assuming you have Norton Commander under the “NC” directory in your dosbox folder, you can start it with the commands:

cd nc
nc

Or to be more precise:

c:\nc\nc.exe

To make Norton Commander run automatically at startup, you can add this command to the [autoexec] section of the DOSBox config file so that it now looks like this:

mount c ~/dosbox
c:
c:\nc\nc.exe
Dosbox Commands 2

You should now be able to run DOS games with ease and just copy any new games into your dosbox folder at will. If you would like to know more about DOS commands or where to find software, check out our excellent guide on DOSBox for Mac.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

John Knight

John Knight is a writer, most notably for Linux Format (UK), Linux Journal (US), and Maximum PC (US). Outside of open source and general computing material, John has also written for automotive publications, and is currently writing material on vintage gaming and drumming. Other areas of interest include Psychology, French, and Japanese.