Posted by & filed under Hacks, Tools & Methodology.

VMware has for a long time shown a blatant disrespect for its Mac customer base by not providing a decent method of accessing Virtual Machines (VMs) from OS X.

The VMware Infrastructure (VI) Client is .Net-based and cannot easily be run from OS X, and the browser plugins does not work with Safari or Firefox (on OS X). There has been a wide range of creative ways of bypassing this ridiculous restriction (among others using another VM as base for launching the VI client), as well as a public “uproar” to witch VMware has decided to turn its deaf ear.

VMware server and ESXi are great products, but not being able to access to my VMs from my Macbook is, to be honest, a huge pain in the *ss. So here’s a simple way of accessing all your VMs consoles directly from the finder in Mac OS X. It will also enable VM access on the iPad/iPhone through VNC apps such as iTeleport. The final result of this tutorial will lead you to a finder that looks something like this, with all your VMs from your VMware Server/ESXi lined up for easy VNC remote desktop access:


You can then easily connect to all of your virtual machines directly from your finder/iPad/iPhone! You have access to all the features of the VI client, including low-level stuff like BIOS, etc. The guide should work with few modifications for other host- and client OSes.

You’ll still need to use the VMware Infrastructure Web Access interface to manage (start/stop/take snapshot/etc.) your VMs. As of Mach 18th, you can also use the VMWare vSphere iPad app to do this.

IMNSHO, this is a much better way of remote access than the hacks mentioned above and other places at the Internet, as it doesn’t involve any client or server-side virtualization. In other words, you don’t need to buy VMware Fusion or struggle with X11 forwarding over SSH to make it work, and it’s far less resource intensive. It’s also less cumbersome than installing VNC in each VM. Finally, it enables access on all devices that supports VNC which is pretty much any OS out there!

Getting started

The ingredients:

  • VMware Server (the guide should work for ESXi as well, but you’ll have to configure it through the VI client, so a bit of a catch-22 there) (host), I’ve used Ubuntu as the host system in this guide
  • A Mac with OS X (other OSes should also work, but you’ll need a VNC client) or a mobile device with a VNC client connected to the same LAN/WLAN as the host
  • An Internet connection
  • Ability to type some commands in the terminal (do not fear, the commands will be provided)

That’s it! Let’s get started.

Enable VNC to the virtual machines

To enable VNC access to a virtual machine, log into your VMware Infrastructure Web Access at:

https://[your ip/hostname]/ui/

Once in, select the machine you want to access from the Inventory, power it off if its on, and select Configure VM from the Commands window under the Summary tab.

VMware Web Access - configure VM

Then click Add New Entry, and add the following lines:

  • RemoteDisplay.vnc.enabled = TRUE
  • RemoteDisplay.vnc.port = [port number]
    (The port number can be anything above port 1024, but VNC ports are commonly from 5901 and upwards. Note: You’ll need to supply a different port number for each VM you want to connect to.)
  • RemoteDisplay.vnc.password = [password]

I strongly suggest using a password. When done, you should have something like this:

Remember the port number (or write it down, for example in the VM notes in the Web Access interface). Click OK.

Now, let’s test the connection with OS X’s built-in VNC client (any other VNC client should work as well). In the Web Access interface, power on the VM.

On your client, open Finder and navigate to /System/Library/CoreServices. You should be able to find an application called Screen Sharing. Open it, and enter your host’s IP address or hostname and the port number you added to the VM configuration using the following syntax:

[ip address/hostname]:[port number]

In my example, this is what it looks like:


Note: It’s important that you connect to your host’s IP/hostname, not your VM. VMware Server “forwards” the VNC connection to the VM.

Click Connect, you should be asked for a password (if you set one), enter it, and voila:

Remotely access VM through Screen Sharing

Congratulations! You can now use the VM as a normal remote desktop. But you’re only halfway to total VMware console bliss. Stay tuned to see how you can make all your remote desktops magically appear in your Finder!

Magically turn your Finder into a VMware console (optional)

In order to make the virtual machines turn up in the finder as pictured above, you’ll need avahi/zeroconf installed at the host. This guide will cover how to install and configure avahi on Ubuntu.

First, install the avahi service:

sudo apt-get install avahi-daemon

Then configure avahi by adding services in /etc/avahi/services. Create a file (one for each virtual machine) and open it:

sudo gedit /etc/avahi/services/win-xp-sp2.service

Paste the following in gedit, and then substitute [VM name] with the VM name and [port number] with the port number set above, respectively:


<DOCTYPE service-group SYSTEM 'avahi-service.dtd'>
<service-group>
<name replace-wildcards='yes'>Windows XP SP2</name>
<service>
<type>_rfb._tcp</type>
<port>5902</port>
</service>
</service-group>

Save and close gedit, and restart avahi:

sudo service avahi-daemon restart

The virtual machine should now magically appear in your Finder if you’re on the same LAN/WLAN as you VMware server. To connect, simply hit Share screen… in the right top corner of your Finder window.

Congratulations, you can now use your Mac with VMware Server!

International only: How to fix keyboard issues

Are you having trouble with the key bindings in VNC? Change your keyboard in OS X to U.S., and set the keyboard to your appropriate model in the virtual machine. This should fix all wierd special characters that are unavailable or erroneously mapped.

You’ll have to switch keyboards at the client side each time you switch between working remote and local, though.

Update: In order to enable the right keymapping, add the following line to the VM configuration:

RemoteDisplay.vnc.keymap = “[keymap]”

Swap [keymap] with your appropriate keymap code.

Note to VMware

This guide is entirely unnecessary; I’m sure you easily could have listened to your paying customers and whipped up a VI Client for OS X in no time. Your move.

5 Responses to “Poor man’s VMware Infrastructure Client for OS X”

  1. HeyVMware

    VMware is dumping all things Microsoft in favor of Flex. The next vSphere reportedly has a new web Flex interface. Maybe that interface supports browser plug-ins and console access on OS X?

    Reply
    • Carsten

      That would be great, personally I can’t wait to get rid of all the workarounds I have to use when administrating a VMware environment from my Mac. A standards-compliant web interface with plugins for all major browsers would be perfect.

      Reply
  2. รับจำนำ iphone

    Thanks for your personal marvelous posting! I really enjoyed reading it, you happen to be a great author.I will
    be sure to bookmark your blog and definitely will come back sometime soon. I want to encourage continue your great work, have a nice day!

    Reply

Trackbacks/Pingbacks

  1.  Geek ToDo: at The bloody toe
  2.  ESXi and VMware Workstation: quick way of getting Console screenshots in PNG format; some URLs on your ESXi machine « The Wiert Corner – irregular stream of stuff
  3.  Geek ToDo: | Nathan Nelson

Leave a Reply

  • (will not be published)