Hosting Linux: LPARs, z/VM, KVM and s390x
Linux on Z can run directly in an LPAR or as a virtual guest under z/VM or KVM. Software must be built for the s390x architecture, which is 64-bit and big-endian, so most open-source code works but some binaries and assumptions do not.
Three ways to host Linux
Every mainframe is already virtualised at the hardware level: PR/SM firmware divides the machine into LPARs. Linux can sit directly in one of those, or a second hypervisor can run inside an LPAR and host many Linux guests.
z/VM in brief
z/VM gives each guest a virtual machine defined in a user directory: its memory, virtual processors, disks and network connections. The z/VM Control Program (CP) runs the guests. Linux guests are typically networked through a VSWITCH, a virtual switch in z/VM connected to physical OSA network adapters. Disks are usually minidisks carved from mainframe DASD, or SCSI disks attached through FCP channels.
Inside the guest, Linux sees ordinary block devices. The s390-tools package supplies Linux commands for the platform's devices, for example lsdasd to list DASD volumes, lsqeth for network devices and vmcp, which passes a CP command to z/VM from a guest that is allowed to issue it.
$ lsdasd Bus-ID Status Name Device Type BlkSz Size Blocks ============================================================================== 0.0.0201 active dasda 94:0 ECKD 4096 7043MB 1803060 0.0.0202 active dasdb 94:4 ECKD 4096 7043MB 1803060
Why s390x matters to software
s390x is the name Linux, compilers and container tools use for the 64-bit IBM Z architecture. Three practical consequences follow:
- Binaries must be built for s390x. An x86 binary will not run. Interpreted and bytecode languages (Java, Python, Node.js) and source-built code (C, C++, Go, Rust) usually work; closed-source x86-only software does not.
- It is big-endian. Code that reinterprets raw bytes as integers, or reads binary files written on x86, can silently produce wrong numbers. Well-written portable code handles byte order explicitly.
- Some optimisations are architecture-specific. Libraries with hand-tuned x86 assembler or SIMD intrinsics need an s390x code path or a generic fallback.
| Software | Usually fine on s390x? | What to check |
|---|---|---|
| Java applications | Yes | Any bundled native libraries (JNI) need s390x builds |
| Python, Node.js | Yes | Packages with compiled extensions need s390x wheels or a build toolchain |
| Go, Rust, C, C++ from source | Usually | Endianness assumptions and x86-specific code |
| Vendor binary products | Only if the vendor supports it | The vendor's platform support list |
| GPU-dependent workloads | Not a fit | Typically better placed on other platforms |
Operating the guests
- Capacity: z/VM and KVM let guests share IFLs and memory. Overcommit is a strength, but too much causes paging and CPU contention that looks like an application slowdown.
- Monitoring: standard Linux metrics still apply, but a guest's view of CPU is virtual. Confirm hypervisor-level figures with the team that owns z/VM or KVM.
- Patching: guests are patched like any Linux server; the hypervisor and firmware have their own maintenance cycle, usually owned by systems programmers.
- Cloning: sites often provision guests from golden images, which makes building many similar servers fast.
Common mistakes
It will fail with an exec format error. Install the s390x package from the distribution or build from source on or for s390x.
s390x is big-endian. Decode binary fields with explicit byte-order handling and test with real files from the producing system.
Guests share physical IFLs. A guest can be starved by its neighbours even when its own top output looks normal; check hypervisor-level data.
What you will see at work
- Linux administrators raise requests to the z/VM or KVM owners for new guests, extra memory or disks, much as they would with a VMware team.
- Developers porting an application run a platform readiness check: are all dependencies available for s390x?
- Performance incidents on Linux guests are often worked jointly by the Linux team and the mainframe capacity team.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.