Last Updated on 7th March 2025 by peppe8o
In this tutorial, I’m going to show you how to emulate a Mainframe on Raspberry PI computer boards by setting up and using Hercules, which brings a lite version of MVS (Mainframe) to our loved single-board computers.
What is a Mainframe
Mainframes mainly belong to a remote computer era, when Windows or Linux on PCs were quite not used on the company’s main servers. Anyway, they are still installed and running in many server farms and run a number of services we use every day (like, for example, banking back-end). Hercules brings a light (and old) version of MVS emulation to get Mainframe on Raspberry PI
Wikipedia Mainframe Computer page defines Mainframe as follows:
Mainframe computers or mainframes (colloquially referred to as “big iron”) are computers used primarily by large organizations for critical applications; bulk data processing, such as census, industry and consumer statistics, enterprise resource planning; and transaction processing. They are larger and have more processing power than some other classes of computers: minicomputers, servers, workstations, and personal computers.
Mainframes are focused on some key factors that are vital for critical businesses:
- high availability
- security
- high I/O volumes
- reliability for transaction processing
Even if they are currently considered an outdated technology (compared to modern virtual machines/container technology), they are still deep-rooted in modern data centres, especially for banks, stock exchanges, etc
In this article I’ll show you how to run a Mainframe MVS (Multiple Virtual Storage) inside … a Raspberry PI computer board! I will use a Raspberry PI Zero 2W. This device has a very few resources to run it (even if I experienced that it worked), so I suggest using Raspberry PI computer boards with better CPU and more RAM, as this procedure should work with any Raspberry PI computer board.
What We Need
As usual, I suggest adding from now to your favourite e-commerce shopping cart all the needed hardware, so that at the end you will be able to evaluate overall costs and decide if to continue with the project or remove them from the shopping cart. So, hardware will be only:
- Raspberry PI Zero 2 W (including proper power supply or using a smartphone micro USB charger with at least 3A) or newer Raspberry PI Board
- high-speed micro SD card (at least 16 GB, at least class 10)

Step-by-Step Guide
This guide will use an amazing MVS package available from the page https://www.prince-webdesign.nl/tk5, which also includes a User Manual explaining how to use this MVS emulation.
Preparing the Raspberry PI Operating System
The first step is installing the Operating System. I suggest you use the Raspberry PI OS Lite (I use the 64-bit version) to get a fast and light operating system (headless). In this case, you will need to work from a remote SSH terminal. If you need a desktop environment, you can also use the Raspberry PI OS Desktop, in this case, working from its terminal app. The links provide you with the procedures for both the OSes.
Please find the differences between the 2 OS versions in my Raspberry PI OS Lite vs Desktop article.
Make sure that your system is up to date. Connect via SSH terminal and type the following command:
sudo apt update -y && sudo apt upgrade -y
Install TK4 MVS Emulation
We’ll download and unzip the tk5 package inside a new folder from where our system will load. From the Raspberry PI terminal, please type the following commands:
mkdir mvs
cd mvs
wget https://www.prince-webdesign.nl/images/downloads/mvs-tk5.zip
unzip mvs-tk5.zip
You will find a new folder named “mvs-tk5”. All the required files are included in this folder.
Before starting the MVS emulator, we need to change the permissions for all the files by adding the “x” (execution) permissions:
cd mvs-tk5/
chmod -R +x *
Now, your MVS emulation is ready to be started. The basic configuration doesn’t need any change and runs in unattended mode with the simple command:
./mvs
This launches an unattended startup. Please wait for the load procedure to finish, which will be once you see the following screen:

Connect To MVS
To log in to your MVS, you will need a terminal emulator capable of starting an x3270 session. There are several 3270 emulators available on the web, but many of them offer only a 30-day evaluation period for free. I’ve found the free X3270 from the Miraheze page useful for this test, which should work both from a remote Windows PC as well as from a Linux.
On the other side, the Aptitude repository also offers valid 3270 emulators, which should be installed from a Desktop environment as they require an X window manager.
For the first time, you may need to enter a minimal set of info to create your x3270 session. Please remember that the host parameter is your Raspberry PI’s IP address, while the port is 3270.
With the X3270 installed on a remote PC, please issue the connect command with the host address and port. My Raspberry PI has IP “192.168.1.18” so, in my case, it is:

You will find the TK4 welcome banner:

