using vino/vncviewer
John
dingo at coco2.arach.net.au
Wed Oct 20 00:55:52 UTC 2004
Noah Dain wrote:
> you can still run a stand-alone vnc server (does not use the current
> desktop). several, in fact. OR you can simply ssh into the box and
> run an X11 application and it will show up on the screen that you are
> currently using if you have an Xserver running there (linux in
> graphical mode, or windows with 3rd party software - ie
> hummingbird($$), cygwin(free) ).
>
> the vnc server route gives you the option of disconnecting and
> reconnecting from the session without the programs terminating
> (somewhat like remote desktop in windows).
>
SuSE has a very nice setup, but as my SuSE box is currently running
Mepis I don't have the recipe.
It runs the server out of xinetd, and you get a standard dm login screen.
Red Hat does it differently, and I have the recipe for something similar
because I've adapted it.
I run a script at boot time along with all the others in /etc/init.d
Here's the script:
summer at Kookaburra:~$ cat /etc/init.d/vnc
#!/bin/bash
# If no config, do nothing
[ -f /etc/vncserver.conf ] || exit 0
function cfg()
{
sed </etc/vncserver.conf \
-e 's=#.*$==g' \
| grep -v '^$'
}
case "$1" in
start)
cfg | while read user port options
do :
echo Starting session for ${user} on ${port}
eval passwdfile=~${user}/.vnc/passwd
if [ ! -f ${passwdfile} ] ; then
echo Cannot start session for ${user}, no passwd file
continue
fi
P=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
[ "${user}" = "root" ] &&
P=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
su - ${user} -c "PATH=${P} vncserver ${options} ${port}"
done
;;
stop)
cfg | while read user port options
do :
echo Stopping session for ${user} on ${port}
eval passwdfile=~${user}/.vnc/passwd
if [ ! -f ${passwdfile} ] ; then
echo Cannot stop session for ${user}, no passwd file
continue
fi
su - ${user} -c "vncserver -kill ${port}"
done
;;
*)
echo ${0} '[start|stop]'
;;
esac
summer at Kookaburra:~$
Here's the config file:
summer at Kookaburra:~$ cat /etc/vncserver.conf
# vncserver configuration: sessions to start automatically
# User display <options>
root :55 -geometry 1600x1200
suzanne :1 -geometry 1024x850
summer at Kookaburra:~$
1600x1200 us the resolution of the screen I connect from. I run the
client full-screen. Colours can be a bit strange, but otherwise it works
very well.
You can also configure your dm to accept remote clients, then run X thus:
X -query garage.home.lan
I generally do that from inittab.
You switch with the usual ctrl-alt-F7 etc.
Finally, here is a great article that touches on this:
http://www.linuxworld.com/story/32827.htm
Just slip Ubuntu in in place of those other distroes whereever you like.
More information about the ubuntu-users
mailing list