Sunday, June 6, 2010

How to make window-manager work on Linux through VNC



Assumption: vnc is installed on your remote linux server which you want to access

Look for the file called “xstartup”

For me I got the below files:




As I logged in as root so my interest is “/root/.vnc/xstartup”

Stop the vnc server/viewer if running.

Make a copy of this file as backup:

cp xstartup xstartup_orig

Then make your “xstartup” filr look like

[root@myserver .vnc]# cat xstartup


# Uncomment the following two lines for normal desktop:


exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

startx &

[root@myserver .vnc]#

Start vnc server,

Then goto vnc_home, eg, /root/.vnc/

Execute xstartup command as:


Ignore the crazy messages it throws on the terminal. Wait a minute and enjoy a full desktop via VNC :)

No comments:

Post a Comment