Ubuntu 控制台分辨率设置(含宽屏)



(本文使用环境为 Ubuntu 9.04 AMD64 版)

使用Linux作为操作系统,或多或少会接触到Console,特别是使用Server版本的情况下。当前计算机基本均具备宽屏显示器,若不针对宽屏监视器对控制台分辨率进行设置,则会造成控制台字体变形、显示的命令行数过少等缺陷。

修正的方法为:修改grub的menu.lst(路径通常为 /boot/grub/menu.lst),在需使用的
kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=1382bf9f-963d-4cf3-af2a-92beff6b9e03 ro locale=zh_CN quiet splash
语句后面加入 vga=

通常
可以通过查阅下表得出

Reference value for x 640×480 800×600 1024×768 1280×1024 1152×864 1600×1200
8 bit 769 771 773 775 353 800
15 bit 784 787 790 793 354 801
16 bit 785 788 791 794 355 802
24 bit 786 789 792 795 803

上表不包含宽屏分辨率,其他网站介绍使用lrmi中的vbetest进行查询,但lrmi不包含在Ubuntu的库中,在此可使用hwinfo代替。

安装hwinfo
sudo apt-get install hwinfo

使用hwinfo查看分辨率信息
sudo hwinfo –framebuffer

若安装正确,该命令显示结果类似下述:
02: None 00.0: 11001 VESA Framebuffer
[Created at bios.450]
Unique ID: rdCR.sbqupgMqM7F
Hardware Class: framebuffer
Model: "NVIDIA G96 Board - kl1_n10p"
Vendor: "NVIDIA Corporation"
Device: "G96 Board - kl1_n10p"
SubVendor: "NVIDIA"
SubDevice:
Revision: "Chip Rev"
Memory Size: 14 MB
Memory Range: 0xcd000000-0xcddfffff (rw)
Mode 0x0300: 640x400 (+640), 8 bits
Mode 0x0301: 640x480 (+640), 8 bits
Mode 0x0303: 800x600 (+800), 8 bits
Mode 0x0305: 1024x768 (+1024), 8 bits
Mode 0x0307: 1280x1024 (+1280), 8 bits
Mode 0x030e: 320x200 (+640), 16 bits
Mode 0x030f: 320x200 (+1280), 24 bits
Mode 0x0311: 640x480 (+1280), 16 bits
Mode 0x0312: 640x480 (+2560), 24 bits
Mode 0x0314: 800x600 (+1600), 16 bits
Mode 0x0315: 800x600 (+3200), 24 bits
Mode 0x0317: 1024x768 (+2048), 16 bits
Mode 0x0318: 1024x768 (+4096), 24 bits
Mode 0x031a: 1280x1024 (+2560), 16 bits
Mode 0x031b: 1280x1024 (+5120), 24 bits
Mode 0x0330: 320x200 (+320), 8 bits
Mode 0x0331: 320x400 (+320), 8 bits
Mode 0x0332: 320x400 (+640), 16 bits
Mode 0x0333: 320x400 (+1280), 24 bits
Mode 0x0334: 320x240 (+320), 8 bits
Mode 0x0335: 320x240 (+640), 16 bits
Mode 0x0336: 320x240 (+1280), 24 bits
Mode 0x033d: 640x400 (+1280), 16 bits
Mode 0x033e: 640x400 (+2560), 24 bits
Mode 0x0345: 1600x1200 (+1600), 8 bits
Mode 0x0346: 1600x1200 (+3200), 16 bits
Mode 0x0347: 1400x1050 (+1400), 8 bits
Mode 0x0348: 1400x1050 (+2800), 16 bits
Mode 0x0349: 1400x1050 (+5600), 24 bits
Mode 0x034a: 1600x1200 (+6400), 24 bits
Mode 0x0352: 2048x1536 (+8192), 24 bits
Mode 0x0360: 1280x800 (+1280), 8 bits
Mode 0x0361: 1280x800 (+5120), 24 bits
Mode 0x0362: 768x480 (+768), 8 bits
Mode 0x0364: 1440x900 (+1440), 8 bits
Mode 0x0365: 1440x900 (+5760), 24 bits
Mode 0x0368: 1680x1050 (+1680), 8 bits
Mode 0x0369: 1680x1050 (+6720), 24 bits
Mode 0x037b: 1280x720 (+5120), 24 bits
Mode 0x037c: 1920x1200 (+1920), 8 bits
Mode 0x037d: 1920x1200 (+7680), 24 bits
Config Status: cfg=new, avail=yes, need=no, active=unknown

此处Mode 为16进制,换算为10进制即为对应值。如我选择Mode 0x037b: 1280x720 (+5120), 24 bits这一项,则应将设置为891(0x037b换算为10进制)