喜欢ubuntu的绚丽的桌面效果,这需要装上英伟达驱动。但是装上之后发现终端的分辨率变低了,这令我十分不爽。google了一下,终于找到了解决办法,只需要将grub文件改一下就行了。具体如下:
1.安装v86d和hwinfo包:
sudo apt-get install v86d hwinfo
2.查看显卡支持的分辨率:
sudo hwinfo --framebuffer
我的是:
02: None 00.0: 11001 VESA Framebuffer [Created at bios.464] 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 0x0366: 1600x900 (+3200), 16 bits Mode 0x0367: 1600x900 (+6400), 24 bits Mode 0x0368: 1680x1050 (+1680), 8 bits Mode 0x0369: 1680x1050 (+6720), 24 bits Mode 0x0370: 1600x900 (+1600), 8 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
不过我感觉这个意义不大,因为虽然上面没有1366x768这个分辨率,但是还是可以在下面将参数设成1366x768.你可以根据你的爱好来修改,但是最好按上面机器支持的分辨率来修改,否则可能会出现意想不到的问题。
3.修改grub文件:
sudo gedit /etc/default/grub
将GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"改成GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1366x768-24,mtrr=3,scroll=ywrap"。
将#GRUB_GFXMODE=640×480改成#GRUB_GFXMODE=1366x768。
其最终结果如下(不同的机器不一定相同,我的是Lenovo Y450):
# 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` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1366x768-24,mtrr=3,scroll=ywrap" 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=1366x768 # 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"
4.修改/etc/initramfs-tools/modules文件:
sudo gedit /etc/initramfs-tools/modules
将uvesafb mode_option=1360x768-24 mtrr=3 scroll=ywrap添加上去。
最终结果是这个样子:
# 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 uvesafb mode_option=1366x768-24 mtrr=3 scroll=ywrap
5.更新grub配置文件:
sudo update-grub2 sudo update-initramfs -u
最后重启就行了