Making Ubuntu 18.04 work on MSI GS65 8RE

Carlos Rodriguez
6 min readApr 25, 2019

--

After a lot of headaches with this laptop, I finally have what I consider the perfect setup. I use my laptop with dual boot, Windows 10 for gaming and Ubuntu 18.04 for work (web development and general usage). In the past I tried to make ubuntu 18.04 work but failed to do so, even tried other distros, including Arch Linux and openSuse. None worked, either had problems with Nvidia, wifi didn’t work, thunderbolt port, etc.

This is how I made it work with Ubuntu 18.04, every single thing works, I use an external monitor through thunderbolt (USB-C => HDMI) without using the nvidia card, got wireless headphones (Steelseries Arctis 7, works perfectly after some configurations), Skype and discord detects my devices, I can suspend my laptop, everything seems to work. This is the specific setup that worked for my laptop model, but the same should work with any laptop with nvidia optimus and similar hardware.

I wont run into how to do some basic stuff, I assume you know how to install a Linux Distro and how to edit files on terminal.

BIOS setup

First thing we need to do is setup our BIOS with the right configurations. I only disabled Secure Boot, some people say you should disable more than that, but just the Secure Boot part worked for me. You can see my configuration below in screenshots.

Nothing changed from default
Fastboot enabled, UEFI, again nothing changed from default
Secure Boot disabled

Installing Ubuntu 18.04

I used a simple 8GB USB with the most recent Ubuntu 18.04 image. There’s one thing you need to do, otherwise it will freeze at a random point during the installation.

Just before booting from the USB, on the menu, select “Install Ubuntu” and press “e”, then on the line that reads “linux /cas/vmlinuz”, just before the “quiet splash — -”, write “nomodeset”, then press “F10” to run. You can see screenshots below.

On "Install Ubuntu" press 'e'
Write "nomodeset" before quiet splash, then F10 to load

After this, install as you wish.

First boot into Ubuntu 18.04

If you did the nomodeset part above, your Ubuntu 18.04 should have that option by default on boot. Just make sure it does, on boot, ‘Ubuntu’, press ‘e’ again and just make sure it says “nomodeset” around the same linux quiet splash line, then F10. If it doesn’t then add it just like you did when installing, otherwise Ubuntu will freeze.

Installing GPU drivers

  1. Install the ubuntu recommended drivers, they should work just fine.
sudo ubuntu-drivers autoinstall

2. We need to tell grub to stop using nomodeset and to blacklist Nouveau. The reason for blacklisting nouveau is because we now use nvidia.
Edit /etc/default/grub,

sudo nano /etc/default/grub

Go to the line with “GRUB_CMDLINE_LINUX”, remove “nomodeset” and write “nouveau.blacklist=1”, save the file.

Line should be like this:

GRUB_CMDLINE_LINUX="nouveau.blacklist=1"

Now let's update the boot configuration.

sudo grub-mkconfig -o /boot/grub/grub.cfg

3. Reboot. Now you laptop should be running the nvidia drivers (we have not changed to intel yet). Select the intel card:

sudo prime-select intel

4. Install bbswitch. It’s a tool we will use for disabling the nvidia card at boot, so we will always use the intel only.

sudo apt install bbswitch-dkms

5. Configure bbswitch. Create file (or edit) bsswitch conf file:

echo "options bbswitch load_state=0" | sudo tee /etc/modprobe.d/bbswitch.conf

6. Add bbswitch to the modules to load (simply add "bbswitch" to the end of this file: /etc/modules)

echo "bbswitch" | sudo tee -a /etc/modules

7. Now let's make the changes take effect after boot.

sudo update-initramfs -u

8. Reboot

Now your laptop should be loading the intel drivers only. Thunderbolt (USB-C) port should also work for extra monitors. If you need to use HDMI, you need to use the nvidia drivers (disable bbswitch, select nvidia on prime-select and reboot).
I don’t recommend using bumblebee for Ubuntu 18.04. If you want to game, you can use Ubuntu 16.04, bumblebee works wonders there on this same laptop, or you could just not disable the nvidia drivers.

Making suspend work

I never shut down my laptop, I just close it and open when I need. The first time you suspend it and wake it up, you will notice it’s in airplane mode and you can’t turn on WiFi. We need to add some commands to the GRUB boot configuration in order to make it work. If you run dmesg, you will notice there are ACPI errors (or sometimes on boot, you might see some ACPI errors). We need to add some specific instructions for ACPI so it works. If you have the right fix for that (not using grub commands), let me know to add it here so everyone can use it.

Edit file "/etc/default/grub"
Look for the line that has GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
Just before quiet, add add acpi_osi=! acpi_osi=’Windows 2009'
See below screenshot for how this file should look like (at least for me).

# The following constants should have these values:
GRUB_CMDLINE_LINUX_DEFAULT=”acpi_osi=! acpi_osi=’Windows 2009' quiet splash”
GRUB_CMDLINE_LINUX=”nouveau.blacklist=1"

Now re-generate grub boot config

sudo grub-mkconfig -o /boot/grub/grub.cfg

Now every time you suspend and wake it up, you can use FN+F10 (press it two times) to disable airplane mode.

Skype/Discord (even web) not detecting audio devices

If you don’t use skype/discord or don’t have problems with it, you can skip this. I commonly use it for work and for calling family, so I had to make it work. Every time I installed, be it from repository, from skype.com, snap, etc, none would work. The reason is that it uses pulseaudio, but ubuntu 18.04 uses ALSA by default. We need to change it so it works.
1. Let’s remove the default alsa and any other audio stuff you might had:

sudo apt remove --purge alsa-base alsa-utils pulseaudio pulseaudio-utils pavucontrol

2. I recommend rebooting, not needed but ensures no modules/stuff is loaded and not really removed.
3. Now let’s install pulseaudio. pavucontrol is optional, but I prefer it rather than the default sound settings.

sudo apt install pulseaudio pavucontrol

4. Reboot. That’s it, now skype should detect your devices, same for skype web, or discord web.

So, that’s it guys. I’m writing this for the other people that might be stuck trying to make things work, and for myself, in case I format my laptop in some months/years and I don’t remember what I did to make it work.

--

--

Carlos Rodriguez

A passionate software engineer with insatiable curiosity