How to get BASH Shell for Developers on Windows 10

Getting BASH

First you must change your settings to enable Windows "Developer Mode" this offers extra features and turns off certian restrictions, with developer mode enabled, be careful when downloading software from untrustworthy sources, since some notifications designed to keep normal users from changing certian settings will be turned off on the assumption that developers would be aware that those settings are being changed.

Turning on Developer Mode

1. Open Settings Panel

Settings panel for Bash Tutorial

2. Click on Update and Security

3. Click on "For Developers" and check the "Developer Mode" box.

Installing BASH

4. Search for "Add Program" in the search bar and click on "Turn Windows features on or off"

5. Then click on "Windows Subsytem for Linux (Beta)", you will be prompted to reboot your system, close all other apps safely and do so now.

6. After the reboot is complete click on the Start Menu, or press the Windows key and type "bash.exe" then click on bash.exe or press enter to run. You will be prompted in the command window to accept terms, type "y" and press enter to accept.

7. After the installation is complete, you should be able to search for "Bash on Ubuntu on Windows" to run the BASH shell whenever you like, for ease of use, save a shortcut and make sure to check the "Run with Administrator Privledges" box so that your BASH shell always has admin privledges.

Optional but Highly Encouraged Tweaks

Download an Xserv Client

Download an Xserv client so that you can run X11 apps visually through GUIs, this is mandatory if you plan to use ROOT, but recommended otherwise.

1. Go to “VcXsrv Windows X Server", Download and install "VcXsrv".

2. Run "XLaunch" this is the only shortcut that "VcXsrv" creates that you will need, the others can be deleted.

3. When prompted, click on "Multiple Windows", change no other settings and click next until XLaunch is finished. (Note: you will have to repeat this step everytime you reboot or shutdown your computer, but the following steps need only be performed once. A work around is posted below.)

(Steps 4-6 below were borrowed from Mohit Kumar, whose article on this process appears here)

4. Install ubuntu-desktop, unity, and ccsm. Then, export the display and open ccsm as shown below:

Ubuntu Linux GUI Bash Windows 10

5. When ccsm's application window pops up, enable following plugins (using checkbox).

Ubuntu Linux GUI Bash Windows 10

Ubuntu Linux GUI Bash Windows 10

6. Close ccsm window and run ‘compiz’ command, as shown:

Ubuntu Linux GUI Bash Windows 10

7. Now you're ready to launch GUI Ubuntu apps in Windows.

Always export your display to "VcXsrv"

This is so that you don't have to run

export DISPLAY=localhost:0

everytime you open the BASH shell.

1. Open "Bash on Ubuntu on Windows"

2. Enter the command

sudo nano .bashrc

If you have a preffered linux terminal text editor, feel free to use it instead of nano, but for beginners, nano has a very easy method for closing and saving.

3. Add the following lines, as shown below

#Exports the display, useful on my Ubuntu on Windows Bash Shell
export DISPLAY=localhost:0

Now, everytime you launch your BASH shell, it will automatically export your display to "VcXsrv"

VcXsrv Launches Automatically on Start Up

To compliment the fact that we've set up BASH to always export the display to "VcXsrv" it makes since to always launch "VcXsrv" at startup to ensure you always have access to GUI applications in BASH like ROOT.

1. After using Xlaunch, or after launching it again for the purposes of this tutorial, make sure you save the config, as shown below:

2. Open the Start menu or press the Windows button and search for "Task Scheduler"

3. Open "Task Scheduler" and click "Create Basic Task..."

4. Name and Describe the task

5. Change the trigger

6. Choose the action, "Start a Program

7. On the "Start a Program" menu, select "Browse"

8. In the "Browse" menu, select the config.xlaunch that you saved earlier.

9. After selecting the config file, click next.

10. Review the scheduled task in the "Finish" menu, and click "Finish" to save

Topic revision: r5 - 19 Oct 2017, ForrestPhillips

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback