J. R. Swab's Blog

How to Play Dwarf Fortress in the Terminal

Categories: Technology
Tags: open-source apps linux dwarf fortress ssh

The following instructions are for Arch Linux without Xorg (so essentially terminal only arch or what you get after a fresh Arch Linux install). If you are using Ubuntu server or another distro, the steps should be close to the same. But not exact so please do your research. You may get lucky and just have to edit the config file.

  1. Enable multi-lib for pacman: sudo vim /etc/pacman.conf
  2. Search for the following and remove the # symbols. I was missing SigLevel in my conf so if you are also missing just add it in the correct spot as shown.
    [multilib]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
  3. Save and exit
  4. Run: sudo pacman -Syyu
  5. Install from your Arch mirrors: sudo pacman -S dwarffortress
  6. Add your user account to a "games" group: gpasswd -a [user] games.
    1. This gives you the config files in your home directory
    2. So you do not have to edit the defaults as root/sudo.
  7. Log out and log back into your server.
  8. Edit your Dwarf Fortress config: vim .dwarffortress/data/init/init.txt
  9. Change [SOUND:YES] to [SOUND:NO]
  10. Change [PRINT_MODE:2D] to [PRINT_MODE:TEXT]
  11. Install sudo pacman -S xorg-server-xvfb
    1. This will act as your virtual X server.
    2. Dwarf Fortress basically gets tricked into thinking you have a GUI installed.
  12. Setup the virtual X server: Xvfb :1 -screen 0 1024x768x16 &
    1. Pick whatever resolution you want
    2. Dwarf Fortress will out scale as you resize your terminal anyway.
  13. Point your display variable to the virtual X server: export DISPLAY=:1

That's it!

Now you can log in over SSH and play Dwarf Fortress in your terminal! Keep in mind you may have to export the display before each new run if you are using tmux or screen.

To run Dwarf Fortress on Arch type: dwarffortress

Happy Fort'n!


Ways to support the blog.

« Previous Post