I just want to SSH into my compute instances using a profile in the new Windows Terminal app.
This worked for me:
"commandline": "cmd.exe /k \"C:/Users/**YOUR_USER**/AppData/Local/Google/Cloud SDK/cloud_env.bat\""
.
Remember about escaping backslash.
Easiest and neat way to do this by running Linux WSL 2 like Ubuntu, install gcloud
sdk, then setup gcloud by running gcloud init
and use below config in Windows Terminal:
{
"guid": "{d8567bf5-f802-498a-899a-efedc99a2aa8}",
"hidden": false,
"name": "Google Cloud Shell",
"commandline": "wsl -d Ubuntu-20.04 gcloud beta cloud-shell ssh",
"fontFace": "Cascadia Code PL",
"useAcrylic": true,
"acrylicOpacity": 0.6,
"backgroundImage": "C:\\Users\\USERNAME\\.terminal\\.gshell-icon.png",
"icon": "C:\\Users\\USERNAME\\.terminal\\.gcloud-icon.png",
"backgroundImageStretchMode": "none",
"backgroundImageAlignment": "center",
"backgroundImageOpacity": 0.5,
"tabColor": "#1a73e8",
}
Note: In the command:
wsl -d WSL-NAME gcloud beta cloud-shell ssh
, you can use any wsl like (kali-linux, alpine, openSUSE-Leap-15.2, etc. just make sure you install and setup gcloud sdk)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With