Use VNC to Access VMware ESX guests

While browsing through the ESX 4.0 screens, I stumbled on the firewall option to enable or disable access to a VNC server. That was reason for me lookup a way to use this VNC server.

It appears that ESX 4.0 has a built-in VNC Server which you can use to manage your virtual machines. You can login from machines that you don't have the vSphere client installed on. For example, Linux systems or  that nice little HP Thin Client I have here. Some may even use it as a backdoor.

Basics

  • This VNC connection is a console view, just like when you're using a KVM switch.
  • Yes, you can access the BIOS.
  • It's a pretty basic way of accessing guests. It does not have advanced functions like poweron/poweroff, reconfiguration and stuff. Use the VMWare Server Console or the VMWare MUI web interface for that.
  • It must be enabled per-guest.
  • Connect to the IP/hostname of the ESX server - not the IP/hostname of the guest!
  • The VNC server for each VM guest you connect to will have a different display number.
  • Display numbers and tcp port numbers are linked: display 0 = port 5900, display 1 = port 5901

How it works

  1. Switch off your VM Guest.
  2. Add a few lines to its configuration.
  3. Switch on your VM Guest
  4. Connect to the IP/hostname of the ESX server - not the IP/hostname of the guest!

The actual configuration

RemoteDisplay.vnc.enabled = "TRUE"
RemoteDisplay.vnc.password = "your_password"
RemoteDisplay.vnc.port = "5900"

You can apply these settings by editting the .vmx file manually using ssh or the Datastore browser. Or you can use the gui:

  • Select the right VM Guest in your vSphere client.
  • Right click and choose "Edit settings"
  • Go to the "Options" tab
  • Under "Advanced", choose "General".
  • Click on the "Configuration Parameters" button.
  • Add the configuration parameters
  • Click OK
  • Click OK
  • That's all folks.

Firewall

You will need to open the firewall to allow incoming VNC connections. You can find this in the ESX hosts configuration > Software:Security profile > Properties. Or you could run "esxcfg-firewall -e vncServer"

© GeekLabInfo Use VNC to Access VMware ESX guests is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info

1 Star2 Stars3 Stars4 Stars5 Stars (9 votes, average: 4.22 out of 5)
Loading...

6 comments on “Use VNC to Access VMware ESX guests”

  1. Good point. You will need to open the firewall to allow incoming VNC connections. You can find this in the ESX hosts configuration > Software:Security profile > Properties
    Or you could run "esxcfg-firewall -e vncServer"

  2. Very nice feature!
    We have 3 VMware hosts, and the VM's could be moved around.
    Is there any way of connecting to a specific VM without knowing which of the hosts it is residing on?

  3. @David May 30, 2011 at 12:55 pm
    I don't think there is a solution to that problem at the host level. Installing a vnc server on the client would be the solution here, I guess.

    Hmm, I wonder what happens when you vMotion a client to a host that already has the vnc server running on the specific port...

  4. May I ask you a question?
    I did this configuration, but my mouse can't run normally without VMTools.
    Do you have any good solution? Thanks.

  5. Never had this problem. But then again, I always install the vmtools. They are not absolutely required, but when installed, they make sure memory usage and thus the guest's speed is improved seriously.

Leave a Reply