文章目錄
- 操作步驟
- 實踐截圖
- 配置 Xorg 的虛擬顯示界面(升級版)
操作步驟
“遠程連接”,在設置里直接打開就可以.進行配置就行.
1.配置 GRUB 以支持無顯示器啟動
sudo nano /etc/default/grub
(里面有一行改為:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=vesa:off video=efifb:off nomodeset")2.保存后更新 grub
sudo update-grub3.設置自動登錄
sudo nano /etc/gdm3/custom.conf
(修改添加:
AutomaticLoginEnable=True
AutomaticLogin=robot
WaylandEnable=false)4.重啟 GDM 服務
sudo systemctl restart gdm35.打開"密碼和密鑰" 應用程序
seahorse
(右擊 "登錄" ,單擊 "更改密碼",輸入原密碼后,空著密碼行不輸入,點擊確定繼續)
實踐截圖
這樣就可以在局域網內其他電腦上,遠程桌面連接訪問無外接顯示器的Ubuntu22.04系統的計算機.
配置 Xorg 的虛擬顯示界面(升級版)
上面的配置完成后,顯示的界面分辨率僅為 1080×738 .
此升級版就是想要將虛擬顯示界面分辨率設置為 1920×1080 .
此配置的前提是禁用 Wayland 的界面,顯示界面系統為 Xorg(X11).
查看界面:
echo $XDG_SESSION_TYPE
輸出 x11 -> Xorg .
輸出 wayland -> Wayland .
首先是 “/etc/default/grub” 文件更改為:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=vesa:1920x1080 video=efifb:off"
GRUB_CMDLINE_LINUX=""# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1920x1080# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
安裝虛擬顯示器驅動(xserver-xorg-video-dummy):
安裝虛擬顯示器驅動,強制系統識別 “虛擬屏幕” ,支持分辨率(如1920×1080).
1.
sudo apt install xserver-xorg-video-dummy2.
sudo nano /etc/X11/xorg.conf.d/10-dummy.conf
添加內容:
Section "Device"Identifier "DummyDevice"Driver "dummy"VideoRam 256000
EndSectionSection "Monitor"Identifier "DummyMonitor"HorizSync 5.0-75.0VertRefresh 50.0-75.0Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
EndSectionSection "Screen"Identifier "Default Screen"Device "DummyDevice"Monitor "DummyMonitor"DefaultDepth 24SubSection "Display"Depth 24Modes "1920x1080"EndSubSection
EndSection
重新啟動后,就不會在外接顯示器上顯示界面了,只有通過虛擬界面進行顯示,若要恢復的話,只需要刪除 “/etc/X11/xorg.conf.d/10-dummy.conf” 文件即可.