The video “The First Self Hosted Game” shows how to install the github vintage computing repository. This installs several programs. However, I focus on the program Zork, AKA Dungeon to show an example of one of the first ever text based adventure programs.
Read about the vintage computing Github repository here:
https://github.com/jgoerzen/vintage-computing
Zork was written in 1980 and originally coded for the Digital Equipment Corporation PDP-10/11 computers and later converted to Fortran 77.
In my example, I create a LXD image for the application. A virtual machine would also work just as well. On my channel, I have several videos discussing LXD containers and lxc command options and networking.
Here is how I created my container. Note that I used a custom image and a custom profile which may not exist on your system unless you have followed my LXD series:
lxc launch Ubuntu-20.04 zork --profile default --profile vlan80 -c boot.autostart=true
I connect to the container and create a user account and grant it sudo privilege:
lxc exec zork bash
adduser scott
chmod -aG sudo scott
su - scott
Now install “git” and clone the github repository to the local machine:
sudo apt install git
git clone https://github.com/jgoerzen/vintage-computing
Move into the new folder and execute the setup:
cd vintage-computing/setup
sudo ./setup.sh
After installation, set the ownership of the files to the user and move back to the home folder:
sudo chown -R "`id -u`:`id -g`" /opt/vint
cd ~
Create a script to run the program:
nano zork.sh
Insert the following data into script and save it:
#!/bin/bash
# trap control-c
trap ctrl_c INT
function ctrl_c() {
echo "** Goodbye"
exit
}
cd ~/vintage-computing
vint zork-glk
exit
Set the execute bit on the script:
chmod +x zork.sh
Edit the .bashrc environment file for terminal sessions:
nano .bashrc
Go to the end of the file and add the following line:
source ./zork.sh && exit
Now, if you ssh to your server instance, Zork will run. If you exit normally or attempt to CTRL C, you will be logged out of the server.
I took this a step further by creating an entry in my Apache Guacamole to connect to my Zork instance. This allowed the terminal based program to be HTML5 hosted in a web page. Watch my Apache Guacamole tutorial to learn how to self host Apache Guacamole.