remote-oss READMEThis extension allows you to use the existing remote extension host (REH) machinery of
VSCode for OSS builds. The machinery is the same as in the proprietary remote development
extension like The remote development pack provided by Microsoft includes several domain specific extensions (ssh, docker, WSL2, etc.). These extensions contain shell scripts that are used to start up a REH instance on the remote host. The remaining part is some glue code to direct the local editor to a local port that has been forwarded in some way to the remote port or socket on which the REH instance is listening. (And some fancy GUI of course...) This extension delegates the REH startup and port forwarding completely to the user to keep the scope simple. Therefore, if you want to use this extension then you are responsible for starting up the correct version of the REH instance and creating the necessary tunnel to forward the traffic (using for example SSH, see the examples below.) For now, this extension just allows you to connect to a local port. (This is actually something the original remote extensions do not allow you to do for some reason.) Note: If you want an alternative that is limited to either SSH tunnels or WSL, you can try the extensions open-remote-ssh or open-remote-wsl instead. RequirementsVSCode defines the connection to remote hosts though special URIs of the shape:
In our case In order to hook into this mechanism, this extension needs to enable several API proposals.
Normally these are blocked so you have to explicitly enable them in your
With this out of the way, we can register our own "remote authority resolver" that will resolve
Extension SettingsThis extension contributes the following settings:
Known IssuesThe RPC protocol follows a strict versioning using the commit hash of the VSCode build as the version. This is mostly useful, because different version might have incompatible changes. Unfortunately, this also means that you have to upgrade the REH instance every time you upgrade your main editor. If you are seeing "authentication" errors, the most probable reason is that your REH instance and your editor have different versions. ExamplesIn this example we are going to connect to a remote host
Log in to the remote port and simultaneously setup port forwarding:
Then, on the remote machine download the REH build and put it in some folder. You can use the following update script:
(The above folder structure is inspired by the remote-ssh extension but is not strictly necessary.) Create a connection token and save it in a file. This is a password, so it must be kept secret, otherwise other users of the same remote machine can connect to your Remote Host Extension and perform arbitrary actions in your name! For example, to create a random 24-character connection token and save it, you can do:
Start the REH instance:
Note, that in the above command line we specified the host to be If you are using SSH as the tunnel service you can further improve the security by using unix
domain sockets. To do that, replace the host and port options above by
Note: The socket has to exist (i.e. the reh must be started up) before a connection to the local
port is attempted by VSCodium. Also note that you have to specify the full path as ssh will not
shell expand You have to keep the tunnel service (i.e., SSH) session running as long as you are using the REH. Alternatively, you can use tools like tmux to create persistent sessions. Now, to connect your local editor install the extension and add the following section to your
To make VSCodium ask for the connection token at each connection attempt, use Now you should be able to trigger a connection from the "Remote Explorer" tree view. You should see a tree that allows you to connect either to the REH instance directly or to a folder you specified in the config. Trigger either one and you will be asked for the connection token you specified above. Have fun! Release Notes... 0.0.5Make the access examples discussed here more secure by using access tokens and unix domain sockets. 0.0.4Properly encode the remote label so it survives a round-trip through the URI parser. 0.0.3Enabled port view and added an example update bash script. 0.0.2Added a new config option ( 0.0.1Initial release of Remote OSS |