Search code examples
visual-studio-codevscode-remote

How to specify port for VSCode server when using Remote - SSH?


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.


Solution

  • Update:

    You can now specify range of ports like so

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

    Where "hostname" is the hostname of the remote server.

    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