Windows Remote Development Tips
Port Forwarding (Tunnel) With SSH
|
|
Arguments (see man page):
-L [bind_address:]port:host:hostport
: Which port to forward-N
: Executes no command, creating a shell that’s just forwarding the port. It’ll look like it’s hanging.-f
: Putssh
process in background
Remote Development Through a Jump Host
Remote Machine Setup
- Go into the Developer Settings (search for it in the Start Menu), and then enable all of the Remote Desktop options
- Follow the guide here to install OpenSSH server on the remote machine, which will also include
scp
Windows Remote Desktop
The Windows Remote Desktop port is 3339 by default. You can forward this port through your jump host, and then create a remote desktop connection to the port you’ve opened locally. Any of the following options should work.
|
|
Then, you can create a Remote Desktop connection to the port you’ve opened locally (configuring username as appropriate).
You can also forward local drives (from the client to the remote machine), such that the client’s drive is available for transparent local access on the remote machine. Be warned that the transfer speeds may not be fantastic, though, and you may be better off with another solution (from below).
Transferring Files (With SCP)
This website has some more details / options. I’ve listed the two I found most useful below.
Single Command Transfer
|
|
This will prompt you for a password to log in to the jump_host, which may not be a problem if you’ve set up passwordless ssh, but could become annoying if you have additional authentication on the jump host, such as via 2fa. If so, consider the next option.
Persistent Transfer Tunnel
In one terminal, open a tunnel to port 22:
|
|
Then, in another terminal, scp
via the port you just forwarded (4242
for the command above):
|
|
SOCKS Proxy
Install Proxy SwitchyOmega.
Then, forward some port with dynamic forwarding (-D
):
|
|
As before, this will not produce any output after connection, so it’ll look like its hanging. Once this is initialized, though, you should be able to use the Chrome extension to proxy traffic through port 8124, as below:
Visual Studio Code (VS Code)
CTRL + Shift + P, edit remote SSH settings for the user, and then update remote.ssh.serverinstallpath
to point to a different directory for the vscode server, using the ssh config names.
- Windows terminal, set the splits to be ctrl +\ and ctrl +- for split-right and split-down respectively
user settings vim:
|
|