October 03, 2013

Accessing vSphere Web Client via SOCKS proxy

vSphere Web Client is a very nice and usable alternative to a standard vSphere Infrastructure Client. The first one is a cross-platform solution, when the second can be run only from Windows machines and need a license to install / or a remote desktop connection to use from the customer (which is usually slow)

When someone wants to open VM Console in the vSphere Web Client under Linux (via SOCKS proxy), here is a nice way I have found after doing some debugging & tracing.

Assume you have following IP to vSphere is vCenter is ESX

vSphere Web Client is at address.

To access the you need to go via SOCKS proxy

Below is the solution of getting a “straight” access to the vCenter

Add Virtual IPs (em1 is my main network interface)

# ifconfig em1 add
# ifconfig em1 add

Define vCenter IP in /etc/hosts

[root@localhost ~]# grep '10\.30' /etc/hosts    vcenter.esx.lab.local

Create following port forwards (ncat you can find in the “nmap-ncat” package)

# ncat -k -l 902 --sh-exec "ncat -v --proxy-type socks4 --proxy 902"
# ncat -k -l 9443 --sh-exec "ncat -v --proxy-type socks4 --proxy 9443"
# ncat -k -l 443 --sh-exec "ncat -v --proxy-type socks4 --proxy 443"

Now you can “directly” access to the vCenter / ESX using original IP.

Go to “” in your favorite browser

[arno@localhost ~]$ firefox
2013-05-16 10:53:34.912 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:1576]: ReceiveVmrcCommand(initComplete, 0)
2013-05-16 10:53:34.912 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:340]: startup succeeded
2013-05-16 10:53:35.649 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:1576]: ReceiveVmrcCommand(2, 6)
2013-05-16 10:53:35.670 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:1651]: conn state -- 2 / vcenter.esx.lab.local:443 /  / vm-418 / true / Connection successful.
2013-05-16 10:53:35.918 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:1576]: ReceiveVmrcCommand(gotConnState, 1)
2013-05-16 10:53:35.936 [/build/mts/release/bora-781747/bora/apps/vmplayer/npplugin/linux/VmrcDelegateImpl.cc:1576]: ReceiveVmrcCommand(4, 2)

VM Console was successfully opened!