58 Comments

  1. Anders Sjögren

    Thanks for a very well written tutorial. I have spent quite some time now trying to make VNC to an updated Ubuntu 14.04 machine work, but to no avail. Your post is recent and it seems you know very well what you are doing. However, even though I follow your steps exactly, I do not get VNC to work. My client is currently the tightVNC viewer in Windows.

    What I want to do is to use a separate frame buffer (desktop) and that is why I want tightVNC. x11vnc works fine but gives me just a copy of the desktop being displayed on the server side.

    I think I have understood that I cannot use the standard Ubuntu desktop (do not know why), and I have read posts trying with gnome (as opposed to the ones you use above). Another well written post is http://www.havetheknowhow.com/Configure-the-server/Install-VNC.html but that also does not work for me.

    I have tried trillions of different .vnc/xstartup to no avail. I am new to this so I really just follow the posts I read for now. I haven’t found anywhere to read up on this configuration file; what you can and cannot do etc.

    Most xstartup settings just give me a grey background and the mouse cursor. If I enable the following two lines

    #x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
    #x-window-manager &

    I get a terminal window, but I cannot write the character “s”. I wanted to try startx, but even that failed. I have no solution to that and it seems others have had similar issues.

    With the setup you propose above, I get some difference. Instead of a grey background, the background is grey hatched. I get the same result if I just have the line

    gnome-session &

    in xstartup.

    If you have any idea what I should try more I would be most grateful.

    • namhuy

      First of, are you trying to use gnome or xfce. As far as I can tell from http://askubuntu.com/questions/361617/does-gnome-fallback-desktop-require-accelerated-graphics-in-13-10 newer ubuntu 13.10 – 14.04 gnome requires accelerated graphics. I had the same problem as you black screen/ grey screen if I don’t have to right xstartup file.

      Use a clean xstartup file (blank), don’t mind the default xstartup. Try to use the xstartup from the second answer from askubuntu link above if you want to use gnome (I didn’t try myself). Or simply use xfce4 instead of gnome.

      Also, what packages have you installed so far? and are you using ubuntu-desktop or ubuntu-server ?

      update: lol I finally can load up gnome w/ vncserver. I used ubuntu-desktop package, with some extra from askubuntu

      and then use this xstartup

      Update, even though I can load gnome, some keys on the keyboard don’t work right

  2. Anders Sjögren

    So far I have installed gnome-core, gnome-session-fallback and xfce. Haven’t tried xubuntu-desktop.

    $ ls /usr/share/xsessions/
    gnome.desktop gnome-fallback.desktop xfce.desktop gnome-fallback-compiz.desktop ubuntu.desktop

    I have Ubuntu desktop 14.04 on a powerful Lenovo machine.

    I guess accelerated graphics mean hardware accelerated; does that exclude multiple vnc desktops (frame buffers) then?

    Anyway, I replaced the xstartup with the second answer in http://askubuntu.com/questions/361617/does-gnome-fallback-desktop-require-accelerated-graphics-in-13-10 and IT FINALLY WORKS!

    Thanks a lot, namhuy, you made my day!

    (I will try some more with gnome, too, when I have the time.)

  3. call

    Hi, thanks for the great tutorial. How do I make it so that the GUI doesn’t show up if I plug a monitor into the server itself? I went with xubuntu-desktop this time, I had gnome on a Server 12.04 install before upgrading and it never showed the GUI if I plugged a monitor in, only via VNC. It’s not important, I just liked it that way.

    • namhuy

      as root, edit grub file

      change

      to

      finally update grub

  4. Don Romeo

    I just did it, so now I have both SSH and VNC access to my headless Intel NUC.

    Thank You very much for your detailed instructions. You turned a complex problem to an easy one.

  5. T

    It seems the the user I’m adding can’t install new software. Anything I missed? I did change “vncuser” to my username.

    • namhuy

      you can’t install software with privileged user, you can setup vnc for root account, or install new software with sudo or become root in the terminal to install new software

  6. Hello please how can i make VNC server start at boot in a normal ubuntu 14.04 install with Unity desktop. i have tried many outdated tutorials with no avail.
    Im running latest 5.2 VNC Server from realvnc.com. Thanks!

    • namhuy

      I don’t have realvnc license so I didn’t try with realvnc server. I use vnc4server instead, follow my instructions and you should be able to make vnc server work on Ubuntu 14.04. Another thing, I don’t think Unity will work over VNC, you properly want to install xfce4 package, and use xfce4 for VNC rather than Unity.

  7. hamid

    Thanks very much with this detailed guide.
    please correct me if wrong : Just for users who want to have Wine on this, install Wine before ‘starting vnserver’; Wine is adding lines to xstartup file which should keep those lines thereafter.

  8. Lam Nguyen

    Hey Nam Huy,

    I followed your post installing gnome-core, xfce4, vnc4server. Ran vncserver. Edited xstartup, but did not do the rest. Now when I try to connect, all I get is a terminal but not full desktop session. I tried different version of xstartup without success.

    Do you have suggestion that I should check what went wrong?

    Thanks,

    Lam

    • namhuy

      You may have edited xstartup file for wrong user. How many user do you have on the system? What user are you trying to use for VNC?

      • Lam Nguyen

        Today I found the problem. I did not kill the server before editing xstartup so changes did not take effect. Now everything is fine.

        Just so you know, I uninstalled and reinstalled things to check what are needed. All I need is just xfce4, but gnome-core and others are not needed.

        The only small problem I have now is the tab function. In linux the tab function is very useful. E.g.when you want to cd to a directory, you just need to type in a part of the directory name then tab to display the rest. when I connect to my desktop running Ubuntu from my macbook via VNC, this tab function does not work.

        Lam

        • namhuy

          good to hear you have your vnc ser er up and running. I mainly use vnc to do some web surfing myself and its good to have some extra environment to do some developing, beside that I dont use the GUI that much from the remote system. I also noticed some of the keys dont work when I use vnc, if I remember correctly these are “e” and “d”. Different set keys dont work with different distro and/or window manager when you use vnc.

          back to your tab problem, edit xfce4-keyboard-shortcuts.xml file

          search for this line

          replace the whole line with

          reboot your system when you are done

  9. Lam Nguyen

    Thanks for suggestion. I found that there are already both lines in the file. Should I still replace the first line with the second line or just simply delete the first line?

    Lam

    • namhuy

      Search for

      It should be only one line with that value (if you search w/ nano) with the exact code for xfce4 on Ubuntu and Debian

  10. Matteo

    hi.
    great guide and all is working….but i’ve a little problem
    when connect to a vnc session is all ok
    But when i logout, all i obtai is a green page
    Then I cannot log again until I restart the vnc service. (using ex external ssh conection)
    I’m looking around for a solution … but sill nothing…
    May you help me?
    Thx Matteo

  11. Lam Nguyen

    I have the same problem. If I just simple close the VNC connection, things are fine. But if I logout then it won’t give me an option to log back in. Closing VNC connection does not help because next time I connect, it just give me a blank screen again with no option to login.
    Killing the VNC then restarting it fix the issue, but this is not convenient at al.
    So I am looking for a solution too.

    Lam

  12. Ridgeland

    Thank you.
    Worked fine – the only part that slowed me was not knowing the command to launch the viewer.
    Here on my home LAN I used:
    $ vncviewer 192.168.1.115:1
    The window title says it’s TightVNC: vncuser’s X desktop (ASR_PC:1)
    I’m using Xubuntu on both PCs, not Gnome or Unity.
    Is there a GUI for the login?

    • namhuy

      I don’t quite understand what you are trying to say, are you trying to login to VNC server or login to your Xubuntu system?

  13. Ridgeland

    A PC running Xubuntu is the host, the VNC server. I’m logging in remotely using a PC that also is running Xubuntu. I don’t see a GUI app that asks me what remote host I want to connect to. Instead I use the command line as above. Is there a GUI I’m missing, or don’t know I have? I don’t find a GUI like the image “New TightVNC Connection” near the end of your blog.

    • namhuy

      Oh I see, the “New TightVNC Connection” window you are seeing is tightvnc viewer client for Windows. For Linux, you can try xtightvncviewer (X viewer client for VNC)
      to install xtightvncviewer

      now you can connect to your vnc server with the command

      or

      you will be asked for your vnc server’s password.

  14. Seranth

    Great tutorial! Checked a bunch out and this is the only one that got it working for me.

    One small thing though…

    I want to add another desktop. I want to be able to just start up the server and it starts the vncserver for two separate users on the server (not multiple people connecting).

    I tried editing /etc/vncserver/vncservers.conf as follows (1920×1000 is because I use VNC viewer on my phone so it loses 80 pixels off the top for the notifications bar):

    VNCSERVERS=”1:user1″
    VNCSERVERARGS [1]=”-geometry 1920×1000″

    VNCSERVERS=”2:user2″
    VNCSERVERARGS[1]=”-geometry 1920×1000″

    This didn’t work. It will only start one of them, entirely based on which order I place them in. Perhaps the startup script should be altered?

    • namhuy

      Don’t forget to create xstartup file for your user2 and when you connect to your vnc server with user2, use port :2 or 5902

      No you dont need to modify startup script, just add xstartup file for each separate user and add each user to /etc/vncserver/vncservers.conf as you did.

      • jason

        It’s still not working…please advise. I read other post they put VNCSERVERARGS[2]=, what is the right format to add more than one users? Thanks, Jason

        • namhuy

          For additional user, well lets say it’s user2, I assume you already have user2 in your system. Switch to user2 console

          If it’s a brand new user without xstartup file, start up vncserver to let vncserver creates its files

          Now the steps are very similar to create user1, like set vnc’s password for user2 and modify xstartup file.

          The next thing is to modify /etc/vncserver/vncservers.conf to accept multiple users and multiple ports
          VNCSERVERS=”1:user1″
          VNCSERVERARGS[1]=”-geometry 1024×768″
          VNCSERVERS=”2:user2″
          VNCSERVERARGS[2]=”-geometry 1024×768″

  15. SPektor

    Thank you very much for the tutorial it worked perfectly. I have one question though. I am unable to connect to the internet through the virtual machine. Can this be solved through the config file?

    • namhuy

      from your virtual machine, try to ping the destination IP if it’s reachable, and make sure there is no firewall/iptables plus VNC ports are allowed (both VNC server and VNC client).

  16. Conan

    Hello i have a problem, when i try to start a app (to try krusader) the vnc connection crashing down.
    the log fil in .vnc say:
    22/08/14 09:50:10 Xvnc version TightVNC-1.3.9
    22/08/14 09:50:10 Copyright (C) 2000-2007 TightVNC Group
    22/08/14 09:50:10 Copyright (C) 1999 AT&T Laboratories Cambridge
    22/08/14 09:50:10 All Rights Reserved.
    22/08/14 09:50:10 See http://www.tightvnc.com/ for information on TightVNC
    22/08/14 09:50:10 Desktop name ‘X’ (Ubuntu-1404-trusty-64-minimal:1)
    22/08/14 09:50:10 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
    22/08/14 09:50:10 Listening for VNC connections on TCP port 5901
    Font directory ‘/usr/share/fonts/X11/75dpi/’ not found – ignoring
    Font directory ‘/usr/share/fonts/X11/100dpi/’ not found – ignoring
    /root/.vnc/xstartup: 8: /root/.vnc/xstartup: .Xresources: not found
    /usr/bin/startxfce4: X server already running on display :1
    No VNC extension on display :1
    Xlib: extension “RANDR” missing on display “:1”.
    Xlib: extension “RANDR” missing on display “:1.0”.

    (xfwm4:10515): xfwm4-WARNING **: The display does not support the XRender extension.

    (xfwm4:10515): xfwm4-WARNING **: The display does not support the XRandr extension.

    (xfwm4:10515): xfwm4-WARNING **: The display does not support the XComposite extension.

    (xfwm4:10515): xfwm4-WARNING **: The display does not support the XDamage extension.

    (xfwm4:10515): xfwm4-WARNING **: The display does not support the XFixes extension.

    (xfwm4:10515): xfwm4-WARNING **: Compositing manager disabled.
    Xlib: extension “RANDR” missing on display “:1”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.

    (xfsettingsd:10525): xfsettingsd-CRITICAL **: No RANDR extension found in display :1.0. Display settings won’t be applied.
    Xlib: extension “XInputExtension” missing on display “:1.0”.

    (xfsettingsd:10525): xfsettingsd-CRITICAL **: XI is not present.

    (xfsettingsd:10525): xfsettingsd-CRITICAL **: Failed to initialize the Xkb extension.

    (xfsettingsd:10525): xfsettingsd-CRITICAL **: Failed to initialize the Accessibility extension.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    AUDIT: Fri Aug 22 09:50:12 2014: 10486 Xtightvnc: client 16 rejected from local host
    Client is not authorized to connect to Serverxscreensaver: 09:50:12: Can’t open display: :1.0
    xscreensaver: 09:50:12: initial effective uid/gid was root/root (0/0)
    xscreensaver: 09:50:12: running as nobody/nogroup (65534/65534)

    xscreensaver: 09:50:12: This is probably because you’re logging in as root. You
    shouldn’t log in as root: you should log in as a normal user,
    and then `su’ as needed. If you insist on logging in as
    root, you will have to turn off X’s security features before
    xscreensaver will work.

    Please read the manual and FAQ for more information:

    http://www.jwz.org/xscreensaver/faq.html
    http://www.jwz.org/xscreensaver/man.html

    Xlib: extension “RANDR” missing on display “:1.0”.

    ** (process:10576): WARNING **: volume-control.vala:227: pa_context_connect() failed: OK

    ** (process:10576): CRITICAL **: volume_control_set_volume_internal: assertion ‘_tmp1_ == PA_CONTEXT_READY’ failed

    ** (process:10583): CRITICAL **: bluez.vala:104: GDBus.Error:org.bluez.Error.NoSuchAdapter: No such adapter
    initctl: UPSTART_SESSION isn’t set in the environment. Unable to locate the Upstart instance.
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioRaiseVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers
    Starting Dropbox…
    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioLowerVolume’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Binding ‘XF86AudioMute’ failed!

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    ** (xfce4-volumed:10655): WARNING **: Failed to map virtual modifiers

    (process:10621): Indicator-Power-WARNING **: Fail to query backlight devices.
    Xlib: extension “RANDR” missing on display “:1.0”.

    (xfce4-volumed:10655): xfce4-volumed-WARNING **: xvd_connect_to_pulse: failed to connect context: OK

    (xfce4-volumed:10655): xfce4-volumed-WARNING **: Unable to initialize pulseaudio support, quitting

    (xfce4-volumed:10655): GLib-GObject-CRITICAL **: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.
    process 10667: arguments to dbus_message_new_method_call() were incorrect, assertion “path != NULL” failed in file ../../dbus/dbus-message.c line 1262.
    This is normally a bug in some application using the D-Bus library.
    Verbindungsfehler: Verbindung verweigert
    pa_context_new() fehlgeschlagen: Verbindung verweigert

    (zeitgeist-datahub:10569): GLib-GObject-WARNING **: invalid (NULL) pointer instance

    (zeitgeist-datahub:10569): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion ‘G_TYPE_CHECK_INSTANCE (instance)’ failed

    ** (update-notifier:10682): WARNING **: not starting for system user

    (polkit-gnome-authentication-agent-1:10617): GLib-CRITICAL **: g_variant_new_string: assertion ‘string != NULL’ failed

    (polkit-gnome-authentication-agent-1:10617): polkit-gnome-1-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    ** (process:10576): CRITICAL **: file /build/buildd/indicator-sound-12.10.2+14.04.20140401/obj-x86_64-linux-gnu/src/volume-control.c: line 1775: uncaught error: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface (g-dbus-error-quark, 16)
    Dropbox isn’t running!
    Done!
    Xlib: extension “RANDR” missing on display “:1.0”.

    (process:10576): AccountsService-WARNING **: ActUserManager: user (null) has no username (object path: /org/freedesktop/Accounts/User0, uid: 0)

    (process:10576): AccountsService-WARNING **: ActUserManager: user (null) has no username (object path: /org/freedesktop/Accounts/User0, uid: 0)

    22/08/14 09:51:12 Got connection from client 91.89.148.90
    22/08/14 09:51:12 Using protocol version 3.8
    22/08/14 09:51:13 Enabling TightVNC protocol extensions
    22/08/14 09:51:17 Full-control authentication passed by 91.89.148.90
    22/08/14 09:51:17 Using tight encoding for client 91.89.148.90
    22/08/14 09:51:17 rfbProcessClientNormalMessage: ignoring unknown encoding 16
    22/08/14 09:51:17 Using image quality level 6 for client 91.89.148.90
    22/08/14 09:51:17 rfbProcessClientNormalMessage: ignoring unknown encoding -223
    22/08/14 09:51:17 Enabling LastRect protocol extension for client 91.89.148.90
    22/08/14 09:51:17 Enabling cursor position updates for client 91.89.148.90
    22/08/14 09:51:17 Enabling full-color cursor updates for client 91.89.148.90
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “XInputExtension” missing on display “:1.0”.
    X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id: 0x0
    X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id: 0x0
    X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id: 0x0
    kdeinit4: Shutting down running client.
    Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
    xfsettingsd: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    xfwm4: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    xfce4-session: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.
    xfce4-panel: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    Thunar: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.
    wrapper-1.0: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    xfce4-netload-plugin: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    wrapper-1.0: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    xfdesktop: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    blueman-applet: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    (polkit-gnome-authentication-agent-1:10617): Gdk-WARNING **: polkit-gnome-authentication-agent-1: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    Loading configuration plugins
    blueman-applet version 1.23 starting
    Stale PID, overwriting
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    Using gconf config backend
    kdeinit4: Can not connect to the X Server.
    kdeinit4: Might not terminate at end of session.
    XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:1.0”
    after 729 requests (729 known processed) with 0 events remaining.
    dropbox: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    wrapper-1.0: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.
    wrapper-1.0: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    (nm-applet:10625): Gdk-WARNING **: nm-applet: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    (light-locker:10667): Gdk-WARNING **: light-locker: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    parcellite: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1.0.

    ** (zeitgeist-datahub:10569): WARNING **: zeitgeist-datahub.vala:229: Unable to get name “org.gnome.zeitgeist.datahub” on the bus!
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

    (process:10588): indicator-application-service-WARNING **: Name Lost
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

    ** (process:10576): CRITICAL **: indicator_sound_service_name_lost: assertion ‘connection != NULL’ failed
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

    ** (process:10583): CRITICAL **: service_on_name_lost: assertion ‘connection != NULL’ failed
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
    g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    kded(12460): KUniqueApplication: Cannot find the D-Bus session server: “Failed to connect to socket /tmp/dbus-0Mm4STTGib: Verbindungsaufbau abgelehnt”

    kded(12459): KUniqueApplication: Pipe closed unexpectedly.

    krusader(12449): Couldn’t start knotify from knotify4.desktop: “KLauncher could not be reached via D-Bus. Error when calling start_service_by_desktop_path:
    Connection is closed

    ICE default IO error handler doing an exit(), pid = 12449, errno = 32

    (process:10576): GLib-GObject-CRITICAL **: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed

    whats is the problem? i have ubuntu 14.04.1 as server.

    • namhuy

      Try to install some fonts

      # apt-get update
      # apt-get install xfonts-base xfonts-75dpi xfonts-100dpi

  17. call

    Hi, I’ve got SSH tunnelling working both locally and from outside the local network but where do I add the -localhost switch to only allow “local” IPs to connect? I want the VNC server to be unreachable if not connecting through an SSH tunnel.

    So far I’ve tried adding -localhost to the VNCSERVERARGS[1] variable in /etc/vncserver/vncservers.conf ( VNCSERVERARGS[1]=”-geometry 1280×1024 -localhost”) and also when the vncserver command is put together in /etc/init.d/vncserver, so the line reads:

    su ${USER} -c “cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS} -localhost”

    instead of

    su ${USER} -c “cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}”

    but that broke it. Any ideas? Thanks.

    • namhuy

      sorry for the late reply, I must have missed your comment. what does the vnc’s log give you? the log should be located in $HOME/.vnc/ and /var/log/auth.log

  18. GiftofIsis

    Hi i just have upgrade from 12.10 to 14.04, and i used X11VNC and it worked no issues, as soon as i upgraded the VNC stopped working.

    So i followed your instructions and it works fine. So thank you for this :)

    Only problem is i use my Ubutnu Machine as a Media Server using XBMC, and now it doesn’t work, it says it needs “hardware accelerated opengl rendering. install an appropriate driver”

    Have you got any idea on how i can fix this ?

  19. Jim

    Thank you! I have been trying to find a remote desktop that works since I upgraded to 14.04, and the “nomachine” I was using just got a black screen.. I followed your steps, and it work perfectly the first time! Again Thank you!

  20. Harry Cooper

    How do I reset everything back the the way it was before following this procedure? I don’t really care for Xubuntu and now it’s my only GUI. Also I notice that when I have it up, there’s a wine box as well as a black hole rectangle that can be moved around the screen. All this makes me want to go back to my original desktop ubuntu and try something else. Thanks. P.S. I’m running this is Vbox VM as guest OS.

  21. Niaxem

    Hey, NamHuy can you make tutorial install xrdp? Anyway this tutorial work for me but vnc so slow even my internet about 3mbps. I already try use low-bandwitdth also same

  22. bhaskar

    Hi Nam Huy I have followed your tutorial and I can’t get the vncserver to work. I tried both the xstartup files that you have mentioned and I always get a grey hatched screen. I have tried changing the lines in xstartup but I am no expert and was not really sure what I was doing with those files. I have wasted 2 days trying to set this up and I would like to seek your help on this.

    Thanks
    Bhaskar

    • namhuy

      Sorry for the late reply, what do you have in your vnc log file? The vnc’s log file should be located in your user home directory /home/user/.vnc/hostname:port.log

      few things might go wrong:
      1. set xstartup file for wrong user
      2. didn’t use xfce4
      3. you have to kill vncserver before edit xstartup file

  23. I’m having an issue with your vncserver file starting up. I’ve made executable, etc. I can get everything to work if I start things manually. I did find another tutorial that did show another vncserver file that does work, but its locked to a specific user (which you must modify to match your own environment).

    The file is found here; https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-14-04

    #!/bin/bash
    PATH=”$PATH:/usr/bin/”
    export USER=”user”
    DISPLAY=”1″
    DEPTH=”16″
    GEOMETRY=”1024×768″
    OPTIONS=”-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost”
    . /lib/lsb/init-functions
    case “$1” in
    start)
    log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
    su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
    ;;
    stop)
    log_action_begin_msg “Stopping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
    su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
    ;;
    restart)
    $0 stop
    $0 start
    ;;
    esac
    exit 0

    I tried your version, but it won’t start up for some reason. Whereas, this one does.

    Any ideas?

    Eric

    • namhuy

      If you use my /etc/init.d/vncserver file, you will have to create extra /etc/vncserver/vncservers.conf file because rather store & call each user in /etc/init.d/vncserver. The one from digitalocean that guy store all user’s settings in the same file which is /etc/init.d/vncserver.

  24. John.

    Working flawlessly man ! Till u posted this.
    Thanks so much, i try 14 04 and 14 10 x64, no problem with xfce.
    Keep post !

  25. moein

    hello
    really thanks for your tutorial.very helpful .
    when i install xface for my ubuntu server it is returns lot of error fro example : too many files open,out put input error and when i open two program neither not work.i increase hard and soft but nothing change a lot.

    fortunately i use your recommended about instal gnom panel

    # apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

    but still i have little error and i can’t fix it . i instal firefox then i want run it in terminal it is return Error: cannot open display: localhost:10.0
    and when i want run firefox in desktop it is show me the firefox crash.
    please help me say waht should i do.
    thanks

  26. boistordu

    I have some problem with the geometry… Do you know if something had change?
    the vncserver -geometry command work fine but with your setup it seems that it didn’t read the vncserverargs line….

  27. boistordu

    for the problem with geometry of the session I had to manually put it in the script… I’m not an expert in scripting so could you see what’s wrong with the call of vncserverargs[1]?
    thanks best regards

  28. boistordu

    by the way can you update the wiki for 15.04 since update-rc does’nt work anymore

Leave a Reply