How to run Linux standalones on Windows with WSL

Windows Subsystem for Linux (WSL) is a feature of Windows 10 and 11 that enables you run a Linux environment without having to dualboot or run a virtual machine. This lesson will cover installing WSL2 and setting it up to run Linux standalones on it.

For other material on installing WSL specifically, please refer to https://learn.microsoft.com/en-us/windows/wsl/install

Installing WSL

First, open PowerShell or Windows Command Prompt in adminstrator mode: Either right click and choose "Run as Adminstrator" or if using Windows Search in the start menu, simply choose the "Run as Adminstrator" option that should already be visible when Command Prompt comes up as the Best Match. From there, enter the command:

wsl --install

This will begin to guide you through the installation of WSL, which by default will come with a distribution of Ubuntu. When this is complete, restart Windows. WSL should then by ready to use.

Upgrade and change to WSL 2

These days, WSL 2 should be the version that is installed. However, if you had already installed WSL or it is not the case for some other reason, then further commands may be needed to rectify this. Again in PowerShell or Command Prompt (and again, Run as Adminstrator), run the following command:

wsl --set-default-version 2

Install missing packages

While other Linux executables with GUIs are able to run on WSL2 without any action beyond installing them, LiveCode standalones rely on packages that they do not. As such, in WSL, run the command:

sudo apt-get install libgtk2.0-dev

You will be prompted for a password, since the "sudo" part of that command, short for Super User DO, instructs the terminal to perform the task with elevated privileges.

With that installed, it should then be possible to run a Linux standalone through WSL, even if it requires a GUI window to work. Below are a stack to be built for Windows and Linux (both 64-bit) and a screenshot of the Linux standalone in action:

(Note: In the above, /mnt/c/ is used to refer to the C: drive. Also note that if you drag and drop a file or folder onto WSL, the path will not be transcribed in the manner required; do not do this.)

File access between Windows and WSL can be something of an irritant, however it is not impossible and can be made simpler by symbolically linking a folder WSL could more quickly reach with one you would more likely have LiveCode on Windows build inside, essentially setting up a shortcut. If, for example, you were saving all of your standalones in a Standalones folder in your desktop, you could use the following commands in WSL:

ln -s 'mnt/c/Users/<your_username>/Desktop/Standalones' '~/Standalones'

(Note: The location in the first argument, i.e. the Windows folder, does not have to exist - in fact anything later renamed to have that path will where the link goes - but will not be created by this command. The second argument, the shortcut file will be created by the command and must not already exist.)

Then, whenever you enter cd ~/Standalones in WSL, a following ls command should show all of the contents of that Standalones folder on your desktop.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.