VirtualBox with RDP through ssh tunnel

I have a strange requirement that I thought would be easy to do but turns out to be more complicated than I thought.

I run a heavily firewalled HPC scientific cluster. A user wants a Windows 7 VM to run a specific app. I created the VM on my Mac and then copied it to a Centos 7 server in the cluster. VirtualBox runs it fine as a headless server and says it is listening on port 3389.

To get to the cluster you first have to ssh to a login node, and from there you can get the rest of the cluster.

So, I have to create an SSH tunnel, right? Except the tunnel is not to the login node, it's to another server in the cluster after you get into the node. The VM is not running on the login server (that is a VM in and of itself). So I have to do double-forwarding?

I tried using localforward in the .ssh/config file and it doesn't quite work.

Now I'm thinking that I have to configure the login node to forward all traffic on port 3389 to the server running the vm.

Am I moving in the right direction or barking up the wrong tree?

0
задан 31 January 2017 в 10:53
1 ответ

Учитывая, что вы можете заставить сервер входа в систему перенаправлять трафик на экземпляр VirtualBox, я предполагаю, что сервер VirtualBox находится всего в одном шаге от сервера входа в систему, а сервер входа в систему может достигать экземпляр VirtualBox на порту 3389.

В этом случае вам не нужно выполнять двойную пересылку. SSH может перенаправить порт любого удаленного компьютера, к которому может подключиться SSH-сервер, поэтому вам нужно сделать только следующее:

ssh -L 3389:host.which.runs.virtualbox:3389 the.login.node

Следует отметить, что host.which.runs.virtualbox: 3389 часть в приведенном выше примере относится к компьютеру, на который вы входите. Поэтому, если компьютер для входа в систему знает хост, на котором запущен VirtualBox, как vboxrunner.local , вы можете использовать это имя в пересылке, даже если ваш локальный компьютер (тот, на котором вы запускаете ssh) ничего не знает об этом имени .

0
ответ дан 5 December 2019 в 08:42

Теги

Похожие вопросы