安裝 VNC Server
sudo apt update
sudo apt install vino
編輯此檔案
sudo vi /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml
<key> … </key> 結構為一組,別弄壞原始資料了
# 添加如下內容
<key name='enabled' type='b'>
<summary>Enable remote access to the desktop</summary>
<description>
If true, allows remote access to the desktop via the RFB
protocol. Users on remote machines may then connect to the
desktop using a VNC viewer.
</description>
<default>false</default>
</key>
接著編譯一下
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
然後按照官方資料,第一步驟請依你實際情況執行。
我這邊是Nano 4GB
mkdir -p ~/.config/autostart
cp /usr/share/applications/vino-server.desktop ~/.config/autostart/.
第一行指令與先前編輯的內容有關(官方資料沒有)
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false
thepassword 請替換成你的密碼,後續使用VNC客戶端連線時會用到
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password $(echo -n 'thepassword'|base64)
sudo reboot
至此,就可以使用VNC可戶端連線了。下載RealVNC® Viewer
填上Jetson的IP 名稱自訂 按OK
輸入先前替換 thepassword 的密碼
畫面解析度調整
xrandr --fb 1024x768
無法連接?
我前面一大堆操作,都是透過電腦ssh進去,開發板壓根沒接螢幕(也沒登入),ssh終端裡我想手動開啟也都無法,我這邊卡到懷疑人生!
之後爬文發現到,即使設定自動開啟VNC服務,若開機後沒有登入,就不會執行。
所以我這邊是設定開發板上電開機後會自動登入
UserName 替換成你的開發板登入帳號
sudo vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
# 添加如下內容
allow-guset=false #禁止訪客登入
Autologin-user=UserName #指定UserName為自動登入帳號
sudo vi /etc/gdm3/custom.conf
# 找到 [daemon]
# 取消註解如下內容
AutomaticLoginEnable=true
AutomaticLogin=UserName