Ubuntu 设置 虚拟分辨率

61 篇文章 1 订阅
22 篇文章 0 订阅

Ubuntu 设置 虚拟分辨率

无屏显示(开启后连接显示器会无输出,仅可使用远程控制)

设置远程软件

确保远程控制软件开机自动启动

远程连接

sudo apt install openssh-client

并用 ssh 远程连接

安装第三方包

根据版本安装对应的包(已测试 16.04 及 18.04)

sudo apt-get install  xserver-xorg-core-hwe-18.04
sudo apt-get install  xserver-xorg-video-dummy-hwe-18.04

获取参数(跳过)

依次为分辨率和刷新率

cvt 2560 1440 60

设置开机生成虚拟屏幕

使用上面生成的参数来设置

sudo vim /usr/share/X11/xorg.conf.d/xorg.conf

添加并修改最后的

Virtual <your-width> <your-height>

待添加内容如下

Section "Device"
	Identifier "dummy_videocard"
	Option "NoDDC" "true"
	Option "IgnoreEDID" "true"

	Driver "dummy"

	VideoRam 524288
EndSection

Section "Monitor"
	Identifier "dummy_monitor"

	Modeline "3840x2160_20.00" 218.15 3840 4016 4416 4992 2160 2161 2164 2185
	Modeline "3440x1440_20.00" 124.95 3440 3520 3864 4288 1440 1441 1444 1457
	Modeline "2560x1440" 42.12 2560 2592 2752 2784 1440 1475 1478 1513
	Modeline "1920x1440" 69.47 1920 1960 2152 2384 1440 1441 1444 1457
	Modeline "1920x1200" 26.28 1920 1952 2048 2080 1200 1229 1231 1261
	Modeline "1920x1080" 23.53 1920 1952 2040 2072 1080 1106 1108 1135
	
	HorizSync   5.0 - 1000.0
	VertRefresh 5.0 - 1000.0
EndSection

Section "Screen"
	Identifier "dummy_screen"
	Device "dummy_videocard"
	Monitor "dummy_monitor"
	DefaultDepth 24
	SubSection "Display"
		Depth 24
		Modes "3840x2160_20.00" "3440x1440_20.00" "2560x1440" "1920x1440" "1920x1200" "1920x1080"
		
		# Not sure why, but 3440x1440 won't work when the Virtual is set to "3840 2160"
		# However it will complain in the Xorg.log when you didn't comment out the 3840x2160 resolution at the top
		Virtual 2560 1440
	EndSubSection
EndSection

重启以生效

sudo reboot

取消无屏显示

sudo mv /usr/share/X11/xorg.conf.d/xorg.conf /usr/share/X11/xorg.conf.d/xorg.conf.bak
sudo reboot

虚拟分辨率

获取目标分辨率参数

cvt 2560 1440 75

添加分辨率

xrandr --newmode "2560x1440_75.00"  397.25  2560 2760 3040 3520  1440 1443 1448 1506 -hsync +vsync
xrandr --addmode DP-0 "2560x1440_75.00"

激活分辨率

xrandr --output DP-0 --mode "2560x1440_75.00"

尽情享用吧~

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值