Skip to content
View All / zPDT Running on WSL2

zPDT Running on WSL2

A few years ago there was a concerted attempt to get zPDT running under Microsoft Windows Subsystem for Linux V2 (run Linux inside Windows), but it ultimately ended in stalemate because we couldn’t get the license key manager working. Having taken another run at this a few weeks ago and got it working, I thought I’d share what I did.

My environment:

  • Machine : ASUS fx507, pimped to 64GB RAM and 1TB m2 SSD
  • External Crucial X9 Pro 2G SSD – v fast!
  • Windows 11 Home 22H2 – Build 22621.2428
  • WSL2 (“wsl –version” reports 1.2.5.0) running Ubuntu 22.04 (LTS) (“wsl –list –all –verbose” reports running on WSL2) from the Microsoft Store app. Microsoft notes / instructions here:

To get the installation of zPDT to run, I needed to get i386 support installed on Ubuntu:

  • Switch to root:
    • sudo -i
  • Add i386 support for the Sentinel license key manager:
    • dpkg –add-architecture i386
    • apt-get update
    • apt-get install libc6:i386
    • apt-get install libncurses5:i386
    • apt-get install libstdc++6:i386

Running the installation and accepting the license got zPDT installed, but then getting the license key manager working was the tricky bit. There are two parts to this:

 

Part 1

Sharing USB devices with WSL2 guests. I found an article on the Microsoft tech blog site that referred to usbipd, which is an open source tool to support this:

  • On Windows:
  • On Linux (Ubuntu WSL2 guest):
    • sudo -i
    • apt install linux-tools-virtual hwdata
    • update-alternatives –install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
  • Now on Windows Powershell, we can list our USB devices and share our Sentinel key to our WSL2 guest:
    • usbipd wsl list

PS C:Usersjames> usbipd wsl list

BUSID VID:PID DEVICE STATE
2-1 04b9:8000 Sentinel Hardware Key Not attached
2-2 046d:c539 USB Input Device Not attached

:

    • usbipd wsl attach –busid 2-1
      • “bing bong” and the key lights up
      • On the Ubuntu WSL2 guest, “lsusb” now shows the Sentinel key
        james@fx507:~$ lsusb
        Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
        Bus 001 Device 002: ID 04b9:8000 Rainbow Technologies, Inc. SafeNet Sentinel Hardware Key
        Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • Care and feeding.
    • When we take updates on Linux, sometimes the client end (Linux bit) of the usbipd stops working. Some notes on the usbipd github site explain that re-applying the “update-alternatives” command (above) when this happens resolves the problem. And it does 😊

 

Part 2

The Linux “systemd” service manager. This is the parent for all of the systemd service tasks – including the sentinel-shk-usb license key handler – and without it they can’t run. By default, the Ubuntu WSL2 guest comes with “systemd” disabled. The good news is that it’s really easy to re-enable it:

  • sudo -i
  • vi /etc/wsl.conf
  • Add the following lines (this didn’t previously exist on our Ubuntu so was empty):
    [boot]
    systemd=true
  • Save (“:x”), exit and close WSL2 (wsl –shutdown)
  • When you re-open your Ubuntu session “sudo systemctl status sentinel-shk-usb” should work and show the handler running

Everything from here on is vanilla zPDT, although worth knowing that our Crucial USB drive didn’t play nicely with being hot plugged or handled by usbipd, but if connected to the laptop before starting Ubuntu in the Windows Terminal, would reliably appear in (Linux) as /mnt/e – it’s the E: drive in Windows.

Other than having to remember the usbipd commands, this has been fantastically easy to use.

I haven’t looked in to how to make z/OS services visible from outside of the Ubuntu and Windows layers – tn3270 from Windows to the Ubuntu IP address (“ip addr” in Ubuntu) on port 3270. In the past (containerised zD&T) we’ve done this sort of thing in the Linux layer with firewalld port forwarding, but I guess this will involve doing a bit more with the network config in zPDT and z/OS and using the Windows “netsh interface portproxy” command.

Whilst the objective was to share how to do this for the zPDT (z1090) ISV community, I guess this would work just as well for zD&T (z1091) customers who use the USB license key (Personal and Learners editions?). If someone in IBM would like to pass me a copy of zD&T Learners edition I’d be happy to confirm 😊