本文最主要是因為個人工作上,有遇到只鍾愛桌面模式的工程師,他的程式有GUI在桌面登入執行時 everything all right!!

當然你可以把程式加到桌面模式的開機啟動, 有問題時就重開機

但是

如果我要console模式下命令執行它, 或者重開機用 shell script 帶起它時就會遇到問題, 因為它找不到 X 的顯示

那麼要怎麼辦呢??

在你的程式前面加上 env DISPLAY=:0

比如說我要啟動 桌面vino程式, 如果直接下指令會出現 Cannot open display:錯誤訊息

/usr/lib/vino/vino-server --sm-disable

Cannot open display:

改加上 env DISPLAY=:0 , 就成功了

env DISPLAY=:0 /usr/lib/vino/vino-server --sm-disable

** Message: The desktop sharing service is already running, exiting.

arrow
arrow
    全站熱搜

    痞客興 發表在 痞客邦 留言(0) 人氣()