LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-26-2012, 05:41 PM   #1
eqtime
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Rep: Reputation: Disabled
Attach X11Vnc to X?


I'm using CentOS 6.2.

From Windows I can connect to my Linux server running X11Vnc server fine running the command x11vnc -forever -bg.

What I want to do is make the automatically available after a reboot without having to run the command. I have edited rc.local with command but it's not working.

In the log it has ***X11vnc was unable to Open the X DISPLAY ":0", it cannot continue

Any help would be appreciated.
 
Old 04-27-2012, 09:47 AM   #2
krunge
Member
 
Registered: Mar 2007
Posts: 39

Rep: Reputation: 18
x11vnc needs to be started after the X server starts.

It also needs do be directed at the display, usually :0, with the the correct xauthority credentials.

Usually this is done with the display manager start up script,e.g. gdm Init Default.

But your rc local script may work if you simply have x11vnc wait for a period of time before starting. Try an x11vnc cmdline option '-sleepin 60' to have it wait 60 secs.
 
Old 04-27-2012, 06:03 PM   #3
eqtime
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you for the reply. I will test that out when I get the chance.

From the log it auto attempts to use -display :0, but fails, I'm guessing this is because I was trying to execute it before X started, but likely wouldn't have worked anyway because authority credentials were being omitted?

