How to Setup Bash on Windows 10 for Developers – Ultimate Setup

Bash for Windows 10 has been out for almost a year now. It has been incredible for a developer like myself to be able to use Bash natively on a Windows machine!

In this article, I’ll show you how I install my main Bash setup for Windows 10.



  1. Your Windows 10 PC must be running a 64-bit version of Windows 10 Anniversary Update build 14393 or later.
    To find your PC's CPU architecture and Windows version/build number, open Settings>System>About. Look for the System type and OS Build fields.

    In this screenshot, I have a 64-bit operating system, x64-based processor and OS Build, 15063.138, so I fit the requirements.



  1. Install Bash on Windows 10
  2. Install ConEmu for tabs
  3. Must have Bash customizations
  4. Install VcXsrv Windows X Server for opening GUI applications


1. Install Bash on Windows 10

In order to run Bash on Windows, you will need to manually:

  1. Turn on Developer Mode
  2. Enable the “Windows Subsystem for Linux (beta)” feature

Open Settings -> Update and Security -> For developers
Select the Developer Mode radio button.

Developer mode is selected.

From Start, search for “Turn Windows features on or off” (type ‘turn’)
Select Windows Subsystem for Linux (Beta)

Windows Subsystem for Linux (Beta) is checked.

Hit OK. Installation will proceed, and afterwards, you will have to restart your computer.

After you restart your computer, you will be able to finish installing Bash on Windows 10.

Search for Microsoft Store.

From the Microsoft Store, find Ubuntu and download and install it.

From Start, search for “bash” (type ‘bash’) or it might already be open.

When you open bash, you will see a command prompt window.

Type "y" to continue.

The real “Bash on Ubuntu on Windows” shortcut will be installed. Bash on Ubuntu on Windows might already be installed through the Microsoft Store.

Now, you can open “Bash on Ubuntu on Windows” whenever you search for “bash”

Try opening Bash.  The first time you install Bash on Windows, you will be prompted to create a UNIX username and password.

After typing in a UNIX user name and UNIX password, you can use Bash the same way that you would use a terminal on Mac and Linux.

The biggest problem though is there are no tabs! Let’s fix the tab issue.


2. Install ConEmu for tabs

ConEmu is an amazing program that gives you terminal tabs, allows you to copy and paste the normal way with CTRL-C and CTRL-V, and run any combinations of shells including Command Prompt, Bash, Powershell, and more.

Hi the Download button, which will take you to a redirected list of versions of ConEmu. I like to use the Preview version.

Run the executable. Select the x64 bit version of installation.

Hit Next on the next few prompts, which are the intro window, license and agreement, and settings. I leave everything by default.

Now, you are ready to install. Hit Install.

Hit Finish on the next prompt.

From Start, search for “ConEmu” (type ‘ConEmu’)

When ConEmu first starts, you will be brought to the Startup Settings. You have to select the default console that you want to open.

Find and select {Bash::bash} in the Specified named task section.

Now, whenever you open ConEmu, it will open to Bash by default! ConEmu is easy to read and smooth.

I like to pin ConEmu to the taskbar to be able to open bash quickly. Right click ConEmu’s icon and click Pin to taskbar.

To add a new tab on ConEmu, type WIN+W.

To switch to the right tab, type CTRL+Tab.

To switch to the left tab, type CTRL+Shift+Tab.

All ConEmu’s shortcuts are listed:


3. Must have Bash customizations

Bash on Windows 10 is great, but it could use a few customizations to make using it with Windows 10 files and programs easier!

First, we will adjust our ~/.bashrc.

nano ~/.bashrc

Use any text editor. On nano, type ALT+/ to go to the end of the file.

These configurations allow easy access to some of my favorite Windows related directories and programs.

I want to be able to change directory to the Windows C: drive easily and access my desktop, so I use aliases.

alias converts the given word into shortcuts.

