Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get x11vnc to run at startup with openSuse but not having much luck. Here's what I did so far.

I edited /etc/X11/xdm/Xsetup and added the following lines to the end, right before exit 0:

#run x11vnc automatically
/usr/bin/x11vnc -rfbauth /usr/bin/vnc/passwd -o /var/log/x11vnc.log -forever -bg

I created the `/usr/bin/vnc/passwd file using:

sudo x11vnc -storepasswd /usr/bin/vnc/passwd

When I reboot, I do a ps -A | grep x11 and do not see the process running. I also see no /var/log/x11vnc.log file created. I can run the command from bash directory and it works fine. I have a feeling this script is never getting run at startup.

I also created a new file called /etc/kde4/kdm/Xsetup and put the two lines from above in there, and same behavior.

The file permissions are:

-rw------- 1 root root 8 Apr 26 22:26 /usr/bin/vnc/passwd
-rwxr-xr-x 1 root root 5691 Apr 26 22:01 /etc/X11/xdm/Xsetup

Any ideas?


I've even tried just echo'ing Hello World to a text file in Xsetup which also does nothing. It seems this script simply doesn't get run at boot.


I upgraded to 12.1, however none of my attempts have worked either.

share|improve this question
i have a few questions if you dont mind: 1. what display manager are u running (KDM or GDM) 2. is there a particular reason for preference to x11vnc over the default vnc server of your distribution 3. best i know, vnc allows you to share a desktop after login and not the login session itself, is that sufficient for you... thanks... – user1055604 May 5 '12 at 19:29
@user1055604 - 1) I'm running KDE. 2) No, x11vnc is just the first one I looked up how to install and get working but I'm fine with any VNC server really and 3) Yes, automatically starting after a logon is fine as well. – Mike Christensen May 5 '12 at 22:48
thanks... check out my post... hope it solves your problem... – user1055604 May 6 '12 at 7:26
up vote 2 down vote accepted

Here is what I could find, either should work:

To fix x11vnc:

Enter these commands at a console as the user:

mkdir ~/.vnc
x11vnc -storepasswd "password" ~/.vnc/passwd

Put this in the ~/.x11vncrc file replacing user with your username:

display :0
rfbauth /home/user/.vnc/passwd

Now to autostart it each time the user logs in:

ln -s /usr/bin/x11vnc ~/.kde/Autostart/x11vnc

Now reboot or restart the desktop session.



From the KDE desktop, select the YaST icon, enter the root password, and select OK; then select Network Services > Remote Administration.

Select Allow Remote Administration; then select Finish


share|improve this answer
This looks promising, I will try this later on today! – Mike Christensen May 6 '12 at 16:01
Tried both, neither work.. I did notice Autostart didn't exist, so I created it first. But x11vnc does not start at logon. Allow Remote Administration was already on this whole time, however it has no effect. Still can't VNC into the box. Thanks for trying though! – Mike Christensen May 8 '12 at 4:01
Ok I have no idea why this doesn't work, all the docs say it will. However, the .x11vncrc file seemed to help a lot. I found a method involving creating a file in ~/.config/autostart which finally works combined with your first step. I think this answer is probably the best out of the bunch though. Thanks! – Mike Christensen May 8 '12 at 4:18
.config/autostart is the new place where both KDE and Gnome look for their autostart files, in the .desktop format... the src i used was really old... good to know it worked out... – user1055604 May 8 '12 at 7:13

Revert /etc/X11/xdm/Xsetup back to it's original state (remove your edits). This is not being called during system boot.

Add your startup line /usr/bin/x11vnc -rfbauth /usr/bin/vnc/passwd -o /var/log/x11vnc.log -forever -bg to the file /etc/init.d/after.local.

Unless you want write a compliant init script that starts/stops/restarts the x11vnc process (which is possible but beyond the scope of this answer), you should place any processes you want to execute on boot in /etc/init.d/after.local.

Note: On RedHat systems, this would go in rc.local. SUSE uses before.local (execute before the init scripts) and after.local (execute after the init scripts).

share|improve this answer
This will start it as the system boots, not when KDE starts. – Rob May 2 '12 at 16:05
This doesn't work. x11nvc still isn't running at boot and if I look in the logs I see: *** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. - I'm gonna guess because there's not yet a valid display to bind to when after.local gets run? – Mike Christensen May 3 '12 at 2:23
Full log: – Mike Christensen May 3 '12 at 2:25
For clarification, X is running on this host, right? You have a graphical login screen and desktop? – uther May 3 '12 at 18:13
@uther - Yes, default openSuse 12.1 install with a KDE desktop.. Nothing too special about it.. – Mike Christensen May 5 '12 at 22:49

I don't have a SuSE 11 install in front of me to check.

Uther's on the right track - but you need to get the program to start AFTER X11 has been started.

I don't know for sure if it CAN work if just X is running - would you WANT it to be run if, for example, "guest" logged in via the X-window login screen?

With 12, SuSE changes all of the startup script stuff, so you may just want to upgrade, then fix it on 12:

As a general goal, you'll want to figure out what's actually running as your "login screen" under X (probably gdm - ) and how that got fired up. Wherever it's getting run, you'll want to run your x11vnc either directly before or directly after that.

share|improve this answer
Thanks! I've upgraded to 12 (I was meaning to anyway), but still I can't seem to find a script that actually gets run after X starts.. – Mike Christensen May 3 '12 at 15:14
I don't think you'll find one. You'll want to chase the scripts that are STARTING X - look for whatever's running GDM. Once you find it, you can either (a) call your script and be done, or (b) code a generic "hook" that runs some script if it exists, and submit that change back to the project. – pbr May 5 '12 at 22:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .