Ubuntu14.04 で IPv6 を無効にしたら Xクライアントがエラーで起動できない件の対処

スポンサーリンク
スポンサーリンク

Ubuntu14.04 では次のようにすると、IPv6 を無効にして、従来の IPv4 のみでの運用になります。

root で以下を実行して再起動する。
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf

ところが、IPv6を無効にすると、GUIアプリケーションをリモートから実行しようとすると、以下のように「Error: Can’t open display」や「Error: no display specified」と表示されて起動できません。

# xeyes
Error: Can't open display:

# firefox
Error: no display specified

これを回避する対処法です。

ファイル /etc/ssh/sshd_config の末尾に次の1行を追加し、再起動します。

/etc/ssh/sshd_config

AddressFamily inet

これで、再起動後からは、GUIアプリケーションをリモートから起動できます。

なお、Windows からも Xming というアプリケーションを使用すると、Linux の画面を Windows に表示できます。
詳細は以下を参照して下さい。

WindowsでリモートのLinuxのGUIアプリを表示させる-Xサーバ Xming パソコン鳥のブログ

参考

X forwarding though SSH not working: $DISPLAY not set

コメント

タイトルとURLをコピーしました