I found a way.
I went to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers and deleted subkeys that had DELA in them. These are apparently the keys windows uses to decide what display settings to use when the display configuration changes. Deleting them caused windows to forget the settings and when I plugged the external monitor in it reverted back to mirroring both monitors at a lower resolution that worked.
Special thanks to sysinternals process monitor tool which I spent a while using to see which registry keys were read and written when I plugged in and unplugged my monitor.
Yay!
Well, I did not found the solution to always be on the nvidia GPU. But after some research I find a good way to jump between the two, using bumblebee which is the recommended package to efficiently manage multiple gpus.
I did the following on a fresh install :
echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nvidia-nouveau.conf
echo "options nouveau modeset=0" >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf
sudo systemctl set-default multi-user.target
Reboot (sudo systemctl reboot
), you should so be in cli and not in gui mode.
This is the moment where you install specific nvidia-driver and bumblebee which will manage the two graphic cards :
sudo apt install bumblebee-nvidia nvidia-driver-libs-nonglvnd nvidia-driver bumblebee primus
sudo systemctl set-default graphical.target
sudo systemctl reboot
You should be in graphical mode then.
Not sure if the nouveau blacklisting is necessary but it seems to work fine this way...
Also, on a Dell laptop, you can frequently have problems with the fans which are rotating way too fast even if the laptop is doing nothing (which can give you the impression that nothing is working fine). This is an other problem for whoch you can maybe find help using google.
Personnally, I have not been able to find a ogod fan configuration yet on my vostro 7590...
Best Answer
Nvidia Inspector can export and import Nvidia profile settings. Start "profile inspector" by clicking the icon on the right side, on the middle:
Select "export user defined profiles" (import option is next on the right), "export all customized profiles" option exports per-program settings:
Close Nvidia Control Panel before importing, if running.