2025年11月30日日曜日

X11 connection rejected because of wrong authenticationと表示され GUI アプリケーションが立ち上がらない

IC Compiler II などにGUIアプリケーションを起動しようとすると,"X11 connection rejected because of wrong authentication" と表示されて GUI が立ち上がらない事が起きた.

% icc2_shell -gui
(icc2_shell が立ち上がる)
X11 connection rejected because of wrong authentication.
Cannot initialize GUI.
The connection to X-server 'localhost:10.0' is broken or refused.
Please check the value of the DISPLAY environment variable.
For this session, the tcl command 'setenv' can be used to set the value of the DISPLAY variable,
then the command 'gui_start' is used to start the GUI.
icc2_shell > 

これを解決するためには,以下を設定すればよいらしい.
% export XAUTHORITY=$HOME/.Xauthority

Xauthority は XServer の認証の際に xauth が使用する Cookie に資格情報を保存するために使用されるらしい.xauth は Xauthority と $DISPLAY 変数を用いて X の接続を行う.

stackexchange の説明では,Snapを用いるアプリケーションはHOME="$SNAP_USER_DATA" を設定するためこれが X が想定する Xauthority ファイルの場所と干渉する,とのことである.IC Compiler II がSnapで作られているとは思わないが,似たような現象が起きているのだろう.


じゃあ Xauthority どうやってつくるの?というとこれはsshログイン時に自動で作成されるらしい.

0 件のコメント:

コメントを投稿