Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    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:
    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

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,813
    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://linuxcounter.net/

  3. #3
    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

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,813
    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://linuxcounter.net/

  5. #5
    Just Joined!
    Join Date
    Feb 2005
    Location
    Lomm - Netherlands
    Posts
    80
    in /etc/sysconfig

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

    if toks is your valid username and you want a screensize of 800x600
    start your vncserver with:
    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 :

    #!/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:
    vncserver -kill :2
    restart the vncserver:
    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)

  6. #6
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    167
    thanks guys,

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

    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

  7. #7
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,813
    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://linuxcounter.net/

  8. #8
    Linux Newbie
    Join Date
    Nov 2002
    Posts
    139
    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

  9. #9
    Linux Newbie
    Join Date
    Nov 2002
    Posts
    139
    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
    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"

  10. #10
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    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.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •