Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Servers
Reload this Page VNC cant connect on without "vncserver" command
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Servers Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Reply
 
Thread Tools Display Modes
Old 12-16-2005   #1 (permalink)
Tokunbo
Linux Newbie
 
Join Date: Nov 2004
Posts: 167
VNC cant connect on without "vncserver" command

hello,

I downloaded and installed vncserver on my FC4 using the yum install command. I entered "vncserver" was prompted for a password etc...

I also downloaded and installed a viewer on my windows laptop.

I was able to get around the twm and graphical display by referring to some previous posts on the forum.

My FC4 boots up to runlevel 3, and i just need VNC for purposes where i have to do somethings using the GUI, as a newbie.

My problem now is:
When my FC4 boots up, and I try to connect from my windows Laptop, i continue to get a connection refused error, until i type "vncserver" on my FC4 machine directly, then i get some three lines below:
Quote:
xauthstdin):1 bad display name...my ip ...in add command
New "my ip" (root) desktop is "my ip
starting applications specified in /root/.vnc/xstartup
log file is ............................
Except i issue the command "vncserver", i wont be able to connect from windows VNC viewer. pls how do i re-solve this issue.

cheers
Toks
Tokunbo is offline   Reply With Quote
Old 12-16-2005   #2 (permalink)
Roxoff
Linux Guru
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,348
Edit /etc/sysconfig/vncservers

Change and uncomment the two example lines at the end of the file to tell the system who you want the servers for, and the size of display you want.

Then do (as root):

service vncserver start

This will start a vnc session seperate to your main logon, make sure you use the <servername>:<screennum> argument correctly when you connect.

If you want this in your runlevel when you boot up, use:

system-config-services

to add it to runlevel 5. You can also add it to runlevel 3 if you want - it'll run quite happily in the background of both runlevels. If you do this, it'll start when the machine boots into those runlevels.
__________________
Linux user #126863 - see http://counter.li.org/
My Blog
Roxoff is offline   Reply With Quote
Old 12-20-2005   #3 (permalink)
Tokunbo
Linux Newbie
 
Join Date: Nov 2004
Posts: 167
thanks Roxoff,

i went to /etc/sysconfig and vi'd into file:vncservers. I uncommented the two last lines in the file as follows:

VNCSERvERS="2:myusername"
VNCSERVERARGS[2]="-geometry 800x600"

using the command:

service vncserver start

I get an error" Starting VNC server: 2: myusername runuser: user myusername does not exist"
[FAILED]

so i redited the vnservers file and changed "myusername" to a valid user on my FC4. Still, i get a

"starting VNC server: 2:toks {FAILED]

when i use the command "service vncserver start"/stop

i still get a failed result.

I could't find any "system-config-services" file at /etc/sysconfig. I did a locate, and the ones i found are at /usr/sbin and /usr/bin

I rebooted my pc and first checked the status of vncserver...it tells me its stopped.

Pls how do i add it to the runlevel 3 and 5 as you mentioned earlier on?

thanks
Toks
Tokunbo is offline   Reply With Quote
Old 12-20-2005   #4 (permalink)
Roxoff
Linux Guru
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,348
Ahhh - I missed a bit.

For the user who's having the vnc session, create a '.vnc' directory in their HOME directory.

Inside this, make an executable file called 'xstartup' to start off the server session.

Mine looks like this:

Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
xosview &
# start the window manager of choice... today it's KDE!
#gnome-session
startkde
May I also suggest you use the 'vncpasswd' command for that user too.
__________________
Linux user #126863 - see http://counter.li.org/
My Blog
Roxoff is offline   Reply With Quote
Old 12-21-2005   #5 (permalink)
Bikerepairmann
Just Joined!
 
Join Date: Feb 2005
Location: Lomm - Netherlands
Posts: 80
in /etc/sysconfig

put the lines:
Quote:
VNCSERVERS="2:toks"
VNCSERVERARGS[2]="-geometry 800x600"

if toks is your valid username and you want a screensize of 800x600
start your vncserver with:
Quote:
vncservers :2
It will create the .vnc directory itself after it askes for your password

Then edit your xstartup if you want a gui.
mine is :

Quote:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
vncconfig -nowin &
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 &
kill the vncserver with:
Quote:
vncserver -kill :2
restart the vncserver:
Quote:
vncserver :2
And open the ports on your firewall. 5802, 5902, 6002 (all tcp, the 2 is for scrren 2, change if you have an other screen number)
__________________
Veni vidi foetsie. (I came, I saw, I was gone)
Bikerepairmann is offline   Reply With Quote
Old 12-22-2005   #6 (permalink)
Tokunbo
Linux Newbie
 
Join Date: Nov 2004
Posts: 167
thanks guys,

Pls, im still a little confiused. When I uncommented the line

Quote:
VNCSERvERS="2:myusername"
VNCSERVERARGS[2]="-geometry 800x600"
and substituted "myusername" with "toks", as I complained, i was getting errors.

Note: I have VNC running fine as root. I would also like to set it up for a user "toks"


Bikerepairmann>> note that the file /etc/sysconfig/vncservers is not editable by user "toks"

so how do about changing/substituting the lines VNCservers="2:myusername"....

suppose I have multiple users, where only somepeeps out of the many are allowed to use VNC, how am I to configure VNC selectively?

cheers
Toks
Tokunbo is offline   Reply With Quote
Old 12-22-2005   #7 (permalink)
Roxoff
Linux Guru
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,348
You can only edit /etc/sysconfig/vncservers as root.

When you do:

service vncserver start

you must also do that as root.

Make sure that for each user who has a vnc session listed in /etc/sysconfig/vncservers that they have a .vnc directory in their home directory, and add an xstartup file in there to start off any window managers or other apps. xstartup must be made executable too.
__________________
Linux user #126863 - see http://counter.li.org/
My Blog
Roxoff is offline   Reply With Quote
Old 05-09-2006   #8 (permalink)
zillah
Linux Newbie
 
Join Date: Nov 2002
Posts: 135
Since it is unacceptable to post a reply in more than one thread within the forum, Kindly check my query here

http://www.linuxforums.org/forum/red...tml#post323714

Thanks
zillah is offline   Reply With Quote
Old 05-28-2006   #9 (permalink)
zillah
Linux Newbie
 
Join Date: Nov 2002
Posts: 135
Quote:
Make sure that for each user who has a vnc session listed in /etc/sysconfig/vncservers
Shouldn't I be a root to add vnc sessions for each users ?

While I was reading this threat
Quote:
6.VNCSERVER="1:username" (example root). Make a space before the quotes if
you want to add another user and type 2:username, etc.
I get confused how to add more than one users,,,,do I need to do like below ?

VNCSERvERS="2:root"
VNCSERVERARGS[2]="-geometry 800x600"

VNCSERvERS="3:jsmith"
VNCSERVERARGS[3]="-geometry 800x600"

VNCSERvERS="10:jpeter"
VNCSERVERARGS[10]="-geometry 800x600"
zillah is offline   Reply With Quote
Old 05-29-2006   #10 (permalink)
jledhead
Linux Engineer
 
jledhead's Avatar
 
Join Date: Oct 2004
Location: North Carolina
Posts: 778
http://www.ubuntuforums.org/showthread.php?t=122402

it says ubuntu but it works for others also, just not exactly as shown since you don't need to add the extra apt stuff, other then that it works.
jledhead is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 02:37 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0