总体思路:修改 Ubuntu 的 /etc/default/grub 配置,然后更新 grub,重启系统。详细过程如下:
grub 文件的默认权限是只读的,我们需要通过 chmod 命令修改它的权限。命令如下:
hxstrive@localhost:~/桌面$ sudo chmod 774 /etc/default/grub [sudo] hxstrive 的密码:
你可以选择使用 Ubuntu 默认的编辑器 gedit 去编辑 grub 文件,命令如下:
hxstrive@localhost:~/桌面$ sudo gedit /etc/default/grub
执行上面命令后,将打开 gedit 编辑器,然后我们就可以编辑 grub 文件了。或者使用 vim 编辑器,但是默认 Ubuntu 没有安装 Vim,则是自带 Vi 编辑器。命令如下:
hxstrive@localhost:~/桌面$ sudo vim /etc/default/grub
主要修改 “GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"”
将它修改为“GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1366x768"”
上面配置会将 Ubuntu 的分辨率改为 1366x768,配置完后如下图:
使用 sudo 权限执行 update-grub 命令更新 grub,如下:
hxstrive@hxstrivehost:~/桌面$ sudo update-grub [sudo] hxstrive 的密码: Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.15.0-52-generic Found initrd image: /boot/initrd.img-5.15.0-52-generic Found linux image: /boot/vmlinuz-5.15.0-43-generic Found initrd image: /boot/initrd.img-5.15.0-43-generic Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done
使用 sudo 权限执行 reboot 命令去重启系统,重启后系统分辨率就是你想要的了。命令如下:
hxstrive@hxstrivehost:~/桌面$ sudo reboot
感谢分享,我按照配置修改后果然有用,但是我修改的分辨率是 1920x1080。
谢谢支持!你的支持,是我们更新的动力