Adding VNC to an imported VMware VM

Hi folks,

Could someone tell me how I can add VNC console access to an existing VM once imported.

For eg the following template configuration:

GRAPHICS = [
TYPE = “vnc”,
LISTEN = “0.0.0.0”
]

I have setup the advanced remotedisplay.* settings on the VM from vCenter which is not enough to establish VNC capability from a power on via OpenNebula.

Any help is greatly appreciated.

Thanks,
Derek

You not able to access the VM’s VNC console from Sunstone?

We can for VMs that have been deployed via OpenNebula (new VM from template etc).

A customer has built a VM in vCenter, it was imported into OpenNebula, then the remotedisplay.* settings were set, it was then restarted via OpenNebula.

We were hoping this would be enough to bring up the VNC connection, as the VM was imported it has no ‘Graphics’ area in it’s template.

This is the current remotedisplay.* settings in the VM .vmx file that is not working…

remotedisplay.vnc.enabled = “TRUE”
remotedisplay.vnc.ip = “0.0.0.0”
remotedisplay.vnc.port = “5900”

I have attached a screenshot of the template of the VM.


I’m curious could the following ‘onevm’ flags be used to add VNC options to the VM?

 --vnc                     Add VNC server to the VM
 --vnc-password password   VNC password
 --vnc-listen ip           VNC IP where to listen for connections. By
                           default is 0.0.0.0 (all interfaces).

Hi folks,

Does anyone have a suggestion on how this could be done?

Seems like one option would be to rebuild the VMs and reuse the vmdk’s for the new VMs, and setting the remotedisplay.* advanced options before importing to have VNC work.

Alternatively we would have to remove the one DB and start again?

Any suggestions appreciated!

Thanks

Setting the remotedisplay.* options in the VM extraConfig before importing the VM is a must.

Other options are (for most to least destructive)

  1. removing the DB and starting again as you say
  2. removing the vm_pool entry in the DB corresponding to that VM and importing again
  3. modifying the XML in the vm_pool entry in the DB corresponding to that VM to include the GRAPHICS section

Hello,
I just tested for already imported VM’s;
1 shudown VM (from opennebula) - so vmx file is editable
2 go to Conf tab _ Update Configuration
3 remove all entries from Graphics
GRAPHICS = [
TYPE = “vnc”,
LISTEN = “0.0.0.0”
]
3 save “Update button”
4 check Template page - no more Graphics section
5 edit from Conf tab “Update Configuration” → Advanced
6 add graphics+ port after CPU entry
GRAPHICS = [
LISTEN = “0.0.0.0”,
PORT = “5904”,
TYPE = “vnc” ]
7 save “Update button”
8 check Template tab
9 start VM from OpenNebula :slight_smile: enjoy