emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 3:30 pm

I am building up a personal 'setup steps' list to apply to a fresh Debian image to quickly setup my Rpi after image flashing. I have my Rpi booting (without login prompts) direct to LXDE as user pi. I want to use the Rpi headless and and connect to the console session :0, so using x11vnc instead of tightVNC.

My problem: I am a linux noob. After much google, there seems to be numerous possible ways to auto start x11vnc but not all apply to Debian (or Rpi configuration). I'm pretty sure x11vnc needs X11 already running (ie, startx) before you start it.

What's the best way to have x11vnc start after startx without too many changes to the default config?

Tnx

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 4:03 pm

Since you already have some kind of auto-login setup to log in as the user (presumably, user "pi"), the easiest would be to put x11vnc in your .xinitrc file.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 4:53 pm

I'm using the steps found here: RPi Debian Auto Login

I can't find any .xinitrc file, what is the path?

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 7:46 pm

~/.xinitrc

(your home directory)

Keep in mind that all linux files/folders with a . in front of their filename are "hidden".

You can show them by doing: ls -A in a terminal or in ctrl + h in a filebrowser

Simon H
Posts: 156
Joined: Sun Jan 08, 2012 2:41 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 8:32 pm

Try the instructions here, they worked for me.

http://forum.lxde.org/viewtopi.....38;t=31114

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 8:41 pm

Under the latest Debian image, .xinitrc does not exist in the pi user home directory. (thanks, I knew about the .file = hidden already, should have mentioned it to reduce confusion).

Do I create a new one?

lworbey
Posts: 41
Joined: Tue Dec 20, 2011 12:39 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 9:02 pm

i created a file in the home directory called .xsessionrc and placed my call to x11vnc in there and that works fine for me!

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 9:06 pm

Yes, if the .xinitrc file doesn't exist, you will have to create one (and make it executable - it is in fact a shell script).  And you will have to do a little research into how exactly it works, because it is not entirely newbie friendly.  But it is the way I've always done my X stuff.

I'm guessing that .xsessionrc is the new, newbie-friendly-Linux way of doing the same thing.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 10:04 pm

I create a .xsessionrc with the x11vnc command, made it executable. Rebooted and vnc started but the vnc session window was all black (as was the display via HDMI)?

As per Simon (above), I looked for the 'Autostart' folder under /home/pi/.config and it was not there...

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 10:16 pm

The xinitrc file is pretty simple to create:

An example can be found at:

http://wiki.debian.org/Xinitrc

Obviously you'll want to start your windowmanager of choice.

My .xinitrc just says:

exec awesome

Additional places to look:

https://wiki.archlinux.org/index.php/Xinitrc

It's for arch, but it might be similar to what you need to do under Debian (not sure as I don't use debian)

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 10:53 pm

hmmm. I think my problem is there is no good source of Rpi specific Debian info. Example: what window manager is used (openbox, gnome)? Is a window manager the same as a display manager?

Simon H
Posts: 156
Joined: Sun Jan 08, 2012 2:41 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 10:56 pm

I create a .xsessionrc with the x11vnc command, made it executable. Rebooted and vnc started but the vnc session window was all black (as was the display via HDMI)?

As per Simon (above), I looked for the "Autostart" folder under /home/pi/.config and it was not there…

Just
mkdir autostart
in the .config folder then
cd autostart
nano x11vnc.desktop
and copy the text in the link.

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 11:24 pm

Simon,

Created Autostart folder in .config, created x11vnc.desktop and copy/saved text and rebooted. VNC did not start. Have you done this on a Rpi and it worked? I can only still puTTY to the Rpi login as pi and run x11vnc...

BTW, thanks to all for your suggestions!

Simon H
Posts: 156
Joined: Sun Jan 08, 2012 2:41 pm

Re: x11vnc autostart for headless - best way on Debian?

Sun May 06, 2012 11:33 pm

Yes I did it on a pi yesterday. autostart is a small "a" might be your problem those instruction must be a typo but the rest is right.
I did it via putty too just because it is easy to paste.

emg
Posts: 88
Joined: Wed Jan 11, 2012 11:01 pm

Re: x11vnc autostart for headless - best way on Debian?

Mon May 07, 2012 12:10 am

Nice.

That was it! Thanks for your help Simon.

Return to “Troubleshooting”