You are not logged in.

#1 2014-09-25 15:34:53

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

[Solved] x11vnc not starting automatically

I've setup my htpc with Arch, SLiM login manager and Xfce4. It logs in automatically.

I want the current desktop shared via VNC, so I came up with the following line:

x11vnc -display :0 -forever -usepw -ncache 10 -ncache_cr -auth ~/.Xauthority -bg -o ~/.x11vnc.log

I added this in Xfce settings to the Session & Autostart, but it is not starting.

When I run the command manually in the terminal it works fine.

Why isn't this working via the autostart function?


Thanks!

Last edited by mouseman (2014-09-26 19:36:33)

Offline

#2 2014-09-25 16:13:37

dave91
Member
Registered: 2014-08-04
Posts: 10

Re: [Solved] x11vnc not starting automatically

I start vnc manually but from the archwiki i would suggest trying with this authfile

 -auth /var/run/slim.auth 

but it generally requires root

Last edited by dave91 (2014-09-25 16:15:17)

Offline

#3 2014-09-25 16:17:07

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

Thanks, I read the wiki, but have no idea what to do with that line. What do I do with it?

Offline

#4 2014-09-25 16:26:41

dave91
Member
Registered: 2014-08-04
Posts: 10

Re: [Solved] x11vnc not starting automatically

I'm can't test it because i use startx but i can show you my options

 x11vnc -nap -wait 50 -noxdamage -rfbauth ~/.x11vnc/passwd -display :0 -forever -o /var/log/x11vnc.log -bg 

I don't use X authority at all and can call this script als user. Maybe it works for you too. How to generate the file for rfbauth is in the wiki.

Offline

#5 2014-09-25 16:37:44

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

The -usepw parameter I'm using automatically uses the default ~/.x11vnc/passwd file. It exists and it works as when it runs, I need to authenticate with the password that's in that file.

I removed the -auth ~/.Xauthority option but that doesn't make a difference. I suppose I didn't need that.

Offline

#6 2014-09-26 16:55:19

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

Anyone please?

Offline

#7 2014-09-26 17:24:40

mwillems
Member
Registered: 2014-08-09
Posts: 99

Re: [Solved] x11vnc not starting automatically

Hey mouse, have you tried experimenting with XFCE's save session on closing options?  For example, if you have it running successfully and save your session on log out, xfce will restart most programs automatically on your next login; I've found that (for whatever reason) that sometimes works more reliably than autostart.

Barring that, have you had a look at the .desktop files in ~/.config/autostart?  That's where Session and Autostart keeps the .desktop files it creates when you add an autolaunch item using the GUI, so you might be able to see some issues in the actual .desktop file being created.

It may also be a permissions issue, in which case something should show up in the journal.

Last thought; you're not trying to do this on a headless system are you?  If so, that might explain why it works when you do it manually, but not automatically. If that's the case you need to add the -create flag to your x11vnc line.

Last edited by mwillems (2014-09-26 17:28:08)

Offline

#8 2014-09-26 18:33:34

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

Hey buddy! I have this strong feeling I've seen you somewhere else before wink.

I don't use the save session anymore since I had some trouble with it in the past, where it would simply hang showing a desktop and not load any panels.

The desktop file contains nothing special as far as I'm concerned:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Remote Desktop
Comment=Shares the Current Desktop
Exec=x11vnc -display :0 -forever -usepw -ncache 10 -ncache_cr -bg -o ~/x11vnc.log
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

As you can see I'm logging to ~/x11vnc.log, after I login there's nothing there. Only when I start it manually it creates the file or writes something to it.

I can't see how its a permission issue, I can run the command manually, same user account, its supposed to be able to un as the current user too. I'll have a look in journal logging again in case I missed something but I don't think there was anything there.

The system is not headless, a HDMI doctor sits in between the HTPC and the TV for when the TV is turned off so the HTPC things the TV is always on. I also tested with the TV turned on, no difference.

Thanks for helping!

Offline

#9 2014-09-26 19:07:28

