TurboVNC
TurboVNCを使いたい
Display Managerの変更
code:bash
# Check current display manager
systemctl status display-manager.service
cat /etc/X11/default-display-manager
# Change default manger
# If current display manager is gdm3, then...
sudo dpkg-reconfigure gdm3
# If current display manager is lightdm, then...
sudo dpkg-reconfigure lightdm
とりあえずTurboVNCを使えるようにする
table:構成
a b
Display Manager lightdm
Desktop Package Ubuntu Mate
code:bash
sudo apt install -y ubuntu-mate-desktop
起動スクリプト
code:xstartup.turbovnc
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset DBUS_SESSION_BUS_ADDRESS
export XMODIFIERS="@im=fcitx"
fcitx
xsetroot -solid grey
#- x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & mate-session &
code:bash
$ /opt/TurboVNC/bin/vncserver -depth 24
TurboVNCのコマンド
VNCサーバの起動
code:bash
# VirtualGLなし
/opt/TurboVNC/bin/vncserver -geometry 1920x1080 -depth 24
# VirtualGLあり(mate-sessionの起動が途中で止まってグレー画面)
/opt/TurboVNC/bin/vncserver -geometry 1920x1080 -depth 24 -vgl
VNCサーバの停止
code:bash
/opt/TurboVNC/bin/vncserver -kill :1
VNCサーバの稼働状況を確認
code:bash
/opt/TurboVNC/bin/vncserver -list
novnc
code:bash
sudo apt install novnc
websockify --web=/usr/share/novnc/ 6080 localhost:5901
SSL対応
code:bash
# PEM生成
openssl req -x509 -nodes -newkey rsa:2048 -keyout novnc.pem -out novnc.pem -days 365
# HTTPSで接続可能なサーバ起動
websockify --web=/usr/share/novnc/ --ssl-only --cert=/path/to/novnc.pem 6080 localhost:5901
TurboVNCは5900+<Window ID>のポートへVNCサーバを構築する
websockifyは6080ポートから5901ポートへのリバースプロキシの役割を果たすので、ログインする際も、<Server IP>の6080ポートへ接続する設定でログインする
参考
セッション関係