UOS虚拟显示器&VNC配置

  1. 安装xserver-xorg-video-dummy
sudo apt install xserver-xorg-video-dummy
  1. 配置文件
sudo vim /etc/X11/xorg.conf.d/99-dummy.conf

写入以下内容

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
    VideoRam 256000
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 10.0-300
    VertRefresh 10.0-200
EndSection

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1920x1080"
    EndSubSection
EndSection
  1. 重启lightdm服务
sudo service lightdm restart

=======================================================================================

  1. 安装vnc
sudo apt-get install x11vnc
  1. 设置密码
sudo x11vnc -storepasswd
  1. 配置文件
sudo vim /lib/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/<USERNAME>/.vnc/passwd -rfbport 5900 -shared -capslock -nomodtweak


[Install]
WantedBy=multi-user.target

/home/USERNAME/.vnc/passwd 中的USERNAME需要换成你自己的用户名

systemctl daemon-reload

systemctl enable x11vnc.service

systemctl start x11vnc.service
posted @ 2021-02-20 11:14  mikigo  阅读(1079)  评论(0编辑  收藏  举报