User Tools

Site Tools


atmos:software:windowssoftware:wsl

Windows Subsystem for Linux

These instructions will allow you to set up the Windows Subsystem for Linux, which will allow you to run Linux bash commands on the Windows 10 operating system without the need of a virtual machine. Ubuntu will be used for example purposes.

Note: The Documents folder in Windows is located in “/mnt/c/Users/{Username}/Documents” in the Linux environment.

Setting up the Ubuntu terminal

  1. In the start menu, type “Powershell”
  2. Right click, and click Run as Administrator. Click Yes
  3. Run the following command:
    • Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  4. You will need to restart your computer. Powershell will provide this option. Type y and hit enter to restart.
  5. Go the Microsoft Store and search “Linux”.
    • Click “Get the Apps”
    • Install Ubuntu and launch it.
  6. It will take a few minutes to install.
  7. Create a username and password.
    • Note: you will not be able to see the password characters you type, so type carefully.
    • Important: Make sure you remember this password!
  8. Type: sudo apt-get update

Setting up Graphics Support (X Server)

VcXsrv setup
  1. Search for “VcXsrv” in your browser or click here.
  2. Download from Source Forge
  3. Run the installer.
  4. Open VcXsrv and select the following settings.
    • In Display settings, leave “Multiple Windows” checked. Click Next.
    • In Client settings, leave on “Start no client” and click Next.
    • In Extra settings, keep “Clipboard” checked, but uncheck the others, including opengl. Click next.
    • Save the configuration to somewhere that you can easily find it, like the Desktop.
    • Click Finish.
    • If it asks you to allow access through the firewall, things should still work if you click “Cancel”.
  • Note: If you restart your computer, double-click the config file to run the X server for your terminal.
Ubuntu setup
  1. In ubuntu, type the following commands:
    • sudo apt-get update
    • sudo apt-get install xauth xorg x11-apps
      • Note: This may take several minutes.
  2. Add the following to your ~/.bashrc:
    • export DISPLAY=localhost:0.0

Installing Other Packages

Software Packages in Ubuntu can be installed with “sudo apt-get install <command>”

Example commands:

  • sudo apt-get install python3-numpy
  • sudo apt-get install python3-matplotlib
  • sudo apt-get install python3-scipy
  • sudo apt-get install gedit

Mounting a USB Drive in the Linux Environment

The path to the USB drive is located in “/mnt/{drive_letter}”. In this example, it is assumed that the USB is located in E: in the Windows system. Replace instances of E: or e with your drive letter.

First time setup:

  • sudo mkdir /mnt/e

To mount usb drive:

  • sudo mount -t drvfs E: /mnt/e

To unmount usb drive:

  • Make sure that you are not in the USB drive's directory.
  • sudo umount /mnt/e

Suggested alias to add to ~/.bashrc to streamline the mounting and unmounting process.

  • alias usb='sudo mount -t drvfs E: /mnt/e; cd /mnt/e'
  • alias unusb='cd; sudo umount /mnt/e'
atmos/software/windowssoftware/wsl.txt · Last modified: 2020/01/29 17:25 by 127.0.0.1