SSHを介してgnome-sessionを機能させることはできません

SSHを介してgnome-sessionを機能させることはできません

マイホームコンピュータからSSH経由でマイオフィスコンピュータにログインするには、次の2つの手順を実行する必要があります。まず、私のオフィスサーバーにログインします。ssh -X myOfficeServerID@myofficeServer次に、ローカルIPを使用してマイコンピュータにログインしますssh -X myOfficeComputerID@myOfficeComputerIP。私のデスクトップをリモートで見て、GUIを使用できるようにしたいです。

これは実行結果ですgnome-session

[myOfficeComputerID@myOfficeComputer]$gnome-session
gnome-session[17491]: WARNING: Unable to determine session: Unable to lookup session information for process '17491'
GNOME_KEYRING_SOCKET=/tmp/keyring-TokklK/socket
SSH_AUTH_SOCK=/tmp/keyring-TokklK/socket.ssh
GNOME_KEYRING_PID=17507

** (gnome-settings-daemon:17510): WARNING **: You can only run one xsettings manager at a time; exiting

** (gnome-settings-daemon:17510): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager.

** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting...

** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused
Window manager warning: Screen 0 on display "localhost:10.0" already has a window manager; try using the --replace option to replace the current window manager.
Window manager warning: Screen 0 on display "localhost:10.0" already has a window manager; try using the --replace option to replace the current window manager.
Starting Dropbox...Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Done!

(polkit-gnome-authentication-agent-1:17571): polkit-gnome-1-WARNING **: Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() on /org/freedesktop/ConsoleKit/Manager at name org.freedesktop.ConsoleKit: org.freedesktop.ConsoleKit.Manager.GeneralError: Unable to lookup session information for process '17571' org.freedesktop.ConsoleKit.Manager.GeneralError Unable%20to%20lookup%20session%20information%20for%20process%20%2717571%27
system-config-printer-applet: failed to start NewPrinterNotification service

** (gnome-panel:17538): CRITICAL **: panel_applet_frame_change_background: assertion `PANEL_IS_WIDGET (GTK_WIDGET (frame)->parent)' failed

** (nm-applet:17578): WARNING **: <WARN>  request_name(): Could not acquire the NetworkManagerUserSettings service.
  Error: (9) Connection ":1.261" is not allowed to own the service "org.freedesktop.NetworkManagerUserSettings" due to security policies in the configuration file

Failed to play sound: Not available

** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting...

** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension

** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting...

** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused

** (gnome-settings-daemon:17510): WARNING **: Grab failed for some keys, another application may already have access the them.

** (gnome-settings-daemon:17510): WARNING **: Clipboard manager is already running.

** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting...

** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
failed to create drawable
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension
^CTraceback (most recent call last):
  File "/usr/share/system-config-printer/applet.py", line 434, in <module>
    waitloop.run()
KeyboardInterrupt
** Message: Got disconnected from the session message bus; retrying to reconnect every 10 seconds

(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gtk' was not being monitored by GConfClient 0xda21e0

(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/interface' was not being monitored by GConfClient 0xda21e0

(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/apps/gnome_settings_daemon/gtk-modules' was not being monitored by GConfClient 0xda21e0

(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/font_rendering' was not being monitored by GConfClient 0xda21e0

(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/sound' was not being monitored by GConfClient 0xda21e0
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
[myOfficeComputerID@myOfficeComputer ~]$ 
(gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/peripherals/mouse' was not being monitored by GConfClient 0xda21e0
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused)
^C

コマンドが示すように、このコマンドは^ Cを押すまで中断することなく実行され続けます。

Initializing nautilus-gdu extension
Initializing nautilus-open-terminal extension
Initializing nautilus-dropbox 1.4.0
Shutting down dropbox extension
Shutting down nautilus-open-terminal extension
Shutting down nautilus-gdu extension

同時に、私のオフィスのコンピュータで実行するのと似ていますfirefoxが、下部パネルからアイテムの読み込みが中断されることはありません。

答え1

両方のSSHセッションは、-Xオプションを使用して開始する必要があります。

ただし、セッション全体が必要な場合は、次のようなものを使用することをお勧めします。X投稿イメージを圧縮し、いくつかのプロキシが含まれているため、帯域幅の消費が大幅に削減され、セッションを再開できます。

リモートgnomeセッションがローカルウィンドウマネージャの代わりにリモートメタシティを起動したときにgnomeセッション全体を実行すると、不快な副作用が発生する可能性があります。

あなたの追加情報には、私が言及した「不快な副作用」が記載されています。gnome-sessiongnome-sessionが引き継ぎを試み、実行中のデスクトップ環境ではこれを簡単に実行できないため、すでに実行中のデスクトップ環境がある場合は簡単に実行することはできません。 XプログラムがSSHを介してリモートで実行されるのか、ローカルで実行されるのかは異なりません。

達成したい目標に応じてxnestセッションを開始し、リモートgnomeセッションで使用できます。

xnest -geometry 1280x1024 :123 &
DISPLAY=:123 ssh -X firsthop
ssh -X secondhop
gnome-session

注:一部のディストリビューションでは、バイナリ名はXnest大文字xで指定されています。

答え2

同じエラーが発生したため、複数のファイルエクスプローラ(ノーチラス)インスタンスが開かれましたが、アカウントに正しく接続できませんでした。

今日私が見つけた理由は〜.cshrcに次の行があるからです: "setenv DISPLAY unix:0.0"

コメントを付けた後、すべてがうまくいきます。したがって、SSHを介して接続すると、ディスプレイはSSHごとに1回、ユーザー-cshrcごとに1回ずつ2回設定され、わずかな混乱を引き起こします。

答え3

グラフィカルセッションはSSHを介して開始できず、VNCサーバーまたはリモートデスクトップ接続を使用する必要があります。 SSHは、ユーザーがシステムにログインする方法でアクセス権を持つX-Sessionへのgnomeセッションを開くことができないため、シェルアクセスのみを提供します。したがって、目標が完全なグラフィカルデスクトップ(RealVNCなどのVNCビューアを介して接続できる)を取得する場合は、VNCを使用してください。コンピュータにVNCサーバーをインストールして設定できますtightvncserver。インストールが完了したら、シェルに次のように入力してVNCサーバーを起動できます。tightvnc

    username@hostname $tightvncserver --geometry 1024x760

答え4

たぶんあなたはコマンドを忘れてしまったかもしれません:(xhost + sshコマンドの前に:)ssh -XY username@servername

関連情報