LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   difficulty getting VNCserver to run at startup for multiple user and Gnome desktop (https://www.linuxquestions.org/questions/linux-software-2/difficulty-getting-vncserver-to-run-at-startup-for-multiple-user-and-gnome-desktop-719601/)

solutionsville 04-16-2009 10:32 AM

difficulty getting VNCserver to run at startup for multiple user and Gnome desktop
 
I have several RHEL 5.x servers, and need them to have VNC server start at bootup. I have been able to get it to start at bootup however I either get a black screen or a TVM desktop.

If I do not include it in the startup, I am able to SSH into the server, and run vncserver at the xterm prompt and then I am able to login with VNCviewer and see my Gnome desktop.

The other issues is I have 5 users that will need to access thier own Gnome desktop.

This is how I have each users /.vnc/xstartup file;

----------------------------
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
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" &
#twm &
startx &
#startkde &

-----------------------------
My vncservers file looks like this;

-----------------------------
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:root 2:user2 3:user3 4:user4 5:user5
VNCSERVERARGS[1]="-geometry 1024x768 -depth 32 -nohttpd"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 32 -nohttpd"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 32 -nohttpd"
VNCSERVERARGS[4]="-geometry 1024x768 -depth 32 -nohttpd"
VNCSERVERARGS[5]="-geometry 1024x768 -depth 32 -nohttpd"
---------------------------------
I don't know what else I need to change, setup or install.

Thanks,

tredegar 04-16-2009 01:12 PM

I start a vncserver on my server for my user (tred) at boot time with this in /etc/rc.local:
Code:

# Start vnc server on DISPLAY:1 for tred
su - tred -c "cd /home/tred/ && vncserver :1 -geometry 1024x768 -depth 24" 2>/dev/null &

On that server my /home/tred/.vnc/xstartup just looks like this:
Code:

startkde &
you'll have to change startkde to something different if you are running gnome, which I am not. I'll leave you to find this out ;)

So you can do it for several users, each on different displays:
Code:

su - user2 -c "cd /home/user2/ && vncserver :2 -geometry 1024x768 -depth 24" 2>/dev/null &
su - user3 -c "cd /home/user3/ && vncserver :3 -geometry 1024x768 -depth 24" 2>/dev/null &

user3 can then connect with vncviewer servername:3

Get the idea?

solutionsville 04-20-2009 01:11 PM

No workie
 
Tried as you suggested. It did not work. I start at Runlevel 5. Do I need to do anything else?

Thanks,

solutionsville 04-20-2009 01:18 PM

Found my error
 
I forgot to put the "cd /home piece. I typed only the "/home. That did the trick.

Thanks again.


All times are GMT -5. The time now is 02:00 PM.