simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK

Setting up x11vnc on Raspbian

Tue Jul 24, 2012 8:51 pm

I've been using tightvncserver to sucessfully run remote sessions on my Pi but I'd like to be able to directly view/control the same session as I seen on my Pi HDMI connected monitor.

I understand I need to use x11vnc for this (which I've downloaded and installed) but I'm struggling with Mr Google to find a working example of what parameters to use with it.

Can anyone help please?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2876
Joined: Sat Mar 03, 2012 11:57 am
Location: UK

Re: Setting up x11vnc on Raspbian

Tue Jul 24, 2012 8:57 pm

I'm sure someone asked a very similar question a few days ago. I don't think it was fully resolved though. I'll see if I can find the thread.

It was here...
http://www.raspberrypi.org/phpBB3/viewt ... 55#p129655

Don't know if you've seen that one (maybe it's where you got the x11vnc thing from?)
Alex Eames RasPi.TV, RasP.iO

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK

Re: Setting up x11vnc on Raspbian

Tue Jul 24, 2012 9:48 pm

As you say - not really resolved :(
For things like this, you need the person who been there and got the t-shirt :)

Ta tho :)

Si
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK

Re: Setting up x11vnc on Raspbian

Wed Jul 25, 2012 11:28 pm

Found it :)

http://www.raspberrypi.org/phpBB3/viewt ... 62#p108862

and it worked 1st time for me :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

evanj
Posts: 1
Joined: Thu Jan 03, 2013 6:15 pm

Re: Setting up x11vnc on Raspbian

Thu Jan 03, 2013 6:17 pm

thanks Simon. I was looking for the same answer and your solution worked.

haranath
Posts: 3
Joined: Sat Jan 26, 2013 7:57 pm

Re: Setting up x11vnc on Raspbian

Mon Jan 28, 2013 6:48 am

Thanks Simon, I was looking for the same as well and worked for me as well.

Regards

PeteW
Posts: 3
Joined: Wed Jan 30, 2013 8:12 am

Re: Setting up x11vnc on Raspbian

Sat Feb 02, 2013 4:16 pm

Hello,
I'm no expert but having spent some time trying various methods (without success), the following worked for me:

1. Install

Code: Select all

sudo apt-get install x11vnc
NB I chose not to set a password

2. Auto-start
NB Previously configured auto-login & StartX by following: http://elinux.org/RPi_Debian_Auto_Login

Create new / edit existing ~/.xsessionrc file:

Code: Select all

# Start X11VNC
x11vnc -bg -nevershared -forever -tightfilexfer -nopw -display :0
NB no need to make it executable.

Comments:
-bg : run in background after screen setup. Without it I get a blank / black screen on local (& remote) display - had to SSH-in, to fix via CLI. So, this option seems *essential* for me, though is rarely mentioned!?
-nevershared -forever : on creating a new connection, drop existing. (I only need 1 connection). From x11vnc --help, this combo "guards against hung TCP connections that do not go away."
-nopw : I choose not to use a password; this prevents a warning.
-tightfilexfer : I use TightVNC client
-display 0 : default X11 server display

I use the TightVNC client, as UltraVNC connects but displays solid (red) window, no contents.

Hope this helps.

Cheers,
Pete.

References:
http://elinux.org/RPi_VNC_Server
http://www.penguintutor.com/linux/tightvnc
http://www.rpiforum.net/forum/tutorials ... -raspbian/
http://www.raspberrypi.org/phpBB3/viewt ... 63&t=24809
http://www.raspberrypi.org/phpBB3/viewt ... f=6&t=5540

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK

Re: Setting up x11vnc on Raspbian

Sun Feb 03, 2013 1:18 am

hi Pete
Did you actually try
http://www.raspberrypi.org/phpBB3/viewt ... 62#p108862

because it worked for me and everyone else who's tried it :)

I use is on a daily basis as I'm remoting into battery powered robot RPi.

Its worked with both tightnvcviewer and ultravncviewer, both here at home and in 2 of my schools.

So I think its a runner :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

PeteW
Posts: 3
Joined: Wed Jan 30, 2013 8:12 am

