Running a Bootleg Mainframe from Home Part 2: Getting DUZA z/OS 1.10 Online
Tonight’s project was getting DUZA, a z/OS 1.10 system running under Hercules, booted, reachable, and able to exchange a file with Linux. We ended up working through Linux administration, mainframe startup messages, TCP/IP profiles, terminal connections, FTP, and one very determined AppArmor profile.
The final test file said:
hello world! it is 10/24/26!
That little line had a lot of troubleshooting behind it.
Getting the Linux side ready
The host was a Lubuntu VM named zos-vm. We set up a dedicated codex-zos-user account for SSH access, created a dedicated Ed25519 key on the Windows client, and configured the account’s sudo access.
We also turned the Hercules installation steps into a reusable script. The recorded build used these options:
./configure --enable-cckd-bzip2 --enable-regina-rexx
The installer includes the development packages, including zlib1g-dev, runs the build and installation, configures the runtime library path, and verifies the installed executable. Its default behavior is to reboot automatically after successful verification, matching the setup procedure we wanted.
Before booting the guest, we checked the disk-image paths in the Hercules configuration. All 42 referenced CCKD files were present and nonempty. That check covered file presence and size.
The scripts and notes are in zOS-Hercules-Repo on GitHub.
IPL, startup messages, and the DUZA welcome screen
In the Hercules panel, the IPL command for this configuration was:
ipl a80
Startup brought the usual collection of messages and prompts. We wrote down the prefixes that helped make sense of them: IWM for WLM, $HASP for JES2, IST for VTAM, BPX for UNIX services, and IKT for TSO/VTAM. They help explain what is happening while the console keeps moving.
I replied COLD to the System Automation initialization prompt during this session. That was an automation initialization choice; it did not by itself identify JES2’s startup mode. The startup notes keep those two things separate.
Eventually the DUZA welcome screen appeared, and I could enter TSO and work in ISPF. There was also some rediscovery of the function keys: F7/F8 for up and down, and F10/F11 for left and right in SDSF.
Then came networking.
The one-character typo that broke the link
Hercules was configured with an LCS adapter:
0E20.2 LCS 192.168.140.200
The TCP/IP profile in DUZA.TCPPARMS still had CTC device/link definitions in the section we were editing, while the address and routing statements referred to ETH1. We needed the guest definitions to match the Hercules LCS device.
The corrected device and link pair was:
DEVICE LCS1 LCS E20
LINK ETH1 ETHERNET 0 LCS1
During the edit, I left the final 1 off the LINK statement:
LINK ETH1 ETHERNET 0 LCS
That was enough to produce a whole chain of errors. TCP/IP reported that device LCS was undefined, then complained about ETH1, the routes using that link, and LCS1 having no links.
The useful clue was the pair of names: the device was defined as LCS1, but the link pointed at LCS. Adding the missing 1 connected the definitions.
In this profile, LCS1 is the device name. ETH1 is the link name. HOME and the routes refer to ETH1; START refers to LCS1.
The working address and routes
For this lab, the relevant address and routing section became:
HOME
192.168.140.200 ETH1
PRIMARYINTERFACE ETH1
BEGINROUTES
ROUTE 192.168.140.0 255.255.255.0 = ETH1 MTU 1500
ROUTE DEFAULT 192.168.140.1 ETH1 MTU 1500
ENDROUTES
START LCS1
We changed the subnet route destination to the network address 192.168.140.0. The guest address stayed 192.168.140.200, the default gateway was 192.168.140.1, and the MTU was 1500.
The existing IPCONFIG NODATAGRAMFWD and TCP/UDP low-port restrictions were retained. The complete recorded section is in the DUZA.TCPPARMS network notes.
Once TCP/IP processed the corrected profile, the console reported:
EZZ4314I INITIALIZATION COMPLETE FOR DEVICE LCS1, LINK ETH1
It also reported stack initialization complete, TCP/IP services available, and TCPIP IS UP - UP.
The next test was from the ISPF command shell:
PING GOOGLE.COM
The hostname resolved, and the response took 0.020 seconds. A 20-millisecond reply from z/OS was a good moment. We had confirmed hostname resolution and an external ICMP round trip.
Two IP addresses, with different jobs
The next point of confusion was trying to connect to port 23 on the guest address. The connection was refused, even though a terminal connection to localhost:23 worked from the Lubuntu VM.
The connection targets in this setup were:
| Connection | Address |
|---|---|
| SSH to Lubuntu | 192.168.140.196:22 |
| Hercules TN3270 terminal connection | 192.168.140.196:23 |
| FTP to the z/OS guest | 192.168.140.200:21 |
We checked the VM’s listening socket and confirmed that Hercules owned port 23. Its configuration contained CNSLPORT 23.
That explained the localhost connection: it reached the Hercules listener on the Linux host. The guest’s 192.168.140.200 address was still the correct address for services running in z/OS, including FTP.
A mainframe hello world, downloaded over FTP
I created IBMUSER.HELLO.HI, a sequential data set with fixed-block, 80-character records. The z/OS FTP server was answering, and the Linux client could find and begin sending the data set.
For a text download, the commands were:
ascii
get 'IBMUSER.HELLO.HI' HELLO.HI
ASCII transfer requests the EBCDIC-to-ASCII conversion needed to read ordinary mainframe text on Linux. The quoted full data set name also makes the intended remote name explicit.
The first attempt failed at the local file:
ftp: Can't open `HELLO.HI': Permission denied
I was running FTP as root. Naturally, that raised a few questions.
AppArmor had the final say
We checked the actual process and filesystem. FTP was running with user ID 0, the destination was root-owned, and the underlying ext4 filesystem was writable. The kernel log supplied the answer:
apparmor="DENIED"
profile="tnftp"
name="/mainframe/ftp/HELLO.HI"
fsuid=0
denied_mask="c"
The FTP client had an enforced AppArmor profile. Root’s normal filesystem permissions did not give the confined process permission to create a file at that path.
Changing the local destination to /tmp allowed the transfer to finish:
250 Transfer completed successfully.
82 bytes received
The intended destination was /mainframe/ftp, so we added a persistent local exception in /etc/apparmor.d/local/tnftp:
owner /mainframe/ftp/ r,
owner /mainframe/ftp/* rw,
The exception covers owner-owned files directly inside that directory. AppArmor stays enforced, and ordinary Linux ownership and directory permissions still apply. Ubuntu documents this approach through its local AppArmor override mechanism.
We validated and reloaded the policy, then used the FTP client with temporary test data to confirm that it could save into /mainframe/ftp. A write elsewhere directly under /mainframe was still denied. The successful z/OS download had already been verified separately, and that downloaded file was copied into the required directory and checked for an exact content match.
Turning the fixes into something reusable
The session produced three scripts:
- SSH account setup for the dedicated account and key-based access.
- Hercules installer for the dependencies, build, runtime configuration, verification, and automatic reboot.
- FTP AppArmor configuration for the persistent
/mainframe/ftpexception.
The AppArmor script preserves existing local rules, avoids duplicate entries, validates before loading, and backs up the prior configuration. If a reload fails, it restores the previous override and attempts to reload that policy.
The Ubuntu GitHub Actions run passed Bash syntax checks, ShellCheck, the existing SSH and Hercules tests, and 13 AppArmor checks covering configuration, reruns, preservation, rollback, and the native policy parser. The fixture parser checks run with kernel loading disabled. The successful CI run is available here.
One issue saved for another night
Startup also reported:
JES2 resource shortage of JOES - 81% utilization reached
That warning is recorded in the known-issues notes. We deferred investigation and did not change JES2 resource settings during this session.
Tonight ended with a working TSO/ISPF session, an external ping from z/OS, a successful FTP download, and the required Linux destination prepared for future downloads. We also left behind the scripts, the exact TCP/IP section, and the error messages that explained the fixes.
For a file that only needed to say hello, it was a pretty productive night.



























