VNC в Ubuntu 14.04 LTS

У меня есть Mac под управлением OS X 10.11.6 и экземпляр Ubuntu EC2 под управлением 14.04LTS. Я пытаюсь заставить VNC запускать KDE с моего Mac. XQuartz запускается, но у меня нет клавиатуры или мыши для управления KDE.

введите здесь описание изображения

Порт 5901 открыт в моей группе безопасности EC2.

Вот мой файл /etc/init.d/vncserver:

ubuntu@ip-10-0-1-107:~$ vi /etc/init.d/vncserver

[ -x /etc/vnc/xstartup ] && 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 ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
kdestartup &

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

Запуск скрипта vncserver:

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: 

Вот команда ssh в OS X (адрес сервера и сертификат изменены).

ssh -L -X 5901:127.0.0.1:5901 -N -f -l ubuntu x.x.x.x -i blahblahblah.pem 

Вот сервер VNC, работающий на Ubuntu:

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

Вот кде:

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

Я использую клиент X2Go, который использует «Эта программа использует версию Qt 4.8.7».

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.

Вот файл журнала /home/ubuntu/.vnc/ip-10-0-1-107:1.log:

** (xfce4-volumed:4415): WARNING **: Binding '<Ctrl><Alt>XF86AudioMute' failed!

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

** (xfce4-volumed:4415): WARNING **: Binding '<Alt><Shift>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 '<Ctrl><Shift><Alt>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 ")

person dbl001    schedule 12.08.2017    source источник
comment
хм, это больше похоже на проблему конфигурации/использования, чем на проблему программирования — возможно, вы хотели опубликовать это на SuperUser.com или AskUbuntu?   -  person Marcus Müller    schedule 12.08.2017


Ответы (1)


Возможно, это связано с экраном. попробуйте добавить -X в команду ssh

ssh -X
person pushStack    schedule 12.08.2017
comment
Добавьте -X в команду ssh и перезапустите сеанс X2Go. То же самое. Знаете ли вы, что означает ошибка в журнале: ERROR:dbus.proxies:Introspect error...? - person dbl001; 12.08.2017
comment
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: ответ не получен. Возможные причины: удаленное приложение не отправило ответ, политика безопасности шины сообщений заблокировала ответ, истекло время ожидания ответа или сетевое соединение было разорвано. - person pushStack; 12.08.2017
comment
Порт 5901 открыт. Нужно ли обновлять другой порт? ubuntu@ip-10-0-1-107:~$ netstat -a | grep 5901 tcp 0 0 localhost:5901 : ПРОСЛУШАТЬ - person dbl001; 12.08.2017
comment
У меня 5901-5904 открыты на EC2. - person dbl001; 12.08.2017
comment
Также видел это в журнале /home/ubuntu/.vnc/ip-10-0-1-107:1.log: system-config-printer-applet: не удалось запустить службу NewPrinterNotification system-config-printer-applet: не удалось запустить службу PrinterDriversInstaller: org.freedesktop.DBus.Error.AccessDenied: Connection: 1.171 не разрешено владеть службой com.redhat.PrinterDriversInstaller из-за политик безопасности в файле конфигурации Xlib: расширение RANDR отсутствует на дисплее: 1.0. Xlib: расширение RANDR отсутствует на дисплее: 1.0. Ошибка выполнения команды от имени другого пользователя: Не авторизован - person dbl001; 12.08.2017