Wednesday, June 13, 2007
Making vncserver work on Ubuntu
The VNC server on Ubuntu Edgy and Feisty is busted and that has been true for some time. However, the VNC server from Debian Etch works just fine on Ubuntu, with one simple work-around for font directory location. Here is how to get it working in Ubuntu Feisty:
You should now have a vnc viewer window with your choice of desktops. As long as you keep a VNC server running on your computer, you can now connect to your home computer from work (or vice versa) by setting up your firewall or gateway to forward port 5901 to the computer you wish to connect to, then running the xvnc4viewer or the Windows VNCviewer icon on the computer you're connecting from. This also makes a dandy way of accessing a real Linux desktop from a Windows computer in another room. The only real issue here is that neither Firefox nor Thunderbird much like the notion of you being logged in twice, and thus you can't leave a Firefox or Thunderbird open on the VNC desktop. No biggie, just use Konqueror or Epiphany as your web browser (depending on whether you're on Gnome or KDE) and use Evolution or kmail for your email.
- Download the latest vnc4-common package to your home directory via packages.debian.org.
- Download the latest vnc4-server package to your home directory via packages.debian.org
- Type the following at a command prompt:
- cd /usr/X11R6/lib/X11
- mkdir fonts note - don't worry if it says the directory already exists, that's okay.
- cd fonts
- mv encodings encodings- again, don't worry if it says encodings doesn't exist, that's okay.
- ln -s /usr/share/fonts/X11/* .
- dpkg -i vnc4-common*.deb
- dpkg -i vnc4server*.deb
- apt-get install xvnc4viewer
- Run vnc4server the first time:
- vnc4server -depth 16 -geometry 1024x768 :1
- If all went well, you should have been prompted for a new password to use for connecting to the vnc server, then it should have started. Connect to the vncserver to make sure it started up correctly:
- You should have gotten a window with a rather sparse twm configuration. (If not, check the log file that the vnc4server command created to see why not!). This probably isn't what you want. So edit the file ~/.vnc/xstartup to look something like this (make a copy of the file to another name first!):
# gnome-session vncsession &
- If you don't want a separate eyecandy-less KDE configuration for your VNC sessions (I have lots of memory and CPU thus I run my regular KDE with lotsa eye candy but that really doesn't travel well over the Internet), remove the KDEHOME line. If you want gnome rather than kde, comment out the startkde line and uncomment the gnome-session line. I also specify a vnc-specific session for the gnome-session line so that it will (hopefully) co-exist with a desktop gnome session.
- Now you're ready to test your new startup:
- vnc4server -kill :1
- vnc4server -depth 16 -geometry 1024x768 :1
- xvnc4viewer localhost:1
Another issue: what to put for -geometry. I put 1024x768 but if you have a big screen on your client computer, you'll want to put something bigger (something smaller really doesn't work for a number of reasons to do with KDE and Gnome UI design). -depth 8 would be faster, but a number of programs will not work with that, thus -depth 16.
-- Badtux the Linux Penguin
Posted by: BadTux / 6/13/2007 12:07:00 PM
But I have no fucking idea what you are talking about.
And frankly my dear, I don't give a damn because it will all change tomorrow.
God, the I don't give a fuck computer user as long as what I have does what I want it to.
# posted by BBC : 13/6/07 7:03 PM
What he said...
# posted by deuddersun : 14/6/07 9:39 AM
I hate hassles like you just described.
This is probably the main reason I'm staying away from linux. I actually tried to set up a media server not long ago, but the capture cards I had weren't supported (one might have been if I followed an instruction set as in-depth as what you just laid out.) I threw a windows MCE AIO on it instead.
If I did need a lightweight machine just to run openoffice and firefox, or if I had a machine where everything worked, I'd definitely look at XUbuntu or Puppy.
# posted by NewsBlog 5000 : 14/6/07 5:00 PM
Thanks for your efforts, it looks lots of people having problems on ubuntu / kubuntu with VNC. I tried to fallow your instruction, I've deinstaled ubuntus own vnc4-common and vnc4server packages and instaled debain packages as you sugested. I got warning that there is newer version, which I ignored. Install went ok. Problem occured when I executed
dpkg -i vnc4server*.deb
dpkg: error processing vnc4server*.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
# posted by Darko kantic : 25/6/07 10:11 AM
Just make sure you're in the same directory as the vncserver deb! (i.e., make sure 'ls' shows the vncserver deb).
# posted by BadTux : 25/6/07 11:41 AM
Thanks, so for future pinguiners who may read this helpful howto:
after you do
# ln -s /usr/share/fonts/X11/*
than find location of your package files
on my computer it was in
so next step is
# dpkg -i vnc4-common*.deb
# posted by : 26/6/07 8:33 AM
ok, it works!
one problem, some aps dont'run, I tried Eclipse but I starts to load but than it just doesnt, no messages. Same with gimp. Could it be because they are gnome apps ( I am accessing KDE from my windows laptop)
Thanks for help so far
# posted by Darko Kantic : 26/6/07 8:45 AM
Sorry, Darko, what that means is that you managed to track down where apt-install had stashed the original Ubuntu vncserver dkpg's and re-install them :-). Download the Debian dpkg's again, REMEMBER WHERE YOU DOWNLOADED THEM TO, un-install the Ubuntu packages again, then install the Debian packages.
As far as I know, the only program that just absolutely refuses to work with the Debian packages is Opera. No big loss, IMHO.
# posted by BadTux : 26/6/07 9:18 AM
douhg, yes I reinstalled Ubuntu packages, that is why it didn't completely work.
Now I deinstaled them and installed Debian packages, and it all works
so OS community rocks
# posted by : 26/6/07 10:15 AM
Why does Ubuntu ship a broken vncserver package for already a few months now? According to the RealVNC guys there's also a severe security risk! Do the Ubuntu package/release managers just don't care, or is there nobody competent enough to fix this problem?
# posted by : 2/7/07 2:01 AM
It's unclear whether the current Ubuntu vnc packages pose a security risk. They've been heavily patched. It is clear that they just plain don't work with any GTK+ program or with many other programs due to bugs. As to why it doesn't get fixed, beats me. But I'm running the Debian packages now, so other than Synaptic whining about how it has two updates to apply (the broken Ubuntu packages), I'm good to go.
# posted by BadTux : 2/7/07 7:51 AM
The current feisty vnc4server package seems to work fine if you start it with:
as noted in https://bugs.launchpad.net/ubuntu/edgy/+source/vnc4/+bug/78282/comments/57
# posted by : 20/7/07 8:10 PM
Your instructions worked perfectly and saved me a lot of time in getting it up and running!
# posted by Marnus : 22/7/07 11:30 AM
- Name: BadTux
- Location: Some iceberg, South Pacific, Antarctica
I am a black and white and yellow multicolored penguin making his way as best he can in a world of monochromic monkeys.
View my complete profile
April 2004 / December 2004 / January 2005 / February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / July 2007 / August 2007 /
Bill Richardson: Because what America needs is a competent fat man with bad hair as President (haven't we had enough incompetent pretty faces?)
Cost of the War in Iraq