How to Configure a Permanent Dual Monitor Setup in Ubuntu

In most cases, if you’re running a two-monitor display, you can simply open the Ubuntu display preferences dialog box by selecting ‘System’ from the Dash and then choosing ‘Preferences’ followed by ‘Display.’ You will see a window featuring two different displays that you can simply drag around to configure multiple desktops. Unfortunately, this method does not always work.

If you’re having difficulty with this, then you may need to use a command called xrandr to make the display changes permanent. This advice will work for all graphical versions of Ubuntu, whether you’re using Unity, KDE Plasma, GNOME-Shell, LXDE, Xfce4 or any other desktop environment. It won’t work with text-only versions of Ubuntu Server, however.

Using xrandr to Configure Two Monitors

Open a graphical terminal from the Ubuntu Dash, the LXDE menu, the Whisker menu in Xfce4, or by holding CTRL, ALT, and pushing T in any version of Ubuntu. Type nano .xinitrc and press return. If you have an existing startup script, press Page Down until you’re at the bottom of it. However, most Ubuntu installations won’t have a standard .xinitrc script, so you can start your own.

If you see a line like ‘xmonad’ or any other multi-screen window manager without an ampersand following it, add one after a space, like ‘xmonad &’, so that they execute in the background. Afterward, you need to add a line at the bottom that reads the following:”.

xrandr –output DP2 –auto –left-to DP1

You might need to adjust the DP2 and DP1 settings if the displays are swapped. After you’ve written the line, press CTRL and X together, followed by Y to save your changes. To test if the settings are working, restart your machine. If it’s not working, consider swapping the designations and restart again. If the multiple monitor display still isn’t functioning correctly, reopen the graphical terminal. Simply input ‘xrandr’ and press return. This will generate a list of connected displays. These displays might also bear alternate names such as DFP1, CRT1, or others. You could potentially use these instead of DP2 and DP1 in the xrandr line of the .xinitrc script.

You should then have one desktop on each monitor.

If you’re running custom schemes or any custom window managers, then these will still work regardless of what type of Ubuntu distribution you’re using. You can even use two different sets of wallpaper if you’d like.

Drag applications to the edges of the window to position them on either of your two monitors.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.