mwillems
Member
Registered: 2014-08-09
Posts: 99

Re: [Solved] x11vnc not starting automatically

mouseman wrote:

Hey buddy! I have this strong feeling I've seen you somewhere else before wink.

Funny I've got the same feeling smile

Two more questions and then I'm out of ideas: 1) I know this sounds silly, but did you make sure that the checkbox next to it in the XFCE4 GUI was checked? If that box isn't checked nothing loads. 2) Have you tried to run it as a startup service using systemd?

Offline

#10 2014-09-26 19:10:37

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [Solved] x11vnc not starting automatically

Have you tried an alternative implementation of vnc?  Try tigervnc:

x0vncserver -display :0 -passwordfile ~/.vnc/passwd

EDIT: what if you make your x11vnc line into a bash script with some sort of logging mechanism to verify that it ran, i.e.:

#!/bin/bash

RUNDATE=$(date "+%F %T")
echo $RUNDATE >> ~/x11vnclog.txt
x11vnc -display :0 -forever -usepw -ncache 10 -ncache_cr -auth ~/.Xauthority -bg -o ~/.x11vnc.log

EDIT2:  back when I used x11vnc, I did so with the following in openbox with a ~/.config/autostart/x11vnc.desktop and it worked flawlessly:

/usr/bin/x11vnc -nap -wait 50 -noxdamage -display :0 -forever -o /dev/shm/x11vnc.log -bg

Last edited by graysky (2014-09-26 19:14:12)

Offline

#11 2014-09-26 19:16:17

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

mwillems wrote:

Two more questions and then I'm out of ideas: 1) I know this sounds silly, but did you make sure that the checkbox next to it in the XFCE4 GUI was checked? If that box isn't checked nothing loads.

Yes, it's checked.

mwillems wrote:

2) Have you tried to run it as a startup service using systemd?

No, I haven't. I know it can be done with --user, create a simple script but I've not done it before.

Offline

#12 2014-09-26 19:30:05

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

graysky wrote:

Have you tried an alternative implementation of vnc?  Try tigervnc:

x0vncserver -display :0 -passwordfile ~/.vnc/passwd

I didn't try autostarting it, but I used it shortly and started it manually. I switched to x11vnc because the wiki recommended it and it's documentation seemed more elaborate.

I'll try to autostart x0vncserver tomorrow (it's getting late wink).

graysky wrote:

EDIT: what if you make your x11vnc line into a bash script with some sort of logging mechanism to verify that it ran, i.e.:

#!/bin/bash

RUNDATE=$(date "+%F %T")
echo $RUNDATE >> ~/x11vnclog.txt
x11vnc -display :0 -forever -usepw -ncache 10 -ncache_cr -auth ~/.Xauthority -bg -o ~/.x11vnc.log

I just tried a script, but as I suspected, it's not even starting it. When I clear that x11vnc.log, it's not created when I reboot or login. Same with the script, its not started.

graysky wrote:

EDIT2:  back when I used x11vnc, I did so with the following in openbox with a ~/.config/autostart/x11vnc.desktop and it worked flawlessly:

/usr/bin/x11vnc -nap -wait 50 -noxdamage -display :0 -forever -o /dev/shm/x11vnc.log -bg

Honestly I don't think its the parameters as running it manually works fine. The .desktop file is simply not run by XFCE it seems.

Thanks for your suggestions!

Offline

#13 2014-09-26 19:33:17

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: [Solved] x11vnc not starting automatically

x0vncserver is an inefficient screen scraper. It'll be less inefficient in the next Tigervnc release (it gained support for the damage extension), but still.

I recommend using the Tigervnc X module: https://bbs.archlinux.org/viewtopic.php … 0#p1457550

Offline

#14 2014-09-26 19:36:19

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 298

Re: [Solved] x11vnc not starting automatically

Thanks Gusar, I'll keep that in mind.

x11vnc is working by the way.

In my haste to test it via the script I forgot to make it executable. Now that it is, it's working.

Thanks again for all the help!

Offline

Board footer

Powered by FluxBB