發表文章

目前顯示的是有「VNC」標籤的文章

Ubuntu 20.04 安裝 lightdm 後無法自動鎖定螢幕

圖片
接續以前發過的文章 Ubuntu 16.04/18.04/20.04 設定 VNC server (使用 x11vnc) ,其中有個步驟安裝了 lightdm 來取代原本的 gdm3。但發現在 Ubuntu 20.04 會導致自動鎖定螢幕的功能失效(包含快捷鍵 Super + L 鎖定螢幕也無法使用) 解決的方式如下: 開啟 設定-->鍵盤快捷鍵-->拉到最下方點選 "+" 來自訂快捷鍵 指令欄位輸入 "dm-tool lock" ,快捷鍵不要跟其他重複就可以(我選的是 L 旁邊的按鍵,這樣也不用動到原本的設定) 雖然還是比不上原本的流暢的樣子(原本是 Super + L 後會鎖定桌面並使螢幕變暗待機),但至少可以透過快捷鍵鎖定螢幕了 真的不能接受的話就輸入以下指令然後重開機,換回 gdm3 吧~ sudo dpkg-reconfigure gdm3 後記 發現用了此方法鎖定後,一段時間電腦會進入休眠狀態;還未找到原因,請看官斟酌使用。

TightVNC(或其他 VNC Viewer) 無法連線到 Ubuntu 18.04/20.04 內建螢幕分享之解方

Error in TightVNC Viewer: No security types supported. Server sent security types, but we do not support any of their. 如果使用 TightVNC 連線 Ubuntu 螢幕共享時出現上方錯誤提示,請照下方步驟設定: 安裝 dconf-editor sudo apt install dconf-editor 啟動 dconf-editor dconf-editor 關閉 "require-encryption" 使用 dconf-editor 到 org > gnome > desktop > remote-access 目錄下,將 "require-encryption" 關閉 完成!

Ubuntu 16.04/18.04/20.04 設定 VNC server (使用 x11vnc)

安裝 x11vnc 首先更新一下套件清單 sudo apt update Ubuntu 18.04/20.04 預設使用 gdm3 作為登入介面,會導致 VNC 運作異常,因此需要換回 lightdm sudo apt install lightdm sudo dpkg-reconfigure lightdm 安裝 x11vnc sudo apt install x11vnc -y 產生 x11vnc 的密碼 x11vnc -storepasswd --> 預設會存在 ~/.vnc/passwd,建議存這邊比較好管理 sudo x11vnc -storepasswd --> 預設會存在 ~/root/.vnc/passwd 執行 x11vnc,此時遠端即可用 VNC viewer 登入 x11vnc 設定開機後自動啟動 VNC 建立 service 設定檔 sudo vim /etc/systemd/system/x11vnc.service 檔案內貼上以下內容: [Unit] Description=Start x11vnc at startup. After=multi-user.target   [Service] Type=simple ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/ <user_name> /.vnc/passwd -rfbport 5900 -shared   [Install] WantedBy=multi-user.target 重新載入 systemd 的腳本設定檔內容,並啟動服務 sudo chmod u+x /etc/systemd/system/x11vnc.service sudo systemctl daemon-reload sudo systemctl enable x11vnc.service sudo systemctl start x11vnc.service 完成!可以重開機試試~ 後記 使用過一陣子後發現 x11vnc 在 Ubuntu 18.04/20.04 上,在某些程式上做某些 UI 操作的時候會...