# How to play Dwarf Fortress on OpenBSD?
2024-09-18T15:48:00Z

Sort of...

## TL;DR

Run a linux distro under vmd, then "ssh -Y" to if and play dwarf fortress.

## What is Dwarf Fortress ?

It's an incredible game where you control a dwarves outpost. The world is randomly generated and incredibly deep.
=> https://www.bay12games.com/dwarves/features.html

Well, you already knew this ;)

## How to install Debian in vmd?

Since that's what I know the best, I choosed to run Debian with vmd.
=> https://www.debian.org/

```
sysctl net.inet.ip.forwarding=1
rcctl enable vmd
rcctl start vmd
vmctl create -s 20G debian.qcow2
vmctl start -c -m 1G -L -i 1 -r debian.iso -d debian.qcow2 debian 
```

Before loading the installer, you must setup a few things to get the console.
Press TAB, then enter:

```
/install.amd/vmlinuz vga=off initrd=/install.amd/initrd.gz --- quiet console=ttyS0,115200n8 
```

A few things may be set in your /etc/pf.conf. Here is mine, it use my local unwind for DNS resolution:

```
set skip on lo
antispoof for egress
block

### Required to install debian with network access
pass on tap0
match out on egress from tap0:network to any nat-to (egress)
pass in proto { tcp udp } from tap0:network to any port domain \
    rdr-to localhost port domain
###

pass in proto icmp
pass in proto icmp6
pass out
```

## How to install Dwarf Fortress?

On your debian fresh, install, add a few things:

```
apt install libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 libgtk2.0-0 libopenal1 libsndfile1 libncursesw5
apt install xserver-xorg
apt install openssh-server
```

Now you may log on your VM using ssh : 

```
ssh dwarf@100.64.1.3
```

Check your ip with "ip a" on the console if necessary.

Then, get dwarf fortress:

```
wget https://www.bay12games.com/dwarves/df_50_13_linux.tar.bz2
tar xjvf df*.tar.bz2
```

## Run Dwarf Fortress

Use ssh "-Y" flag:

```
ssh -Y dwarf@100.64.1.3 "./run_df"
```

I won't lie, it's kinda slow.
But it works \o/.

=> https://0x0.st/X3_l.png

## Conclusion

Actually Dwarf Fortress isn't really running on OpenBSD, but I find this trick handy if one day I miss a software ony running on Linux.

---
Comments?
=> mailto:bla@bla.si3t.ch?subject=how-to-play-dwarffortress-on-openbsd
=> /log/_commentaires_.txt