When Ubuntu fails to detect a second monitor, it can be frustrating. This common issue has several potential causes and solutions. This guide covers the most frequent issues, from simple cable checks to driver configurations and manual display setup.
Understanding the Problem: Display Detection Process
When you connect a monitor, several things need to happen for Ubuntu to recognize it:
- Physical Connection: The cable (HDMI, DisplayPort, VGA, DVI) must be securely connected to both the monitor and your computer.
- Graphics Driver: Your graphics driver (NVIDIA, AMD, or Intel) must be properly installed and functioning.
- Display Server: The display server (Xorg or Wayland) must detect and configure the new monitor.
- Desktop Environment: Your desktop environment (GNOME, KDE, XFCE, etc.) needs to manage the display settings.
Problems can occur at any of these stages.
Read: How to display Graphics card information on Ubuntu 22.04
Troubleshooting Steps
3.1 Basic Checks (Don’t Skip These!)
- Cable Connection: Unplug and replug the cable at both ends. Make sure it’s firmly seated. Try a different cable if you have one.
- Monitor Power: Ensure the monitor is powered on and the correct input source is selected (HDMI 1, HDMI 2, DisplayPort, etc.).
- Try a Different Port: If your computer has multiple video output ports, try a different one. Some ports might be disabled or controlled by a different graphics card.
- Reboot: Sometimes, a simple reboot is all it takes.
3.2 Check Display Settings
- Open your system’s display settings. On Ubuntu with GNOME, you can find this by searching for “Displays” in the Activities overview.
- Detect Displays: Look for a “Detect Displays” button or similar option. Click it to force Ubuntu to re-scan for connected monitors.
- Mirror/Extend: If the second monitor is detected but not showing anything, make sure it’s not set to “Mirror” mode (which duplicates the primary display). Choose “Extend” to use it as a separate workspace.
- Resolution and Refresh Rate: Check that the second monitor’s resolution and refresh rate are set correctly.
- Scale: For HiDPI displays, check if scaling settings are appropriate. Mismatched scaling between monitors can cause visibility issues.
3.3 Graphics Driver Issues
Incorrect or outdated graphics drivers are a very common cause of monitor detection problems.
- Identify Your Graphics Card:
lspci | grep VGA
This command will show you the type of graphics card you have (NVIDIA, AMD, or Intel).
- Install Proprietary Drivers:For NVIDIA:
For NVIDIA cards, the proprietary drivers often provide better performance and compatibility than the open-source drivers. Ubuntu has a built-in tool for managing drivers:
- Open “Software & Updates” and go to the “Additional Drivers” tab.
- Ubuntu will search for available drivers. Select the recommended proprietary driver (usually labeled “tested”) and click “Apply Changes.”
- Reboot your computer after installing the driver.
Alternatively, you can install drivers from the command line:
# Show available drivers sudo ubuntu-drivers devices # Install a specific driver version (replace 470 with the version you want) sudo apt install nvidia-driver-470
NVIDIA Settings Tool:
After installing NVIDIA drivers, you can use the NVIDIA Settings tool for additional configuration:
# Install the NVIDIA settings tool sudo apt install nvidia-settings # Launch the tool nvidia-settings
This tool provides advanced display configuration options specifically for NVIDIA hardware.
For AMD:
AMD drivers are often included in the kernel, but you can install additional packages for better support:
# Install the AMDGPU driver sudo apt install xserver-xorg-video-amdgpu # For newer cards, you might want Mesa drivers sudo apt install mesa-vulkan-drivers libvulkan1
For the proprietary AMDGPU-PRO driver (needed for some professional applications):
- Download the driver from AMD’s website
- Extract the package:
tar -xf amdgpu-pro-XX.XX-XXXXX.tar.xz
- Run the installer:
cd amdgpu-pro-XX.XX-XXXXX && ./amdgpu-pro-install -y
For Intel Graphics:
Intel graphics usually work well with the open-source drivers included in Ubuntu. You can ensure you have the latest drivers with:
sudo apt install xserver-xorg-video-intel
- Blacklist Nouveau (If using NVIDIA):If you have an NVIDIA card and are experiencing issues even after installing the proprietary driver, the open-source Nouveau driver might be interfering. You might need to blacklist it:
echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf sudo update-initramfs -u sudo reboot
3.4 Using xrandr (Manual Configuration)
Note: These commands work primarily with Xorg. For Wayland sessions, some xrandr
commands may have limited or no effect.
xrandr is a powerful command-line tool for configuring displays. It can be used to detect monitors, set resolutions, and arrange displays.
- List Connected Monitors:
xrandr
This command will show you a list of connected displays and their current configurations. Look for output like
HDMI-1 connected
orDP-2 disconnected
. If your second monitor is listed but shows as “disconnected,” you can try to enable it. - Enable a Disconnected Monitor:
xrandr --output OUTPUT_NAME --auto
Replace
OUTPUT_NAME
with the name of your second monitor (e.g.,HDMI-1
). The--auto
flag tells xrandr to use the monitor’s preferred resolution and refresh rate. - Set Resolution and Position:
xrandr --output HDMI-1 --mode 1920x1080 --rate 60 --right-of LVDS-1
This command sets the monitor connected to HDMI-1 to a resolution of 1920×1080 at 60Hz and positions it to the right of the primary display (LVDS-1, which is often the laptop’s built-in screen). You’ll need to adjust these values based on your specific monitors and desired configuration.
- Example to enable and position the second monitor:
# If your displays are, for example, HDMI-0 and HDMI-1 xrandr --output HDMI-0 --primary --mode 1920x1080 --rate 60 --output HDMI-1 --mode 1920x1080 --rate 60 --right-of HDMI-0
- Make xrandr Changes Permanent:xrandr changes are usually temporary and will be lost on reboot. To make them permanent, you can add the xrandr command to your startup applications. The exact method depends on your desktop environment. For GNOME, you can add it to your
~/.xprofile
file (create it if it doesn’t exist):nano ~/.xprofile
Add your xrandr command to the file and save it. This will make it execute at login.
3.5 Check Logs
If you’re still having trouble, examine the system logs for clues:
- dmesg: Shows kernel messages, including hardware detection.
dmesg | grep -i "drm\|radeon\|nvidia\|intel"
This filters the output to show messages related to graphics drivers.
- Xorg Log: Contains information about the X server, including display detection.
less /var/log/Xorg.0.log
- Journal logs: For more recent information:
journalctl -b | grep -i "drm\|radeon\|nvidia\|intel"
Read: How to analyze Linux systemd logs using journalctl advanced filtering options
3.6 Wayland-Specific Solutions
If you’re using Wayland (Ubuntu’s default display server since 17.10), note that some troubleshooting steps differ:
- Check if you’re using Wayland:
echo $XDG_SESSION_TYPE
If it returns “wayland”, you’re using Wayland; if “x11”, you’re using Xorg.
- Wayland and NVIDIA: Until recently, Wayland had limited support for NVIDIA GPUs. For better compatibility:
- Ensure you have the latest NVIDIA drivers (470 or newer)
- Edit
/etc/environment
and add:GBM_BACKEND=nvidia-drm
- Add
nvidia-drm.modeset=1
to your kernel parameters in GRUB
- Switch to Xorg temporarily:If you’re having persistent issues with Wayland, you can switch to Xorg for testing:
- On the login screen, click the gear icon and select “Ubuntu on Xorg”
- If monitor detection works in Xorg but not Wayland, this helps narrow down the issue
- Wayland-compatible tools:Instead of
xrandr
, try using GNOME’s built-in display configuration tools or:gnome-control-center display
3.7 Hybrid Graphics Setups
Many laptops have both integrated (Intel/AMD) and discrete (NVIDIA/AMD) graphics cards. These “hybrid graphics” setups can complicate display detection:
- Identify hybrid graphics:
lspci | grep -E "VGA|3D"
If you see multiple graphics adapters listed (typically Intel + NVIDIA or AMD + AMD), you have a hybrid system.
- NVIDIA Optimus technology:For laptops with Intel + NVIDIA, use NVIDIA Prime:
# Install NVIDIA Prime sudo apt install nvidia-prime # Switch to NVIDIA graphics (requires logout) sudo prime-select nvidia # Switch to Intel graphics (requires logout) sudo prime-select intel
With recent drivers, you can also use PRIME Render Offload to use the NVIDIA GPU selectively:
# Launch an application using the NVIDIA GPU __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia application_name
- AMD hybrid graphics:For AMD hybrid systems, check if you have both “amdgpu” and “radeon” modules:
lsmod | grep -E "amdgpu|radeon"
You might need to configure DRI_PRIME for proper operation:
# Run an application on the discrete AMD GPU DRI_PRIME=1 application_name
- External display ports and hybrid graphics:In many hybrid setups, external display ports may be connected to one GPU or the other:
- HDMI/DisplayPort directly wired to NVIDIA/AMD discrete GPU
- Or connected through the integrated GPU
This can cause confusion when monitors don’t appear. Try switching between graphics modes using the tools mentioned above.
Common Pitfalls
- Faulty Cable or Adapter: Don’t underestimate the possibility of a bad cable or a faulty adapter (e.g., HDMI to DVI).
- BIOS/UEFI Settings: Some computers have BIOS/UEFI settings that can disable or configure video output ports. Check your BIOS/UEFI settings if you suspect this.
- Conflicting Drivers: Ensure that you don’t have multiple conflicting graphics drivers installed (e.g., both the NVIDIA proprietary driver and Nouveau).
- HiDPI Scaling Issues: Mismatched scaling between high-resolution and standard displays can cause visual problems. Adjust scaling in Display settings.
- Compositor Issues: Sometimes display problems can be related to the compositor. Try disabling desktop effects or switching compositor settings.
Success Indicators
How to know when you’ve solved the issue:
- Both monitors appear in the Display settings
- Your desktop extends across both screens as configured
- Windows can be moved between monitors smoothly
- The resolution and refresh rate are appropriate for each display
- No graphics artifacts or screen tearing are visible
- Settings persist after a system reboot
Quick Reference Commands
# Check graphics cards
lspci | grep -E "VGA|3D"
# Install NVIDIA driver
sudo apt install nvidia-driver-470 # Replace 470 with desired version
# Install NVIDIA settings tool
sudo apt install nvidia-settings
# Basic display detection and setup with xrandr
xrandr
xrandr --output HDMI-1 --auto
xrandr --output HDMI-1 --mode 1920x1080 --right-of eDP-1
# Check if using Wayland or Xorg
echo $XDG_SESSION_TYPE
# Toggle between integrated and discrete graphics (NVIDIA hybrid)
sudo prime-select intel # Use integrated GPU
sudo prime-select nvidia # Use discrete GPU
# View system logs for graphics issues
less /var/log/Xorg.0.log
dmesg | grep -i "drm\|nvidia\|radeon\|intel"
Troubleshooting second monitor issues can be a process of elimination. By systematically checking the hardware, drivers, and display settings, you can usually identify the cause and get your dual-monitor setup working. Remember to reboot after making significant changes, like installing drivers! A methodical approach is key to solving these kinds of problems.
If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.