Ubuntu 修改分辨率为1024x768 24位

(1)修改grub文件:
sudo vim /etc/default/grub
-------------------------------------------------------------------------------------------------------------------
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

#need to add this line####################################################
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1024x768-24,mtrr=3,scroll=ywrap"
#add end #############################################################

GRUB_CMDLINE_LINUX=""

# 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=1280x800

# 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_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
-------------------------------------------------------------------------------------------------------------------


(2)修改initramfs:

sudo gedit /etc/initramfs-tools/modules

-------------------------------------------------------------------------------------------------------------------
# List of modules that you want to include in your initramfs.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1

# sd_mod


#need to add this line###########################

uvesafb mode_option=1024x768-24 mtrr=3 scroll=ywrap

#add end############################ ########
-------------------------------------------------------------------------------------------------------------------


(3)强制使用Framebuffer:

echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash


(4)更新grub和initramfs:
sudo update-grub2

sudo update-initramfs -u


(5)重启
### 修改工控机Ubuntu系统中的屏幕分辨率 在工控机上运行的Ubuntu系统中调整屏幕分辨率,可以通过以下方法实现: #### 1. 使用图形界面工具 在Ubuntu桌面环境中,用户可以使用“显示设置”来调整屏幕分辨率。打开“设置”应用程序,选择“显示”选项卡,在“分辨率”下拉菜单中选择所需的分辨率[^1]。如果目标分辨率未出现在可用选项中,则需要检查显卡驱动程序是否正确安装或通过命令行进行手动配置。 #### 2. 使用 `xrandr` 命令行工具 对于没有图形界面或需要更灵活控制的情况,可以使用 `xrandr` 工具。首先列出当前连接的显示器及其支持的分辨率: ```bash xrandr --query ``` 如果所需分辨率不在列表中,可以创建一个新的模式并应用它。例如,创建一个分辨率为1920x1080的模式: ```bash cvt 1920 1080 ``` 这将输出一个模型定义,例如: ``` # 1920x1080 59.96 Hz (CVT) hsync: 67.16 kHz; pclk: 173.00 MHz Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync ``` 然后将该模式添加到 `xrandr` 中: ```bash xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync xrandr --addmode <output_name> "1920x1080_60.00" ``` 最后应用新分辨率: ```bash xrandr --output <output_name> --mode "1920x1080_60.00" ``` 其中 `<output_name>` 是通过 `xrandr --query` 查找到的输出设备名称[^2]。 #### 3. 更新 GRUB 引导配置 如果需要在启动时设置固定分辨率,可以修改 GRUB 配置文件 `/etc/default/grub`。编辑该文件并找到以下行: ```bash GRUB_GFXMODE=1024x768 ``` 将其更改为所需的分辨率(例如 1920x1080): ```bash GRUB_GFXMODE=1920x1080 ``` 保存文件后更新 GRUB 配置: ```bash sudo update-grub ``` 重启系统以应用更改[^3]。 #### 4. 检查显卡驱动 如果以上方法无法实现期望的分辨率,可能需要安装或更新显卡驱动程序。对于 NVIDIA 显卡,可以使用以下命令安装驱动: ```bash sudo ubuntu-drivers autoinstall ``` 安装完成后重启系统以确保驱动生效[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值