如何在无头服务器上通过 Teamviewer 访问 Ubuntu GUI?

hpp*_*ngy 5 remote-desktop remote-access headless

我正在构建主要是 Plex 媒体服务器,但我也喜欢修补 Linux,所以我想通过 Teamviewer 访问 GUI。

在我意识到 GUI 在没有连接显示器的情况下无法加载之前,我把一切都准备好了并开始工作。

我如何设置虚拟监视器或其他东西?我不太擅长使用命令行,但可以很好地遵循说明。该盒子将在没有键盘、显示器或鼠标的情况下运行。

mat*_*att 1

包“xserver-xorg-video-dummy”似乎可以完成所需的操作

有关此问题中设置的一些详细信息

添加未插入显示器时的假显示


kuk*_*ulo 1

我基本上已经安装了一个包 xserver-xorg-video-dummy,sudo apt install xserver-xorg-video-dummy然后创建了一个名为xorg.conf以下内​​容的配置文件:

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 "1366x768"
    EndSubSection
EndSection
Run Code Online (Sandbox Code Playgroud)

我还创建了两个脚本monitor.shnomonitor.sh

monitor.sh:

sudo rm /usr/share/X11/xorg.conf.d/xorg.conf
Run Code Online (Sandbox Code Playgroud)

nomonitor.sh:

sudo cp xorg.conf /usr/share/X11/xorg.conf.d/
Run Code Online (Sandbox Code Playgroud)

ssh您可以在连接显示器时执行其中一个脚本。

sudo reboot执行脚本后您需要执行。

您可以然后执行xvncteamviewer根据您的喜好执行。