Find the answer to your Linux question:
Results 1 to 9 of 9
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Posts
    3

    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!
    fandango

  2. #2
    Just Joined!
    Join Date
    Feb 2006
    Posts
    4
    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 it...as 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
    Location
    Nottingham, England
    Posts
    3,885
    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:

    Code:
    VNCSERVERS="2:neils"
    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:

    Code:
    gnome-session
    startkde
    startxfce4
    depending on the window manager you want (note, there are other window managers...)

    Then use:

    Code:
    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):

    Code:
    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 http://linuxcounter.net/

  4. #4
    Linux Newbie
    Join Date
    Nov 2002
    Posts
    139
    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)
    First:
    [root@localhost ~]# rpm -q --info vnc-server
    Code:
    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: decompose.build.redhat.comGroup       : 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.
    Second:
    Then gedit /etc/sysconfig/vncserver
    Code:
    # 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
    "VNCSERVERS="2:root"
    #zillah uncomment VNCSERVERARGS[2]="-geometry 800x600"
    VNCSERVERARGS[2]="-geometry 800x600"
    Third:
    [root@localhost ~]# vncpasswd root
    Password:
    Verify:

    Fourth:
    [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

    http://www.linuxforums.org/forum/lin...s-fc4-vnc.html
    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


    Fifth:
    From win2003 I open vnc viewer and I typed inthis:
    198.222.168.189:2

    Code:
    http://img273.imageshack.us/img273/8994/vncviewer5vn.jpg


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

    Code:
    VNC Viewer: 198.222.168.189:Error----Title of the screen
    unable to connect to host: The requested address is not valid in its context.(10049)
    http://www.redhat.com/archives/rhl-l.../msg05595.html
    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
    http://fcp.homelinux.org/modules/sma....php?faqid=524

  5. #5
    Linux Newbie
    Join Date
    Nov 2002
    Posts
    139
    I read the thread here as well:
    http://www.linuxforums.org/forum/ser...r-command.html

    I tried From FC4 the following:
    Code:
    vncviewer 127.0.0.1:2
    It worked

  6. #6
    Linux Newbie
    Join Date
    Nov 2002
    Posts
    139
    Any help ?

  7. #7
    Just Joined!
    Join Date
    May 2006
    Location
    PA
    Posts
    13
    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

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

  9. #9
    Just Joined!
    Join Date
    Mar 2006
    Posts
    62
    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. http://www.ews.uiuc.edu/clrtxt/cygwin/
    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
  •