Showing posts with label putty. Show all posts
Showing posts with label putty. Show all posts

Tuesday, July 14, 2015

Open a console to a virtual guest on ESXi or vSphere cluster

This entry ties in nicely with a previous entry I made about creating SSH tunnels for vSphere.

Unfortunately, when you setup SSH tunnels for the Windows vSphere client (or even for the vSphere web client), you cannot open console windows to the guests using the normal methods -- they will always fail to connect.

To workaround this, use VMware's "Remote Console" program to connect through the tunnel to the host. Note that the tunnel must go to the host on which the guest is running.

Steps:

  1. Install VMware Remote Console (in Vmware downloads, vsphere 5.5, "Drivers & Tools" tab)
  2. find out the VMID of the desired guest using the ESXi cmd line:
        vim-cmd vmsvc/getallvms
  3. open url (assuming host tunnel is 127.0.0.4):
       vmrc://root@127.0.0.4/?moid=vmid
    where vmid is the id you found; e.g. if the ID is 29:
       vmrc://root@127.0.0.4/?moid=29

In case it is not obvious, you open the URL from the command prompt:

cd C:\Program Files (x86)\VMware\VMware Remote Console
vmrc.exe vmrc://root@127.0.0.4/?moid=29

Thursday, April 3, 2014

SSH tunnel to multiple vSphere/ESXi hosts

An SSH tunnel to a single host is easy; reference: http://www.virtuallifestyle.nl/2010/03/tunneling-a-vsphere-client-connection-over-ssh/

However, if you want to open the vSphere client multiple times for simultaneous connections to multiple ESXi/vCenter hosts, then you have to get a little creative. Basically you follow the same instructions as above, except you don't need to edit the hosts file. Just use a single address in the loopback network (127.0.0.2 - 127.255.255.254 ) for each remote ESXi host.  e.g.:

ESXi host Tunnel Source Tunnel Destination
host1 127.0.0.2:443 esxhost1:443
host1 127.0.0.2:902 esxhost1:902
host1 127.0.0.2:903 esxhost1:903
host2 127.0.0.3:443 esxhost2:443
host2 127.0.0.3:902 esxhost2:902
host2 127.0.0.3:903 esxhost2:903

Then simply connect vSphere client to one of the loopback addresses you used.  In the example above, to connect to esxhost1, you connect vSphere Client to 127.0.0.2.  For esxhost2, 127.0.0.3.

You should be able to make up to ~16 million tunnels this way!

NOTE: When using an SSH tunnel, the vSphere Client will not show the "Hardware" tab for your hosts.

Tuesday, January 5, 2010

Replace Cygwin command prompt with Puttycyg

I install Cygwin on every Windows machine that I have to use regularly. By default, Cygwin uses the Windows Command Prompt for its terminal. Gross!

I much prefer putty -- to the point that I would open putty and SSH to localhost, just so that I can use a real terminal!

With puttycyg, there's no need to SSH in. Donwload puttycyg and extract the ZIP. Then copy the two executables (putty.exe and cthelper.exe) into C:\cygwin (or wherever you have it installed).

Then, modify your cygwin.bat shortcut to run this target instead:
C:\cygwin\putty.exe -cygterm -

(yes that is a dash at the end!)