I also want to be able to use Sublime, which is my go-to GUI text editor, so that I can type subl . and open the current working directory with Sublime.

I am using Sublime 3

I want to be able to open any folder with File Explorer with open, so that I can open the current working directory with open .

I have a shortcut called linux to open the Ubuntu’s root folder with File Explorer.

Lastly, I have an alias called reload for reloading the ~/.bashrc to apply any new configurations.

Replace huyle with the username of your computer.

# Custom shortcuts
alias windows="cd /mnt/c"
alias desktop="cd /mnt/c/Users/huyle/Desktop"
alias subl="/mnt/c/Program\ Files/Sublime\ Text\ 3/subl.exe"
alias open="/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe /c start -WorkingDirectory C:'\\'Users'\\'huyle'\\'AppData'\\'Local'\\'lxss"
alias linux="open C:/Users/huyle/AppData/Local/lxss"
alias reload="source ~/.bashrc"

These other shortcuts I use to access my favorite directories. I recommend you to add your favorite Windows or Ubuntu directories where you put your development code or work.

# Optional shortcuts
alias repos="cd /mnt/c/Users/huyle/Desktop/Repos"
alias work="cd /mnt/c/Users/huyle/Desktop/Work"
alias youtube="cd /mnt/c/Users/huyle/Desktop/YouTube"

You can save your file with nano by using CTRL+O and then pressing Enter.

Now, we can apply these changes.

source ~/.bashrc

Use the windows alias to easily switch to your Windows files! You can try some of these other aliases!

open .

The open alias does not work with Ubuntu’s directories because of directory translation errors, but by default, at least, I set the alias to open the Ubuntu root directory.

Every now and then, I prefer using Sublime, so it’s very convenient to be able to type subl . in order to open current working directories with Sublime.

Here are some extra utilities that I like to install on Bash. These utilities are optional.

I like to use tmux, which is a terminal multiplexer. It lets you switch easily between several programs in one terminal.

I like tabs, but every now and then, I like everything in one terminal for a bird’s eye view.

I also like to use zip and unzip often to create zip files and extract them.

sudo apt-get install -y tmux zip unzip

Nice! Bash on Windows 10 with tabs and tmux feels so good. Your development is now super-charged!


4. Install VcXsrv Windows X Server for opening GUI applications

If you have ever wanted to open GUI applications through SSH connections, this step is for you.

By default, Windows 10 does not come with an X11 server by default. I’ve been using VcXsrv Windows X Server, but Xming also works.

You can download VcXsrv Windows X Server here:

Hit the Download green button.

I leave the settings by default.

You can open VcXsrv by searching for “vcx” on Windows 10 search.

I Allow access for VcXsrv Public networks.

Now that we have our X11 server open, we should adjust our ~/.bashrc a little bit to make sure that the DISPLAY value will be correct.

vim ~/.bashrc
# X11 server display value
export DISPLAY=localhost:0.0

Let’s test if our X11 server works! I like to install x11-apps for testing.

x11-apps contains xclock, which is great for testing GUI applications and X11.

sudo apt-get install -y x11-apps

Now, let’s run xclock.


Last but not least, let’s make sure that X11 will work on top of SSH connections.

mkdir ~/.ssh
vim ~/.ssh/config
Host *
    ForwardAgent yes
    ForwardX11 yes

Now, save the ssh config file and change its permissions correctly.

chmod 600 ~/.ssh/config

Afterwards, you should be able to use -X with ssh in order to enable the forwarding of X11 connections to VcXsrv.

ssh -X [email protected]_address

Great job! Good luck with your development. I’ve been finding this setup very comfortable as a developer!

How to Access Ubuntu Bash Files from Windows

If you installed Bash on Windows 10, and you want to get access to the files that you created on Bash from the Windows side, here’s what you need to do!

  1. Open File Explorer
  2. Click File on the top left, click Change folder and search options
  3. Click on View tab, make sure Show hidden files, folders, and drives is selected, Click OK
  4. Click on the folder directory address box, copy and paste: %localappdata%\lxss or C:\Users\{username}\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu##.##
  5. When you click Enter, you’ll be in the Bash directory (2017): C:\Users\{username}\AppData\Local\lxss
  6. You can access the files through Cygwin or File Explorer in the future


