xhost: unable to open display…
在Linux下設(shè)置xhost
# 先切換到root用戶,執(zhí)行xhost +
[root@host01 ~]# xhost +
access control disabled, clients can connect from any host
# 然后再切換到oracle用戶,執(zhí)行export DISPLAY=:0.0
[oracle@host01 ~]$ export DISPLAY=:0.0
[oracle@host01 ~]$ xhost +
access control disabled, clients can connect from any host
DISPLAY科普
DISPLAY變量是用來設(shè)置將圖形顯示到何處.比如CENTOS,你用圖形界面登錄進(jìn)去,DISPLAY自動(dòng)設(shè)置為DISPLAY=:0.0表示顯式到本地監(jiān)視器,那么通過終端工具(例如:xshell)進(jìn)去,運(yùn)行圖形界面的程序,如果沒有設(shè)置,系統(tǒng)是不允許程序啟動(dòng)的。
在執(zhí)行xhost +命令(使得所有客戶都可以訪問)
正常返回信息為:
access control disabled,clients can connect from any host
如果xhost +不能執(zhí)行,報(bào)錯(cuò):xhost : unable to open display …
有個(gè)比較簡單的解決辦法,就是使用xmanager的passive
準(zhǔn)備:安裝xmanager文章來源:http://www.zghlxwxcb.cn/news/detail-765474.html
步驟:
1.啟動(dòng)xmanager的passive
2.執(zhí)行以下的命令文章來源地址http://www.zghlxwxcb.cn/news/detail-765474.html
# oracle用戶執(zhí)行
[oracle@host01 ~]$ export DISPLAY=(Windows主機(jī)IP):0.0
# 打開xclock測試圖形化是否能顯示成功,如果顯示命令沒有,下一個(gè)xclock就可以了
[oracle@host01 ~]$ xclock
如果在passive的窗口出現(xiàn)一個(gè)圖形化的鐘表,就證明圖形化顯示成功
到了這里,關(guān)于xhost: unable to open display..的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!