# Dell Inspiron 7559 Ubuntu Linux Guide

Last updated **10 July 2018**

This guide will show you how to install and configure an **Ubuntu Linux 16.04/18.04 LTS** distribution (Ubuntu, Lubuntu, Xubuntu, Kubuntu, Ubuntu Gnome, Ubuntu MATE) on the Dell Inspiron 7559 laptop.

Do not try to upgrade from **Ubuntu 16.04 LTS** to **18.04 LTS now**. This might crash your OS (Crashed mine! Had to do a fresh install of Ubuntu 18.04 LTS.). Upgrade from 16.04 LTS to 18.04 LTS will be enabled [late july](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes#Upgrading_from_Ubuntu_16.04_LTS).

&#x20;**DISCLAIMER** This document just details the processes that I discovered through hours of trial and error to get a stable Ubuntu distribution working on my laptop. *I'm not liable for any damage or adverse effects that this has on your system.* Always back up your important data before doing any major work to your computer.

## &#x20;[Table of Contents](https://notes.leetdev.net/ubuntu/broken-reference)

1. &#x20;[Reading this Guide](https://notes.leetdev.net/ubuntu/broken-reference)
2. &#x20;[Pre-requisites](https://notes.leetdev.net/ubuntu/broken-reference)
3. &#x20;[Installation](https://notes.leetdev.net/ubuntu/broken-reference)
4. &#x20;[Initial Setup](https://notes.leetdev.net/ubuntu/broken-reference)
5. &#x20;[Installing the Nvidia Driver](https://notes.leetdev.net/ubuntu/broken-reference)
6. &#x20;[Update Linux kernel to 4.8.5.](https://notes.leetdev.net/ubuntu/broken-reference)
7. &#x20;[Installing Bumblebee](https://notes.leetdev.net/ubuntu/broken-reference)
8. &#x20;[Installing Power-Management Utilities](https://notes.leetdev.net/ubuntu/broken-reference)
9. &#x20;[Running Games and Applications with the Right GPU](https://notes.leetdev.net/ubuntu/broken-reference)
10. &#x20;[(Optional) Installing the Intel Driver and Firmware](https://notes.leetdev.net/ubuntu/broken-reference)
11. &#x20;[Known Issues](https://notes.leetdev.net/ubuntu/broken-reference)

## &#x20;[Reading this Guide](https://notes.leetdev.net/ubuntu/broken-reference)

While it might seem straightforward, I just want to make sure this document's structure is absolutely clear.

Text within blue boxes indicates instructions intended only for **Ubuntu Linux 18.04 LTS**. The sections that were **not** tested with **Ubuntu Linux 18.04 LTS** will be explicitly stated.

Text within green boxes usually contains clarifying information and could be helpful if you're curious as to why something is the way it is.

Text within a red box like this should never be ignored as it usually contains warning information.

Text in a black box like this usually represents something typed into a terminal or a text file!

`sudo apt update`

&#x20;Text like this usually represents something you need to select, click, or a program name to use. Something that you interact with or may see in a text file or interface.

## &#x20;[Pre-requisites](https://notes.leetdev.net/ubuntu/broken-reference)

* Some experience installing an Ubuntu distribution
* Installation media for said Ubuntu distribution
* A Dell Inspiron 7559 laptop (duh)

## &#x20;[Installation](https://notes.leetdev.net/ubuntu/broken-reference)

1. Make sure Secure Boot is disabled from the BIOS.
2. If you intend to dual boot with Windows, make sure Window's Fast Boot is disabled.

   I updated my BIOS to v1.1.8, but I don't think it is required for all of this to work as I had a successful setup following these procedures prior to doing so.
3. Boot from your installation media.
4. Highlight the Install Ubuntu entry and press e on your keyboard.
5. Modify the line that contains quiet splash at the end and change it to:
6. &#x20;
7. `nomodeset i915_bpo.nomodeset=1 quiet splash`
8. Press F10 to boot.
9. Proceed with the installation as normal.
10. Reboot.

## &#x20;[Initial Setup](https://notes.leetdev.net/ubuntu/broken-reference)

1. Follow [Installation steps 4-6](https://notes.leetdev.net/ubuntu/broken-reference) to boot into the operating system.
2. Connect to a network.
3. If you didn't do this during the install, update your system.
4. &#x20;
5. `sudo apt update`
6. <br>
7. &#x20;`sudo apt upgrade`

## &#x20;[Installing the Nvidia Driver](https://notes.leetdev.net/ubuntu/broken-reference)

1. Add the proprietary graphics drivers repository.
2. &#x20;
3. `sudo add-apt-repository ppa:graphics-drivers/ppa`
4. <br>
5. &#x20;`sudo apt update`
6. Install your chosen Nvidia driver.
7. &#x20;
8. `sudo apt install nvidia-367`
9. Open the GRUB configuration file: /etc/default/grub.
10. &#x20;
11. `sudo vi /etc/default/grub`
12. Change the line that reads GRUB\_CMDLINE\_LINUX="" to
13. &#x20;
14. `GRUB_CMDLINE_LINUX=`
15. `"`
16. `acpi_backlight=native acpi_osi=`
17. `"`
18. Save your changes and close the file.
19. Apply the changes to GRUB. Doing this means that we no longer have to manually add kernel boot parameters to boot like we did earlier in the guide.
20. &#x20;
21. `sudo update-grub`
22. Switch to the Intel GPU to save power.
23. &#x20;
24. `sudo prime-select intel`
25. Reboot.

## &#x20;[Update to Linux kernel 4.8.5 for better GTX 900 & Optimus support](https://notes.leetdev.net/ubuntu/broken-reference)

**Did not** test this section with **18.04 LTS** installation.

1. Make a directory to download the kernel files to, make sure it's empty then cd into it.
2. Download the [Ubuntu mainline Linux kernel 4.8.5.](http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/) You need the header files for amd64, all, and the image files for amd64.
3. &#x20;
4. `wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805_4.8.5-040805.201610280434_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-image-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb`
5. Install the new kernel.
6. &#x20;
7. `sudo dpkg -i *.deb`
8. Reboot.

## &#x20;[Installing Bumblebee](https://notes.leetdev.net/ubuntu/broken-reference)

**Did not** test this section with **18.04 LTS** installation.

Bumblebee is a program that allows "on-the-fly" GPU switching similar to what Nvidia Optimus does on Windows. Unfortunately, Nvidia doesn't exactly support this on Linux. Without Bumblebee, we can only switch GPUs and then log out/back in to change it. This results in us using the power-hungry Nvidia GPU for *all applications* rather than just the game or program we need it for. And like I said, if we want to change, we have to initiate the change and then log out and back in. Annoying!

Bumblebee provides the convenience of switching the GPU for us just for the given application and then powers down the beefy GPU when we're not using it. Oh, and we don't have to log out then back in. Awesome, right?

1. Add the Bumblebee Testing repository.
2. &#x20;
3. `sudo add-apt-repository ppa:bumblebee/testing`
4. <br>
5. &#x20;`sudo apt update`
6. Install bumblebee.
7. &#x20;
8. `sudo apt install bumblebee`
9. Open Bumblebee's configuration file ( /etc/bumblebee/bumblebee.conf) in your preferred text editor.
10. &#x20;
11. `sudo vim /etc/bumblebee/bumblebee.conf`
12. Edit the line in the \[bumblebeed] section that looks like Driver= and change it to:
13. &#x20;
14. `Driver=nvidia`
15. Change every occurence of the word nvidia-current in this file to the Nvidia driver you selected. In my case, it's nvidia-367.

    If you're using vi or vim, you can just type :%s/nvidia-current/nvidia-367/g and hit enter to change all occurences of nvidia-current with nvidia-367.
16. Edit the line in the \[driver-nvidia] section to say:
17. &#x20;
18. `PMMethod=bbswitch`
19. Save your changes and close the file.
20. Open /etc/modprobe.d/bumblebee.conf in your favorite text editor.
21. Append blacklist entries to match the Nvidia driver you installed to the bottom of this file.
22. &#x20;
23. `blacklist nvidia-367`
24. <br>
25. &#x20;`blacklist nvidia-367-updates`
26. <br>
27. &#x20;`blacklist nvidia-experimental-367`
28. Reboot
29. Verify you can use Bumblebee.
30. &#x20;
31. `optirun glxinfo | egrep -i`&#x20;
32. `'`
33. `nvidia|gtx`
34. `'`
35. &#x20;
36. `connor@connor-Inspiron-7559:~$ optirun glxinfo | egrep -i`&#x20;
37. `'`
38. `nvidia|gtx`
39. `'`
40. <br>
41. &#x20;`server glx vendor string: NVIDIA Corporation`
42. <br>
43. &#x20;`OpenGL vendor string: NVIDIA Corporation`
44. <br>
45. &#x20;`OpenGL renderer string: GeForce GTX 960M/PCIe/SSE2`
46. <br>
47. &#x20;`OpenGL core profile version string: 4.5.0 NVIDIA 367.57`
48. <br>
49. &#x20;`OpenGL core profile shading language version string: 4.50 NVIDIA`
50. <br>
51. &#x20;`OpenGL version string: 4.5.0 NVIDIA 367.57`
52. <br>
53. &#x20;`OpenGL shading language version string: 4.50 NVIDIA`
54. <br>
55. Verify that the discrete card is now off since we aren't actively running a program with optirun.
56. &#x20;
57. `cat /proc/acpi/bbswitch`
58. &#x20;
59. `0000:02:00.0 OFF`
60. &#x20;**OPTIONAL** Download and install the [VirtualGL tools](https://sourceforge.net/projects/virtualgl/files/2.5.1/virtualgl_2.5.1_amd64.deb/download) to benchmark your system and make sure optirun uses the correct video card. I like using glxspheres64

## &#x20;[Installing Power-Management Utilities](https://notes.leetdev.net/ubuntu/broken-reference)

Battery life isn't too bad when your brightness is a bit lower. I usually install TLP to squeeze some more time out of my Linux battery life. After you install it and verify that it's running, it's pretty hands-off from there and it'll take care of itself from then on.

You won't have the same amount of time on battery as a Macbook does, but depending on the screen brightness, I can usually make it a full day on campus with my laptop doing web browsing, word processing, or programming.

1. Install tlp and tlp-row.
2. &#x20;
3. `sudo apt install tlp tlp-rdw`
4. Make sure TLP is running in battery mode.
5. &#x20;
6. `sudo tlp bat`

## &#x20;[Running games and applications with the proper GPU](https://notes.leetdev.net/ubuntu/broken-reference)

**Did not** test this section with **18.04 LTS** installation.

&#x20;**Running Steam games**

1. Right click on the game in your Steam library and click Properties.
2. Click Set Launch Options.
3. Enter primusrun %command%.

   If you already have launch options in this box, make sure that you put primusrun at the very beginning and put %command% at the very end and everything should work fine.
4. Play your game normally by launching it through the Steam client!

&#x20;**Running applications from the command line**

Prefix the command with optirun. We did this earlier when we ran glxinfo.

Example:

`optirun firefox`

&#x20;**Running Wine games**

Similar to running command line programs, you can just do:

`optirun wine gamenamehere`

## &#x20;[(Optional) Installing the Intel Graphics Driver and Firmware](https://notes.leetdev.net/ubuntu/broken-reference)

**Did not** test this section with **18.04 LTS** installation.

This step is optional just because I followed it to quiet down some "warnings" given saying that some i915 firmware is missing or whatever. It only fixes one or two of the warnings but the other one remains even after installing it. I haven't investigated this too much to see if there's an actual benefit, but as far as I know, you won't harm anything by skipping this.

1. Download the [Intel Graphics Driver Installer](https://01.org/linuxgraphics/downloads/intel-graphics-installer-linux-1.4.0).
2. Install the .deb we just downloaded.
3. &#x20;
4. `sudo dpkg -i`
5. `.deb`
6. Run the Intel Graphics Installer for Linux program (you may need to open your dash/search for the application, it has a GUI).
7. Reboot.
8. Download the [**Skylake** DMC and GuC graphics firmwares](https://01.org/linuxgraphics/intel-linux-graphics-firmwares) from Intel.
9. Extract the contents of the archives.
10. &#x20;
11. `tar -xf name_of_downloaded_file_here`
12. Go into the extracted folders one at a time and install the firmwares.
13. &#x20;
14. `sudo bash ./install.sh --install`
15. Reboot

## &#x20;[Known Issues](https://notes.leetdev.net/ubuntu/broken-reference)

&#x20;**The Brightness Function keys don't work**

As already mentioned above, **acpi\_backlight=vendor** setting in GRUB works well with **18.04 LTS** installation and hence the brightness function keys do work.

(Possible fix!) Changing the GRUB configuration from acpi\_backlight=native to acpi\_backlight=vendor may fix this issue. A kind visitor to the guide mentioned that \*buntu 16.10, the latest kernel, and those GRUB settings restored brightness function key functionality.

I suspect this has something to do with some weird quirk of the ACPI controls after installing the Nvidia driver. The workaround is described in [the Nvidia driver setup section](https://notes.leetdev.net/ubuntu/broken-reference) where we modify Grub's boot parameters. This does not regain use of the function keys, but it does allow for controlling the brightness via settings, brightness applet, or some other brightness controller application.

&#x20;**Bumblebee service status says it failed to load module "mouse"**

&#x20;Not entirely sure what this means, but it hasn't really interfered with anything.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.leetdev.net/ubuntu/untitled-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
