Install DOSBox in Ubuntu to Play Retro Games

The DOSbox emulator lets you use the disk operating systems of the 80s. You can also use it to play retro games on Linux.
Warp Terminal

DOSBox is free and open-source software that allows you to emulate the MS-DOS operating systems from the previous century.

Why would you want that? For nostalgia as it allows you to play the 8-bit games that were popular in the 80s and 90s.

That includes legendary games like Mario, Contra, DOOM, etc.

Sounds good? Let me walk you through how you can install DOSBox on Ubuntu. I will also show how you can install and play retro games.

Dosbox is also available in other Linux distributions. Apart from the installation, the rest of the instructions should be valid for all distros.

โœ‹๐Ÿป
DOS was primarily command line based operating system. Using DOSbox requires using the terminal.

Installing DOSBox on Ubuntu

The DOSBox package is available in the universe repository. Which should already be enabled so DOSBox can be installed using the following command:

sudo apt install dosbox

Once done, start the DOSBox from the system menu.

Alternatively, you can use the terminal for the same:

dosbox

The first run is essential as it will create a configuration file for us. Actually, there is nothing to do on the first launch as it creates the configuration file.

So close the DOSBox by executing exit on the DOSBox terminal:

exit

If you want to tweak the configuration, the file is located at ~/.dosbox/dosbox-[version].conf.

Using this configuration, you can tweak almost everything, like entering full screen when you start DOSBox, changing cores, etc.

But enabling the full screen made things worse (for me) and had to log back in to get to the default:

full screen error on DOSBox

So know what you are doing or leave the config to default.

Install games on DOSBox

You can access hundreds of popular games from the software library of the internet archive.

Each game comes in its own zip file containing .exe file. Download the ones you like.

Next, create a new directory named dosbox inside your home directory and also make directories for the games you have downloaded:

mkdir ~/dosbox && cd ~/dosbox
mkdir [game_name]

I have downloaded Mario. You can name the directories anything. There is no rules here., It's for organizing games. That's it.

create a directory in linux

Now, extract the .zip file to the dosbox directory that you've just created:

extract file to the dosbox directory

You can do the same using the unzip command in the terminal if you want:

unzip ~/Downloads/MARIO.zip -d ~/dosbox/mario/

Once you are done, start DOSBox:

dosbox

Next, mount the game to the virtual C drive:

mount c ~/dosbox/mario
mount the game to the virtual C drive

Now, switch to the virtual C drive:

c:
switch to the virtual drive C

And finally, start the game by typing the filename of the game:

mario

And enjoy the game.

play mario on Ubuntu

Want more retro stuff?

If you have an old system or a Raspberry Pi that you are not using anymore, you can turn that machine into a retro gaming console. There are various Linux projects just for this purpose.

Linux Distros That Turn Your PC into Retro Gaming Console
Steam Deck is making news for all the right reasons. It is a fantastic piece of tech, powered by a variant of Arch Linux (SteamOS 3.0) developed by Valve. While you can install any other operating system in it, it is best to have it as it is for

And why stop at games? You can get the vintage computer terminals back as well.

Get a Vintage Linux Terminal with Cool Retro Terminal
Nostalgic about the past? Get a slice of the past by installing retro terminal appย cool-retro-term which, as the name suggests, is both cool and retro at the same. Do you remember the timeย when there were CRT monitors everywhere and the terminal screen used to flicker? You donโ€™t

I hope you will find this guide helpful. How do you game on Linux? Let me know in the comments.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! Youโ€™ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.