Step-by-Step Guide: Configuring Ubuntu and PuTTY in Windows Terminal
Windows Terminal is a powerful tool that can unify multiple command-line interfaces, including Ubuntu (via WSL) and PuTTY. This guide will help you integrate both into Windows Terminal for an efficient and streamlined workflow.
Step 1. Install Windows Terminal
If you haven’t already, install Windows Terminal from the Microsoft Store:
- Open the Microsoft Store.
- Search for Windows Terminal.
- Click Install.
Step 2. Add Ubuntu to Windows Terminal
Install WSL To use Ubuntu, you must enable and install the Windows Subsystem for Linux (WSL):
-
Open PowerShell as Administrator and run:
wsl --install
This installs the latest version of WSL along with a default Linux distribution, usually Ubuntu.
- If Ubuntu is not installed, you can manually install it from the Microsoft Store:
- Open the Microsoft Store.
- Search for Ubuntu.
- Install the version you prefer (e.g., Ubuntu 20.04). or,
-
Run the following command in PowerShell:
wsl --install -d Ubuntu
- Once installed, launch Ubuntu to set up your username and password.
-
To set up a user and password, run the following command in Ubuntu:
sudo adduser <username>
Check Installed WSL Distributions Run the following command in PowerShell to verify Ubuntu is installed:
wsl --list --verbose
You’ll see a list of all installed WSL distributions.
Step 3: Add Ubuntu Profile to Windows Terminal
Ubuntu is usually added automatically. If not, add it manually:
- Open Windows Terminal.
- Click the down arrow in the top menu and select Settings.
- Scroll down to JSON file or click “Open JSON file” to edit it directly.
-
Add the following JSON snippet for Ubuntu:
{ "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "icon": "ms-appx:///ProfileIcons/{2c4de342-38b7-51cf-b940-2309a097f518}.png", "hidden": false }
-
Save and close the JSON file.
- Or, Click on the dropdown menu and select Settings.
- Click on the Add a new profile button.
- Click on the New empty profile button.
- Add name as Ubuntu and set the commandline as wsl.exe -d Ubuntu.
- Restart Windows Terminal, and Ubuntu will appear in the dropdown menu.
Step 4. Add PuTTY to Windows Terminal
PuTTY is a popular SSH client and can also be integrated into Windows Terminal.
Install PuTTY
- Download PuTTY from the official PuTTY website.
- Install PuTTY on your system.
Add a Profile for PuTTY
- Open Windows Terminal.
- Go to Settings and open the JSON file for editing.
-
Add the following JSON snippet to configure PuTTY:
{ "commandline": "C:\\Program Files\\PuTTY\\putty.exe", "guid": "{82a5e4dc-8b1d-4635-804d-0f03a20aff5e}", "hidden": false, "icon": "C:\\Program Files\\PuTTY\\putty.ico", "name": "PuTTY", "startingDirectory": "%USERPROFILE%" },
- Or, Click on the dropdown menu and select Settings.
- Click on the Add a new profile button.
- Click on the New empty profile button.
- Add name as PuTTY and set the commandline as C:\Program Files\PuTTY\putty.exe.
- Save and restart Windows Terminal. PuTTY will now be available in the dropdown menu.
Customize Ubuntu and PuTTY Profiles
Customization Options You can further customize each profile with options like fonts, color schemes, or starting directories:
{
"fontFace": "Cascadia Code PL",
"colorScheme": "Campbell",
"startingDirectory": "//wsl$/Ubuntu/home/<your-username>",
"backgroundImage": "C:/path/to/your/background.png",
"backgroundImageOpacity": 0.5
}
Steps to Apply Customization
- Replace
<your-username>
with your Ubuntu username. - Update paths to match your setup.
- Save and restart Windows Terminal.
Verify Profiles
- To verify your configuration:
- Open Windows Terminal.
- Click the dropdown menu and check if Ubuntu and PuTTY appear.
- Launch each profile to ensure they work correctly.
Bonus: Enable SSH with Ubuntu
You can also use Ubuntu for SSH connections instead of PuTTY by installing OpenSSH:
-
Open Ubuntu and run:
sudo apt update sudo apt install openssh-client
-
Use SSH commands directly in your Ubuntu profile, such as:
ssh user@hostname
Conclusion
By integrating Ubuntu and PuTTY into Windows Terminal, you can manage your development and administrative tasks more efficiently. The unified interface allows for seamless switching between environments, enhancing your productivity and workflow.