/wsl-workarounds

Various tricks and workarounds for WSL (Windows Subsystem for Linux)

Primary LanguageShellMIT LicenseMIT

WSL Workarounds

Various tricks and workarounds for WSL (Windows Subsystem for Linux).

Table of content

  1. WSL says it's not installed on first launch
  2. Issues with npm install

Workarounds

WSL says it is not installed on first launch

This is an issue related to the window service called lxssmanager and is resolved by restarting it.

Run lxssmanager-restart.bat as administrator.

Tips: Create a shortcut to lxssmanager-restart.bat

  1. Right-click lxssmanager-restart.bat > Send to > Desktop (move it anywhere you like later).
  2. Right-click lxssmanager-restart shortcut (Desktop) > Properties.
  3. Click Advanced... button.
  4. Check Run as administrator.
  5. Click OK.
  6. Select the Shortcut key field. (optional)
  7. Assign the desired shortcut. (optional)
  8. Click OK.

Back to top


Issues with npm install

This is usually a issue related to the mounting of Windows C:\ drive to /mnt/c path. This can be resolved by appending a script to .bashrc (ran on every bash session) to re-mount the C:\ drive when needed.

Install

  1. Open Bash on Windows.
  2. Run:
    cd /path/to/wsl-workarounds
  3. Run:
    bash wsl-mount-fix.sh --install

Uninstall

  1. Run:
    bash wsl-mount-fix.sh --uninstall

Back to top