3

How can I specify on which port will instance of VSCode server be started on remote host? Is it at all possible?

Currently it seems like VSCode just selects this port somewhat randomly. However it won't work for me since in my environment almost all the ports are closed.

There is Default Forwarded Ports setting, but either I don't understand how to fill it in correctly, or it is about different thing.

I believe my question is not a duplicate of this one. I am talking about a different port.

halfer
  • 19,824
  • 17
  • 99
  • 186
gyzerok
  • 1,338
  • 2
  • 11
  • 26
  • 1
    I'm afraid this is internal to the Remote SSH extension and does not provide any parameter in the SSH Config to define either the Host receiving port nor the Remote Agent port `Tunneled remote port 40510 to local port 63464`. The rationale might be to permit popular ports such as 5000,3000,8080 be used for mock-up rather than reserve it for vscode-remoteserver tunnel. – Bharath May 19 '20 at 22:51

2 Answers2

3

Update:

You can now specify range of ports like so

"remote.SSH.serverPickPortsFromRange": {
  "hostname": "8000-9000"
},

Original:

Currently VSCode does not support specifying custom port for VSCode server instance.

There is an open issue on the topic: https://github.com/microsoft/vscode-remote-release/issues/1386

gyzerok
  • 1,338
  • 2
  • 11
  • 26
3

Just add remote SSH config on vs code and edit that config like bellow

Host www.somehostName.com
 HostName 194.00.83.57
 User root
 Port 9022

you can also add pvt key files this is the key

IdentityFile ~/.ssh/target

Alap
  • 59
  • 4