Display resolution not shown in Ubuntu

Problem

I uninstalled my NVIDIA drivers using this command:

$ sudo apt-get purge "nvidia*"

I rebooted my computer and logged into Ubuntu. I was greeted by a desktop of resolution 1280x768. This was far lesser than the native resolution of this display, which is 1920x1080!

When I opened System Settings -> Display, only the above low resolution was available in the dropdown!

Solution

Online solutions point to using xrandr to pick the display resolution and make it permanent. Since my system was due for a new LTS Enablement Stack, I went ahead and updated the Linux kernel and X server as described here.

After rebooting from this update, my desktop was back to its full native resolution! πŸ˜„

Tried with: Ubuntu 14.04

How to change resolution of virtual console

On many systems, I find that the virtual console in Ubuntu is limited to 80x40. That is, it only displays 80 columns and 40 lines of text. The resolution of my display is much higher than this and I would like to render more lines and columns in the virtual consoles.

To do that:

  • Open the file /etc/default/grub in an editor:
$ sudoedit /etc/default/grub
  • We add two lines to the file. If these lines are already there, edit or comment them out. The first line provides the pixel resolution (say 1920x1200) of your display:
GRUB_GFXMODE=1920x1200x32
GRUB_GFXPAYLOAD_LINUX=keep
  • Update GRUB:
$ sudo update-grub
  • Restart Ubuntu. The virtual console should have a resolution that matches your display resolution.

Note: This also works for virtual console of Ubuntu running inside a VirtualBox virtual machine. Since the VirtualBox window can be resized (and the virtual console cannot), I provide a smaller resolution to GRUB there. For example: 1024x768.

Tried with: Ubuntu 14.04

How to find resolution of terminal

A terminal or console in Linux is a rectangle which displays a certain number of lines and columns of text. This is the resolution I refer to when I talk about terminal or console. This is not the display resolution, which is expressed in units of pixels.

To find the width or the number of columns: tput cols
To find the height or the number of lines: tput lines

Tried with: Ubuntu 14.04

Ubuntu switches to old display resolution in VirtualBox

Problem

I had increased the display resolution of Ubuntu in VirtualBox using Guest Additions, as explained here. Today it switched back magically to a small 800×600 resolution after a reboot! And also the resolution would not increase or change to match its window size.

Solution

Ubuntu had updated itself before this happened. Apparently, it overwrites the display resolution settings or drivers that were enabled by Guest Additions. Once I suspected this, I installed Guest Additions again, as explained here. A reboot later, Ubuntu was in high resolution matching whatever size I dragged its window to.

Tried with: Ubuntu 12.04, VirtualBox 4.2.4 and Windows 7 Professional x64

Increase resolution of Ubuntu in VirtualBox

Problem

No matter how much video memory you give Ubuntu running inΒ VirtualBox, it runs with a pitifully small resolution like 800×600 or something like that.

Solution

To enable Ubuntu to use larger resolutions, you need to install Guest Additions to it. The instructions to do that are here. After installation, reboot Ubuntu and you will see that Ubuntu resolution will match the window size. To increase the resolution just increase or change the VirtualBox window size by dragging its corner.

Tried with: Ubuntu 12.04, VirtualBox 4.2.4 and Windows 7 Enterprise