Ubuntu20.04 Desktop安裝tigervnc-server


Ubuntu20.04 Desktop安裝tigervnc-server

一、准備

由於使用的是desktop版,默認為gnome桌面

 

二、安裝TigerVNC服務器

TigerVNC,是一個主動維護的高性能VNC服務器

sudo apt install tigervnc-standalone-server

 

三、修改配置文件

如果home目錄下沒有.vnc目錄,新建目錄

touch $HOME/.vnc/xstartup

修改xstartupvim .vnc/xstartup, 修改為以下內容:

#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/etc/X11/xinit/xinitrc
# Assume either Gnome or KDE will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
if [ -e /usr/bin/gnome-session -o -e /usr/bin/startkde ]; then
    vncserver -kill $DISPLAY
fi

修改xstartup權限

chmod u+x xstartup

 

四、創建vnc端口

  • 一定要加上 -localhost no, 否則只能本地連接,不能實現遠程連接,那么vnc就毫無意義
  • 關閉防火牆,否則可能無法連接
vncserver :1  -geometry 1920x1000  -depth 24 -localhost no


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM