title: VNC on Ubuntu 14.04 LTS
body: <p>I have a Mac running OS X 10.11.6 and Ubuntu EC2 instance running 14.04LTS.
  I'm trying to get VNC running KDE from my Mac.
  XQuartz launches but I have not keyboard, or mouse control over KDE.</p>
  
  <p><a href="https://i.stack.imgur.com/IvVRW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IvVRW.png" alt="enter image description here"></a></p>
  
  <p>Port 5901 is open in my EC2 security group.</p>
  
  <p>Here's my /etc/init.d/vncserver file:</p>
  
  <pre><code>ubuntu@ip-10-0-1-107:~$ vi /etc/init.d/vncserver
  
  [ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartupTH="$PATH:/usr/bin/"
  export USER="ubuntu"
  DISPLAY="1"
  DEPTH="16"
  GEOMETRY="1600x1200"
  OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
  . /lib/lsb/init-functions
  
  [ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources
  xsetroot -solid grey
  vncconfig -iconic &amp;
  x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;
  x-window-manager &amp;
  kdestartup &amp;
  
  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
  </code></pre>
  
  <p>Starting vncserver script: </p>
  
  <pre><code>ubuntu@ip-10-0-1-107:~$ sudo service vncserver start
  xsetroot:  unable to open display ''
  vncconfig: unable to open display ""
  $DISPLAY is not set or cannot connect to the X server.
   * Starting vncserver for user 'ubuntu' on localhost:1...                       Option "--login" is no longer supported in this version of gnome-terminal; you might want to create a profile with the desired setting, and use the new '--profile' option
  
  (x-window-manager:2591): Gtk-WARNING **: cannot open display: 
  error: XDG_RUNTIME_DIR not set in the environment.
  Failed to parse arguments: Cannot open display: 
  </code></pre>
  
  <p>Here's the ssh command on OS X (server address and cert altered for).</p>
  
  <pre><code>ssh -L -X 5901:127.0.0.1:5901 -N -f -l ubuntu x.x.x.x -i blahblahblah.pem 
  </code></pre>
  
  <p>Here's the VNC server running on Ubuntu:</p>
  
  <pre><code>ubuntu@ip-10-0-1-107:~$ ps -ef | grep vnc
  ubuntu    4289     1  0 17:13 ?        00:00:00 Xtightvnc :1 -desktop X -auth /home/ubuntu/.Xauthority -geometry 1600x1200 -depth 16 -rfbwait 120000 -rfbauth /home/ubuntu/.vnc/passwd -rfbport 5901 -fp /usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,/usr/share/fonts/X11/100dpi/ -co /etc/X11/rgb -localhost
  </code></pre>
  
  <p>Here's kde:</p>
  
  <pre><code>ubuntu@ip-10-0-1-107:~$ ps -ef | grep kde
  root        57     2  0 Jul30 ?        00:00:00 [kdevtmpfs]
  kdm       1535  1532  0 Jul30 ?        00:33:25 /usr/lib/kde4/libexec/kdm_greet
  ubuntu    6067     1  0 17:16 ?        00:00:00 /bin/bash /usr/bin/x2goruncommand 50 5895 ubuntu-50-1502558186_stDKDE_dp32 34503 startkde esd D
  ubuntu    6165  6067  0 17:16 ?        00:00:00 /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch /usr/bin/env LD_LIBRARY_PATH=/usr/lib/nx/X11/Xinerama:/usr/lib/nx/X11 startkde
  ubuntu    6302  6165  0 17:16 ?        00:00:00 /bin/sh /usr/bin/startkde
  ubuntu    6305     1  0 17:16 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch /usr/bin/env LD_LIBRARY_PATH=/usr/lib/nx/X11/Xinerama:/usr/lib/nx/X11 startkde
  ubuntu    6429     1  0 17:16 ?        00:00:00 /usr/lib/kde4/libexec/start_kdeinit +kcminit_startup
  ubuntu    6435     1  0 17:16 ?        00:00:00 kdeinit4: kdeinit4 Running...                  
  ubuntu    6436  6435  0 17:16 ?        00:00:00 kdeinit4: klauncher [kdeinit] --fd=9           
  ubuntu    6438     1  0 17:16 ?        00:00:03 kdeinit4: kded4 [kdeinit]                      
  ubuntu    6457  6435  0 17:16 ?        00:00:02 kdeinit4: ksmserver [kdeinit]                  
  ubuntu    6633     1  0 17:16 ?        00:00:02 /usr/lib/kde4/libexec/polkit-kd-authentication-agent-1
  </code></pre>
  
  <p>I'm using X2Go client which uses 
  "This program uses Qt version 4.8.7."</p>
  
  <pre><code>NXPROXY - Version 3.5.0
  
  Copyright (C) 2001, 2010 NoMachine.
  See http://www.nomachine.com/ for more information.
  
  Info: Proxy running in client mode with pid '25164'.
  Session: Starting session at 'Sat Aug 12 10:16:20 2017'.
  Info: Connecting to remote host 'localhost:35502'.
  Info: Connection to remote proxy 'localhost:35502' established.
  Info: Connection with remote proxy completed.
  Warning: Unrecognized session type 'unix-kde-depth_32'. Assuming agent session.
  Warning: Failed to read data from the X auth command.
  Warning: Generated a fake cookie for X authentication.
  Info: Using WAN link parameters 768/24/1/0.
  Info: Using cache parameters 4/4096KB/8192KB/8192KB.
  Info: Using pack method '16m-jpeg-9' with session 'unix-kde-depth_32'.
  Info: Using ZLIB data compression 1/1/32.
  Info: Using ZLIB stream compression 1/1.
  Info: No suitable cache file found.
  Info: Forwarding X11 connections to display '/private/tmp/com.apple.launchd.hnXbYavKVp/org.macosforge.xquartz:0'.
  Session: Session started at 'Sat Aug 12 10:16:22 2017'.
  Info: Established X server connection.
  Info: Using shared memory parameters 0/0K.
  </code></pre>
  
  <p>Here's the log file /home/ubuntu/.vnc/ip-10-0-1-107:1.log:</p>
  
  <pre><code>** (xfce4-volumed:4415): WARNING **: Binding '&lt;Ctrl&gt;&lt;Alt&gt;XF86AudioMute' failed!
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Binding '&lt;Alt&gt;&lt;Shift&gt;XF86AudioMute' failed!
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Binding '&lt;Ctrl&gt;&lt;Shift&gt;&lt;Alt&gt;XF86AudioMute' failed!
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  
  ** (xfce4-volumed:4415): WARNING **: Failed to map virtual modifiers
  initctl: UPSTART_SESSION isn't set in the environment. Unable to locate the Upstart instance.
  
  ** (process:4416): WARNING **: killswitch.vala:103: Can't open /dev/rfkill for use as a killswitch backend: Permission denied
  
  ** (process:4416): CRITICAL **: bluez.vala:104: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.155" (uid=1000 pid=4416 comm="/usr/lib/x86_64-linux-gnu/indicator-bluetooth/indi") interface="org.bluez.Manager" member="DefaultAdapter" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=1052 comm="/usr/sbin/bluetoothd ")
  
  (xfsettingsd:4462): 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:4462): xfsettingsd-CRITICAL **: XI is not present.
  
  (xfsettingsd:4462): xfsettingsd-CRITICAL **: Failed to initialize the Xkb extension.
  
  (xfsettingsd:4462): xfsettingsd-CRITICAL **: Failed to initialize the Accessibility extension.
  
  (zeitgeist-datahub:4395): GLib-GObject-WARNING **: invalid (NULL) pointer instance
  
  (zeitgeist-datahub:4395): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
  
  ** (process:4355): CRITICAL **: volume_control_set_volume_internal: assertion '_tmp1_ == PA_CONTEXT_READY' failed
  Failure: Module initialization failed
  
  ** (process:4355): 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)
  
  ** (nm-applet:4347): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: Rejected send message, 3 matched rules; type="method_call", sender=":1.168" (uid=1000 pid=4347 comm="nm-applet ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=1123 comm="NetworkManager ")
  
  (xfsettingsd:4462): xfsettingsd-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.
  system-config-printer-applet: failed to start NewPrinterNotification service
  system-config-printer-applet: failed to start PrinterDriversInstaller service: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.171" is not allowed to own the service "com.redhat.PrinterDriversInstaller" due to security policies in the configuration file
  Xlib:  extension "RANDR" missing on display ":1.0".
  Xlib:  extension "RANDR" missing on display ":1.0".
  Error executing command as another user: Not authorized
  
  This incident has been reported.
  ERROR:dbus.proxies:Introspect error on :1.5:/org/freedesktop/NetworkManager: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 3 matched rules; type="method_call", sender=":1.175" (uid=1000 pid=4686 comm="/usr/bin/python3 /usr/bin/update-manager --no-upda") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.5" (uid=0 pid=1123 comm="NetworkManager ")
  </code></pre>