Code Ghar

Remote Login with GDM and VNC on Fedora 11

Posted in configuration by hs on June 11, 2009

Do you want the ability to VNC into your remote Linux computer and login to the GUI as if you were right next to the machine? Then you need to setup VNC with GDM. These steps were tested on Fedora 11.

Install VNC

You need to install VNC first. If it’s already installed, running the following command may either do nothing or upgrade it.

sudo yum install vnc-server

Turn Off VNC Service

sudo chkconfig vncserver off

sudo service vncserver stop

Install xinetd

You need to have xinetd installed. If it’s already installed, running the following command may either do nothing or upgrade it.

sudo yum install xinetd

Enable XDMCP

sudo vim /etc/gdm/custom.conf

Your file should have following lines (there may be other lines so leave them be)

[xdmcp]
Enable=true

[security]
DisallowTCP=false

Create VNC Service

sudo vim /etc/services

Edit the file so that the lines with vnc-server look like

#vnc-server 5900/tcp # VNC Server
#vnc-server 5900/udp # VNC Server

And add the following line

vnc1024 5900/tcp # VNC and GDM

Create xinetd Service

Create a file as below

sudo vim /etc/xinetd.d/vnc1024

And make sure the file has the following contents

service vnc1024
{
disable = no
socket_type = stream
protocol = tcp
group = tty
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none
}

Restart xinetd

You should restart the xinetd service.

sudo service xinetd restart

VNC into the Server

Using a VNC client on another computer, try to VNC into the server. If it doesn’t work, you may have to restart the server.

sudo reboot

Hat Tips: Run VNC and GDM for headless boxes; VNC & GDM; Using remote X applications under Fedora Core 3 (re: xhost usage);

Tagged with: ,

15 Responses

Subscribe to comments with RSS.

  1. [...] :1 -geometry 1280×1024 -depth 16 /etc/init.d/xend start /etc/init.d/xendomains start View also :- Remote Login with GDM and VNC on Fedora 11 regarding standard setup resumable VNC session. It seemed to me too much unstable. Several actions [...]

  2. Patrick Buchi said, on June 19, 2009 at 11:14 pm

    Worked through this but still could not log on remotely. Locally trying to start vncserver complained about “no displays configured”.

    Had edit /etc/sysconfig/vncservers and add
    VNCSERVERS=blahblahblah
    VNCSERVERARGS[x]=blahblahblah

    Did I do something wrong or did you leave that part out of this tut?

  3. Patrick Buchi said, on June 20, 2009 at 12:05 am

    Okay, found the mistake:

    server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none

    Looks like its 2 seperate lines but is actually all one line.

    Thanks for this, all working perfectly.

  4. David said, on July 16, 2009 at 4:01 pm

    Ran through the tutorial. Servers up and running. Problem with client connection.

    Using TightVNC, the client connects but only shows a black screen with a GNOME X in the middle.

    Any thoughts?

  5. hs said, on July 17, 2009 at 3:33 am

    It happened to me as well. I rebooted the server and it worked. Try and see if it works for you.

  6. Philip Dezuttere said, on July 22, 2009 at 8:50 am

    Just a small problem when i try to use bash on the cleint.
    To display gedit i need to enter this command first “export DISPLAY=:1.0″
    Can this be added to some script some where ?

  7. Robert Dehez said, on August 2, 2009 at 9:12 am

    Hi, I tried it with fedora 11 and gdm ans it works fine; but, as I prefer kde, I configured Fedora to use kdm instead of gdm. But, doing this, vnc does’nt work anymore … Have I something to change int the configuration to use kdm with vnc ?

  8. hs said, on August 2, 2009 at 1:55 pm

    @ Philip: I am not very experienced in Linux so am not able to help you with this. A good forum should be able to help.

    @ Robert: I think you will have to enable XDMCP in KDM.

  9. Robert Dehez said, on August 4, 2009 at 8:52 am

    @hs : Thanks for your reply. I had already enabled xdmcp in KDM but it had no effect :-(
    It’s very strange : if I use vncviewer with gdm, I have the login screen, If I use it with kdm, I don’t have any connection. I verified firewall rules and I also opened port 177 for xdmcp, but with no result ….

  10. Robert Dehez said, on August 4, 2009 at 8:58 pm

    I would like to precise that when I use vncviewer, I have a connexion but with a black screen … and, after a few minutes, the connexion die.

  11. Robert Dehez said, on August 5, 2009 at 1:20 pm

    Ok, it works now, I just had to add at the end of the file : /etc/kde/kdm/Xaccess :

    LISTEN 0.0.0.0

    So your tip works fine also for kdm !!!! Thank’s a lot ! :-)

  12. Andreas said, on August 18, 2009 at 7:32 pm

    Thanks for this good tutorial. Works fine for me but with one exception:

    When I have a remote session and want to do “root things” (e.g. System – Administration – Date & Time) a dialog opens up asking for the root password and after hitting OK nothings happens any more. The same for packet updates and all other windows requiring root authentication. A “su -” works well.

    Any ideas about that? I didn’t find any restrictions on root logins but I am not very familar with X-configuration.

  13. Trey said, on August 22, 2009 at 5:57 pm

    I’m using Fedora 11. If nobody has logged into the box, I get a black screen with a cursor when I use vncviewer. However, if I log into the box directly, then I no longer get the black screen when trying to connect. This defeats the purpose though, since I cannot log in remotely until I first login locally at least once. Any ideas?

  14. ricbax said, on September 11, 2009 at 8:21 pm

    I am trying o connect from a Mac using JollyFastVNC, the server closes the connection. I have opened the port 5900 but still it does not connect. Any suggestions?

  15. Louis said, on September 24, 2009 at 7:35 pm

    Hello,

    I try to setup a server using fedora 11 64 bit. The server should be managed remotly, using using gnome via VNC .

    To make things short, despite a lot of searching and effort. I do not manage. I can not setup VNC in such a way that it provide me access to the logon screen (I can connect to a logged in user, but that is not very usefull here).

    I saw some solutions using XVNC (here foreinstance), however as far as I know XVNC is not available for FEDORA11.

    I am strongly considering to switch to another distribution (opensuse 11), since this is a blokking issue for me.

    But perhaps some one has a solution !?

    Sincerely,

    Louis


Leave a Reply