Does every VM in XEN have a VNC server running for it? If so, how do I connect to this VNC session, this would be VERY helpful for me!

I'd like to be able to tunnel a connection to my server via SSH, in a manner, ssh -L localportX:localhost:vncportnumber to i can use my VNC client, and connect to localhost:localportX and get the screen of the VM.

Am I understanding the VNC wrong here?


This would depend on how you're managing your Xen VMs?

If you are using libvirt, it should be a simple matter of connecting to the host with virt-manager and opening up the specific VM. The details of opening up the VNC to listen to a port and tunneling the client connection over to it will be handled in the background.

  • I generally use virt-manager but when I'm remote or using a slow connection, virt-manager stops being my friend! :) and it becomes very slow, I just wanted to check out using VNC. – Mister IT Guru Jan 28 '11 at 13:20
  • Might be caused by all the other things that virt-manager is doing. Have you just tried virt-viewer stand-alone? – sybreon Jan 28 '11 at 13:35
  • virt-viewer, I have not tried, (feel very embarrassed) - I will try this! – Mister IT Guru Jan 30 '11 at 13:08
  • 1
    If it works, let us know. :) – sybreon Jan 30 '11 at 14:58

From the Xen xmexample1 file:

# To create one using the VNC backend and sensible defaults:
# vfb = [ 'type=vnc' ]
# The backend listens on port 5900+N by default, where N is
# the domain ID.  You can override both address and N:
# vfb = [ 'type=vnc,vnclisten=,vncdisplay=1' ]
# Or you can bind the first unused port above 5900:
# vfb = [ 'type=vnc,vnclisten=,vncunused=1' ]
# You can override the password:
# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
# Empty password disables authentication.  Defaults to the vncpasswd
# configured in xend-config.sxp.

So put something like vfb = [ 'type=vnc' ] in your VM config file.


I'm not 100% sure about opensource Xen, but with Citrix XenServer (based on OSS Xen) the Host machine is running VNC (vncterm) for each VM. I believe with OSS Xen you can use:

xm list

to find the DOM id of the VM. The connect to it using:

xm console {domID}
  • Is this only from the CLI of the host system, can I not VNC from any desktop via an SSH tunnel or similar? – Mister IT Guru Jan 26 '11 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.