linux解決xhost: unable to open display ""(

實用技巧:在Linux下設置xhost方法步驟

第一步:用root登陸linux,啓動vnc服務;

第二步:根據vnc起來的端口,設置export DISPLAY=localhost:1(1表示vnc在第一個tty上啓動的),vnc的啓動信息見附件1;

第三步:執行xhost +,並且提示“access control disabled, clients can connect from any host”才正確。

linux下的操作日誌如下:

[root@localhost ~]# vncserver

New 'localhost:1 (root)' desktop is localhost:1

Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost:1.log

[root@localhost ~]# export DISPLAY=localhost:1

[root@localhost ~]# xhost +

access control disabled, clients can connect from any host 

在設置xhost時,出現了unable的問題。使用上訴方法就可以搞定。

發佈了14 篇原創文章 · 獲贊 14 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章