LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2009, 05:33 PM   #1
nenyer
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
Unhappy VNC + Fluxbox + Multiple Users


While this may be a simple problem - it has been causing me a massive headache over the past several hours - so any help would be GREATLY appreciated.

Here's the lowdown.

I just purchased a remote server (running CentOS 5.3) and have installed VNC and Fluxbox (amongst other things).

My problem is, when I try to connect via VNC to port 5902 (instance 2 - for user 2) I am at the point where the fluxbox desktop and toolbar are showing, however the menu is completely unresponsive -> NO application will launch.

However, all installed applications launch on my VNC connection on port 5901 (instance 1 - for user 1) from the fluxbox menu.

I have tried using the fluxbox startup file to run xterm - but that doesn't work either.

What is going wrong? I'd like to be able to run applications via VNC on the 2nd instance for my 2nd user.

Once again, any help would be very much appreciated.
 
Old 07-10-2009, 06:17 PM   #2
CSandman
Member
 
Registered: Mar 2007
Distribution: Fedora/SUSE/Debian/Knoppix
Posts: 34

Rep: Reputation: 16
The way I've done that in the past is to write a simple script to start the servers (also useful if the box gets rebooted)...

Code:
#!/bin/bash

PORT = 5900 + 1

Xvnc :${PORT} 
sleep 2

export DISPLAY=:${PORT}
fluxbox &
xterm -hold &

# otherStartup programs
The script can be easily modified to run similar startups for the other vncservers you wish to start. I currently have 7 vncservers on my machine for various reasons and that setup works great for starting them.

Last edited by CSandman; 07-10-2009 at 06:19 PM. Reason: need to tell bash that it's a bash script
 
Old 07-10-2009, 06:27 PM   #3
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
Have you configured VNC for multiple instances?
 
Old 07-10-2009, 09:29 PM   #4
nenyer
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
I'm a huge noob when it comes to linux.. there is no denying it... I know my way around Windows / Hardware / Basic Networking... but linux isn't a strong point..

Where would I implement that script? And even if I did.. the startup script I have now for fluxbox ( ~/.fluxbox/startup) isn't working (and yes I have "startfluxbox" put in my xstartup file for VNC) - xterm wont load automatically.

Code:
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "$HOME/.Xmodmap"

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
#

xterm &

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with exec before it.

exec fluxbox
I'm not sure what you mean by set up for multiple users.
Each type I reboot I su to the user I want to have VNC setup for and go vncserver :1 or vncserver :2 - I believe thats all I have to do. (It works for user one... just not user two.

I am probably completely wrong - so please enlighten me.
Thank you both for your timely responses.
 
Old 07-10-2009, 10:30 PM   #5
CSandman
Member
 
Registered: Mar 2007
Distribution: Fedora/SUSE/Debian/Knoppix
Posts: 34

Rep: Reputation: 16
First off, leave your fluxbox startup script alone. Create a file containing the script I had in my previous post and remember that you can add a second section to that where the port is set to a second number ( 5900 + 2 ). Then all you need to do is chmod the script to be executable ( chmod u+x filename ) and execute it. It should start the vncservers with an open xterm in each.

That should be all you need to get two instances of Xvncserver running with the fluxbox WM and a single instance of xterm. If you want other programs to start in one or both of the vnc servers just add it after the xterm line.

voila.
 
Old 07-10-2009, 10:40 PM   #6
CSandman
Member
 
Registered: Mar 2007
Distribution: Fedora/SUSE/Debian/Knoppix
Posts: 34

Rep: Reputation: 16
Just to clear things up with what I mean...

Code:
#!/bin/bash

# first vncserver setup
PORT = 5900 + 1
xvnc :${PORT} 
sleep 2
export DISPLAY=:${PORT}
fluxbox &
xterm -hold &


# second vncserver setup
PORT = 5900 + 2
xvnc :${PORT}
sleep 2
export DISPLAY=:${PORT}
fluxbox &
xterm -hold &
The above script should be run locally on your remote server. So ssh there, write the script, and then execute it.

Then user one on another computer can use "vncviewer servername:1" to access their vnc session that was just setup. Likewise user two can access theirs with "vncviewer servername:2". If user one would like to have firefox started when their session is created you would add the line "firefox &" after the call to xterm in that section.

Hopefully that clears up what I mean.

Last edited by CSandman; 07-10-2009 at 10:41 PM.
 
Old 07-10-2009, 10:49 PM   #7
nenyer
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Will this create a separate session for each user? If so, how will it know to associate each session with each user?

I don't want someone to be able to connect to my box via vnc and have access to one of my users.
 
Old 07-11-2009, 01:26 AM   #8
CSandman
Member
 
Registered: Mar 2007
Distribution: Fedora/SUSE/Debian/Knoppix
Posts: 34

Rep: Reputation: 16
I guess it depends on the vncserver that you use. tightvnc has an option to start a server with a password file.

In your case each of the users could use the command "vncpasswd". What that would do is create a password file in ~/.vnc/passwd that would contain their password information.
Then all you need to do is make sure your server can see the file (either on an nfs or a local copy to the server) and then add the password option to the xvnc command.

In the script that we've been talking about, the line:

xvnc :${PORT}

would be changed to:

xvnc :${PORT} -rfbauth passwd-file

except instead of passwd-file you would use the path to the copy of the password file that the server can see.

I have to admit that this is probably not the most secure solution. But, as long as the passwords are decent then this should be a good head start.

Last edited by CSandman; 07-11-2009 at 01:27 AM.
 
  


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
Multiple Autologins; Multiple Users; Multiple Sessions mrclisdue Linux - Desktop 1 09-26-2007 06:50 AM
help to configure VNC for multiple users on RHEL4WS bneal Linux - Software 5 07-06-2007 08:14 AM
fluxbox and vnc lord-fu *BSD 2 08-11-2006 07:00 PM
starting vnc for multiple users in fedora core 4 openbysource Linux - Networking 1 02-11-2006 09:55 AM
copying kde configuration for 2 users OR 2 users on 1 x session for vnc blackphiber Linux - General 0 02-26-2004 09:57 PM


All times are GMT -5. The time now is 06:29 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration