Thursday, January 20, 2011

Access Linux console via text mode VNC

VNC is synonymous with X window, But, actually, A tool called linuxvnc can work in text mode by displaying tty console. Similar technique is often used in virtualization to access VM guest console.
install linuxvnc on Debian Lenny
root@xen4#apt-get install linuxvnc 
Start linuxVNC by binding tty2.
root@xen4# linuxvnc 2 -rfbauth /root/linuxvncpass -rfbport 5910
The VNC password can be generated using “vncpasswd” from  Realvnc or Tightvnc  Server, I use x11vnc.
root@xen4#/usr/bin/x11vnc -storepasswd /root/linuxvncpass
1) Access by Windows client.
Realvnc viewer client worked well with linuxvnc, tightvnc client didn’t
2) Access by web browser, the Java applet way
You need to enable http feature of Linuxvnc
/usr/share/x11vnc/classes belong to x11vnc pkg, you don’t want to install x11vnc, just unpack the pkg in your PC then upload the files.
root@xen4# linuxvnc 2 -httpport 8080 –httpdir /usr/share/x11vnc/classes  -rfbauth /root/linuxvncpass -rfbport 5910
image
3) Access by web browser, the Java script way 
A tool called novnc offload the Java applet function to browser using HTML5.
Download the zip from http://kanaka.github.com/noVNC/, unzip the scripts then launch.sh
Start LinuxVnc without http function
root@xen4# linuxvnc 2 -rfbauth /root/linuxvncpass -rfbport 5910
Start novnc proxy forwarding 8080 to vnc port 5910
root@xen4# ./utils/launch.sh --listen 8080  --vnc localhost:5910
NOTE:You can bind the port to particular ip with string : IP:PORT
image

No comments:

Post a Comment