microsoft / microsoft/vscode-remote-release

Cannot connect to windows host because uname is not found

Open
#11,389 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Is there an existing issue for this bug?
  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.
Required Troubleshooting Steps
  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar
[Optional] Diagnose with Copilot

I asked @remote-ssh but it did not help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I COULD successfully SSH to the remote machine with the generated SSH command

Remote-SSH Log
Remote-SSH Log

...
[22:39:13.219] Spawned 12201
[22:39:13.220] Using connect timeout of 62 seconds
[22:39:13.332] > local-server-4> Running ssh connection command: ssh -v -T -D 57142 -o ConnectTimeout=60 windows-host.local powershell
[22:39:13.334] > local-server-4> Spawned ssh, pid=12209
[22:39:13.714] stderr> debug1: Server host key: ssh-ed25519 SHA256:q1uMM4sdD/YBS+ZBe636bLJXfwFtaAhSjGTEgCwmTFU
[22:39:13.881] stderr> Authenticated to windows-host.local([192.168.68.111]:22220) using "publickey".
[22:39:14.450] > Windows PowerShell
> Copyright (C) Microsoft Corporation. All rights reserved.
> 
> Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
[22:39:14.450] > 
[22:39:14.776] > PS C:\Users\Quickemu> 
[22:39:14.790] > echo 'ready: 234b978c1266'
[22:39:14.907] > ready: 234b978c1266
[22:39:14.922] > PS C:\Users\Quickemu> 
[22:39:14.923] > uname -rsv
[22:39:15.100] Platform: windows
[22:39:15.101] Remote command length: 6676/8192 characters
[22:39:15.108] stderr> At line:1 char:1
[22:39:15.108] stderr> + uname -rsv
[22:39:15.109] stderr> + ~~~~~
[22:39:15.109] stderr>     + CategoryInfo          : ObjectNotFound: (uname:String) [], CommandNotFoundException
[22:39:15.109] stderr>     + FullyQualifiedErrorId : CommandNotFoundException
[22:39:15.110] stderr>  
...

Expected Behavior

By default, Windows hosts don't have uname installed and on the path. This requires installing Git Bash, GnuWin32, Cygwin or MSYS2.

It should be possible to connect to a windows host successfully when uname is missing.

Or at the very least this behaviour, and how to fix it, should be documented.

Actual Behavior

When uname is not on the path, connecting to a Windows host fails with:

Failed to connect to the remote extension host server (Error: ExtensionInstallFailed(ExtensionInstallFailed("bash: line 1: C:UsersQuickemu.vscode-servercliserversStable-994fd12f8d3a5aa16f17d42c041e5809167e845aserverbincode-server.cmd: command not found\n")))
Steps To Reproduce
  1. Connect to a Windows host that doesn't have uname on the path.
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Remote-SSH: Show Log output and reproduce the connection using the generated SSH command on a Windows host where uname is unavailable. Trace the uname -rsv step and the subsequent server startup command; done means Remote-SSH connects successfully without requiring uname, or the required Windows setup is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.