VNC Server disconnected (code: 1006)

OpenNebula 5.2

After deploying the VM from vCenter Template i am not gating VNC console .

I have checked this setting

firewall-cmd --state
not running

remotedisplay.vnc.enabled TRUE
remotedisplay.vnc.port 5901

VMWare Tools is installed

In the vSphere client proceed to Home -> Inventory -> Hosts and Clusters
Select the ESX host, Configuration tab and select Security Profile in the Software category
In the Firewall section, select Edit. Enable GDB Server, then click OK

Hi Ranveer,
I’d start checking a few things:

  • Are you running an AdBlocker in your browser? VNC console in Sunstone is affected by that browser extension.
  • Can you confirm that OpenNebula’s frontend can reach the ESX host where the VM is running? For instance, you can install nmap and try to do nmap -p 5900 X.X.X.X changing X.X.X.X with the IP of your ESX host. That way we can check if that port is open and non-filtered.
  • What’s the ID of the VM you’re running?
  • Sometimes I would wait a couple of minutes once the VM is in running state as some operations would be finishing.


I haven’t used VMWare, but this might help.
For Vagrant + Virtualbox, when I got the same error:

  1. I went to developer options in the browser, and went to the network tab to see what traffic was happening.

  2. I saw a request for myhost:29876 . This was different from the port I used to access the web portal (myhost:9869).

  3. I modified the Vagrantfile to include both ports… "forwarded_port", guest: 9869, host: 9869 "forwarded_port", guest: 29876, host: 29876