Find the answer to your Linux question:
Results 1 to 9 of 9
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    noob VNC Question (FC4)

    I enabled remote desktop on my FC4 box and I'm able to connect from another PC using a VNC client. But I can only connect to another session in progress - that is, I have to log in to the FC4 box directly as a particular user before I can connect remotely and view that session. When no user is logged in, my VNC client fails to make a connection.

    I want to be able to _log in_ remotely and start up a session. How do I do that?

    I've tried enabling remote desktop through the menu system and by running vncserver from the CLI, both as a standard user and as root, but neither option has worked for me.

    thanks for your help!

  2. #2
    Well, I am kinda new to the Linux world, but I do know that when you enable the remote desktop, you are only enabling it for the session you are currently in. There are ways to make VNC run as a system service, but I'm not that good yet

    However, I might be able to set you in the right direction. About a year ago, I had a similar problem. I Googled until my eyes were sore trying to find a good answer that didn't involve me have to basically rewrite the Linux kernel from scratch. Look into FreeNX. It is like Windows Terminal Services in that it lets multiple users log into the same machine with their own sessions. It also lets you choose what windows manager (kde, gnome, etc) you want to use when you log in (very cool). The only downside is that it is not compatible with VNC. You have to use the free client from NoMachine. The server setup was very easy and the client works on Windows and Linux. I actually installed the Windows version of it on my thumbdrive so that I could log into my Linux box from where ever I was without having to download and install the software on the machine I was using.

    If you must use VNC, I think there is xvnc service somewhere that you can activate at boot. It might work. I never really tried I said I got fed up with trying to get VNC to work right and went for the easy solution

    Good Luck and I hope this works for you or at least points you in the right direction.

  3. #3
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    VNC can be enabled as a service. If you have the vncserver package installed (it's available through yum), you only need to edit /etc/sysconfig/vncservers and add a screen name you want it to run on, you can optionally specify arguments too. On my server, I have this:

    VNCSERVERARGS[2]="-geometry 1280x800 -depth 24"
    add a file for the user specified in their ~/.vnc directory called xstartup, and make it executable. It really only needs to contain one of the following lines:

    depending on the window manager you want (note, there are other window managers...)

    Then use:

    service vncserver start
    you might also want to add this service startup to the active list for your normal runlevel.

    The vnc server then runs all the time, you just connect and disconnect at will. It's a good idea, therefore, to run vncpasswd for that user, so that there is a level of security applied.

    Dont open vnc on a computer directly connected to the internet without firewalling the ports - if you want this kind of access then its better to use ssh to log in and forward the vnc port your display is using.

    To connect, you'd just need (if you were using a similar config to mine, above):

    vncviewer [servername]:2
    or run a windows vnc client.

    Remember, this is not a 'log-in'/'log-out' session - it remains running and you connect to it whenever you need to.
    Linux user #126863 - see

  4. $spacer_open
  5. #4
    I know that there are heaps threads about this topics , but this what I did without any success.
    I am logging as root (I know the security implication)
    [root@localhost ~]# rpm -q --info vnc-server
    Name        : vnc-server                   Relocations: (not relocatable)Version     : 4.1.1                             Vendor: Red Hat, Inc.Release     : 10                            Build Date: Wed 27 Apr 2005 10:44:11 AM GSTInstall Date: Wed 15 Feb 2006 11:53:50 PM GST      Build Host:       : User Interface/X              Source RPM: vnc-4.1.1-10.src.rpmSize        : 3054396                          License: GPLSignature   : DSA/SHA1, Fri 20 May 2005 10:28:29 PM GST, Key ID b44269d04f2a6fd2Packager    : Red Hat, Inc. URL         : http://www.realvnc.comSummary     : A VNC server.Description :The VNC system allows you to access the same desktop from a widevariety of platforms. This package is a VNC server, allowing others toaccess the desktop on your machine.
    Then gedit /etc/sysconfig/vncserver
    # 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# .
    #zillah uncomment NCSERVERS="2:myusername
    #zillah uncomment VNCSERVERARGS[2]="-geometry 800x600"
    VNCSERVERARGS[2]="-geometry 800x600"
    [root@localhost ~]# vncpasswd root

    [root@localhost ~]# vncserver
    New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain:2
    Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost.localdomain:2.log
    Is the command "vncserver" same as "service vncserver start" ?

    [root@localhost ~]# service vncserver start
    Starting VNC server: 2:root A VNC server is already running as :2

    From win2003 I open vnc viewer and I typed inthis:


    The error message that I received when I typed in the ip address for the address is below:

    VNC Viewer: of the screen
    unable to connect to host: The requested address is not valid in its context.(10049)
    I am using FC4. The fix for me was that the default iptables (i thinkthats the firewall settings) were preventing incoming VNC connections.To overcome this in gnome i went to Desktop>System Settings>Server Settings>Services There I stopped iptables - and immediately I was able to connect!
    I did stop iptables as qoute above suggested.

    I checked the link below as well, hoping to find something helpful

  6. #5
    I read the thread here as well:

    I tried From FC4 the following:
    It worked

  7. #6
    Any help ?

  8. #7
    Just Joined!
    Join Date
    May 2006
    it looks like when ur connecting from the other box ur using ur external ip address (the one the rest of the world sees u as). Im assuming ur connecting from another computer within ur home network, aka ur home LAN. u need to use ur internal ip address if this is the case. its probably something like 192.168.0.x
    u can find out using the command ifconfig
    if ur not connecting via a home LAN, and u do need ur external ip address (ur connecting from work, a friends house, etc.) and u have a router set up, check that out. sometimes there will be settings on it that keep u from connecting (port forwarding, a firewall, etc.)

    if all of those dont work, and iptables is definitely off, then it may be ur isp. i know my isp doesnt allow any service ports, but vnc ports are high enough that i can connect (5900, 5901, 5902, etc.) check to make sure its not that. thats all i can think of

    one last little thing, i dont know if u did this, but u need to specify the port when ur using the vncviewer, i see that u did in ur linux session but it doesnt specify in ur windows session. so it would be ip: port and its usually 5900+session number so in ur case probably 5902. but it looks like in ur linux session u just typed :2 which works, but on my windows box i know i need to use the full port number, not the session number (in my case 5901)

    hope that helped

  9. #8
    it looks like when ur connecting from the other box ur using ur external ip address (the one the rest of the world sees u as). Im assuming ur connecting from another computer within ur home network, aka ur home LAN. u need to use ur internal ip address if this is the case. its probably something like 192.168.0.x
    I am not using that within my LAN, but between two boxes via WAN (internet).

    so it would be ip: port and its usually 5900+session number so in ur case probably 5902.
    As far as I remember I did, but since it has been long time, I forgot what I have done exactly on my windows box, I will try again.

    Thanks for this insight.

  10. #9
    This is somewhat off-topic, but I will mention that SSH is in general much safer and easier to use than VNC. It is port 22. All you have to do from another linux/unix/mac box is type SSH -X user@remotehost (or IP). From windows you would have to use a third party SSH client.
    An explanation of how to use cygwin, it is a handy tool for those of you who need to use Windows. Putty also works, if you are willing to work in command line.
    -Goodluck, Godspeed.

Posting Permissions

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