1. Open File Explorer.


2. Click File on the top left, click Change folder and search options.


3. Click on View tab, make sure Show hidden files, folders, and drives is selected, Click OK.


4. (2017) Click on the folder directory address box, copy and paste: %localappdata%\lxss

If you’ve downloaded Ubuntu recently in (2018), then the path is different:

A. Go to C:\Users\{username}\AppData\Local\Packages\

B. Start looking for folder with the Ubuntu version (example): CanonicalGroupLimited.Ubuntu18.04

C. Your final destination will be in the LocalState\rootfs folder:


5. When you click Enter, you’ll be in the Bash directory: C:\Users\{username}\AppData\Local\lxss


6. You can access the files through Cygwin or File Explorer in the future!

How to Create Shared Folder on VirtualBox – Windows and Ubuntu

I have a Windows 10 laptop, and I am running VirtualBox. One of my virtual machines has Ubuntu 14.04 64 bit operating system. Now, I want to be able to share folders from my Ubuntu to Windows 10 and vice versa. I’m assuming that you have installed the Ubuntu virtual machine already and ready to set up the shared folder.

Step 1) Make a folder to be shared on your Windows 10 host operating system.

I’ll create a folder called shared on my Windows 10 Desktop.


I’ll put a bunch of stuff inside the shared folder to be used by the Ubuntu virtual machine.



Step 2) Make sure that you have an empty optical drive for your virtual machine.



Step 3) Boot your Ubuntu virtual machine. Go to Devices tab and click Insert Guest Additions CD image…



Step 4) Open up a terminal and install the Guest Additions CD.

We make a directory to mount the Guest Additions CD. The Guest Additions CD contains a file system type that we need to use.

sudo mkdir /media/cdrom

Now, we can mount the Guest Additions CD to the /media/cdrom folder.

sudo mount /dev/cdrom /media/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only

We should install necessary packages if they have not already been installed.

sudo apt-get install make gcc linux-headers-$(uname -r)

Now, we can install and run the Guest Additions CD.

sudo /media/cdrom/


Step 5) Click on the Devices tab and click Shared Folder Settings… and integrate the Windows 10 shared folder.


Hit the add shared folder button.


Click on the Folder Path list and find your shared folder on Windows 10. I checked off Read-only, Auto-mount, and Make Permanent. Hit OK.



Step 6) Create a shared folder on Ubuntu virtual machine and mount the shared folder.

You make a directory on the Ubuntu virtual machine that will act as Ubuntu’s shared folder.

mkdir ~/shared-windows10

We mount the shared folder on Windows 10 to the ~/shared-windows10 folder.

sudo mount -t vboxsf shared ~/shared-windows10

shared was the name of the Windows 10 shared folder, and I called the Ubuntu shared folder, ~/shared-windows10, to differentiate between the two.


Step 7) Change directory into the shared folder and see all the shared files.

cd ~/shared-windows10


Huzzah! The shared folder is great for transferring files from Windows 10 to the Ubuntu virtual machine and vice versa.

I set the shared folder to Read-only, but you can uncheck the box in the Shared Folder Settings…

How to Get Multiple Terminals on Ubuntu Server

Let’s say that you want multiple terminals on an Ubuntu server. If you have ever used the Ubuntu server version of the OS, you should know that it is maneuvered only through the terminal. We had a situation where we didn’t have access to the Internet, so we couldn’t install something like tmux for multi-tasking, and we thought screen was hard to use.

We needed multiple terminals, so that we could run multiple commands at the same time!

