How to install Ubuntu on a Dell XPS 15 model from 2019?
This page will explain how to fix a number of issues with the latest Ubuntu 19.04 running on said laptop. Older Ubuntu versions will not work. Problems addressed are:
- CPU power management
- Changing brightness of OLED screen with brightness keys
- Enabling hardware acceleration for video decoding in Chrome
The most recent version of Dell notebooks only works with the latest Ubuntu version. Only Ubuntu 19.04 or later can be successfully run on these machines. While it is possible to install Ubuntu 18.04 LTS, the power management for the latest CPU generation does not work leading to very high power consumption and a CPUpermanently at the thermal limit.
To install Ubuntu on a Dell XPS 15 you need to set your Sata Operation in the laptops BIOS from Raid to AHCI. Plugin a USB stick with the image of the latest Ubuntu and install from the stick.
It is recommended to also install 3rd party software for which one needs to connect the laptop to the internet. Note: The internal wifi card does not work during the installation process. To connect to the internet an external WiFi adapter or some other network connection is required.
After the installation is complete, run
sudo apt update
sudo apt dist-upgrade -y
to update the system to the latest versions.
Without further configuration the CPU will run quite hot and will quickly drain the battery. Install powertop
and thermald
to fix this.
sudo apt install -y powertop thermald
You can start powertop with sudo powertop
, navigate to the Tunables section and switch all Bad points to Good. Probably not all of them have a big effect, I have not tried, but the processor related points are absolutely required. However, these changes are not permanent and will be reset at reboot. Instead let us create a service that will change these settings at boot time.
The script and setup are taken from here.
First, create a service with
cat << EOF | sudo tee /etc/systemd/system/powertop.service
[Unit]
Description=PowerTOP auto tune
[Service]
Type=idle
Environment="TERM=dumb"
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
EOF
and then enable this service to run at boot time with
sudo systemctl daemon-reload
sudo systemctl enable powertop.service
Voila, this should give you a laptop using around 7 W of power in idle (with a black screen).
Note: I also tried running with the energy management tool TLP but found it ineffective.
When pressing the function keys to change the screen brightness, you will see the Ubuntu brightness icon and its brightness bar changing. However, the brightness of the screen will not change. Apparently, Ubuntu tries to change the background brightness of the screen. Since OLED screens do not have a background illumination, nothing happens.
This is undesirable. Not only will the screen often be too bright, it will also age the display faster. It is possible to change the brightness of the screen from the command line via
xrandr --output eDP-1 --brightness 0.6
to 60 % in this case. The output display eDP-1
might change, if you should use the Nvidia instead of the Intel graphics card. Careful: 0 is black and black on OLED displays is really all black.
The function keys can be mapped to use this command to change the brightness. (Source for Lenovo Thinkpad)
We first create two files that are triggered by the button presses. You need to create a file /etc/acpi/events/dell-brightness-up
with the content
event=video/brightnessup BRTUP 00000086 00000000
action=/etc/acpi/dell-brightness.sh up
and a file /etc/acpi/events/dell-brightness-down
with the content
event=video/brightnessdown BRTDN 00000087 00000000
action=/etc/acpi/dell-brightness.sh down
Finally, we need a script executing the required xrandr
command. Copy this script to /etc/acpi/dell-brightness.sh
and grand it execution rights with sudo chmod u+x /etc/acpi/dell-brightness.sh
.
After all scripts have been added reload the acpi daemon so that they can have an effect, sudo acpid reload
. If the behavior is unexpected, a machine reboot may help.
Note that OLED displays only consume energy and age when the individual pixels are emitting light. Hence, it is advisable to choose dark background colors and install a dark scheme in your browser.
To be able to watch Youtube and other videos from a browser without draining the battery very quickly hardware acceleration for video decoding is required. Unfortunately, neither Googles Chrome(ium) nor Firefox offer hardware acceleration for Linux. There is a private Chromium package on offer that has hardware acceleration enabled, though. Beware that adding private package repositories introduces a security risk and that the following Chromium is based on the less stable beta version. Use at own risk.
Add the private repository and install Chromium via:
sudo add-apt-repository ppa:saiarcot895/chromium-beta
sudo apt update
sudo apt install chromium-browser
For more details and instructions on possibly required driver updates see here.