I had edited Default file (I'm using gdm) with the same command but it didn't seem to run. I also added KillInitClients=false to the custom.conf in gdm directory.

Last edited by eqtime; 04-27-2012 at 06:11 PM.
 
Old 04-28-2012, 11:14 AM   #4
krunge
Member
 
Registered: Mar 2007
Posts: 39

Rep: Reputation: 18
Traditionally, a process running as root would need to supply the same credentials to the X server as anyone else would. But in recent years a feature in the X server has been enabled that allows a process (X client) running as root on the same machine to be let in for free. So your rc.local scheme may work if you just sleep for a bit before trying to connect to the X server (or try indefinitely in a loop.) I've seen people start x11vnc out of the init.d scripts so it works as long as the X server is running before x11vnc is run. If you have trouble collect log file (see below.)

For the gdm method add something like -o /var/log/x11vnc.log to the x11vnc cmdline and examine the error messages. If that log file does not get created then see if it is being run at all, e.g. put the command "touch /tmp/im_here" in gdm file and see if the flag file is created.
 
Old 04-29-2012, 07:33 PM   #5
eqtime
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Putting in -sleepin 60 didn't work unfortunately

This is what I have in my /etc/gdm/Init/Default - /usr/bin/x11vnc -rfbauth $HOME/.vnc/passwd -auth /var/gdm/:0.Xauth -display :0 -forever -bg -o /var/log/x11vnc.log

Do I need both -auth and -rfbauth?

Still giving me the following message in the log ***X11vnc was unable to Open the X DISPLAY ":0".

Is there something I'm missing?
 
Old 04-29-2012, 11:13 PM   #6
krunge
Member
 
Registered: Mar 2007
Posts: 39

Rep: Reputation: 18
Hi, for gdm Init Default neither "-auth" nor "-display" are needed, so I suggest dropping them from the cmdline (gdm sets the DISPLAY and XAUTHORITY env. vars correctly so why potentially change them?)

-rfbauth is needed for a VNC password. Not needed for testing.

Last edited by krunge; 04-29-2012 at 11:15 PM.
 
1 members found this post helpful.
Old 04-30-2012, 04:08 PM   #7
eqtime
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
THanks, I've removed those and just left it as x11vnc -bg -forever -o /var/log/x11vnc.log

I've added that command into gdm right before the x11vnc command, this was the output:, which looks pretty normal.

Code:
user	  1825  0.0  0.1 143444  2848 ?        S    08:53   0:00 /usr/libexec/gvfs-gdu-volume-monitor
user	  1827  0.0  0.3 252216  6672 ?        S    08:53   0:00 gnome-power-manager
user	  1830  0.1  0.4 253212 10040 ?        S    08:53   0:00 /usr/libexec/polkit-gnome-authentication-agent-1
user	  1832  0.0  0.3 249792  6420 ?        S    08:53   0:00 /usr/libexec/gdu-notification-daemon
user	  1834  0.1  0.3 275940  8012 ?        S    08:53   0:00 gpk-update-icon
root	  1835  0.1  0.1  40588  2592 ?        S    08:53   0:00 /usr/libexec/udisks-daemon
user	  1836  0.0  0.3 255300  7904 ?        S    08:53   0:00 bluetooth-applet
user	  1838  0.1  0.4 351592  9604 ?        S    08:53   0:00 gnome-volume-control-applet
root	  1846  0.0  0.0  40328   556 ?        S    08:53   0:00 udisks-daemon: not polling any devices
user	  1851  0.0  0.1 141212  2780 ?        S    08:53   0:00 /usr/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gvfs/exec_spaw/0
root	  1859  0.1  0.1  76936  3940 ?        S    08:53   0:00 /usr/sbin/packagekitd
user	  1861  0.0  0.1 258492  2500 ?        Ss   08:53   0:00 gnome-screensaver
user	  1866  0.0  0.0 231896  2000 ?        Sl   08:53   0:00 /usr/libexec/gvfs-afc-volume-monitor
user	  1871  0.0  0.1 148092  2064 ?        S    08:53   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
user	  1881  0.2  0.6 459744 13128 ?        S    08:53   0:00 /usr/libexec/clock-applet --oaf-activate-iid=OAFIID:GNOME_ClockApplet_Factory --oaf-ior-fd=30
user	  1882  0.1  0.5 386772 10844 ?        S    08:53   0:00 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory$
user	  1883  0.0  0.3 285000  7568 ?        S    08:53   0:00 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Fac$
root	  1888  0.0  0.1  69824  2260 ?        S    08:53   0:00 /usr/libexec/polkit-1/polkit-agent-helper-1 root cookie0
user	  1902  0.0  0.1 134584  2128 ?        S    08:53   0:00 /usr/libexec/gvfsd-burn --spawner :1.8 /org/gtk/gvfs/exec_spaw/1
root	  1903  0.0  0.0  21424   472 ?        Ss   08:53   0:00 /usr/sbin/atd
root	  1919  2.2  0.1 121468  2136 ?        Ss   08:55   0:00 /usr/sbin/gdm-binary -nodaemon
root	  1924  0.5  0.0   4048   536 tty2     Ss+  08:55   0:00 /sbin/mingetty /dev/tty2
root	  1926  0.0  0.0   4048   536 tty3     Ss+  08:55   0:00 /sbin/mingetty /dev/tty3
root	  1928  0.0  0.0   4048   536 tty4     Ss+  08:55   0:00 /sbin/mingetty /dev/tty4
root	  1932  0.0  0.1  12468  2656 ?        S<   08:55   0:00 /sbin/udevd -d
root	  1933  0.0  0.1  12468  2656 ?        S<   08:55   0:00 /sbin/udevd -d
root	  1934  0.0  0.0   4048   532 tty5     Ss+  08:55   0:00 /sbin/mingetty /dev/tty5
root	  1936  0.3  0.0   4048   540 tty6     Ss+  08:55   0:00 /sbin/mingetty /dev/tty6
root	  1951  1.3  0.1 152016  2852 ?        S    08:55   0:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 --force-active-vt
root	  1953 70.6  0.7 111808 15156 tty1     Ss+  08:55   0:02 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-LaB4hy/database vt1
root	  1968  0.0  0.0   9216   496 ?        S    08:55   0:00 /bin/sh /etc/gdm/Init/Default
root	  1970  0.0  0.0  13360  1016 ?        R    08:55   0:00 ps wwaux

Last edited by eqtime; 04-30-2012 at 04:10 PM.
 
Old 04-30-2012, 11:11 PM   #8
krunge
Member
 
Registered: Mar 2007
Posts: 39

Rep: Reputation: 18
Yes, that looks just like we expect. What's in the x11vnc.log? If x11vnc is still not working, post the x11vnc.log file here.
 
1 members found this post helpful.
Old 04-30-2012, 11:41 PM   #9
eqtime
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
It's working !!! I think there may have been a conflict with my rc.local and gdm using the command in both, at least in terms of logging. I removed the command from rc.local and it was logged that it was getting permission denied on listening port. This is from SELinux which I've edited to disabled.

Thanks for the help on this krunge!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
x11vnc Shwick Linux - Server 1 12-09-2008 09:56 AM
LXer: Tips and tricks: How do I use the "xm block-attach" command to attach additiona LXer Syndicated Linux News 0 08-21-2007 12:50 AM
help with x11vnc gtludwig Linux - Networking 5 10-08-2006 04:53 PM
Trying to use x11vnc? Snump Mandriva 12 04-12-2006 02:57 AM
x11vnc error mediaboy Linux - Software 1 06-24-2004 12:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration