SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558
Rep:
Starting a second session using the VNCserver
Greetings all,
I'm using the following command to start a TightVnc session on my Suse 9.2 box.
vncserver -geometry 800x600 -depth 24
This works just fine and the person on the Windows-XP machine can get to the Linux desk top.
Now another user wants to gain access to the same Linux box (now 2 users).
Would the same command as above be used to start a second VNCserver session so a second user could get in?
And if so what would the second person have to do differently to get into the Linux box from his Windows-XP box after he starts TightVNC?
I'm not in my office now so I can't try this out, I just have to call this person and advise him what to do.
I use the following to start 2 VNC servers on one of my boxes. From a windows box I use 192.168.2.11:1 and 192.168.2.11:2 for the connections strings for the tightVNC client:
Code:
#!/bin/sh
#
unset VNCSERVERARGS
VNCSERVERS="1:steve 2:oracle"
VNCSERVERARGS[1]="-geometry 1280x960"
VNCSERVERARGS[2]="-geometry 1280x960"
start() {
echo -n $"Starting VNC server: "
ulimit -S -c 0 >/dev/null 2>&1
if [ ! -d /tmp/.X11-unix ]
then
mkdir -m 1777 /tmp/.X11-unix || :
fi
for display in ${VNCSERVERS}
do
echo -n "${display} "
unset BASH_ENV ENV
DISP="${display%%:*}"
export USER="${display##*:}"
export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
su - ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
done
}
stop() {
echo -n $"Shutting down VNC server: "
for display in ${VNCSERVERS}
do
echo -n "${display} "
unset BASH_ENV ENV
export USER="${display##*:}"
su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
done
echo "Done."
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
It's a shell script (bash syntax, in this case) that gets run when the server boots so that I don't have to manually start the vncserver.
You can manually login as the other user and run the same command as you did to get it running for yourself - but that's going to get annoying pretty quickly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.