閱讀182 返回首頁    go iPhone_iPad_Mac_apple


Linux解決xhost: unable to open display ""

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

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

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

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

linux下的操作日誌如下:

[root@localhost ~]# vncserver

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

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

[root@localhost ~]# exportDISPLAY=localhost:1

[root@localhost ~]# xhost +

accesscontrol disabled, clients can connect from anyhost 

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

最後更新:2017-04-03 12:56:12

  上一篇:go 一個簡單的linux環境下C編譯
  下一篇:go 哈希-poj-3349-相同的雪花