Run your own mainframe using Hercules mainframe emulator and MVS 3.8j tk4

Bradrico Rigg
5 min readJun 18, 2021


Have you ever been interested in how mainframes work and how to develop software on them? Well a lot of very smart people have developed emulation software that emulates an IBM System/370 architecture. The following is from the Hercules website:

Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.

Hercules emulates the hardware now you need a operating system to run on top of it. That operating system is MVS 3.8j tk4. The following is from the user’s manual:

MVS 3.8j Tur(n)key 4- (“TK4-”) is a ready to use OS/VS2 MVS 3.8j system built specifically to run under the Hercules System/370, ESA/390, and z/Architecture Emulator. It is an extension of the original MVS Tur(n)key Version 3 System (“TK3”) created by Volker Bandke in 2002.

Let’s get to installing and running the software. The install example I will give is for linux but MVS 3.8 runs under Windows and Mac OS as well as ARM(may need to build from source.)

1. Install 3270 terminal emulator.

To connect to a running instance of MVS 3.8 you will need to use a 3270 terminal emulator. On linux a good one is C3270. It may already be installed on your system but if not you can run the following commands:

2. Download MVS 3.8j zip file.

Run the following commands to download the mvs zip file, extract it to mvs38 and set it to run in console mode. This allows you to run commands at the MVS console.

3. Start MVS

CD back to the mvs38 directory and run ./mvs. This will start hercules in the hercules console and start mvs. Wait for about 5 minutes and when you see the following screen you will be able to log in using the c3270 terminal emulator.

4. Log onto MVS

Start a separate terminal window and enter the following:

This will bring you to the TSO log in screen

Hit enter once and use herc01 for a user name.

Use CUL8TR for a password. Hit enter twice and you should see the following screen:

Congratulations you have started a mainframe emulator, started an operating system on it and have logged on to your new shiny mainframe emulator.

Running our first job.

MVS 3.8j comes with quite a few different compilers. We will run a COBOL job.

From the TSO Applications screen select 1, then enter to launch the RFE application.

Select 3, then enter to launch the UTILITIES menu.

Select 4, then enter to launch the RFE DSLIST menu.

Type SYS2 then enter to show a listing of the files and directories on the SYS2 partition.

Use the down arrows to SYS2.JCLLIB, type V, then enter.

Press the f8 key until you see the TESTCOB file.

Use the down arrow keys and left arrow keys to the file and type V (all the way to the left as shown). Then press enter.

Type submit then enter to submit the job.

Press enter to return back to the editor. Then the f3 key 6 times to return to the main menu.

Congratulations you have ran your first job. The output for the job is displayed on the hercules console.

Press the f3 key at the main menu of TSO Applications.

Type logoff to log off the session:

You can now close the terminal. (It will say a process will be killed that is OK.)

Closing Thoughts

MVS 3.8j allows you to run mainframe software from your own work station. This was a fast introduction and there are many resources to help you which I will provide below. Stay tuned for the next installment of Setting up a printer spool for MVS 3.8.

Resources The main hercules web page. The main web page to down load MVS 3.8j TK4. The mosix channel. A very valuable resource for learning about everything MVS related. A must view channel. An invaluable site from the great Jay Moseley. Learn programming on MVS, system maintenance you name it.