I had to run GUI applications from PlanetLab for a Project. X11 forwarding (necessary to run GUI applications over SSH connections) is not enabled on the PlanetLab machines due to security reasons. Another option was to install a VNC server on each of the nodes, which provides a GUI enabled remote access to these machines.
I had setup a vnc-server on the planet lab nodes using the instructions given in http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/.
Step-1:
First you need to setup vnc-server on the planetlab node.
You need to have a remote user account that you can use with VNC. Your planetlab account should suffice.
Step-2:
Next you need to configure the vncservers config file. In Fedora Core or Red Hat based distros in general, all we have to do is define the VNC server instances in /etc/sysconfig/vncservers. These will be started by the vncserver initscript. This has to be done as root. Edit this file so that it contains the following lines. Below planetlabaccount is your slice name that you use for logging into planetlab.
Step-1:
First you need to setup vnc-server on the planetlab node.
sudo yum install vnc-server
You need to have a remote user account that you can use with VNC. Your planetlab account should suffice.
Step-2:
Next you need to configure the vncservers config file. In Fedora Core or Red Hat based distros in general, all we have to do is define the VNC server instances in /etc/sysconfig/vncservers. These will be started by the vncserver initscript. This has to be done as root. Edit this file so that it contains the following lines. Below planetlabaccount is your slice name that you use for logging into planetlab.
VNCSERVERS="3:planetlabaccount"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
With these we define that a vnc server instance should be started as user 'planetlabaccount' on display 3 and we also set some options for this server such as resolution and color depth. Each VNC server instance listens on port 5900 plus the display number on which the server runs. In our case, planetlabaccount’s vnc server would listen on port 5903.
For multiple vnc instances /etc/sysconfig/vncservers would look like this:
Step-3:
You need to setup planetlabaccount’s vnc password. So, as user planetlabaccount give the command:
We are prompted for a password. This is the password that we will use when we connect to planetlabaccount’s vnc server instance. This password is saved in /home/<planetlabaccount>/.vnc/passwd.
Step-4:
After the initial configuration is done we restart the vnc service. As root:
You can make VNC server to start on boot. The command looks like (I haven't tested it out):
Step-5:
When vncserver is restarting you will see a message like
Step-6:
For multiple vnc instances /etc/sysconfig/vncservers would look like this:
VNCSERVERS="1:tiger 2:albatros 3:leopard"
VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"
VNCSERVERARGS[2]="-geometry 800x600 -depth 8"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
These would listen on ports 5901, 5902, 5903 respectively.Step-3:
You need to setup planetlabaccount’s vnc password. So, as user planetlabaccount give the command:
vncpasswd
We are prompted for a password. This is the password that we will use when we connect to planetlabaccount’s vnc server instance. This password is saved in /home/<planetlabaccount>/.vnc/passwd.
Step-4:
After the initial configuration is done we restart the vnc service. As root:
sudo /etc/init.d/vncserver restart
You can make VNC server to start on boot. The command looks like (I haven't tested it out):
chkconfig vncserver on
Step-5:
When vncserver is restarting you will see a message like
New '<planetlabmachine>:3 (planetlabaccount)' desktop is <planetlabmachine>:3
Here "planetlabmachine" is your planetlab node name, eg: "planetlab1.poly.edu"
You need to check if the DISPLAY environment variable is set using the command:
echo $DISPLAY
If you see a blank like, try setting it with the desktop name seen above "<planetlabmachine>:3"
export DISPLAY=<planetlabmachine>:3
Now any GUI applications like xterm or Firefox you run from the terminal will be active in your vncserver's desktop.
Step-6:
Now install a vncviewer like xvnc4viewer or xtightvncviewer on your local machine. If using windows, use realvnc's vnc viewer. Once you login to the planetlab's vnc server, you should be able to see all your GUI applications (like xclock and Firefox) running. Though the display is not so colorful and not so fast, it might serve the purpose.
Step-7 (OPTIONAL):
If working with Firefox, remember to install x11 fonts for Firefox to work. The command you need to give is:
Reference:
1. http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/.
2. http://forums.fedoraforum.org/showthread.php?t=201885
Step-7 (OPTIONAL):
If working with Firefox, remember to install x11 fonts for Firefox to work. The command you need to give is:
sudo yum install xorg-x11-fonts-Type1
With regular VNC, you wont be able to move or resize the windows as there is no window manager running. You need to run "Metacity" a GNOME window manager. Run the command from the terminal:
metacity &
Reference:
1. http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/.
2. http://forums.fedoraforum.org/showthread.php?t=201885
No comments:
Post a Comment