2017-08-12 160 views
0

我有一台运行OS X 10.11.6的Mac和运行14.04LTS的Ubuntu EC2实例。 我试图让VNC从我的Mac上运行KDE。XQuartz启动,但我没有键盘或鼠标控制KDE。Ubuntu 14.04上的VNC LTS

enter image description here

端口5901是我的EC2安全组开放。

这是我的/etc/init.d/vncserver文件:

[email protected]:~$ 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的脚本:

[email protected]:~$ 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: 

下面是关于OS X(服务器地址和证书改变了)ssh命令。

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

这里的Ubuntu上运行VNC服务器:

[email protected]:~$ 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 

这里的KDE:

[email protected]:~$ 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 ") 
+0

HM,这种读取更像不仅仅是一种编程问题的结构/使用的问题 - 是否有可能你的意思是发布此上SuperUser.com或AskUbuntu? –

回答

0

它可能与屏幕。 尝试添加-X的ssh命令

ssh -X 
+0

将-X添加到ssh命令并重新启动X2Go会话。一样。你知道日志错误的含义:错误:dbus.proxies:内省错误...? – dbl001

+0

dbus.exceptions.DBusException:org.freedesktop.DBus.Error.NoReply:没有收到回复。可能的原因包括:远程应用程序未发送回复,消息总线安全策略阻止回复,回复超时过期或网络连接中断。 – pushStack

+0

5901号港口开放。我需要更新另一个端口吗? ubuntu @ ip-10-0-1-107:〜$ netstat -a | grep 5901 tcp 0 0 localhost:5901 *:* LISTEN – dbl001

相关问题