• ARTICLES
SEARCH

How-To Geek

Connect to VMware Server Console Over SSH

Has this ever happened to you? I created a new virtual machine running Ubuntu on my VMware server before I left home, but forgot to install the ssh server… so I couldn’t get to that machine at all from my remote location. Rather than driving back home I decided to find a solution.

After a bit of research I discovered that the console communicates on port 902, so I added a port-forwarding rule to an ssh tunnel and was able to easily get on the console and install openssh.

Port Forwarding with ssh Command

In order to open a local port below 1024 you will need to run this command as root, or by using sudo. This will open the local port 902 on your client machine and then forward the connection to the server specified by hostname.com.

sudo ssh -L 902:localhost:902 username@hostname.com

At this point you can skip to the last section in the article.

Port Forwarding with SecureCRT

If you use SecureCRT under Windows like I do, just open up your session options and find Port Forwarding in settings and click the Add button for a new forwarded connection.

image

Enter in a name, and use 902 for both of the Port fields as shown below:

image

Logging into the Console

Bring up your locally installed VMware Server Console, and use localhost for the Remote host name. You can’t use the “Local host” radio button because it will attempt to connect directly to the service… we want to connect over the SSH tunnel.

image

And there you are… logged onto your console.

image

Notes

  • The server console itself should work fairly well, but if you try and get onto the actual console of one of the virtual machines you should make sure you have a really fast connection… otherwise it’s slower than dirt.
  • I’d really only use this for powering machines on/off, or changing the settings.
  • You might potentially have to change your local firewall settings to allow the port.
  • Putty users should be able to easily adapt the settings above to work for them.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 10/10/07

Comments (2)

  1. Guy Leech

    To get a decent console connection, use VNC to the VMware Server itself, over SSH forwarded ports. This is not configurable in the GUI in Server (it is in Workstation 6), you have to edit the .vmx file for the relevant VM directly (when the VM is not running). Just add something like the following:

    RemoteDisplay.vnc.enabled = “true”
    RemoteDisplay.vnc.port = “5910″
    RemoteDisplay.vnc.password = “S0mePassw0rd”
    RemoteDisplay.vnc.keymap = “uk”

    Then set an SSH port forwarding from say local port 5910 to port 5910 on the VMware Server itself (not the IP of the VM) and use a VNC client to connect to 127.0.0.1:5910. I then keep a list of the ports I use for each VM – obviously you must use different ports for different VMs if you use them concurrently.

    This will even let you do a bare “metal” build of the VM since you are not using networking in the VM itself.

  2. PeSe

    Brilliant!

    Thank you!

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!