Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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)

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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