# Enable VNC on VMware Deployments

You can enable VNC on VMware deployments for OpenStack. For VNC console to work, the Platform9 appliance, the ESXi hosts, and the browser where the VNC is being accessed must have IP connectivity to each other.

VMware has provided a vSphere Installation Bundle (VIB) which can be used to open the required firewall ports on ESXi hosts for VNC. The VIB can be found on [GitHub](https://github.com/openstack-vmwareapi-team/Tools/blob/master/openstackvncfirewall.zip).

Follow the steps given below to enable VNC on VMware.

1\. Run the following command to change the ESXi host acceptance level to CommunitySupported.

{% tabs %}
{% tab title="Bash" %}

```bash
esxcli software acceptance set --level=CommunitySupported
```

{% endtab %}
{% endtabs %}

2\. Download openstackvncfirewall.zip and upload it to a datastore that is accessible from the ESXi hosts.

3\. Install the VIB by running the following command.

{% tabs %}
{% tab title="Bash" %}

```bash
esxcli software vib install -d "/vmfs/volumes/datastore1/patch-directory/openstackvncfirewall.zip
```

{% endtab %}
{% endtabs %}

4\. Run the following commands to verify that the firewall rules were applied and the ports are open.

{% tabs %}
{% tab title="Bash" %}

```bash
esxcli network firewall ruleset list | grep vnc
  # vnc true is the output for the above command.
  esxcli network firewall ruleset rule list | grep vnc
  # Details of VNC rule i.e. port range, protocol, direction are displayed in the output for the above command. For example, vnc Inbound TCP Dst 5900 9999
```

{% endtab %}
{% endtabs %}

If you wish to enable VNC console for existing VMs, power off the VM and perform one of the following. This is an optional step.

* Using vSphere Web Client, go to Edit settings>VM Options tab>Advanced> Edit configuration, and add the settings mentioned below, directly on ESXi Host.
* Alternatively, edit the VMX file of the corresponding VM and add the following lines.

{% tabs %}
{% tab title="Bash" %}

```bash
RemoteDisplay.vnc.enabled = "TRUE"
RemoteDisplay.vnc.port = <port number between 5900 and 6199>
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Info**

Ensure that the port number you are adding does not collide with any other VM. One way to verify that is to SSH into the ESXi host, run grep on all the VMX files, and choose a port that is not present in the output of the command, grep “vnc.port” \*.vmx
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-openstack/5.4/accessing-vm/enable-vnc-on-vmware-deployments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
