LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2009, 11:32 AM   #1
solutionsville
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Rep: Reputation: 0
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,
 
Old 04-16-2009, 02:12 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,117

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
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?
 
Old 04-20-2009, 02:11 PM   #3
solutionsville
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
No workie

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

Thanks,
 
Old 04-20-2009, 02:18 PM   #4
solutionsville
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Found my error

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

Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Robust vncserver startup file (rc.vncserver) arobinson74 Slackware 4 05-14-2005 06:33 AM
Gnome startup difficulty noxious Slackware 1 10-22-2004 10:17 AM
vncserver and gnome desktop in RH 8 naijaguy Linux - Software 1 08-16-2004 02:18 PM
VNC showing plain X w/ no desktop when vncserver started by non-root user jboo Linux - Software 6 02-08-2004 05:45 AM
Getting vncserver to run automatically when user logs in indespair Linux - Networking 2 10-26-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration