Ubuntu20.04怎么在不接显示器的情况下用远程桌面

桌面秀,不同桌面、不同风格。
回复
hutest
帖子: 2
注册时间: 2021-06-07 18:41
系统: Ubuntu20.04

Ubuntu20.04怎么在不接显示器的情况下用远程桌面

#1

帖子 hutest » 2021-06-07 18:58

按照网上的一种教程,通过 VNC 远程连接 Ubuntu 系统电脑的图形化桌面时,如该电脑未连接显示器,配置虚拟显示器来解决
通过网上的教程还是无法在不接VGA视频线的时候远程到桌面,安装了虚拟显卡
sudo apt-get install xserver-xorg-core-hwe-18.04
sudo apt-get install xserver-xorg-video-dummy
求怎么修改配置文件能达到在外接显示器的时候优先使用显示器,不接显示器的时候优先使用虚拟显示器
头像
dwl301
帖子: 1130
注册时间: 2007-04-14 11:17

Re: Ubuntu20.04怎么在不接显示器的情况下用远程桌面

#2

帖子 dwl301 » 2021-06-08 14:08

1. Install x11vnc
sudo apt install x11vnc -y

2. Create VNC password
sudo x11vnc -storepasswd abc123.. /etc/x11vnc.pass

3. Setting default resolution ratio
vim /etc/X11/xorg.conf
----------------------
Section "Device"
Identifier "Configured Video Device"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Depth 24
Virtual 1920 1080
EndSubSection
EndSection

4. Service start shell
vim /lib/systemd/system/x11vnc.service
--------------------------------------
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -shared -noxdamage -xrandr "resize" -rfbport 5900
Restart=always
RestartSec=3
StartLimitInterval=0

[Install]
WantedBy=multi-user.target

5. Auto start x11vnc Service
sudo systemctl enable x11vnc.service
Gigabyte Aero 15
Intel Core i7-7700HQ
NVIDIA GeForce GTX 1060 (DISABLED)
2x8GB DDR4 2400MHz
M.2 NVME 2280 512G
M.2 NVME 2280 1024G
15.6" FHD 1920×1080
hutest
帖子: 2
注册时间: 2021-06-07 18:41
系统: Ubuntu20.04

Re: Ubuntu20.04怎么在不接显示器的情况下用远程桌面

#3

帖子 hutest » 2021-06-09 8:42

不行呀,修改了配置文件路径和内容之后vnc都连不上了Windows端我用的vnc viewer,20.04端的X11VNC我之前就装了
1.之前xorg.conf文件在 /usr/share/x11/xorg.conf.d/xorg.conf 下
sudo vim /usr/share/X11/xorg.conf.d/xorg.conf
--------------------------------------
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection

2.x11vnc.sercive 原配置路径为:
vim /etc/systemd/system/x11vnc.service
--------------------------------------
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared -capslock -nomodtweak
[Install]
WantedBy=multi-user.target
头像
dwl301
帖子: 1130
注册时间: 2007-04-14 11:17

Re: Ubuntu20.04怎么在不接显示器的情况下用远程桌面

#4

帖子 dwl301 » 2021-06-21 13:05

20.04还没有用上。。我用的linuxmint-19.03,基于Ubuntu-18.04的。。。这个上面我的配置可以。。。
Gigabyte Aero 15
Intel Core i7-7700HQ
NVIDIA GeForce GTX 1060 (DISABLED)
2x8GB DDR4 2400MHz
M.2 NVME 2280 512G
M.2 NVME 2280 1024G
15.6" FHD 1920×1080
回复