My laptop comes with
lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev a1)
The laptop is able to detect DisplayPort monitors without any issue. Now I tried connecting an HDMI monitor, but it is not detected. The monitor works fine when I boot to Windows.
After googling a bit, I found this Nvidia / Wayland / Ubuntu 18.04 : Unable to find display on any available system Where it is mentioned 'Wayland does not work with nvidia'. I had the 390 drivers installed tried switching to Nouveau (reboot always) and still the same.
Then I found this External monitor not detected on Ubuntu 18.04
and followed it up with this http://www.webupd8.org/2011/07/how-to-switch-between-gdm-lightdm-or.html
so I ran
sudo dpkg-reconfigure lightdm, as gdm was not installed.
The problem wasn't solved after rebooting, although I could see a change, as the login screen now had a lower resolution. I think I was still using nouveau at this time. I then changed to nvidia 390 and this time the login screen appears in the HDMI display. After logging in, the HDMI display turns to black, the laptop display turns on and the HDMI remains undetected. If I lock the screen, the HDMI display turns on again, showing the login screen to enter the password. Also now the login screen is always sent to the HDMI monitor, even if it is not connected. So I cannot login without the monitor attached... The HDMI monitor is at tty7. tty1-6 are displayed on the laptop's screen, text mode.
Then I tried disabling Wayland by following the instructions here https://linuxconfig.org/how-to-disable-wayland-and-enable-xorg-display-server-on-ubuntu-18-04-bionic-beaver-linux but this also didn't change anything. If I change the option on the login screen from Ubuntu (Wayland) (white circle) to Ubuntu default (with the ubuntu logo), then the computer uses the HDMI screen only for login and desktop enviroment. If I logout and switch back to the option Ubuntu (Wayland), I get back the previous behaviour.
During all this time,
ERROR: Unable to find display on any available system
And I could not find a fix for this online. Although it may help, it's not necessary, as the system is able to use the HDMI monitor just fine to display the login/use selection screen.
During all this time, the 'Displays' window only showed my laptop's built-in display.
This is what I get from
xrandr, on my laptop screen, even after reconfiguring to lightdm
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192 XWAYLAND0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm 1920x1080 59.96*+
This is what I get from
xrandr, on the HDMI screen:
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384 DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm 1920x1080 60.00*+ 59.94 50.00
1680x1050 59.95 1600x900 60.00 1440x900 59.89 1400x1050 59.98 1280x1024 75.02 60.02 1280x800
59.81 1280x720 60.00 59.94 50.00 1152x864 75.00 1024x768 75.03 60.00 800x600 75.00 60.32 720x576 50.00 720x480 59.94 640x480 75.00 59.94 59.93 DP-1 disconnected (normal left inverted right x axis y axis) DP-2 disconnected (normal left inverted right x axis y axis) DP-3 disconnected (normal left inverted right x axis y axis) DP-4 disconnected (normal left inverted right x axis y axis) DP-5 disconnected (normal left inverted right x axis y axis)