(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:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#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”
Advertisement
This entry was posted in linux, tips n tricks, tutorials, Ubuntu, Uncategorized. Bookmark the permalink.

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

  1. John Steinman says:

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

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 )

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