Wednesday, February 2, 2011

How we did set up VNC server on Linux

Well, the task was to test one of our plugins for Eclipse using SuSE Linux on Itanium, so that meant, it fact, we needed real machine (Itanium prossecor and ESX VM are incompatible concepts, yeah). And as I needed to test GUI software the remote access was vital, of course...There was a suggestion to use display exporting but for the obvious reasons that appeared to be a bad idea to do that - using some ESX Win VM machine with Cygwin installed with X-server and so on... Shortly speaking, that should be fuckn' crazy testing, no more. We (my teammate and myself) decided to try to set up VNC server (great news were - VNC package was included in basic installation of the disributive).
So, that was just a preamble and now some brief description how we did set up VNC server (okay, guys, that's just a summary from the google's results) - note, that all actions perform as root and for root account (if you need to set up the same for other user account - you need change some things in the following steps):
1. Modify /etc/xinetd.d/vnc file
disable = yes
user = nobody
to
disable = no
user = root
2. Create new file /root/.vnc/xstartup with the following context:
#!/bin/bash
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session --sm-disable
gnome-session
Not exactly sure about the necessity of all of the commands in the script but had no time to experiment with that - so leave it as is (at least it worked for us!)
3. Set the root's remote password using vncpasswd
4. Restart xinetd daemon:
rcxinetd restart
5. Start VNC server:
vncserver
6. Attempt to connect to the open remote session (usually it's :0 if I'm not mistaken)
If u need to change the default display resolution for the remote session use vncserver --help - it works;)
--
P.S. Especial thanks Artem who provided me with the opportune help

No comments: