LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Hey raindog308, That TK5 Article Didn't Work on Debian! (Here's the Fix)

MVS 3.8j TK5A few days ago I posted about the release of TK5, which is the “turnkey” mainframe operating system you can run at home on your Linux or other system.

Interested in vintage operating systems?  Check our other posts:

However, I learned that the “turnkey” OS isn’t as “turnkey” as people like.  Specifically, it doesn’t work on Debian 12.

Actually, it does, but it needs some help.

The core issue is the Hercules emulator.  Hercules is a free emulator that models IBM mainframe operating system hardware.  It can emulate IBM’s mainframe hardware, and virtually plug in tape drives, punch cards, disk and other peripherals.

The previous TK4 was built for Hercules 3, which was very long in the tooth.  Eventually, Hercules fell into disrepair and the v3 edition stretched on for a long time until someone picked up the reins and decided to make a Herc 4.  Tk5 requires Hercules 4.

Unfortunately, your Debian 12 comes with Hercules 3 (assuming you apt install it), which won’t work.  Also, the bundled version of Hercules 4 with TK5 won’t work on Debian, due to either the way it’s compiled or some shared library issue I couldn’t track down.

The Solution

The answer is simple: build and install your own Hercules 4.

First, make sure you have various required packages:

apt-get -y install git wget time build-essential cmake flex gawk \
m4 autoconf automake libtool-bin libltdl-dev libbz2-dev zlib1g-dev \
libcap2-bin libregina3-dev

Now clone Hercules 4 (“Hyperion”) into some place suitable.

cd /usr/local/src
git clone https://github.com/SDL-Hercules-390/hyperion.git
cd hyperion/

Then, just configure and make

./configure
make
make install

Extract the TK5 distro into someplace.  I just put it off root, where it lives as /mvs-tk5

Edit /mvs-tk5/mvs_ipl and modify these lines:

linux)
   force_arch=
#   export PATH=hercules/$system/$arch/bin:$PATH
#   export LD_LIBRARY_PATH=hercules/$system/$arch/lib:hercules/$system/$arch/lib/hercules:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Now you should be able to run ‘mvs’ without issues.

Would you like to create a systemd service so it runs at boot?  Here’s mine:

# cat /etc/systemd/system/mvs.service 
[Unit]
Description=MVS 3.8j
ConditionPathExists=/mvs-tk5

[Service]
WorkingDirectory=/mvs-tk5
ExecStart=/mvs-tk5/mvs
KillMode=process
Type=simple

[Install]
WantedBy=multi-user.target

That WorkingDirectory is important, because various things in the mvs script refer to relative paths.

Now just

systemctl daemon-reload
systemctl enable mvs
systemctl start mvs

And you’re back in the 70s!

raindog308

No Comments

    Leave a Reply

    Some notes on commenting on LowEndBox:

    • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
    • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
    • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

    Your email address will not be published. Required fields are marked *