Today I’ve installed Ubuntu 11.10 Oneiric Ocelot on my ASrock 100HT nettop. I’ve wanted to remotely control this box via VNC protocol.
My solution was x11vnc server, so I could share one one session between remote and physical access. I’ve found useful thread about x11vnc on Ubuntu 11.10 – I’ve just added some upstart magic to start x11vnc after lightdm.
First of all, I’ve installed x11vnc:apt-get install x11vnc
Then, I’ve created /etc/init/x11vnc.conf file:start on login-session-start
script
x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log
end script
After restart, x11vnc shoud listen on vnc startard port – 5900.
This script is of course based on upstart event mechanism. Lightdm emits login-session-start event (you can find it in lightdm.conf), and we start x11vnc when this event is emited – that’s first line of x11vnc.conf file.
Just what I was looking for, thanks!
As the started of the thread referenced above I want to thank mlepicki for this startup script which brought everything together.
Yours looks like a truly brilliant solution, however, it fails for me. I installed x11vnc and made the x11vnc.conf file, but I cannot get it to work. After restart, a ps aux | grep vnc shows no x11vnc running, and I cannot login to the machine.
I looked about everywhere to see if maybe the login-session-start signal needs to be activated, but couldn’t find anything, neither in the upstart lightdm.conf nor in the /etc/lightdm/ directory. Now I am out of my wits.
Any suggestions to get it to work?
Works great! THanks a lot.
Scrap my question, please. I solved the issue – it was just that I typed -display:0 instead of -display :0 …
um. it works on xubuntu for sure. But never prompts me for password. not sure whatsup.
Pingback: Authenticating with x11vnc: what’s the difference between -auth and -rfbauth? | MoVn - Linux Ubuntu Center
Thanks, I was looking for this. One more question, how can we se a password for it?
Hi there,
I found your website and it really helped me to get x11vnc working before login.
Here is what I did to get it to work for Ubuntu 11.10 (your thoughts on this would be appreciated):
1 – Install x11vnc from Software Centre
2 – run command
sudo x11vnc -storepasswd yourpasswordhere /etc/x11vnc.pass
3 – run command:
sudo chmod 744 /etc/x11vnc.pass
4 – run command:
sudo gedit /etc/lightdm/lightdm.conf
5 – Add following line of code to the lightdm.conf file:
greeter-setup-script=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /tmp/x11vnc.log
6 – Save file and restart computer and you should now be able to connect remotely using a VNC viewer of your choice
Kind regards,
David Johnson
Exactly what I was looking for, thanks!
Upss… sorry guys&girls, I’ve forgot to set up mail notification on upcoming emails! Just fixing it!
Just one note about adding password prompt: see this post http://ubuntuforums.org/showpost.php?p=11400219&postcount=23 by emk2203
Thanks so much for posting this. It’s ended a huge headache for me
Great. Still your password flying unencrypted over net.
Mayby try this:
http://mycomputerconfig.blogspot.com/2011/11/upgrade-ubuntu-z-1104-natty-narwhal-do.html [PL] ( http://tiny.pl/h14wk [EN] )
_
regards
tom
@Tom: Thanks for your links! VNC encrypts passwords sent over the net, but the rest of the traffic is sent unencrypted. That’s ok in my home network, but for public VNC access I’d recommend your solution or other security tools, like VPN.
Sure. But if You plan connect with vnc before You login to the desktop on your remote host? Then You must give Your second pass thru unencrypted connection
VPN of course is a good idea
_
regs
tom
For encryption, vncviwer allows a via option to be specified, ala:
vncviewer -via USERNAME@HOST localhost:0
From what I understand, this should give an encrypted connection/tunnel to the HOST. From the manual pages for vncviewer, “man vncviewer”:
-via gateway
Automatically create encrypted TCP tunnel to the gateway machine
before connection, connect to the host through that tunnel
(TightVNC-specific). By default, this option invokes SSH local
port forwarding, assuming that SSH client binary can be accessed
as /usr/bin/ssh.
Best regards
Viktor S. Wold Eide
Best to tunnel the port (5900 for default of whatever you have chosen vnc to listen on)through ssh and you have an extra layer of security.
Google ssh tunelling, there are plenty of how-tos out there.
Thanks for this how-to. I installed x11vnc including password authentication according to mlepicki’s updated information. Maybe it would be a good idea to update the original posting so as to rid readers from scrolling.
Wow, thanks very much!
Very nice and neat solution, that’s what I exactly need. Thanks a lot!