(Solved) vnc4server on Ubuntu 11.10 (Oneiric Ocelot)

Im posting this because I spent a lot of time trying multiple things to get vnc4server up and going on the Ubuntu 11.1 system. Most people suggest using x11vnc, which does work out of the box but does not support multiple users.

vnc4server is great, and up and running finally!

Here are the steps:

  • Install vnc4server
    • sudo apt-get install vnc4server
  • Install gdm
    • sudo apt-get install gdm
      sudo apt-get install gnome-panel
      • When asked to choose the default session manager, choose lightdm
  • When you launch vnc4server for the first time, you will be asked to set a password and a /home/<user>/.vnc/xstartup will be created for you.
  • We need to change the contents of xstartup to get things working properly.
  • Contents should look like this:
# Uncomment the following two lines for normal desktop:
#exec /etc/X11/xinit/xinitrc
#. /etc/X11/xinit/xinitrc
gnome-session  --session=gnome-classic &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &

What’s changed and is important is this:

  • unset SESSION_MANAGER : Gets rid of any errors like “Coud not acquire name on session bus “
  • /usr/share/gnome-session/sessions will have a bunch of .session files. You may use any of these  in your xstartup file.  For example:
    • gnome-session –session=gnome-classic & gives your classic gnome
    • gnome-session –session=ubuntu-2d & gives you Unity
    • gnome-session –session=ubuntu & does not work!
    • gnome-session & will not work because the default session is “ubuntu”
This entry was posted in linux, tips n tricks, tutorials, Ubuntu, Uncategorized. Bookmark the permalink.

7 Responses to (Solved) vnc4server on Ubuntu 11.10 (Oneiric Ocelot)

  1. John Steinman says:

    Awesome!!! Just tried it… works great!!! Thank you so much

  2. brian montgomery says:

    I have been going around and around with vnc on oneiric and this fixed it the first time I tried it! Your *nix fu is the greatest!! Thank you!

  3. sivaprasad says:

    Its working fine but display is coming slowly.
    any way Thanks for this fix.

  4. Mark says:

    Hi, I had been looking for a solution to this problem for quite a while. This worked wonders and save me a lot of time. Thanks for the advice from Mexico

  5. Qianlei says:

    good idea, you use the gdm for the vnc4server . this is good idea .let me try it .
    but i have other question , i want to ask you . it is .
    why the vnc server can’t use lightdm. i try i lot of times . do you have ideas??

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s