linux deploy使用termux-x11作顯示服務(wù)器
linux deploy chroot容器可以使用termux-x11作顯示服務(wù)器。首先來(lái)看下效果: 豎屏:
橫屏效果:
下面是具體步驟: [1]準(zhǔn)備階段: (1)設(shè)置termux-x11apk 的XDG_RUNTIME_DIR,推薦xvfb版本的termux-x11
(2)設(shè)置linux deploy的掛載點(diǎn)
然后在termux基本環(huán)境(不是容器里)輸入su,然后授予root權(quán)限,執(zhí)行chmod 777 /data/data/com.termux/files/usr/tmp。 然后安裝一個(gè)xorg-xhost為之后授予termux-x11的display訪問(wèn)權(quán)限做準(zhǔn)備。 pkg in xorg-xhost [2]實(shí)施階段 (1)正常啟動(dòng)linux deploy chroot容器。不要勾選啟用允許使用圖形環(huán)境。 (2)termux環(huán)境里執(zhí)行termux-x11 :1
執(zhí)行上面命令后打開(kāi)termux-x11的apk,現(xiàn)在termux ,linux deploy,termux-x11三個(gè)應(yīng)用都要保持后臺(tái)運(yùn)行,不要關(guān)閉。必須出現(xiàn)somebody connectd才算連接成功。 (3)回termux,再開(kāi)一個(gè)shell,執(zhí)行 export DISPLAY=:1 xhost +
(4)執(zhí)行ssh fengxue@127.0.0.1,使用openssh連接ubuntu chroot容器,登陸via linux容器后執(zhí)行 export DISPLAY=:1 startlxqt (5)現(xiàn)在打開(kāi)termux-x11 apk即可享受linux deploy chroot容器的termux-x11桌面了。
實(shí)施階段的第二步是最重要的,關(guān)乎成敗。容器內(nèi)部圖形環(huán)境推薦lxqt桌面+xfwm4窗口管理器。 現(xiàn)在linux deploy有帶聲音服務(wù)器的版本,也可以選擇聲音轉(zhuǎn)發(fā)termux pulseaudio(之前的教程里有,自己翻)。