I am connecting to ESXi with vSphere client from a remote LAN.

ESXi is running on 10.1.1.10, so I create an ssh tunnel (using cygwin but putty or plink should also work) with this command:

ssh -v -p 2222 -L 903:10.1.1.10:903 -L 902:10.1.1.10:902 -L 443:10.1.1.10:443 -L 80:10.1.1.10:80 ssh-user@remote-lan-router.example.com

VSphere does not connect, I get a "connection error" connecting to localhost. I can telnet the ports on localhost, they are responding.

Do I have to forward more ports apart from 80,433,902 and 903? When I connect with VSphere client from within the remote-lan to 10.1.1.10 it works.

In this drawing = means WAN connection and -stands for LAN connection:

[vSphere client machine] = = = ssh = = = [remote-lan-router] - - - [ESXi 10.1.1.10]

Edit: Solution (via accepted answer):

I added a host entry 127.0.0.1 myhost1 to the hosts file (c:\WINDOWS\system32\drivers\etc\hosts) on the vSphere client machine (which runs windows) and then connected the vSphere client to myhost1

At least with a single client controlling a single server this seems to work fine.

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

You're going to have problems with this, because ESXi relies on client-side name resolution, which is unlikely to work over an SSH tunnel.

To get around this and get you to connect, try adding an entry into your hosts file with a name of your choosing and settings its IP 127.0.0.1 and connecting to that instead. This should at least get you in, but I don't know how well name resolution will work inside of vSphere (for nodes and clusters, etc)

link|improve this answer
On the client machine that you are using to connect to the remote LAN – Mark Henderson Jul 28 '10 at 1:06
uh I might have messed up the HOSTS entry there... you'll need to point it to your SSH tunnel. I know on Windows with Putty that means pointing it to 127.0.0.x but I'm not sure what it is on Linux... – Mark Henderson Jul 28 '10 at 1:07
It works now. I added a host entry 127.0.0.1 myhost1 to the hosts file on the vSphere client machine (whcih runs windows) and then connected the vSphere client to myhost1 – mit Jul 28 '10 at 2:11
Aah, excellent, you were on Windows. Great. Glad I could help. – Mark Henderson Jul 28 '10 at 2:27
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.