Skip to content

Setting Up Windows Subsystem for Linux (WSL)

Some of the Streaming Integration Platform components can only be built on Linux, and to make it easy to drive the building of those products from Windows, we'll use the Windows Subsystem for Linux (WSL). A Linux system has already been built and provided in a virtual disk, which you can download and install.

Installing Windows Subsystem for Linux

If you don't already have Windows Subsystem for Linux installed on your Windows development system, follow these steps to install it:

  • Open an elevated PowerShell window and execute this command to enable the Virtual Machine Platform if necessary:

    Enable Virtual Machine Platform
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    
  • Check that the Windows Subsystem for Linux optional Windows component is enabled, and if not, enable it:

    Enable WSL
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    
  • Install WSL without a Linux distribution:

    Install WSL
    wsl --install --no-distribution  
    

If the previous command ran successfully, WSL is now installed but a Linux distro has not been installed.

  • If the Microsoft Store installation was blocked, try this alternate command that pulls from Microsoft’s online source instead of the Microsoft Store:

    Manual install
    wsl --install --no-distribution --web-download  
    

If the installer had to enable any optional Windows features, a reboot may be required.

  • Next, we'll set WSL 2 as the default architecture for any distros that are installed:

    Default to wsl 2
    wsl --set-default-version 2
    
  • Update WSL components to the newest build:

    Update WSL
    wsl --update  
    
  • If the Microsoft Store update was blocked, try this alternate command that pulls from Microsoft’s online source instead of the Microsoft Store:

    Manual update
    wsl --update --web-download
    
  • Verify the install (and that no distro is present):

    Verify WSL installation
    wsl --version   # Shows WSL version, kernel, WSLg, etc.  
    wsl --status    # Quick status overview  
    wsl -l -        # Lists installed distros (should say none)
    

These commands confirm WSL is installed and current and that you have no distributions installed yet.

That’s it — WSL 2 is now installed and up to date, with no Linux instance on the machine until you explicitly add one later. Now proceed with Downloading and Installing the SIPVM Linux VM.

Updating Windows Subsystem for Linux

If you already had Windows Subsystem for Linux installed, ensure that you have the latest version:

  • Update WSL components to the newest build:

    Update WSL
    wsl --update  
    
  • If the Microsoft Store update was blocked, try this alternate command that pulls from Microsoft’s online source instead of the Microsoft Store:

    Manual update
    wsl --update --web-download
    

Downloading and Installing the SIPDEV WSL VM

  • Decide where you want to store the files for the Linux (WSL) distro and create a directory to host the files. We suggest something like C:\VM\WSL\SIPDEV.

The WSL machine's disk image is stored in the Synergex SharePoint server and, assuming you have been granted access, you can download it here. The download is a single 7-Zip archive (SIPDEV.7z) that at the time of this writing is about 1 GB in size.

  • After downloading, extract the .7z file to your chosen location and then delete the .7z file. You should be left with a file called sipdev.tar.

  • Using a command prompt window in the chosen location, execute import.bat to import the WSL instance from the tar file.

Once the import is complete, you can delete the tar file.

  • The new WSL VM is named sipdev and should now show up in Windows Terminal, or you can launch it manually:

    Start VM
    wsl -d sipdev
    
  • On startup you should be automatically logged in to the admin account, but if for any reason that fails, you can manually specify the username to use:

    Force username
    wsl -d sipdev -u admin
    

The password is p@ssw0rd.

Starting the WSL VM at Boot Time

If you'd like the WSL virtual machine to start automatically when you start your development PC, follow these instructions:

  • Make sure the WSL SIPDEV instance is not running:

    Show running VMs
    wsl --list --running
    
  • And, if necessary, terminate it:

    Stop the VM
    wsl --terminate sipdev
    
  • Open the Windows Task Scheduler utility.

  • Right-click on Task Scheduler Library and select Create Task...
  • On the General tab:

    • Enter a name for the task, such as "Start WSL (SIPDEV)".
    • Under Security options, select "Run whether user is logged on or not" and also "Run with highest privileges."
  • On the Triggers tab:

    • Click the New... button to define a new trigger.
    • In the New Trigger dialog, set the Begin the task option to "At startup."
    • Click the OK button to close the dialog.
  • On the Actions tab:

    • Click the New... button to create a new action.
    • With action set to "Start a program," set Program/script to

      Program to start
      wsl.exe
      
    • Set Add arguments (optional) to:

      Arguments
      -d sipdev -- bash -c "while true; do sleep 3600; done"
      
  • Click the OK button to close the dialog.

  • Click the New... button to create a second new action.
  • With action set to Start a program, set Program/script to

    text title-"Program to start" powershell.exe

  • Adjusting the path if necessary, set Add arguments (optional) to

    Arguments
    C:\DEV\SYNERGEX\IntegrationPlatform\windows\WslPortForwarding.ps1
    
  • Click the OK button to close the dialog.

By default the task will run only when the PC is on AC power. If you want to change that, on the Conditions tab, configure the options under Power to meet your requirements.

  • On the Settings tab, uncheck the "Stop the task if it runs longer than" option.

  • Click the OK button to create the task, and then reboot your system. After logging in, check that the VM instance is running:

    Show running VMs
    wsl --list --running