Setup VNC Server for Ubuntu Gutsy Gibbon and Hardy Heron in 3 easy steps

I just did this on Gutsy, and I thought that it might be worth sharing as a simple way to set up a persistent VNC server. If you dont know what VNC is, its similiar to Remote Desktop for wind0ze. This is accessible using regular vnc viewers, and through java-enabled browsers. That's right, you work on your computer through a browser.

1) Install packages | click here for 1 click install
sudo aptitude install x11vnc vnc-java
2) Set up password to allow clients to view
x11vnc -storepasswd
3) Open up ports 5800 and 5900 on your firewall

4) Run this command:
x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800

That's it!

And an optional step 5:

5) Add the command from 4) to your sessions, so that it starts at each login

If you want to test it out on a browser, type this in the URL field:

25.542.161.414:5800

Of course, replace the 25.etc. w/ your external IP address.

Addendums to this are welcome, such as how to make it more secure. I just thought it'd be nice to have a quick and dirty tutorial for getting this set up easily.

Comments (21)

Loading... Logging you in...
  • Logged in as
desktop share is already installed in ubuntu by default
Yes Desktop sharing is enabled by default in Gutsy Gibson and it does automatically make a firewall rule. If you need to learn about portforwarding you can check out portforward.com

AskTheAdmin.Com

Thanks you have friends over @ <A HREF="http://www.askTheAdmin.com" REL="nofollow">AskTheAdmin.com!
But i guess that solution covers the vnc access to a not initialized session. In ubuntu default way, you can connect just if a session was initialized.
I get an error when I try and start the VNC server (via putty):

04/11/2007 11:08:44 x11vnc version: 0.8.2 lastmod: 2006-07-12
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match

04/11/2007 11:08:45 ***************************************
04/11/2007 11:08:45 *** XOpenDisplay failed (localhost:10.0)

*** x11vnc was unable to open the X DISPLAY: "localhost:10.0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

HELP!
how do i uninstall it??
1 reply · active 856 weeks ago
sudo apt-get remove x11vnc vnc-java i do believe
how do I control ubuntu 6.10 with windows xp?
it doesnt work when I type "(my name)-desktop:5800
To all people leaving Ubuntu-specific questions here:

Head over to http://www.ubuntuforums.org, register, browse the forums! Chances are, someone has already solved the problem you are looking to solve. If you cannot find a solution somewhere, feel free to post a thread under the appropriate section.

To uninstall,
sudo aptitude remove x11vnc vnc-java

Yes, windows remote desktop (as far as I am aware) is a proprietary piece of software that is not VNC-compliant.

And finally, a security note here: Using the default ports of 5800 and 5900 is generally bad security practice. Try changing them so something higher (40,000-65,000 is a good range). Be sure you forward the correct port, if you are behind a firewall!

Good luck!
[quote]how do i uninstall it??[/quote]

lmao.
Just go to Add/Remove Programs and click on uninstall.

LMAO!

sudo aptitude remove x11vnc vnc-java
Nice! That was super-easy, and worked flawlessly. I'd already set up dyndns, so now I can just pop in whenever I want. Thanks for this super quick and easy VNC setup!
anytime Joel :)
nowandever29's avatar

nowandever29 · 881 weeks ago

Thanks, found tons of tips on getting VNC working on hardy heron, none worked, but yours did!
thanks, having problems with default remote control in Hardy lately, so yours helped, however can you clarify how exactly I can ad the command to start up. I am new to it, but if I add it to my .profile file it doesn't boot me X anymore.
But this is to connect to an already running session desktop:0. what if I want to run it for a fresh resumable session say localhost:2 locahost:3 etc etc
i don't get it how to control my ubuntu desktop from other computer?
1 reply · active 869 weeks ago
I get my connection at my Ubuntu server running the above-described installation, but it sure is painting the screen V E R Y S L O W L Y (: Any ideas what could be causing this?
Thanks in advance.
netvampire's avatar

netvampire · 846 weeks ago

thanks
If you're having trouble you might get benefit from visiting the ubuntu forums or linuxquestions.org
How do I add a session to start it

Post a new comment

Comments by

Clicky Web Analytics