Display Login Screen in External Monitor in Ubuntu 22.04 | 24.04

Last updated: November 26, 2024 — 9 Comments

Have multiple monitors connected into your Ubuntu machine? Here’s the quick tip shows you how to configure which one to display the login screen.

It’s quite easy to set primary display in Ubuntu with default GNOME desktop. However, the login screen is always sticking to the built-in display in my laptop. In case you use the external monitor for the most time, you may also set it as primary display for the GDM login screen by following this tutorial.

NOTE: This tutorial is tested only in Ubuntu with default GNOME desktop! Though, it may also work in other Linux with GNOME (e.g., Fedora, Debian and Arch) or Linux with GDM display manager.

Step 1: Set Primary Display in Gnome Control Center

First of all, open Settings (aka Gnome Control Center) from the top-right corner system tray menu.

Then, navigate to Displays in the left, and choose the monitor in the right you want to use it as primary.

This step is required to generate a XML config file under user’s ‘.config‘ folder. Though, you may switch to another display as primary at anytime as you want.

Step 2: Apply Primary Display for GDM Login Screen

As mentioned above, the previous step generates a XML config file automatically. By copying the file into GDM’s config folder will make it also work for the login screen.

To do so, press Ctrl+Alt+T on keyboard to open terminal. Then, run command:

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

Type user password (no asterisk feedback) when it asks and hit Enter. For other Linux, you may have to replace gdm3 in command with gdm.

Now, save your work and log out to see the magic!

(Optional) Disable the built-in display on startup

Another annoying thing when using multiple monitor in Ubuntu Linux is that the Grub boot menu screen is always displaying in built-in monitor. I can’t figure out how to make it work in external screen as it seems to be responsible to BIOS.

However, you can disable the built-in display on startup and use the external screen only by adding a Kernel parameter.

NOTE: After this step, Grub boot-menu still shows in built-in display, though it goes always blank after that, even after disconnected the external monitor.

1. First, boot up and log into your Ubuntu desktop. Open terminal by pressing Ctrl+Alt+T shortcut on keyboard.

2. Disconnect the external monitor, and run command to get the device ID of built-in display:

for p in /sys/class/drm/*/status; do con=${p%/status}; \
echo -n "${con#*/card?-}: "; cat $p; done

Some said the last command does not work. If so, you may run command below instead. Usually, the first one is the ID of built-in display.

cat ~/.config/monitors.xml |grep connector

Or, just log out and choose login via ‘Ubuntu on Xorg’ via bottom right gear button. And, run xrandr -q to see the display device name.

3. Re-connect your external monitor, and run command to edit the configuration file for Grub:

sudo gedit /etc/default/grub

Replace gedit with gnome-text-editor for Ubuntu 24.04 or use nano that works in most Linux. When file opens, add video=eDP-1:d as value of ‘GRUB_CMDLINE_LINUX_DEFAULT’. So the line will look like:

GRUB_CMDLINE_LINUX_DEFAULT="quite splash video=eDP-1:d"

Here ‘d‘ tells to disable the device. Though, you have to replace eDP-1 with your device name according to what you got in last step.

After saving the change, run sudo update-grub to reload the Grub settings and done!

In addition, you may add video=Device-Name:e or video=Device-Name:D kernel parameter to force enable external monitor on startup if need.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

9 responses to Display Login Screen in External Monitor in Ubuntu 22.04 | 24.04

  1. Thanks. This worked nicely on 20.04.

  2. Thanks for this Ji. It worked great.

  3. Great post Ji!
    I tried it on Ubuntu 24.04 and it didn’t work.
    Any tips?
    Thank you very much.

    • It works in my case. Try deleting the config file:

      rm ~/.config/monitors.xml

      Then, re-connect external monitor, re-configure the primary monitor to re-generate the config file.

  4. Thanks. Solved my problem with an old “headless” Thinkpad that I use with an external monitor. The LCD screen in this laptop died years ago, so I’ve just been using it with an external monitor. A recent upgrade to Ubuntu 24.04 caused some headaches, but your article got me around them. Thanks

  5. You are great!
    Thank you!

  6. Solved my problem also on Fedora, after many fruitless hours googling.
    Both content and presentation/formatting/pictures of the tutorial was excellent.
    Have a “Lucky Goldstar” award, Ji ! (my secondary display was a LG C2 tv)

  7. Hey guys use Linux Mint 22, issue with external displays is not even exist. And bunch of other issues also.

  8. Sylvain Chamberland November 26, 2024 at 1:01 pm

    It works on my Asus gaming laptop with an AMD CPU/GPU and NVIDIA GPU (dual GPUs); on 24.04 LTS, Xorg is still the default session (because of the NVIDIA card) so I had to set up the default monitor in a Xorg session in order for it to work.

    But I can’t change the default monitor on login screen on my Lenovo T14 Gen1 AMD laptop. I tried setting this up in a Xorg session, in a Wayland session, and both external monitors, it just doesn’t work. I’m pulling my hair out.

    It’s in those times that I miss KDE and SDDM (I came back to Ubuntu after the Plasma 6 disaster). But not too much. GNOME is nicer. And I always set up Plasma like GNOME, anyway. :-D

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*