我如何使用VNC连接到我的XEN虚拟机?

XEN中的每个VM是否都有一个VNC服务器运行? 如果是这样,我如何连接到这个VNC会话,这将是非常有帮助的!

我希望能够隧道连接到我的服务器通过SSH方式,ssh -L localportX:localhost:vncportnumber我可以使用我的VNC客户端,并连接到本地主机:localportX并获得虚拟机的屏幕。

我在这里了解VNC错误吗?

这将取决于您如何pipe理您的Xen虚拟机?

如果你正在使用libvirt,那么使用virt-manager连接到主机并打开特定的虚拟机应该是一件简单的事情。 打开VNC来监听一个端口并将客户端连接隧道连接到它的细节将在后台处理。

从Xen xmexample1文件:

 # To create one using the VNC backend and sensible defaults: # # vfb = [ 'type=vnc' ] # # The backend listens on 127.0.0.1 port 5900+N by default, where N is # the domain ID. You can override both address and N: # # vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ] # # Or you can bind the first unused port above 5900: # # vfb = [ 'type=vnc,vnclisten=0.0.0.0,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. 

所以把vfb = [ 'type=vnc' ]放在你的虚拟机configuration文件里。

我并不是100%确定Xen是开源的,但是对于Citrix XenServer(基于OSS Xen),主机为每个虚拟机运行VNC(vncterm)。 我相信与OSS Xen你可以使用:

 xm list 

find虚拟机的DOM ID。 连接到它使用:

 xm console {domID}