Ubuntu: Ubuntu 16.04 & Nvidia - Adding external monitor stretches single display across both monitors


I'm trying to run an external monitor from my HP laptop running 16.04 via HDMI. I have a GTX965M that I'm running the nvidia-375 driver for. This lets me run two monitors but only in mirror mode. If I change to use separate monitors the resolution seems to spread across the total of the two displays and I'm unable to cancel the setting changes as I can only click on the launcher; I have to wait the 30 seconds for revert.

I followed this post from the forums to install a newer version of the drivers as it is faster than going through Software & Updates which seems to take too long.

Here is an image of my desktop after trying to add a second separate monitor:


I'm not sure whether this comes down to the drivers or the system config.

Any help is appreciated

Update: It has randomly started to work and I'm not sure why because I haven't made any changes. I just booted up and plugged in the HDMI. Also, my nvidia-settings doesn't appear correct according to the one of the suggested solutions so I'm not confident that this isn't a temperamental bug.


This shows only one monitor, the external. It doesn't include the laptop's built in. Is this correct?


Further Update: Then the next time I boot up, this time with the HDMI already plugged in it's back to stretching a single 1920x1080 across two 1080p monitors. I think I have got to the route of the problem. I opened up a terminal to get to nvidia-settings and apparently it's not installed.

This is bizarre as it 100% was installed; proven by the image I supplied in this question. I humored this problem and reinstalled and dual monitors is working again! Is this a bug?? I've added a solution myself because this did solve the problem but I don't understand how it can occur.


Press Ctrl+Alt+T to go to a terminal and type:


then you'll see something like this screen: nVidia xserver settings

From the left pane,

  • choose X Server Display Configuration
  • click the secondary screen in the dialog window
  • click Configure.
  • Enable TwinView.

If it doesn't work immediately, reboot the computer.


I had the same problem and I solved using compizconfig. In General Options â†' Display Settings disable Detect Outputs and set the outputs format.



I've got the same problem with a Dell inspiron 7567 with a 1050 gtx, drivers nvidia-375.

The only solution I found out reading your answers is that if you unplug your HDMI, logout, login, plug in the HDMI and switch to extended screen, it will display correctly instead of streching one resolution on dual screen.

It's temporary but at least we can use it.


I tried different options that are mentioned over here and none of them worked for me.

The only thing worked is: On pressing Switch Display key on the laptop, that is available on F4 in HP laptop. It may be different on other vendors.


sudo apt-get purge nvidia-*  

The above command uninstalls all previous versions, restart your pc.

sudo apt-add-repository ppa:graphics-drivers/ppa  

Above commands adds the repos

sudo apt-get update  sudo apt-cache search '^nvidia-[:digit]' --names-only  

Take the latest number and install with:

sudo apt-get install nvidia-381  

For me 381 was latest.

Posting as it might help somebody.


I've answered a similar post :) (14.04 nvidia dual display (external+laptop) stretched display, offset desktop)

This is because the built in display is connected to intel iGPU. (Source: https://devtalk.nvidia.com/default/topic/807239/nvidia-server-setting-utility-doesn-t-see-laptop-screen/)

Which basically result in Nvidia x server has no control over your built in monitor.

To solve this, switch graphic mode from MShybrid to discrete in BIOS setting, which can force the built in monitor to be driven by you discrete GPU, and x server will works correctly to recognize both build in and external display.

Does has a draw back that prime select wont work,thus theres no way to save some battery by swapping to iGPU other then reconfiguration of the BIOS... but well, prime select works poor enough (at least on my end) that i dont even bother anymore....


Keep the mirror display checked. Once the displays are synced, press Ctrl + Tab. This will pop up options and you can find one option for screen extension too. You can navigate through the options by keeping Ctrl pressed and pressing Tab to switch, just like Alt + Tab.


It a bizarre solution to the problem that I was facing but it appears that periodically nvidia-settings becomes uninstalled through no doing of my own.

When the resolution became stretched and the mouse rendered useless I shortcut opened a terminal and input nvidia-settings this informed me that it was not installed (still don't understand this).

I then reinstalled sudo apt install nvidia-settings and everything worked properly again.

If others are in the same situation I was I would definitely check this out as it is easy to fix. I fear this will be a reoccuring issue as this has happened twice before but only now do I understand what was causing it.


I had the same problem and in the end I did

sudo apt-get install compizconfig-settings-manager  ccsm  

and enabled Window Management » Grid. This allows me to use configurable keystrokes to send the windows to the corners of the large single display. Then in certain situations like browsing photos the large single display comes into its own.


Remove your nvidia-375 drivers like so:

sudo apt-get purge nvidia*  

Use legacy drivers. nvidia drivers have lots of issues it seems.

If legacy drivers are missing reinstall them like so:

sudo apt-get install xserver-xorg-video-nouveau  


I have same issue with nvidia-375. Upgrade to nvidia-384 just solve the problem.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »