【Ubuntu24.04无显示器远控】【Todesk远程桌面黑屏】【Linux虚拟显示器】解决方案

1️⃣版本

  • Ubuntu 24.04
  • Todesk 4.7.2.0
  • xserver-xorg-video-dummy 1:0.4.0-1build1

2️⃣安装配置虚拟显示器

  • sudo apt install xserver-xorg-video-dummy
  • 编辑/etc/gdm3/custom.conf关闭Ubuntu24.04Wayland切换为X11
    • WaylandEnable=false
  • /usr/share/X11/xorg.conf.d/目录下新建一个显示器配置文件99-dummy.conf
# 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

在这里插入图片描述

3️⃣重启后查看

xrandr

请添加图片描述

Ubuntu 20.04 上,如果使用 GNOME 桌面环境和 VNC 程连接时,没有外接显示器会导致无法使用的问题。这是因为 GNOME 桌面环境默认需要一个物理显示器才能正常启动。 解决这个问题的方法是,在 VNC 会话中模拟一个虚拟显示器。具体步骤如下: 1. 安装 `xserver-xorg-video-dummy` 包,这是一个可以模拟虚拟显示器的 Xorg 驱动程序。在终端中执行以下命令来安装: ``` sudo apt-get install xserver-xorg-video-dummy ``` 2. 新建一个 Xorg 配置文件 `/etc/X11/xorg.conf.d/99-dummy.conf`,并添加以下内容: ``` Section "Device" Identifier "dummy" Driver "dummy" Option "IgnoreEDID" "true" EndSection Section "Monitor" Identifier "dummy" HorizSync 28.0-80.0 VertRefresh 48.0-75.0 Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync EndSection Section "Screen" Identifier "dummy" Device "dummy" Monitor "dummy" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1920x1080" EndSubSection EndSection ``` 这里的配置文件指定了一个虚拟显示器,分辨率为 1920x1080。 3. 启动 VNC 服务时,使用以下命令指定启动虚拟显示器: ``` vncserver :1 -geometry 1920x1080 -depth 24 -localhost no ``` 这里的 `:1` 表示启动一个新的 VNC 会话,`-geometry` 参数指定虚拟显示器分辨率为 1920x1080,`-depth` 参数指定颜色深度为 24 位,`-localhost no` 表示允许从程计算机连接 VNC 服务器。 4. 在 VNC 客户端中连接到服务器的虚拟显示器,就可以正常使用 GNOME 桌面环境了。 需要注意的是,由于 VNC 会话是基于网络连接的,因此如果网络连接不稳定或速度较慢,可能会影响 VNC 连接的稳定性和流畅度。如果需要在生产环境中使用远程桌面连接,建议使用专业的远程桌面软件,如 Microsoft Remote Desktop 或 Citrix Virtual Apps and Desktops 等。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

newborne

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值