My X1 Extreme shipped with a 1.09 BIOS version - with that BIOS version booting Linux is not really possible. Tried Ubuntu 18.04 and 18.10, also Pop! OS 18.04 and Pop! OS 18.10 - all got stuck during boot. Ubuntu just stopped booting with some weird ACPI errors. Pop! OS at least got a bit further, but then hang.
First, a BIOS update was necessary (also, a lot of web postings mention risk of bricking the machine when changing
thunderbolt settings or switching discrete/hybrid graphics).
Here is what I've tried:
Thankfully, the error didn't break anything. The pragmatic approach was now to use Lenovo System Update (which only runs on Windows). So, installed Windows 10, downloaded Lenovo System Update, ran it and installed all driver updates including all firmware and BIOS patches.
I have Windows on the first SSD (Windows installer created three partitions, the second holding the efi-bootloader). Linux goes to the second SSD. Given the good reviews I got from Pop! OS, I started installing Pop! OS 18.04 to test the hardware support.
According to the recommendations in the web, I first switched in the BIOS the Graphics to "Discrete Graphics" before installing.
Boot method is UEFI, then legacy. During installation, I could not select the Windows boot/efi partition as target for /boot/efi (installer complained
that the partition were too small). Had to create an own 512Mb partition for /boot/efi as first partition on the second SSD.
Installation went smoothly and graphics worked well right from the start (Pop! OS contains
fairly new nvidia drivers precompiled in their kernel).
Problem was: there was no boot menu. Managed to adjust the bootloader timeout, so that the boot menu appears. But no Windows in the boot loader and I couldn't find a way to get Pop! OS to update its boot menu.
Since Pop! OS is based on Ubuntu, I tried installing Ubuntu 18.04.2 LTS
next (actually, the latest Ubuntu release, since 18.10 is already a few weeks older). Again,
installation was done with discrete graphics selected, UEFI boot mode as default.
During the installation I chose "Something else" in the installation choice screen. Then I
created a "/" root partition and swap partition (16 GB at end of disk) on the second m.2 SSD. The first disk (with Windows)
I selected as target for the boot loader.
After the installation, everything looked nice. Actually, the nouveau drivers were
being used and still the system ran stable without any problems. GRUB-bootmenu showed Linux and Windows and I could boot both OS.
Having very fast SSDs there is no need for the fast boot feature. In Windows, I turned off Fast Boot (see instructions).
When switching in BIOS from discrete to hybrid graphics, booting Ubuntu doesn't work anylonger (system hangs during boot).
Note: to avoid hangs when something is wrong with the graphics drivers, you can press 'e' in the GRUB menu and insert `nomodeset` after the `splash` option in the linux boot line. Then press CTRL+X to boot with just Intel drivers.
During installation boot with discrete graphics enabled. Start the live-system, setup network connection and then install with propriatory drivers and updates enabled during install.
After booting the newly installed system the first time, install the propriatory nvidia drivers. Since I had problems with the nvidia-390 driver, I suggest using the most recent one.
First add the repository for updated graphics drivers:
> sudo add-apt-repository ppa:graphics-drivers/ppa > sudo apt-get updateThen, you can check which drivers match your system:
> ubuntu-drivers devicesgives on my machine:
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C8Csv000017AAsd00002267bc03sc00i00 vendor : NVIDIA Corporation model : GP107M [GeForce GTX 1050 Ti Mobile] driver : nvidia-driver-410 - third-party free driver : nvidia-driver-418 - third-party free recommended driver : nvidia-driver-396 - third-party free driver : nvidia-driver-415 - third-party free driver : nvidia-driver-390 - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
I installed the recommended driver:
> sudo apt install nvidia-driver-418
UPDATE: just installed the new version 430 of the driver - works perfectly so far.
Now I could boot Linux with either discrete or hybrid graphics in the BIOS settings. You can test if the driver is working correctly with:
> sudo nvidia-smiwhich gives
Fri Mar 29 17:50:53 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 105... Off | 00000000:01:00.0 On | N/A | | N/A 47C P8 N/A / N/A | 673MiB / 4040MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 3302 G /usr/lib/xorg/Xorg 257MiB | | 0 3445 G /usr/bin/gnome-shell 272MiB | | 0 3649 G /usr/bin/nextcloud 11MiB | | 0 16306 G krusader 1MiB | | 0 21161 G ...quest-channel-token=6673354144912086020 48MiB | | 0 24101 G ...-token=E7C04B3E75389DAC2ACA4279685CC90F 78MiB | +-----------------------------------------------------------------------------+
On Windows the hybrid graphics/Optimus feature causes the desktop to use only intel graphics and thus get really long battery time.
On Linux, the desktop is using the NVidia card by default. When "hybrid graphics" in enabled in the BIOS, you can switch between intel and nvidia mode with the following commands:
> sudo prime-select inteland back to NVidia with
> sudo prime-select nvidiaCurrent setting can be queried with
> sudo prime-select query
The change will get in effect after logout/login or sometimes after a reboot.
Note: I had trouble to use the HDMI port to connect an external screen, even when I rebooted after selecting nvidia PRIME drivers (when using GDM3 login manager). The only reliable way was to use> sudo nvidia-settingsand switch between intel and NVidia drivers using the dialog. After logging out and logging back in (when switching from intel to NVidia) the HDMI port worked and the screen config could be changed with GNOME settings and the Special+P shortcut.
To avoid the problems mentioned above for gdm, you can install another display manager, for example lightdm.
> sudo apt install lightdm
After the installation you can select the login manager to use. Later, you can switch between login managers with:
> sudo dpkg-reconfigure gdm3or
> sudo dpkg-reconfigure lightdm.
With lightdm you can now quickly switch between intel and nvidia with the
> sudo prime-select <intel|nvidia>command line.
Even more convenient is the use of the gnome extension Argos switcher (see below).
The power utility tlp
can be configured to start and stop charging at given percentages. If charge the battery
to full every time, especially when working on a docking station, this may reduce battery life significantly. If instead you stop charging at, say 80%,
the battery capacity will remain high for a longer time. If this is the case with the X1 Extreme battery, I can't really tell already now. But
since the battery is built-in and takes some more effort to change, it is probably worth the effort.
Follow the steps on https://linrunner.de/tlp to install the tool, which comes down to:
> sudo add-apt-repository ppa:linrunner/tlp > sudo apt install tlp acpi-call-dkms
Note: The acpi-call-dkms
package is needed for ThinkPad notebooks.
Next you need to configure the charge thresholds, for that edit the config file:
> sudo nano /etc/tlp.d/00-template.confand add two lines:
# 00-template.conf - Template for TLP drop-in customizations # See full explanation: https://linrunner.de/en/tlp/docs/tlp-configuration.html # # PARAM="value" START_CHARGE_THRESH_BAT0=75 STOP_CHARGE_THRESH_BAT0=80
Save the file and restart tlp
with
> sudo tlp start. If you now run the command
> sudo tlp-stat -s -byou should see:
--- TLP 1.3.1 -------------------------------------------- +++ System Info System = LENOVO ThinkPad X1 Extreme 20MGS0EQ00 BIOS = N2EET43W (1.25 ) Release = Ubuntu 18.04.4 LTS Kernel = 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 /proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-5.4.0-42-generic root=UUID=24d3b7f3-2f2e-4518-8fe4-bbbb9e812d42 ro quiet splash vt.handoff=1 Init system = systemd v237 Boot mode = UEFI +++ TLP Status State = enabled RDW state = enabled Last run = 10:07:37, 104 sec(s) ago Mode = AC Power source = AC +++ Battery Features: Charge Thresholds and Recalibrate natacpi = active (data, thresholds) tpacpi-bat = active (recalibrate) tp-smapi = inactive (ThinkPad not supported) +++ ThinkPad Battery Status: BAT0 (Main / Internal) /sys/class/power_supply/BAT0/manufacturer = Celxpert /sys/class/power_supply/BAT0/model_name = 01AY969 /sys/class/power_supply/BAT0/cycle_count = 173 /sys/class/power_supply/BAT0/energy_full_design = 80400 [mWh] /sys/class/power_supply/BAT0/energy_full = 68140 [mWh] /sys/class/power_supply/BAT0/energy_now = 54190 [mWh] /sys/class/power_supply/BAT0/power_now = 0 [mW] /sys/class/power_supply/BAT0/status = Unknown (threshold may prevent charging) /sys/class/power_supply/BAT0/charge_start_threshold = 75 [%] /sys/class/power_supply/BAT0/charge_stop_threshold = 80 [%] tpacpi-bat.BAT0.forceDischarge = 0 Charge = 79.5 [%] Capacity = 84.8 [%]
The output shows nicely, how the charge threshold works. If you want to charge the battery to full, for example when you are about to embark to a longer journey into the wild without sockets, you simply run:
> sudo tlp fullchargeand the battery will be charged to full.
To change what happens when battery is low and when this should happen, you need the gnome config editor. Install with:
> sudo apt install dconf-editor
Then run the dconf utility and navigate to: org -> gnome -> settings-daemon -> plugins -> power
. There, you can modify the entries:
The built-in hardware of the X1 Extreme works otherwise as expected (except the fingerprint sensor). Other stuff needed a bit more work:
The control software Solaar needs to be downloaded (Ubuntu package is broken). Download from https://pwr.github.io/Solaar, extract and run setup.py with sudo.
For productivity, you need the gnome extensions. First the shell extensions:
sudo apt-get install chrome-gnome-shell
Then open Firefox, navigate to https://extensions.gnome.org and install the browser extension. You also need the following packages:
> sudo apt-get install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 gir1.2-clutter-1.0
I use the following extensions:
For the extension system-monitor a few things need to be done, first. To get the temperature display to work, you need the lm-sensors package:
> sudo apt install lm-sensorsInitialize with
> sudo sensors-detectand test:
> sensorsAfterwards you can install the extension, which will, however, show 'NaN' for temperatures. This is fixed in the development version, so you need to get the most recent source from https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet and install manually (download, extract, run make install in toplevel dir).
Einstellungen->Geräte->Tastatur: - "Fenster wechseln" -> Tastenkombi "Alt+Tab" einstellen (und damit Tastenkombination für "Anwendung wechseln" ersetzen)
Here are a few notes on the software that I use (mostly for myself).
> sudo apt install gdebi p7zip-full htop okularNote: gdebi is a more complete deb-package installer (handles dependencies more robustly).
> sudo add-apt-repository ppa:nextcloud-devs/client > sudo apt install nextcloud-client
> wget -O atom-amd64.deb https://atom.io/download/deb > sudo gdebi atom-amd64.debData migration: copy the
~/.atom
directory
Data migration: copy the ~/.thunderbird
directory and copy ~/.gnupg
for all the pgp/SMIME keys.
First tex and helper tools:
> sudo apt install texlive-full jabref texmaker
Lyx is not taken from official repo, but instead downloaded here: https://wiki.lyx.org/LyX/LyXOnUbuntu.
> sudo add-apt-repository ppa:lyx-devel/release >sudo apt install lyx
There is a nasty problem with imagemagick that results in two distinct errors in Lyx and pdflatex: when inserting a pdf image into a Lyx document, you get the error that it cannot show the pdf. When you build the Lyx file via pdflatex, you get a pdftex error. Both are related to a security measure introduced in imagemagick.
To fix this, you need to edit the file
/etc/ImageMagick-6/policy.xmlso that the following lines are commented out:
<!-- disable ghostscript format types --> <!-- <policy domain="coder" rights="none" pattern="PS" /> --> <!-- <policy domain="coder" rights="read | write" pattern="EPS" /> --> <!-- <policy domain="coder" rights="read | write" pattern="PDF" /> --> <policy domain="coder" rights="none" pattern="XPS" /> <!-- <policy domain="coder" rights="read | write" pattern="LABEL" /> -->
/path/to/AsciidocFX/AsciidocFX.pngand create desktop file with content:
[Desktop Entry] Name=AsciidocFX Exec=/path/to/AsciidocFX/AsciidocFX Icon=/path/to/AsciidocFX/AsciidocFX.png Shell=true Terminal=false Type=Application Categories=Office;WordProcessor;Publishing; StartupNotify=truesave at
~/.local/share/applications/AsciidocFX.desktopand change permissions to +x.
> sudo apt install gimp inkscapeThe screenshot-tool shutter is installed via package-repository:
> sudo add-apt-repository ppa:shutter/ppa > sudo apt update && sudo apt install shutter
Opera, download deb from https://www.opera.com/de/download and install.
I use krusader:
> sudo apt install krusader keepassx kompare \ kio-extras kwalletmanager
Start Krusader and run initial config (note: icons are missing).
Install icon theme:
> sudo apt install breeze-icon-theme-rccCopy icon file:
> cp /usr/share/icons/breeze/breeze-icons.rcc ~/.local/share/krusader/icontheme.rcc
Restart Krusader, and icons are in place.
Settings:
Allgemein -> Terminal:
> gnome-terminal --working-directory %d --name %tAllgemein -> Betrachter/Editor:
> /usr/bin/geditBenutzeraktionen -> Terminal für Benutzeraktionen:
> gnome-terminal --working-directory %d --name %t -eDesktop Icon, create file
~/.local/share/applications/krusader.desktop
with content:
[Desktop Entry] Name=Krusader GenericName=File Manager Exec=krusader Icon=krusader_user Terminal=false Type=Application Categories=Qt;Utility;
> sudo apt install qt5-default cmake subversion git \ meld kompare libqt5svg5 libqt5svg5-dev libqt5serialport5 libqt5serialport5-dev
Open source version of Qt5 from https://www.qt.io/download-qt-installer
For SmartSVN 9.1 you need the following fix:
Note: Edit smartsvn.sh. There you will find a line nearly at the bottomexport LD_LIBRARY_PATH=${_SUBVERSION_LIBRARY_PATH}:${LD_LIBRARY_PATH}Please uncomment this line by adding a leading #.
After starting SmartSVN, edit preferences and in Authentication -> SSH section select "Use system SSH" so that you can use your ssh-agent keys.
> sudo apt install python3 python3-pyqt5Download WingIDE personal from https://wingware.com/downloads/wing-personal.