Modern clusters and cloud platforms requires users to login through SSH on Unix terminals in order to have access to its functionalities. Such terminals also give its users access to a wide range of commands and programs such as awk and Vim which are not available on Windows. Linux and Mac users have such terminals installed by default, but Windows users normally have to install Cygwin or use a browser-based terminal, both with limited capabilities such as the inability to install new packages.
Fortunately, Microsoft has established a partnership with Canonical (Ubuntu’s parent company) which brought part of the Linux kernel to Windows 10, allowing users to install Ubuntu’s terminal on Windows through official means without the need for compatibility layers. Using Ubuntu’s terminal on Windows has the advantages of being able to use apt-get and dpkg to install new packages, which was not possible with Cygwin, and of running Python and C/C++ codes faster. Here are the steps to install Ubuntu terminal on Windows 10:
- On Windows Settings, click on “Update & Security.” There, click on “For Developers” close to the bottom on left pane and turn on the option “Developer Mode.”
- Windows Settings, click on “Apps” -> “Programs and Features” (right pane) -> “Turn Windows features on or off” (left pane) and check “Windows Subsystem for Linux.”
- Restart your computer.
- Open Windows PowerShell as administrator, type the following line and press enter:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Open Microsoft Store (Windows’ app store), look for “Ubuntu Terminal,” and install it.
- Now you should have it installed and a shortcut on your quick-start bar.
- Open the Ubuntu Terminal and type:
sudo apt-get update
In order to install programs such as the Intel compiler and profiler (free for students), pip, Vim, GNUPlot or the most recent version of GCC, just type:
sudo apt-get install program_to_be_installed
If the package you installed has graphical components, such GNUPlot and Python/Matplotlib, you will need to install a program on Windows to display the graphical components from the Ubuntu terminal. One such option is Xming. To use Xming, follow the following steps:
- Install Xming from here.
- Run it. Click “next” until you can click on “Finish.” This process will have to be repeated every time you open the terminal.
- Open Ubuntu terminal
- Type the following and press enter:
echo "export DISPLAY=localhost:0.0" >> .bashrc
- Close and re-open the terminal
- In order to make sure you can run graphic applications, run the following two commands:
sudo apt-get install x11-apps xeyes