Home » Questions » Computers [ Ask a new question ]

Can I use SSH port forwarding to connect via RDC to a Windows VM setup to use NAT?

Can I use SSH port forwarding to connect via RDC to a Windows VM setup to use NAT?

I have the following, totally bizarre, please don't ask, setup:

Asked by: Guest | Views: 79
Total answers/comments: 1
Guest [Entry]

"Yup. This shouldn't be any different than other SSH tunnels, really.

I'll use hostnames since I don't know what your internal IPs are :).

ssh -L 13389:virtual_pc:3389 kch@ibook

The virtual_pc address should be whatever the ibook knows how to connect to it as. The port 13389 can be any port you like, it will be opened on your local system through the ssh tunnel. You can also put this in your ~/.ssh/config file on your Macbook:

Host virtual_pc_rdc
Hostname ibook
User kch
LocalForward 13389 127.0.0.1:3389

In both cases replace kch with your actual username, of course. After adding this to your config, you will get the same SSH tunnel with:

ssh virtual_pc_rdc

Use whatever hostname you like instead in the Host line of the config.

Once the connection is made, you can point RDP to localhost:13389 for the connection. Caveat, I don't know RDP software that well, but you should be able specify a different port."