ISV Ecosystem

ISV Ecosystem

ISV Ecosystem

Engage with the community of IBM Z and LinuxONE independent software vendors: share knowledge, exchange ideas, explore innovation.

 View Only

Running zPDT (z1090) In WSL2 on Windows 11

By James Gill posted Fri November 03, 2023 04:10 AM

  

A few years ago there was a conversation about trying to get this to work - maybe on Windows 10? -  which didn't end in success. Now that we've got zPDT running (very nicely) under WSL2 on Windows 11, I thought I'd share how we did it.

My environment:

  • Machine : ASUS fx507, upgraded 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 : https://learn.microsoft.com/en-us/windows/wsl/install

To get the zPDT installation to run, I needed to do the following 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
  • Create the runtime group and user:
    • addgroup zpdt
    • useradd -g zpdt -d /home/zpdt -m -p pa55word -s /bin/bash zpdt

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

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

                                                               i.      Download from https://github.com/dorssel/usbipd-win/releases

                                                             ii.      Scan the downloaded .msi with your anti-virus software of choice and then run it

                                                           iii.      Reboot

    1. On Linux (Ubuntu):

                                                               i.      sudo -i

                                                             ii.      apt install linux-tools-virtual hwdata

                                                           iii.      update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20

    1. Now on Windows Powershell, we can list our USB devices and share our Sentinel key to our WSL2 guest:

                                                               i.      usbipd wsl list
PS C:\Users\james> 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
                :

                                                             ii.      usbipd wsl attach --busid 2-1

        1. “bing bong” and the key lights up
        2. On the Ubuntu WSL2 guest, “lsusb” now shows the Sentinel license USB 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
    1. Care and feeding.

                                                               i.      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 when this happens resolves the problem. And it does 😊

  1. The Linux “init” process. This is where all of the system tasks are managed – including the sentinel-shk-usb license key handler. By default, the Ubuntu WSL2 guest comes – in common with a lot of Linux container images – with “init” disabled. The good news is that it’s really easy to re-enable it:
    1. sudo -i
    2. vi /etc/wsl.conf
    3. Add the following lines (this file didn’t previously exist on our Ubuntu so was empty):
      [boot]
      systemd=true
    4. Save (“:x”), exit and close WSL2 (wsl --shutdown)
    5. When you re-open your Ubuntu session “sudo systemctl status sentinel-shk-usb” should show the handler running (instead of throwing an error)

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 as a single user system, and has the convenience of being portable (the Asus is a laptop).

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, and my Ansible work is from the Ubuntu Linux layer. However, in the past 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.

This was originally shared on the zPDT email group maintained by Bill Ogden, but added here to make it easier to find and because it will likely apply equally well to customers using zD&T (z1091) personal or learners edition, which also use the Sentinel USB license key.

0 comments
12 views

Permalink