# WSL

### <span class="mw-headline" id="bkmrk-windows-subsystem-fo-1">Windows Subsystem for Linux</span>

The Windows Subsystem for Linux (WSL) was introduced by Microsoft to Windows 10. WSL allows users to to run a full Linux user space in Windows. The latest version, WSL 2, is a major upgrade and introduces a Microsoft-written Linux kernel that is delivered by Windows Update instead of being bundled with the Windows OS image.

This guide will show you how to create a working Mate Desktop environment on Debian Buster, similar to our CS Linux Desktop servers available through NoMachine. This will help you learn much more about using and maintaining a Linux environment.

### <span class="mw-headline" id="bkmrk-installing-wsl-1">Installing WSL</span>

<span class="mw-headline">[Windows Subsystem for Linux Installation Guide](https://docs.microsoft.com/en-us/windows/wsl/install-win10)</span>

#### <span class="mw-headline" id="bkmrk-x11-forwarding-1">X11 forwarding</span>

<span class="mw-headline">You can use [Mobaxterm](https://help.cs.uwindsor.ca/books/cs-help/page/mobaxterm "Mobaxterm") to access WSL with X11 enabled. </span>

[![image.png](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-02/scaled-1680-/Xmfimage.png)](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-02/Xmfimage.png)

<span class="mw-headline">Or your will need to install an X server to run a graphical Linux environment in WSL.</span>

<table class="plainlinks imbox imbox-style" id="bkmrk-download-vcxsrv-for-" role="presentation"><tbody><tr><td class="mbox-image">[![windows (Custom).png](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-07/scaled-1680-/HMBwindows-custom.png)](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-07/HMBwindows-custom.png)</td><td class="mbox-text">[Download VcXsrv for Windows](https://sourceforge.net/projects/vcxsrv/)</td></tr></tbody></table>

<span style="text-decoration: underline;">Notes</span>:

- When installing VcXsrv, Make sure to "Disable access control"  
    [![image.png](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-02/scaled-1680-/2wGimage.png)](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-02/2wGimage.png)
- add the following to your `~/.bashrc`:
    
    ```bash
    export DISPLAY=$(ip route list default | awk '{print $3}'):0
    export LIBGL_ALWAYS_INDIRECT=1
    ```
- Add a separate **inbound rule** for **TCP port 6000** to the windows firewall in order to allow WSL access to the X server, as described by the [wsl-windows-toolbar-launcher](https://github.com/cascadium/wsl-windows-toolbar-launcher#firewall-rules).

#### Debian

Microsoft provides an app to install a complete Debian command line environment.

<table class="plainlinks imbox imbox-style" id="bkmrk-get-debian-for-wsl" role="presentation"><tbody><tr><td class="mbox-image">[![linux (Custom).png](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-07/scaled-1680-/linux-custom.png)](https://help.cs.uwindsor.ca/uploads/images/gallery/2024-07/linux-custom.png)</td><td class="mbox-text">[Get Debian for WSL](https://wiki.debian.org/InstallingDebianOn/Microsoft/Windows/SubsystemForLinux)</td></tr></tbody></table>