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
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, unzip the scripts then
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/ --listen 8080  --vnc localhost:5910
NOTE:You can bind the port to particular ip with string : IP:PORT

Tuesday, January 18, 2011

Install Xen on Virtualbox

Virtualbox is good choice if you just want to do a functional test of Xen, but don’t have the luxury of a dedicated PC.
I tried many times with Xen on Centos without success, Xen on Debian worked perfectly.
- Hardware: RAM: ~1G RAM CPU:VT-X/AMD-V is optional (You can still test paravirtualization  guest[non-windows] without it)
- Host OS:WindowXP SP2 32bit
- Software: Virtualbox 4.0.0
- Xen Distribution: debian-507-amd64-netinst.iso
Install Debian on Virtualbox:
I just allocated 700MB RAM and select “Debian 64” as Virtualbox guest type, other settings were default
Install Xen kernel on Debian:

apt-get install xen-linux-system-2.6.26-2-xen-amd64 libvirt-bin virtinst
libvirt-bin virtinst are optional, they are third party tool to manage Xen.
 “(xend-unix-server yes)” in /etc/xen/xend-config.sxp need to be set in order for libvirt to connect to xen hypervisor. Otherwise following error will appear.

xen:/etc/xen# virsh
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
error: failed to connect to the hypervisor