溫馨提示×

TigerVNC在Debian中的圖形界面展示

小樊
51
2025-08-26 13:18:54
欄目: 智能運維

TigerVNC在Debian中展示圖形界面需安裝服務器、配置桌面環境并啟動服務,步驟如下:

  1. 安裝基礎組件

    • 更新系統:sudo apt update && sudo apt upgrade
    • 安裝TigerVNC服務器:sudo apt install tigervnc-standalone-server tigervnc-common
    • (可選)安裝桌面環境(如Xfce):sudo apt install xfce4 xfce4-goodies
  2. 配置VNC密碼
    運行命令:vncpasswd,按提示設置密碼。

  3. 定制圖形界面啟動腳本
    編輯 ~/.vnc/xstartup 文件,添加對應桌面環境的啟動命令(如Xfce):

    #!/bin/sh
    unset SESSION_MANAGER
    exec startxfce4
    

    賦予執行權限:chmod +x ~/.vnc/xstartup。

  4. 啟動VNC服務器
    指定顯示編號(如 :1)和分辨率啟動:
    vncserver :1 -geometry 1920x1080 -depth 24。

  5. 設置開機自啟動(可選)
    創建systemd服務文件 /etc/systemd/system/vncserver@:1.service,內容參考,然后執行:
    sudo systemctl daemon-reload && sudo systemctl enable --now vncserver@:1.service。

  6. 客戶端連接
    使用TigerVNC Viewer等客戶端,輸入服務器IP及端口號(默認 :1 對應5901端口)和密碼即可訪問圖形界面。

注意:確保防火墻開放VNC端口(默認5900+顯示編號),非root用戶需正確配置用戶權限。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女