Linux

How to get the high resolution back for tty after activation of nVidia driver in Ubuntu

Ubuntu 10.10 has a nice dis­play (high res­o­lu­tion) of com­mand line (tty) by default. Well at least it is out­put per­fectly in my T61p. But after my acti­va­tion of nVidia dri­ver, the tty returned to the ker­nel default which is 640×480. I really can­not work in such a tiny space. Let’s tweak it a bit.

/*Update:
One more point to men­tion, I did all the fol­low­ing steps in a clean installed Ubuntu. So if you can­not get the expected result, you may want to check your sys­tems con­fig files. Make sure they are “clean”. And you may also want to check your pack­ages are not “that dif­fer­ent” with the Ubuntu 10.10’s.
*/

Before we start, please make sure that you didn’t change any­thing in the con­fig­u­ra­tions of grub and ply­mouth. And we will also need to install two pack­ages: v86d and hwinfo.

sudo apt-get install  v86d hwinfo

Look up your favorite res­o­lu­tion mode ID

sudo hwinfo  --framebuffer | grep "Mode"

You will be able to see a list like this:

Model: "NVIDIA G84 Board - NV_NB8P "
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 0x037c: 1920x1200 (+1920), 8 bits
Mode 0x037d: 1920x1200 (+7680), 24 bits

The hex num­bers are the mode ID. In my case I will pick 0x037d. Now we need to tell the ker­nel which res­o­lu­tion should be picked when start.

sudo vi  /etc/default/grub

Find the fol­low­ing three lines.

GRUB_CMDLINE_LINUX_DEFAULT="quiet  splash"
GRUB_CMDLINE_LINUX=""
...
#GRUB_GFXMODE=640×480

Change them to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1920x1200-24,mtrr=3,scroll=ywrap"
GRUB_CMDLINE_LINUX="vga=0x037d"
...
GRUB_GFXMODE=1920x1200

Then save the file. Open another file:

sudo vi  /etc/initramfs-tools/modules

Append the fol­low­ing line:

uvesafb mode_option=1920x1200-24 mtrr=3 scroll=ywrap

We will need to cre­ate a new file:

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

OK, we are almost done. Just need to update the configurations.

sudo update-grub2
sudo update-initramfs -u

Final step, restart. And that’s it. Enjoy! :)

If you want to make your tty sup­port Chinese/Japanese/Korean, please refer to post 给Ubuntu tty加中文.

CBlog

About Conan

博客,好学者,开源控,爱编程,喜设计,迷摄影,爱音乐。好学对象:平面设计,网站架构,算法,网络安全,视觉艺术。