ubuntu设置虚拟显示器且远程连接

4/2/2022 ubuntulinux虚拟显示器vnc

# 版本

  • ubuntu 20.04

# 安装虚拟显示器

sudo apt install  xserver-xorg-core-hwe-18.04
sudo apt install  xserver-xorg-video-dummy-hwe-18.04  --fix-missing
1
2

# 添加配置文件

在 /usr/share/X11/xorg.conf.d/ 中添加 xorg.conf 文件(系统默认就会使用虚拟显示器):

sudo vim /usr/share/X11/xorg.conf.d/xorg.conf
1
Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection
Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection
Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1920x1080"
    EndSubSection
EndSection
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

虽然配置上面写了 “1920x1080”,但是实际上最大支持 "1360x768",重启即可生效。

# 使用远程连接

使用teamviewer、todesk或者向日葵等远程工具实现远程连接即可。

重启计算机后,系统会默认使用虚拟显示器,即使接入了显示器,也不会输出信号到显示器上!

ps:如果需要再用显示器,需要删除或者重命名“xorg.conf”文件,后缀名改掉即可,如.conf_bak

上次更新: 2024/09/10 17:37:12
最近更新
01
跨域的几种常见解决方案
04-03
02
react教程
03-01
03
前端抓包神器whistle
09-01