在 Ubuntu 中安装 DOSBox 来玩复古游戏
DOSBox 游戏
![](/data/attachment/album/202303/12/091038c81kxkmhdonj1mkm.jpg)


DOSBox 是一款自由开源的软件，它可以让你模拟上个世纪的 MS-DOS 操作系统。


你为什么要这么做呢？因为怀旧：它可以让你游玩在 80 年代和 90 年代流行的 8 位游戏。


这其中包含了马里奥、魂斗罗、DOOM 等传奇游戏。


听起来不错吧？让我介绍一下如何在 Ubuntu 中安装 DOSBox。我还会向你展示如何在 DOSBox 中安装并游玩复古游戏。


DOSBox 也可以在其他 Linux 发行版中使用。除了安装部分，其余的指令应该对所有发行版都有效。



> 
> ✋? DOS 是一个主要基于命令行的操作系统。使用 DOSbox 需要使用终端。
> 
> 
> 


### 在 Ubuntu 中安装 DOSBox


DOSBox 包可以在 [Universe 软件仓库](https://itsfoss.com/ubuntu-repositories/) 中找到。这个仓库应该已经被启用了，所以可以使用下面的命令来安装 DOSBox：



```
sudo apt install dosbox

```

完成之后，从系统菜单中启动 DOSBox。


或者，你也可以使用终端来启动 DOSBox：



```
dosbox

```

**需要首先运行一次，因为它会为我们创建一个配置文件。实际上，第一次启动时不需要做任何事情，因为它会创建配置文件。**


然后在 DOSBox 终端中执行 `exit` 命令来关闭 DOSBox：



```
exit

```

![](/data/attachment/album/202303/12/091139e3nqeielnln6h5i6.png)


如果你想要调整配置，配置文件位于 `~/.dosbox/dosbox-[版本].conf`。


在这个配置文件中，你可以调整几乎所有的东西，比如在启动 DOSBox 时进入全屏模式，更改核心等等。


但是（对我来说）启用全屏模式会使事情变得更糟，并且必须重新登录才能进入默认模式：


![DOSBox 全屏模式错误](/data/attachment/album/202303/12/091139eplw6nb6mpb6hlhu.png)


**所以，除非你知道你在做什么，否则不要修改配置。**


### 在 DOSBox 中安装游戏


你可以从互联网档案馆的软件库中访问数百款流行游戏。



> 
> **[从互联网档案馆下载游戏](https://archive.org/details/softwarelibrary_msdos_games?tab=collection&ref=its-foss)**
> 
> 
> 


每款游戏都有自己的 zip 文件，其中包含 .exe 文件。下载你喜欢的游戏。


然后，在你的主目录中[创建一个新目录](https://itsfoss.com/make-directories/)，命名为 `dosbox`，并为你下载的游戏创建目录：



```
mkdir ~/dosbox && cd ~/dosbox
mkdir [游戏名称]

```

我下载了马里奥。你可以给目录起任何名字。这里没什么要求，只是为了管理游戏而已。


![在 Linux 中创建目录](/data/attachment/album/202303/12/091140opwph5j6wwkddd50.png)


然后，将 `.zip` 文件解压到你刚刚创建的 `dosbox` 目录中：


![解压文件到 dosbox 目录](/data/attachment/album/202303/12/091140k2nzxrbq6qjd2cv6.png)


如果你想的话，你也可以在终端中 [使用 unzip 命令](https://learnubuntu.com/unzip-file/?ref=its-foss) 来做同样的事情：



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

```

当你完成之后，启动 DOSBox：



```
dosbox

```

然后，将游戏挂载到虚拟 C 驱动器上：



```
mount c ~/dosbox/mario

```

![将游戏挂载到虚拟 C 驱动器上](/data/attachment/album/202303/12/091141c7877b88a88lf88l.png)


然后，切换到虚拟 C 驱动器：



```
c:

```

![切换到虚拟 C 驱动器](/data/attachment/album/202303/12/091141mm566mg5cnrhwrmr.png)


最后，通过输入游戏的文件名来启动游戏：



```
mario

```

然后，享受游戏吧。


![在 Ubuntu 中玩马里奥](/data/attachment/album/202303/12/091141rdpdyu8ti5tpx5d5.gif)


### 想要更多复古的东西？


如果你有不再使用的旧电脑或者树莓派，你可以把它们变成复古游戏机。有很多 Linux 项目就是为了这个目的而存在的。



> 
> **[把你的电脑变成复古游戏机的 Linux 发行版](https://itsfoss.com/retro-gaming-console-linux-distros/)**
> 
> 
> 


为什么只玩游戏呢？你也可以把复古的计算机终端带回来。



> 
> **[用 Cool Retro Terminal 获得一个复古的 Linux 终端](https://itsfoss.com/cool-retro-term/)**
> 
> 
> 


希望该指南对你有所帮助。你是如何在 Linux 上玩游戏的？在评论中告诉我吧。




---


via: <https://itsfoss.com/ubuntu-dosbox/>


作者：[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题：[lkxed](https://github.com/lkxed/) 译者：[Cubik65536](https://github.com/Cubik65536) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

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.**

## Installing DOSBox on Ubuntu

The DOSBox package is available in [the universe repository](https://itsfoss.com/ubuntu-repositories/). 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`


![](https://itsfoss.com/content/images/2023/02/run-DOSBox-on-ubuntu.png)

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](https://itsfoss.com/content/images/2023/02/full-screen-error-on-DOSBox.png)

**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](https://itsfoss.com/make-directories/) 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](https://itsfoss.com/content/images/2023/02/create-a-directory-in-linux--1.png)

Now, extract the `.zip`

file to the `dosbox`

directory that you've just created:

![extract file to the dosbox directory](https://itsfoss.com/content/images/2023/02/extract-file-to-the-dosbox-directory-1.png)

You can do the same [using the unzip command](https://learnubuntu.com/unzip-file/) 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](https://itsfoss.com/content/images/2023/02/mount-the-game-to-the-virtual-C-drive.png)

Now, switch to the virtual C drive:

`c:`


![switch to the virtual drive C](https://itsfoss.com/content/images/2023/02/switch-to-the-virtual-drive-C.png)

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

`mario`


And enjoy the game.

![play mario on Ubuntu](https://itsfoss.com/content/images/2023/02/play-mario-on-Linux.gif)

## 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 ConsoleSteam 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](https://itsfoss.com/retro-gaming-console-linux-distros/)![](https://itsfoss.com/content/images/wordpress/2022/06/linux-distros-for-retro-gaming-console.jpg)


![](https://itsfoss.com/content/images/wordpress/2022/06/linux-distros-for-retro-gaming-console.jpg)

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

[Get a Vintage Linux Terminal with Cool Retro TerminalNostalgic 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](https://itsfoss.com/cool-retro-term/)![](https://itsfoss.com/content/images/wordpress/2015/10/Retro-Terminal-Linux.jpeg)


![](https://itsfoss.com/content/images/wordpress/2015/10/Retro-Terminal-Linux.jpeg)

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