- 安装xserver-xorg-video-dummy
sudo apt install xserver-xorg-video-dummy
- 配置文件
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
- 重启lightdm服务
sudo service lightdm restart
=======================================================================================
- 安装vnc
sudo apt-get install x11vnc
- 设置密码
sudo x11vnc -storepasswd
- 配置文件
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