Re: Setting up x11vnc on Raspbian

Wed Feb 06, 2013 6:42 pm

Hi Simon,

Thanks for your reply. Yeah, I did try that - it's near the end of http://www.raspberrypi.org/phpBB3/viewt ... 63&t=24809

Using the .config/autostart/x11vnc.desktop file, Ultravnc still gives me a solid red(ish) [on Auto] or blue [manual settings] window - no desktop contents.

With hindsight, I abandoned this method due to the above problem (I have) with UltraVNC [Win32, 1.0.9.6.1]; I've just confirmed it works fine with TightVNC.

Thanks again,
Pete.

pbanders
Posts: 8
Joined: Thu Feb 07, 2013 9:35 pm

Re: Setting up x11vnc on Raspbian

Thu Feb 07, 2013 9:43 pm

Hi, first post. Have my headless Pi with x11vnc up and running, using the instructions on this page, thanks. Only issue is that if I boot the Pi without a monitor attached, I end up with a tiny little VNC window, apparently a default monitor size. If I boot with a monitor attached and then disconnect it, the VNC window is the size of the monitor that was previously attached. What do I need to do to tell x11vnc to create a session of a specific window size, e.g. 1920x1080? Thanks...

pbanders
Posts: 8
Joined: Thu Feb 07, 2013 9:35 pm

Re: Setting up x11vnc on Raspbian

Fri Feb 08, 2013 1:27 am

Figured out that it's not x11vnc that I need to tweek, but it's the X environment, so that when it's headless, it doesn't default to the small 656x416 window size. What do I need to change? A default 1024x768 would be enough for me.

pbanders
Posts: 8
Joined: Thu Feb 07, 2013 9:35 pm

Re: Setting up x11vnc on Raspbian

Sat Feb 09, 2013 3:14 am

Solved my own problem, got it working by forcing hdmi in config.txt. Defaults to a decent screen size now.

ghunter
Posts: 1
Joined: Tue Feb 19, 2013 2:07 am

Re: Setting up x11vnc on Raspbian

Tue Feb 19, 2013 2:09 am

pbanders wrote:Solved my own problem, got it working by forcing hdmi in config.txt. Defaults to a decent screen size now.
Could you post more details on how you did this?

ansimon
Posts: 1
Joined: Sat Mar 16, 2013 1:11 am

Re: Setting up x11vnc on Raspbian

Sat Mar 16, 2013 1:17 am

ghunter wrote:
pbanders wrote:Solved my own problem, got it working by forcing hdmi in config.txt. Defaults to a decent screen size now.
Could you post more details on how you did this?
I think he meant that you have to edit /boot/config.txt and force hdmi display.

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

After making this change i get a decent screen in my vnc connection.

PS: Sorry about my English. I'm not a native English speaker.

amod400
Posts: 2
Joined: Sun Aug 05, 2018 8:49 am

Re: Setting up x11vnc on Raspbian

Sun Aug 05, 2018 9:19 am

Hello PiMates,

Hope someone would find it helpful.
  • By default PiCamera can’t be viewed over vnc.
Few things to consider.
Step 1:
  • Enable VNC on the Raspberry Pi
Image
  • or you could follow a commandline
    sudo raspi-config > Interfacing Options > VNC > Enable
  • Download the deb file from the above link, install using "dpkg -i <package>.deb"
  • Check your vnc connect server version 6.3 should be good as of Aug 2018
  • Image
Step 2:
  • Start vnc server $vncserver :1
  • Display looks too small and unscaled
  • Fix it by changing few display parameters for hdmi in "$ sudo nano /boot/config.txt"
    # uncomment to force a specific HDMI mode (this will force VGA)
    hdmi_ignore_edid=0xa5000080
    hdmi_group=2
    hdmi_mode=16
    More info https://elinux.org/RPi_Configuration
    Now you need to reboot "sudo reboot now"
  • Now open VNC to the pi, and enable "experimental direct capture mode"
    Image
  • Reconnect VNC
  • Thats it Guys. Image

Return to “Beginners”