If you are using a keyboard and monitor with Ubuntu server, it so happens that you can use ALT + F1ALT + F6 to spawn new terminals to do your work. The keyboard shortcuts switch you to a new terminal window. You can have 6 of these terminals, which are basically the equivalent of terminal tabs on Ubuntu with the GUI.

In my case, I was using Ubuntu 14.04, but it should work with the other versions as well.


ALT + F2 to spawn terminal #2 and so on

How to Download Packages and Dependencies from Different Architectures on Ubuntu

Let’s say that I have a computer that I installed Ubuntu 14.04 x86-64 also known as amd64. I want to download a package, but I want to download the package and its dependencies from a different architecture instead of amd64. In this scenario, I want to download a package from arm64 architecture.

Enable Another Architecture to Download

First, we will add a new architecture to be able to select when installing or downloading any package. Instead of arm64, you can substitute any architecture abbreviated name in the following command.

sudo dpkg --add-architecture arm64

Update sources.list

To get access to arm64 packages, we need to add additional sources to our sources.list where apt-get finds its packages.

sudo vi /etc/apt/sources.list

Add the following URLs to the file. Note that I am using Ubuntu 14.04, which is code named: trusty. You will use a different code name at the end of the URLs if you have a different version of Ubuntu.

# source urls for arm64
deb trusty main restricted
deb-src trusty main restricted
deb trusty-updates main restricted
deb-src trusty-updates main restricted
deb trusty universe
deb-src trusty universe
deb trusty-updates universe
deb-src trusty-updates universe
deb trusty multiverse
deb-src trusty multiverse
deb trusty-updates multiverse
deb-src trusty-updates multiverse

We need to update our sources list with the new URLs so that we can download packages for arm64.

sudo apt-get update

How to Download Ubuntu Packages and Dependencies Locally

Afterwards, we should make a directory to store the packages that we want to download.

mkdir arm64-packages

Now, we download the package inside that directory. For instance, let’s say that we wanted to download vim and not install it. To download arm64 architecture packages, you have to place :arm64 after the package name. If you don’t put the architecture name after the package, then the default architecture in my case amd64 will be downloaded.

Where vim:arm64 is, you can replace with the name of any package available through apt-get followed by :arm64.

cd arm64-packages
for i in $(apt-cache depends vim:arm64 | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/); do sudo apt-get download $i 2>>no32.txt; done

Any errors will be outputted inside no32.txt. If you ls, then you should see all of the deb packages and dependencies for arm64.


How to Download Packages and Dependencies Locally on Ubuntu

I want to download a package and all of its dependencies that I would typically use apt-get to install on Ubuntu. How do I download a package and its dependencies locally on Ubuntu? I am using Ubuntu 14.04 and Ubuntu 16.04 for this tutorial.

How to Download Ubuntu Packages and Dependencies Locally

We require Internet access to download the packages locally. First, we should always update our package sources.

sudo apt-get update

Afterwards, we should make a directory to store the packages that we want to download.

mkdir packages

Now, we download the package inside that directory. For instance, let’s say that we wanted to download vim and not install it. Where vim is, you can replace with the name of any package available through apt-get.

cd packages
for i in $(apt-cache depends vim | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/); do sudo apt-get download $i 2>>no32.txt; done

Any errors will be outputted inside no32.txt. If you ls, then you should see all of the deb packages and dependencies.


How to Install .deb Files

sudo dpkg -i *

Errors are processed in no32.txt.

How to SSH to Another Computer with Ethernet Cable – Local Area Network

Let’s say that we wanted to connect an Ethernet cable from Ethernet port of one computer to Ethernet port of another computer. I want to be able to SSH into the other machine from my computer given that I know the other machine’s password or have an authenticated SSH key.


You can also SSH to a series of machines if you have a switch with all the other machines connected to that switch through Ethernet cables. The switch is basically a hub point where all the machines can connect their Ethernet cables to and be able to access every other machine on the local area network.


