In this HOWTO I will install for Fedora 23, you may need to adjust for other versions or distros. I've provided links to most sources I used so feel free to check those out for more info.
-
Make sure you have the Nvidia card enabled in BIOS
Go to BIOS -> Config -> Display, and select “NVidia Optimus”, and make sure to enable “Optimus OS Detection”.
-
Install Bumblebee and intel-virtual-output (provided by the package
intel-gpu-tools
)sudo dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora23/noarch/bumblebee-release-1.2-1.noarch.rpm sudo dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora23/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm sudo dnf install bumblebee-nvidia bbswitch-dkms primus kernel-devel sudo dnf install intel-gpu-tools
-
Copy my
xorg.conf.nvidia
file to/etc/bumblebee/xorg.conf.nvidia
sudo cp xorg.conf.nvidia /etc/bumblebee/xorg.conf.nvidia
-
Reboot to make sure the drivers and modules are correctly built and loaded
-
Test
intel-virtual-output
# Make sure your laptop is connected to dock (or directly to external monitors through DVI/DP) intel-virtual-output -f
-
If that works, go ahead and set up automation
sudo cp 81-thinkpad-dock.rules /etc/udev/rules.d/81-thinkpad-dock.rules cp docked.target ~/.local/share/systemd/user/docked.target cp intel-virtual-output.service ~/.local/share/systemd/user/intel-virtual-output.service systemctl --user enable docked.target systemctl --user enable intel-virtual-output.service
-
(Optional) if you use RedShift and want it to work on your external monitors, set this up as well
cp redshift-virtual.service ~/.local/share/systemd/user/redshift-virtual.service systemctl --user enable redshift-virtual.service
-
Undock and dock again, magic should happen and it should automatically start your monitors. When you undock it should stop the service :)
Always undock before suspending/hibernating. I've been playing around with various ways to have it stop the service before it sleeps but so far I haven't been successful. I'll update this when I have time to play with it.
I have pretty bad lag with xorg-x11-drv-intel-2.99.917-19.20151206.fc23
so I had to downgrade to version xorg-x11-drv-intel-2.99.917-16.20150729.fc23.x86_64
(I filed a bug here