10

I need a way to change the boot-up and login screen resolution to 1920 x 1080 resolution. I have a 4K display on my laptop and can't read the text in the grub bootloader screen properly as they aren't scaled. Even the login screen have some qirkiness like it missed scaling the mouse cursor.

I figure I could solve this if I can just lower the boot-up resolution and login screen, but I don't know what's the best way to about doing this. In the past, I have changed the boot-up screen resolution via kernel boot command parameters and muck about with gnome gdm. But if I don't do things properly, the changes may be overwritten during regular Ubuntu update.

Please provide advice if you have experience in doing this. Thanks.

Bernard Wei
  • 2,125

6 Answers6

9

For 18.04 there are a couple of things you can try.

The first thing to do is to make sure the resolution of 1920 x 1080 is supported in grub. To do that reboot your computer and hit Esc repeatedly until you get the purple screen with the recovery and grub options. Hit c to get a grub prompt. At the grub prompt, type:

videoinfo

and hit Enter.

Look at the list of supported resolutions, and make sure 1920 x 1080 is there. If so, type:

exit

to exit grub and boot.

The boot screen resolution is changed by changing your default grub settings. Open a terminal and enter:

sudo nano /etc/default/grub

Use the down arrow or Page Down until you see the line that looks like this:

#GRUB_GFXMODE=640x480

Below that line, enter the following, substituting the 1920x1080 for a supported resolution:

GRUB_GFXMODE=1920x1080
GRUB_GFXPAYLOAD_LINUX=keep

To save your changes, hit Ctrl+O (with O as in Ohio, not zero). To exit nano, hit Ctrl+X. Now, update grub:

sudo update-grub

That should solve the problem in grub, and won't be overwritten by an update. For the login screen, you may be able to fix it with the 4K settings in Ubuntu 18.04. Go Settings -> Devices -> Displays and set Scale to 200%. I'm not sure if that will affect the desktop manager or not, but it's the first thing I'd try.

zeFree
  • 119
linux4me
  • 416
  • @linux4me Yes, I'm using Ubuntu 18.04. I couldn't get the video modes to show when running videoinfo but that may be due to the fact that I have secure boot enabled. Nevertheless, I blindly set the graphic mode to 1024x768 and later to 1280x1024, both work (tried 1920x1080, doesn't work on my hardware.) After the bootloader, my problem persist, i.e., the login screen is still running at 4K resolution with scaling and the linux console (ctrl-alt-f3) also still running at 4K resolution which makes the text extremely small and very hard to read. – Bernard Wei May 30 '18 at 18:15
  • @BernardWei It sounds like you've got a lower resolution in grub, and you've answered the question regarding the scaling setting in Ubuntu; i.e., it doesn't affect the resolution for the login screen or in consoles. I think Ubuntu 18.04 uses GDM for the login screen. In the past, you could edit your /etc/X11/xorg.conf Screen Section, Subsection Display to set the resolution of GDM, but I don't know if that works now. Ordinarily, I don't think the xorg.conf file exists, though I think you may be able to create one. – linux4me May 30 '18 at 20:02
  • For the benefit of others who use lightdm, follow this to change the login greeter resolution, https://askubuntu.com/questions/73804, but even this still doesn't change the console resolution. I'm at a lost still... – Bernard Wei May 31 '18 at 01:00
  • @BernardWei You may need to start a new thread specifically asking about changing TTY resolution. The Wiki says to set the resolution in /etc/default/grub in the GRUB_GFXPAYLOAD_LINUX line instead of in the GRUB_GFXMODE line with GRUB_GFXPAYLOAD_LINUX set to "keep". You might give that a try. – linux4me May 31 '18 at 18:15
  • @linux4me Yeah, I realise now that the resolution of grub bootloader, linux console and login greeter are each set separately. May be I will need to ask each question separately. Setting resolution direction directly on GRUB_GFXPAYLOAD behaves the same way as the instruction you have provided, only affect the bootloader text, not the linux console. – Bernard Wei Jun 01 '18 at 00:13
  • I have decided to pick this thread as the most useful answer to my question closing this discussion. Though it does not solve this problem entirely, it steered me to the right direction. I fixed the grub resolution following @linux4me instructions above. The tiny linux console text is fixed by changing the console font using "sudo dpkg-reconfigure console-setup" choosing the largest font set, and I switched the greeter to lightdm and using xrandr to set the resolution of lightdm following steps from https://askubuntu.com/questions/73804. Thanks all for helping. Cheers. – Bernard Wei Jun 05 '18 at 17:53
  • Thanks. This also works for Ubuntu 20.04 LTS (Focal Fossa). – Pierre C Sep 21 '20 at 00:53
  • changing the GFXMODE from auto to native resolution in grub fixed the resolution issue in my login screen also. – Neerkoli Jan 26 '22 at 18:14
8

Just want to add that I found a way to change the login screen resolution. That part of my problem has been asked and answered, see how to change gdm3 thread.

After setting up the monitor resolution and zoom level I wanted, I simply copy the settings to gdm3 .config directory, make any further changes you need and then reboot the PC.

sudo cp -i .config/monitors.xml /var/lib/gdm3/.config/
sudo vi /var/lib/gdm3/.config/monitors.xml

You probably also need to do the following before rebooting. Select gdm3 when prompted.

sudo dpkg-reconfigure gdm3
Bernard Wei
  • 2,125
2

For a fresh install of Ubuntu 22.04, bernard-wei's answer is the right one.

sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/monitors.xml

I have had several issues making me think it was wrong:

  • There was no ~/.config/monitors.xml. (by default the gnome display settings can automatically adapt to your monitor)
    Make any change in Settings > Display so that this file is created
  • Create the /var/lib/gdm3/.config folder

From when you have done those 2 steps, you can also install and use this tool to customize your login screen (background, ...)

https://realmazharhussain.github.io/gdm-settings/

The button in Display > Apply current display settings will basically do the above copy, but only if you have done the above steps

Display in Login Manager Settings

0

I would recommend using the excellent third party tool Grub Customizer, which can be installed with:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer

# To remove
# sudo apt remove --autoremove grub-customizer

Specifically, to control the resolution:

  • Open the program (type "grub customizer" in your dash), it will prompt you for your password;
  • Click the tab "Appearance settings";
  • Select the option "custom resolution";
  • Select the resolution of choice in the dropdown menu (the format is width-by-height-by-ncolors, e.g. 1600x1200x24).

NOTE: The resolutions that GRUB can use vary on each machine, and Grub Customizer does not seem to be aware of this. To know which resolutions are supported on your machine, reboot and type c when at the GRUB menu (i.e. instead of selecting a kernel option), and then type videoinfo in the prompt. Write down the resolutions supported (or take a picture with your phone if needed), and then type reboot.

0

I use the guide by Alberto. Run:

sudo cp ~/.config/monitors.xml ~gdm/.config/monitors.xml

where ~gdm is /var/lib/gdm3. Then run:

sudo chown gdm:gdm ~gdm/.config/monitors.xml
Eideen
  • 1
0

I had the same problem with a lot of distribution, I just had to say I tried the display options, I tried the grub, and I tried the graphic card option and nothing helped. The only thing that helped me is changing the resolution of the lightdm log-in manager.

Here is the website with the full explanation of how to do it: https://sudo-juice.com/lightdm-resolution/

And one thing "xrandr --output HDMI-1-1 --primary --mode 1920x1080" = two lines not one

"display-setup-script=/usr/share/lightdmxrandr.sh" = and this is with one cause the original one is not working for me.