If your machine is installed with windows and you need to access Linux machines (SSH) then using Putty is not the best way to work. To get a better terminal experience in windows there are few tools for windows but nothing can match the native terminal experience in Linux Distros. After trying cmder, conemu..etc, I searched for terminator like experience in windows which lead to multiple blogs(added as ref). At last, I have a setup that I love which can be used to code conveniently.
I share the steps I followed to get best bash terminal in windows
Enable Windows Subsystem for Linux
Before installing any Linux distros for WSL, you must ensure that the “Windows Subsystem for Linux” optional feature is enabled.
Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Install Ubuntu for windows
For this post, I use Ubuntu as my Linux Distro. Install Ubuntu (18.04)Subsystem from Windows Store with below link
Get Ubuntu - Microsoft Store
Download this app from Microsoft Store for Windows 10. See screenshots, read the latest customer reviews, and compare…
After installation and setup(username/password), install dbus
sudo apt install dbus-x11
Now we will have a Ubuntu sub-system running in windows. But the problem is we cannot run any Linux application with GUI out of the box. We need an X-Server to do that.
VcXsrv seems to the best choice for X-Server in Windows
VcXsrv Windows X Server
Download VcXsrv Windows X Server for free. Windows X-server based on the xorg git sources (like xming or cygwin’s…
After installation, use the following command to create a new desktop shortcut. Add the following command in the properties → shortcut →target
"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
If a shortcut is already created, in desktop while installing VcXsrv, in name of XLaunch by installer change the target (rightclick-> properties)to the above command.
After changing the shortcut target, double-click on the shortcut to launch the X server. Once done we can see it’s the icon in the system tray as shown below.
We can also use below command in command prompt to verify it.
netstat -abno|findstr 6000
Install Terminator in Bash
Open Ubuntu and install terminator
sudo apt-get updatesudo apt-get install terminator
After successful completion, we can launch terminator GUI using Xserver with command
DISPLAY=:0 terminator &
If you see the terminator window, then we are successful with the initial setup.
But to launch a window first we need to run XServer then open a Ubuntu window and launch terminator using a command. This all seems too much for launching a terminal.
So in the next section, we will see how to automate these steps.
Launch Terminator Directly
Type the following command in command prompt to check if you are able to launch terminator with a single command
bash -c -l "DISPLAY=:0 terminator &"
If you are getting access denied error when executing bash from cmd prompt then follow these steps. check which distro is installed with:
and then set default distro with:
wslconfig.exe /s Ubuntu
If the above step is successful, then we can launch terminator with a single command
Create a vb script named startTerminator.vbs from the following gist
Give it as a target to new shortcut named terminator
You can get the shortcut icon from http://www.iconarchive.com/show/flatwoken-icons-by-alecive/Apps-Terminator-icon.html
Add Xserver to Startup Program
Open Run and type
copy Xserver shortcut in the opened directory.
Use Windows font in Terminator
In WSL ubuntu create a file name local.conf in fonts dir
cd /etc/fonts/sudo vim local.conf
paste the following content
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
Save it and open terminator again to see windows font listed in the terminator settings menu.
Hope this helps for you dev setup in windows. as you might have guessed we can open any application with GUI just by changing command.we can ssh -X to any machine and launch GUI application given DISPLAY env variable is set.
We can also configure mobaxterm pretty quickly and use its inbuilt Xsrerver (refer to the 2nd reference to read an excellent post by Rod Treweek)