Let’s talk about how to SSH from 1 computer to another computer when the Ethernet cable from port to port of the two computers. One of the computers is my Windows 10 laptop. The other computer is an Ubuntu 16.04 server.


Step 1) Start the SSH server on the Ubuntu 16.04 computer.

First, we make sure that we have the OpenSSH server installed. We will require Internet access for this step.

sudo apt-get install openssh-server

Now, we restart the SSH server to be sure that it is working properly.

sudo service ssh restart
ssh stop/waiting
ssh start/running, process 3878

Step 2) Connect Ethernet cable from the Ethernet port of Windows 10 computer to the Ethernet port of the Ubuntu 16.04 computer.

Step 3) Set a static IP address on the Ubuntu 16.04 computer.

If both machines are connected to the Internet on the same router through Wi-Fi, then you will not need to create a static IP address. For more information about setting static IP addresses on Ubuntu, go here.

sudo vi /etc/network/interfaces

Look for an interface that begins with eth. The interface is typically named eth0.

auto eth0
iface eth0 inet static

Now, you save the file and restart the interface.

sudo ifdown eth0 && sudo ifup eth0

Step 4) Set a static IP address on the Windows 10 computer.

We need to have an IP address on the same IP space as the Ubuntu 16.06 computer. On Windows 10, you will right click the Internet icon on your task bar and click on Open Network and Sharing Center.


On the right side bar, click Change adapter settings. Right click on Ethernet and click Properties. Click on Internet Protocol Version 4. Click Properties.


Check off Use the following IP address and fill out IP address and Subnet mask. Note that you cannot use an IP address that is already used by the other machine.


I will set the Windows 10 computer with the IP address and the subnet mask of Default gateway is optional. Use the following DNS server addresses is optional. I set to point to Google’s Public DNS server. I check off Validate settings upon exit and hit OK.

After the validation, your computer should have the new static IP address. If you do not have Wi-Fi, you will not have Internet access at the moment since you set a static IP address that is likely not valid by your DHCP server, but you will be able to SSH into the Ubuntu 16.04 computer.

Step 5) SSH from Windows 10 terminal to the Ubuntu 16.04 computer.

For the Windows 10 terminal, you can use something like Cygwin to SSH into the Ubuntu 16.04 computer. Cygwin is program that allows Windows to use UNIX.  First, we ping the Ubuntu 16.04 machine to see if we have network connectivity.


Eureka! Now, we can SSH into the Ubuntu 16.04 computer with its username.

ssh [email protected]

Enter your password, and you will have access to your Ubuntu 16.04 computer from your Windows 10 computer using the local area network and direct Ethernet cable.

How to Set Static IP on Ubuntu

To set the static IP address on Ubuntu, we want to first determine what network interfaces we currently have. These network interfaces represent the Infiniband or Ethernet ports on your computer. You will typically have an interface called eth0 or eth1 that allows you to connect to the Internet.

Note, setting the static IP will allow you to connect to the Internet as long as the IP address is valid according to your DHCP server. If you set any static IP address randomly and refresh the interface, you will not be able to connect to the Internet. However, the static IP address should still work on the internal network. I would recommend doing the following steps directly on the computer instead of through SSH.


To find out what interfaces you have, you can first check for interfaces that contain eth.

ifconfig -a | grep eth

You can also use the following command to see all your interfaces:

cat /proc/net/dev

Here, we have an eth0 interface that we can set a static IP. If we don’t see any interfaces after running the above commands, then we will have to check the interfaces configuration file.

sudo vim /etc/network/interfaces

You will see something like this:

auth lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto lo refers to the loopback for connections to oneself. We want to change the eth0 interface or whatever named interface you have. Note, the interface may have a different name.

We want to give the eth0 interface a static IP address.

auto eth0
iface eth0 inet static

Now, we save the file, and we can restart the network.

sudo ifdown eth0 && sudo ifup eth0

We can check if eth0 has the new static IP address.

ifconfig | grep eth0

You should see the new eth0 interface information after running the above command.