It’s been over 25 years I have been working in Microsoft environments from MS-DOS 3.X to present-day Windows 10 and never I have even dreamt this will happen. Included with the release of Windows 10 Anniversary update is a Ubuntu Linux subsystem for Windows. Yes, you read it right.

To get Bash shell working in Ubuntu on Windows subsystem you follow these steps:

  1. Ensure you have Windows 10 Build 14393 or later
  2. Enable “Windows Subsystem for Linux (Beta)” in Windows Features screen which can be accessed from Add or Remove Programs
  3. In Settings->Update & Security->For developers screen, enable “Developer mode” option under “Use developer features”
  4. Go to cmd prompt, run bash command which will prompt you to install “Ubuntu on Windows”
  5. Once UoW is installed, it will prompt you to create a user and password in UNIX subsystem

uow-cmd2If everything is installed properly, you will be able to run bash commands in Windows. Even access Windows filesystem from Unix. Awesome!

uow-cmd3

Some tips:

  1. To install a package from Ubuntu package repository, say a text web browser like w3m, use the following command:
    sudo apt-get install w3m
    
  2. To install Python language tools, use the following command:
    sudo apt install python3 python3-pip ipython3
    

    To make Python3 as the default interpreter, open the bashrc file with nano editor:

    nano ~/.bashrc
    

    At the top of the bashrc file, add the following lines:

    alias python=python3
    alias pip=pip3
    

    Exit and save the bashrc file. Then run the below command:

    source ~/.bashrc
    
  3. If you are getting an error when trying to install a package using apt-get, update the package cache by the following command:
    sudo apt-get update
    
  4. To search for a package, try the following with the package name you are looking:
    apt-cache search packagename
    

You can learn from this article on how to install Linux app packages in Ubuntu subsystem and see a demo video on how to use Bash in Windows. This article from Dustin Kirkland briefly talks on how this all works!

Categorized in:

Tagged in:

,