Skip to content

Instantly share code, notes, and snippets.

@Hs293Go
Last active May 24, 2020 05:44
Show Gist options
  • Save Hs293Go/77780bd8407773796c5392eb24f6cf1c to your computer and use it in GitHub Desktop.
Save Hs293Go/77780bd8407773796c5392eb24f6cf1c to your computer and use it in GitHub Desktop.
Installing Ubuntu 18.04 on XPS 15 9570

Installing Ubuntu 18.04 on XPS 15 9570

The XPS 15 is a popular high performance laptop that is quite suitable as a developer laptop. Its Nvidia graphics card even lets it handle some basic machine learning tasks.

Some developers may be tempted to install a Linux-based OS on their XPS 15. However, there are a few steps that must be done for the machine to function properly. This documents collects a few tips and fixes from Stack Overflow, Dell forums, and blog posts and links to the source of the ideas will be provided.

Preliminaries

How to create a Ubuntu bootable USB

Either balenaEtcher or Win32DiskImager can be used. I prefer BalenaEtcher since the same software with an identical interface is available in Linux too.

  1. Go to the Ubuntu 18.04 image download page and download the 64-bit PC (AMD64) desktop image
  2. Go to the balenaEtcher page and download the portable balenaEtcher executable (or the installer)
  3. Run balenaEtcher, click on Flash from file and select the Ubuntu OS image downloaded in step 2
  4. Insert a properly formatted and empty USB stick into the computer; in balenaEtcher, click on Select Target and select the USB stick
  5. Flash!

Tap which functional key at boot?

When booting up the XPS 15, at the Dell logo:

  1. Tap F8 to boot into recovery mode
  2. Tap F12 to access a one-time boot menu
  3. Tap F2 to access BIOS setup

It takes some finesse to hit the key at the right time. Keep trying!

Dual boot or not?

Most XPS 15 should have generous hard-disk space to support dual booting Windows and Linux.

Reference: Does XPS 15 touch support 2 hard drives

Placing different OS'es on separate hard drives often gives greater peace of mind. The XPS 15 has one mSATA slot and one 2.5" SSD bay, but the latter is blocked by the large 9.1 WHr battery if the computer is so configured. It is feasible to swap out the 9.1WHr battery for a smaller 6.1WHr battery, albeit not encouraged. This way the 2.5" SSD Bay is exposed for another drive.

Disaster recovery

Two options are invaluable to recover from a hang / black screen, or just about any kind of unforseen event

  1. Gracefully reboot by holding Alt + PrtScr, then press R, E, I, S, U, B one by one
  2. Boot into recovery mode, then choose advanced options for ubuntu to enter the recovery menu. Next, choose Drop to root shell prompt. Inside the root shell prompt, enter mount -o remount,rw / to enable read/writing files. If any edits to /etc/default/grub mentioned below was missed, it can be done here

Step 1: Enable AHCI mode and disabling Safe Boot

Reference: docs.microsoft.com disabling-secure-boot

Reference with images: Dell XPS 15 (9570) Dual-Booting Windows 10 and Ubuntu 18

  1. Reboot the XPS 15 and access BIOS setup
  2. Choose option Troubleshoot, then choose option Advanced Options: UEFI Firmware Settings.
  3. Expand the Secure Boot dropdown menu, go to the Secure Boot Enabled page and uncheck the checkbox
  4. Expand the System Configuration dropdown menu, go to the SATA Operation page and select AHCI option
  5. Save changes and reboot

Step 2: Installing Ubuntu

Reference: Personal experience of installing Ubuntu 18.04 LTS on XPS 15 9570

  1. Reboot the XPS 15 and access the one-time boot menu.
  2. Select Ubuntu then press ENTER.
  3. Wait for the "GNU GRUB" bootloader screen. At this screen, select Ubuntu and press E. DO NOT PRESS ENTER.
  4. In the editor, find the line quiet splash and append nomodeset to the line. This temporarily disables the noveau display drivers that does not play well with the Nvidia graphics card.
  5. Press F10 to resume booting.

Step 3: Configure display drivers for Nvidia

At this point, Ubuntu will install itself after presenting some localization and personalization options. Next, the noveau drivers must be disabled permanently.

  1. Open a terminal by pressing Ctrl-Alt-T and enter sudo nano /etc/default/grub
  2. Find the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" and edit such that the line is like
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noveau.modeset=0"
  1. Press Ctrl-X to exit, press Y to save changes
  2. Enter sudo update-grub

It is reported that nouveau.blacklist=1 also works in place of noveau.modeset=0 but the author only tested the latter.

Finally, the proper nvidia drivers must be installed. The graphics card for the XPS 15 is GeForce GTX 1050 Ti.

  1. Open a terminal by pressing Ctrl-Alt-T and enter sudo add-apt-repository ppa:graphics-drivers/ppa
  2. Enter sudo apt-get update
  3. Open Software & Updates
  4. Go to the Additional Drivers tab.
  5. Select the line Using NVIDIA driver metapackage from nvidia-driver-435 (proprietary).
  6. Select Apply Changes and reboot.

So far I have only used driver 435 and 384. My unfortunate experience is that no driver labelled (open-source) works.

To switch between the integrated Intel and Nvidia Graphics card, use either sudo prime-select intel or sudo prime-select nvidia

Known Issues after installation

Brightness Keys not Working

Reference: xps-15-9570 with Ubuntu 18.04.02 LTS problem with hotkeys F11 and F12 for brightness

The F10 / F11 brightness keys usually do not work right away after installing Ubuntu. Fix this by the following steps.

  1. Open a terminal by pressing Ctrl-Alt-T and enter sudo nano /etc/default/grub
  2. Find the line GRUB_CMDLINE_LINUX="" and add/append the option acpi_osi within the quotes as shown below
GRUB_CMDLINE_LINUX="acpi_osi"
  1. Press Ctrl-X to exit, press Y to save changes
  2. Enter sudo update-grub

Do not add acpi_backlight=vendor to either GRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX. When this is enabled, pressing the brightness keys merely brings up the brightness bar indicator but does not change the actual brightness.

Computer does not wake up from suspend

Reference: Ubuntu 18.04 - Dell XPS15 9570 - Impossible to reliably suspend/hibernate

The XPS may hang upon attempting to wake up from suspend. Fix this by the following steps.

  1. Open a terminal by pressing Ctrl-Alt-T and enter sudo nano /etc/default/grub
  2. Find the line GRUB_CMDLINE_LINUX="" and add/append the option mem_sleep_default=deep within the quotes as shown below
GRUB_CMDLINE_LINUX="mem_sleep_default=deep"
  1. Press Ctrl-X to exit, press Y to save changes
  2. Enter sudo update-grub

I had to implement both these fixes and my /etc/default/grub containes the following lines

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noveau.modeset=0"
GRUB_CMDLINE_LINUX="acpi_osi mem_sleep_default=deep"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment