Wednesday, February 2, 2011

Access guest VM console via text mode VNC.

In my previous post: Access Linux console via text mode VNC. The technique is not very useful, other than running VNC on non-X window system. It is not real lights out management (LOM), because the VNC service lives on OS. How can you access the console before OS boots up? It is possible for guest VM by directing VNC input/out in host hypervisor to guest VM console. The following is to realize the technique used in virtualization vendors to access guest VM console.
The linuxvnc tool, mentioned in my last post, is actually from libvncserver, there is sister tool called vncommand for executing <command> redirecting stdin from a vncviewer and stdout & stderr to the vnc clients). It doesn’t work well, fortunately, Proxmox fixed some issues and renamed it to vncterm.
Install the library: libvncsever.
$libvncserver0  0.9.7-2+b1    API to write one's own vnc server 
Install vncterm.
Download vncterm
Proxmox only packaged it for Debian, but I found, as long as you have libvncserver libraries, The extracted file: vncterm from DEB pkg works for other distributions. You can also compile from source.
Basic setup: input/output on VNC port 5910 are directed to a command (xen server for example)
-c is the command to be executed. –rfbport is the listening port. All options in x11vnc are supported
$vncterm –timeout 0 –rfbport 5910 –c /usr/sbin/xm console pv2
Advanced setup: enable httpsever and vnc password authentication (check my previous post for instructions)
$vncterm –timeout 0 -httpport 8080 -httpdir /usr/share/x11vnc/classes -rfbauth /root/linuxvncpass -rfbport 5910 -c /usr/sbin/xm console pv2
 image
Connect: Use VNC client (Realvnc viewer, Tightvnc client or Java VNC viewer) to connect to VM hypervisor host on VNC port 5910, the VM console is accessible before VM OS boots up.image

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.