With some client emulators, you may see the “LOGON” prompt asking you for credentials. In my case, it isn’t available, so you can just press the ENTER key from your remote PC to move to another empty page showing an “INPUT NOT RECOGNIZED” error. Here, you can use the credentials of one of the default users. For example:
- user: HERC01
- password: CUL8TR
This emulator also offers more user and passwords, with different permissions. You can find them in the user manual at the “12. Running the TK5 environment” chapter.
Once connected and logged in, you will get 2 welcome screens with red characters (as shown in the following pictures). You can move on by simply pressing ENTER:


In the end, you will go to the TSO home page:

Very First Exercise With TK4 TSO: Create a Simple Dataset
Terminal Emulator Screen
Before all, a few descriptions of the main parts of the Terminal Emulator. It is composed of 3 main parts:

The emulation screen usually gives in the top section a File field, where you can select the desired action to execute. The Options are listed in the following section, each line reporting the option number and the related action.
The function keys (F1 to F12) have an important role in the terminal because each one is a shortcut to a specific function. For example, the most common and most used is F3, to go back to the previous screen.
Create a Dataset
A data set or dataset (refer to Wikipedia for Data set description) is a file with a record organization. It can be associated with a mix of more common Windows directories and files or Linux folders and files.
To create the first dataset (which will be a simple text dataset), please use from the TSO home page the option 3 to select the UTILITIES tool. In this paragraph, with the word “select”, I will intend to write the option number and press ENTER:

Now, please select 2 to use the DATASET utility in the following screen:

This will bring you to the dataset configuration form.
Here, we’ll configure dataset naming (and logical position), modifying the parameters highlighted in the following picture. Moreover, the “A” command will allocate the dataset:

After issuing the command, please press the ENTER key on your computer. You will go to the dataset definition form, where you can enter some parameters. As example, please use the following:
- RECORD FORMAT: FB
- LOGICAL RECORD LENGTH: 80
- PHYSICAL BLOCK SIZE: 3120

You can press ENTER to save the data. As you finish, you will be brought back to the dataset utility page. You can now press F3 to go back to the Dataset utilities.
At this point, we have allocated disk space for the dataset. Now, we’ll search the dataset and then enter it to add some text.
From the Dataset Utility menu, please select option 4 to use the DSLKIST utility to search the dataset:

Here, using the DSLIST you can just write the data set prefix name to search for it:

Press ENTER to start the search. You will find your dataset listed. Now, please note the small apex at the beginning of the line:

Now, the most common actions with a dataset are browse (to view their content), edit (to modify their content) or delete (to delete the entire dataset). These actions can be performed by adding the related command letter (b=browse, e=edit, d=delete) on the left of the dataset. We’ll perform and edit to add content to our dataset. So, change it with an “e” letter (for editing):

Now you can see the dataset content (empty at the moment):

Write your content as shown in the following picture, taking care to write at the beginning of the line (where the “H” of “HELLO” starts in the following picture):

Finally, type save near the Command area and press return. This will save the data set content and show you only the lines containing data:

Congratulations, you have created your very first dataset!
Now press F3 as many times as needed to go back to the TSO home screen.
Closing Emulation
To shut down, simply exit from TSO (from TSO home screen press F3) until you see a “READY” prompt:

Here, you can simply type “shutdown” command and press Return (or CTRL). This will start the shutdown procedure.
User Manual
The complete user manual is currently available in my download area with the following link:
https://www.prince-webdesign.nl/images/downloads/TK5-Introduction-and-User-Manual.pdf
What’s Next
If you want to discover many other projects for your Raspberry PI, you can take a look at peppe8o Raspberry PI tutorials.
Enjoy!
You could add that one needs to intall 32bit RaspberryOs (Lite/Desktop) otherwise there will be an exec error while starting the mvs.
Post updated with the warning. Thank you very much for your notification!
Better is the modified package by Rob: http://www.prince-webdesign.nl/tk4rob
This works with 64bit RaspberryOs (Lite/Desktop) out of the package. You can even upgrade with the hercules helper https://github.com/wrljet/hercules-helper to the newest Hercules version by copy the compiled binary to TK4 instance.
It looks as though that version has been upgraded, try: https://www.prince-webdesign.nl/tk5
Thank you for your notice, David. I will try to test the new version ASAP, so updating the tutorial. Have you already tested it?
Hi David, the tutorial is now updated to the TK5 update 4. Thank you for your message!