WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Uncategorized / Using a VNC Client to Connect to VMs in ESXi 5

Using a VNC Client to Connect to VMs in ESXi 5

01.09.2012 by William Lam // 10 Comments

The ability to connect to a virtual machine using a VNC client has been available since the early days of VMware GSX as described by this VMware KB article. The required .vmx configuration can also be applied to virtual machines running on ESX(i), but is not officially supported by VMware. With ESXi 5, this continues to work but there is one additional caveat users should to be aware of, which is the new firewall that has been introduced in ESXi 5.

In addition to the three .vmx configurations:

  • RemoteDisplay.vnc.enabled = [true|false]
  • RemoteDisplay.vnc.port = [port #]
  • RemoteDisplay.vnc.password = [optional]

Users need to also enable the ports selected for each virtual machine on the ESXi firewall. Here is an example of a firewall rule that needs to be created:

Take a look at this blog post for details on configuring custom firewall rules including persisting the custom rules upon a system reboot.

Here are a few screenshots of configuring the .vmx configurations and using a VNC client to connect to the powered on virtual machine.

Only the first two .vmx configurations are required, if you do not set a password, anyone can connect to the virtual machine as long as they know the hostname/IP Address of your ESX(i) host and port.

To connect to a specific virtual machine, you will specify the hostname/IP Address of the ESX(i) host and port for the given virtual machine. If you set a password, you will need to also provide that before you can connect.

Please be aware of the limitations and security concerns of using VNC. VMware Remote Console or standard RDP/SSH should still be considered for virtual machine remote access.

More from my site

  • How to Create Custom Firewall Rules in ESXi 5.0
  • Quick Tip - vmware-iso builder for Packer now supported with ESXi 7.0
  • Quick Tip - List all open ports on the VCSA / PSC
  • How to audit vSphere Standalone VMRC or HTML5 VMRC connections?
  • How to restrict access to both the Standalone VMRC & HTML5 VM Console?

Categories // Uncategorized Tags // esxi5, firewall, remote console, vnc

Comments

  1. Emanuel says

    05/24/2012 at 1:36 pm

    hmm I just found out that if you don't care about opening up heaps of ports (e.g. at home or labs or just for testing) then you can enable a pre-existing firewall rule called "VM serial port connected over network" which basically just opens all TCP ports above 1024 or so.

    Reply
  2. Flohack says

    08/21/2012 at 1:45 pm

    Just to note that not all VNC clients seem to support the correct encoding. RealVNC failed during connect with some unknown encoding erros in the vmware.log file of the corresponding VM, while TightVNC was fine with hextile encoding.

    Reply
  3. Anonymous says

    09/23/2013 at 11:22 pm

    I copy/pasted the above XML, refreshed the firewall ruleset, but 'vnc' didn't not show up in the list. The cause is that the first line doesn't match the last one (because ESXi is case sensitive)! If you change the first line to then 'vnc' will show up as expected.

    Reply
    • Anonymous says

      09/23/2013 at 11:24 pm

      That should've read "change the first line to 'ConfigRoot'" - I suspect the site interpreted my angle brackets as HTML code and stripped it out. 😉

      Reply
  4. Alexandros says

    09/08/2014 at 5:39 pm

    Very nice How-To!

    Reply
  5. Adwait says

    09/10/2015 at 3:59 am

    How does VNC to a VM managed by vCenter work?
    What I observed was that for VNC console, we still need to connect to the underlying : and not the : .
    Annoying part is to enable firewall rule on each individual ESXi host managed by the vCenter

    Reply
    • Adwait says

      09/10/2015 at 4:18 am

      The text in the brackets was filtered in the above question.
      How does VNC to a VM managed by vCenter work?
      What I observed was that for VNC console, we still need to connect to the underlying ESXi_HOST: DISPLAY_PORT and not the vCENTER_HOST : DISPLAY_PORT .
      Annoying part is to enable firewall rule on each individual ESXi host managed by the vCenter

      Reply
  6. Andrew says

    01/12/2017 at 7:45 am

    Thanks for your work, your site is extremely useful. I just wanted to mention that it looks like the firewall rules mentioned don't seem to be listed here. Did they get stripped out at some point?

    Thanks again!

    Reply
  7. Jan says

    01/19/2017 at 6:58 am

    I just want to mention that the KB article link is broken.

    Reply

Trackbacks

  1. ESXi 開啟VNC功能 | 可丁丹尼@一路往前走2.0 says:
    12/23/2015 at 12:14 am

    […] Using a VNC Client to Connect to VMs in ESXi 5 […]

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to enable passthrough for USB Network Adapters claimed by ESXi CDCE Driver? 03/30/2023
  • Self-Contained & Automated VMware Cloud Foundation (VCF) deployment using new VLC Holodeck Toolkit 03/29/2023
  • ESXi configstorecli enhancement in vSphere 8.0 Update 1 03/28/2023
  • ESXi on Intel NUC 13 Pro (Arena Canyon) 03/27/2023
  • Quick Tip - Enabling ESXi Coredumps to be stored on USB 03/26/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023