ラベル installScape の投稿を表示しています。 すべての投稿を表示
ラベル installScape の投稿を表示しています。 すべての投稿を表示

2024年1月21日日曜日

sudo で X11 を有効にする

Cadence のインストーラー (installScape) を sudo で起動しようとすると,X11 に繋がらないと怒られる.
  1. % sudo /usr/cadence/iscape.04.23-s012/bin/iscape.sh [~]
  2. Initializing InstallScape using JVM at /usr/cadence/iscape.04.23-s012/runtime/LNX86/bin/java. This might take some time...
  3. X11 connection rejected because of wrong authentication.
  4. Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:19.0' as the value of the DISPLAY variable.
  5. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
  6. ...
  7. Failed with InstallScape JVM.
  8. Now loading System JVM...
  9. X11 connection rejected because of wrong authentication.
  10. Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:19.0' as the value of the DISPLAY variable.
  11. at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
  12. ...
  13. Error:
  14. /bin/java
  15. Could not use JVM packaged with Installcape. The Java in your path did not work or could not find Java in your path. Ensure that Java 1.6 or later is in your PATH environment variable and restart InstallScape.
sudo で X11 を有効にするためには,xauth を用いてユーザーの X サーバ接続権限情報を sudo に与えてしまう.ユーザー名が [user] だとすると以下のような感じ.
  1. sudo xauth add $(xauth -f ~[user]/.Xauthority list|tail -1)
/root/.Xauthorityが無いと怒られる場合は空のファイルを作ってから再実行.
  1. % sudo xauth add $(xauth -f ~[user]/.Xauthority list|tail -1)
  2. xauth: file /root/.Xauthority does not exist
  3. % sudo echo " " > /root/.Xauthority
  4. % sudo xauth add $(xauth -f ~[user]/.Xauthority list|tail -1)


まあ,オチとしては,installScape は root で実行するものではないという事なのですけどね.インストール先のパーミッションを適当な管理者にしてユーザー権限でインストールすべし.