Installing Ubuntu 16 Linux On A GE62 6QD Apache Pro MSI Notebook
2016-08-02 - By Robert Elder
Introduction
Updated August 23, 2016: Corrected command and added more details.
Updated March 29, 2017: Added note about remote CPUS printers, and reflection on using this laptop.
Updated July 10, 2017: More details and corrections.
Updated August 27, 2017: Notes from an email someone sent me.
After 3 weeks of using this system after going through the setup described below, I'm overall fairly satisfied with the performance of this laptop with Ubuntu (it's fast and has lots of RAM), but there are still a few things I haven't bothered to get completely working, such as the microphone and webcam. I may just opt for getting a USB camera. I still have one minor issue with being able to switch between using Ethernet and WiFi without rebooting, but I have a suspicion that it may be an Ubuntu bug. As long as an Ethernet cable is not plugged in at boot time, WiFi will work flawlessly.
I recently purchased an MSI GE62 6QD Apache Pro laptop and went through the process of installing Ubuntu 16 on it. The process wasn't too difficult, but there were a few snags along the way and I wanted to share the process that worked for me:
Step 1
By default, this notebook comes with windows 10. You should make a backup of the install disks in case you want to go back to windows 10 or need to roll back for some other reason. After all, you already paid for a copy of windows 10. This backup process requires 6 DVDs or ISO files.
Step 2
For me, I was not able to get the notebook to recognise the Ubuntu install DVD as bootable media unless I went into the BIOS settings and switched the boot method from 'UEFI' to 'legacy'. I also disabled secure boot. I'm not sure if that was necessary, but I did it anyway.
Step 3
Change the boot ordering so it will only try to boot from the install disk that we're inserting.
Step 4
Make sure an Ethernet cable is plugged in, as we're going to want the network configuration in the installer to be able to set up a working network connection for later.
Step 5
At first, I tried installing the desktop version of Ubuntu 16, but this would only take me as far as the loading screen to the point before the installation menu appeared. I was never able to get to a shell prompt. I believe what's happening here is that the Ubuntu installer is trying to use an open source video driver that is not compatible with the GTX960M video card. Unfortunately this locks up the installer instead of at least giving a shell prompt.
The solution: Instead of trying to install the desktop version, burn a DVD to install the server version of Ubuntu 16. This will avoid trying to load the bad video driver during the install, and we can replace the driver through the shell prompt (which turns out to be as easy as 1 command).
In my case, I used the ISO 'ubuntu-16.04-server-amd64.iso' which has md5sum '23e97cd5d4145d4105fbf29878534049'. Burn a copy of this ISO, and you should be able to get through the installation process easily.
Step 6
After the install, don't forget to change the boot order to boot from the hard drive.
Step 7
Now reboot and log into the shell prompt. This is the part where you need your networking to be set up properly (which hopefully happened during the install process). Run these commands (the last one will download a lot and take a very long time):
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-364
Now reboot and you should get to the Ubuntu Unity login screen.
Step 8
If you try logging into this login prompt, you'll get 'Failed to start session'. To solve this, press Ctrl+Alt+F6. This will present you with a login for a shell prompt. Once you're logged into the shell prompt, enter this command:
sudo apt-get install ubuntu-gnome-desktop
Just like the last command, this will take quite a while. After you're done, reboot and you should be able to log into a regular Ubuntu 16 desktop environment. This should put you in a position to do whatever you would have with a typical desktop install.
Loud Speaker Popping On Shutdown
A really awful problem I encountered at this point was a loud 'popping' sound coming from the internal speaker whenever I shut down or restart the computer. I found an option in the 'alsamixer' control that allowed me to change the 'auto-mute' option to disabled which made the popping go away, but whenever this was enabled it also made sounds play from the internal speaker whenever the headphones were plugged in.
I tried many things to fix this, but eventually discovered a program called 'hdajackretask' which can be downloaded with
sudo apt-get install alsa-tools-gui
After launching this program, I overrode any of the internal speakers or SPDIF to be 'not connected'. You'll also need to install a boot override:
This fixed the popping problem (It might take at least 2 reboots), and it also made audio only come through the headphones. One disadvantage is that audio will no longer come out of the internal speakers ever (even if the headphones are unplugged), but that wasn't a problem for me, so I stopped working on this and moved on. You might be able to get everything to work with a bit more experimenting with the hdajackretask tool.
I've read in various places that the root cause of the popping sound is related to power saving operations that automatically turn off the speaker when it is not in use. There are kernel module options that claim to control this, but they didn't have any effect for me.
Networking
My installation seemed like it was working pretty good until I tried to boot it without any Ethernet cable plugged in. When I did, the system would stop booting with the following message:
A start job is running for raise network interfaces
If you let it run for 5 minutes, it will eventually boot normally, but a 5 minute boot time is intolerable. I found that you can avoid this problem by changing the timeout value in one of these files (I forget which one, was it both?) to '1sec'.
/etc/systemd/system/multi-user.target.wants/networking.service
/etc/systemd/system/network-online.target.wants/networking.service
After this the system should boot fairly quick even if the Ethernet cable is not plugged in. I'm not completely sure why this happens, but I suspect it is because I installed the Ubuntu server version which probably has different networking defaults.
WI-FI
After much messing around, I am under the impression that WiFi does actually work fine on its own with my installation, but for some reason if I boot the laptop with the Ethernet cable plugged in, then unplug it, the WiFi will acquire an IP address, but WiFi doesn't seem to work at all. If I then reboot and make sure there is no Ethernet cable plugged in, WiFi seems to work perfectly fine.
I should add that I did end up updating the WiFi firmware because I thought that was the root cause of the switch from Ethernet to WiFi not working, but I don't think that made any difference. I did lots of digging in logs and it looks like the WiFi firmware is loaded correctly, and all the kernel modules look like they're doing what they're supposed to. Perhaps it is an issue in the Ubuntu 16 systemd scripts?
Final Notes
There are some extra fancy LEDs of different colours that turn on in the keyboard with Windows, but not with the default Linux Install. Currently, all the keys have only a red glow under them, but that's not a problem to me.
I also had a problem with the input on keyboard being set to an international setting that caused weird behaviour when typing things like quotes. This might have been because of a mistake I made in the install process, but regardless, it was fixed by running:
setxkbmap us
Ironically, with this super fancy gaming video card I also experienced extreme lag in terminal with the default Unity desktop UI. I decided to switch to using LXDE instead of Unity and the problem went away and that was good enough for me.
Just after writing this, I also discovered some issues with the microphone, webcam, and WiFi. I'll post an update to this post once I iron out these issues. Overall, it almost feels like Ubuntu/Linux support for laptops is getting worse instead of better.
Update March 29, 2017
I noticed that whenever I visit the college campus and connect to their WiFi network, I will get the following message when shutting down the computer:
A stop job is running for remote CUPS printers available locally
This is super annoying because it always takes one minute and thirty seconds to time out. After some googling, I found that the following commands will fix this:
sudo systemctl stop cups-browsed.service # Takes a long time for some reason
sudo systemctl disable cups-browsed.service
Note that the first command to stop the service takes a very long time for some reason. I thought it was hanging at first.
Also, as a general reflection on using this laptop: It is still working well and I haven't had any more problems with it. I never bothered to fix the issues with the sound and video more robustly. The issue with switching from WiFi to network doesn't seem to appear anymore for whatever reason (or at least I don't seem to be triggering that broken behaviour as much).
Update June 12, 2017
Another annoying problem is that the following message shows up repeatedly in my kernel logs, and also in some terminals:
ubuntu kernel: [ 182.444532] pcieport 0000:00:1c.0: PCIe Bus Error: severity=Corrected, type=Physical Layer, id=00e0(Receiver ID)
ubuntu kernel: [ 182.444538] pcieport 0000:00:1c.0: device [8086:a110] error status/mask=00000001/00002000
ubuntu kernel: [ 182.444542] pcieport 0000:00:1c.0: [ 0] Receiver Error
ubuntu kernel: [ 182.546914] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
This problem has been around for a while, but I finally decided to fix it because it prevented me from using the terminal when switching to a different VT. I solved it by adding
pci=nomsi
to the grub book configuration. More instructions on this can be found here.
Update June 28, 2017
The issue I had with typing certain characters that I discussed previously was something that I also experienced in the console that you get by changing your VT with CTRL+F6, and after investigating a bit more I found out that I had accidentally turned on dead keys. I was able to fix this by running:
sudo dpkg-reconfigure keyboard-configuration
And selecting the prompted options in the following order:
- generic 105 key (Intel) PC
- English (US)
- English (US)
- The default keyboard layout
- No compose key
- No
I also wanted to increase the console font size, and I was able to do that by using this command:
sudo dpkg-reconfigure console-setup
When prompted, I selected the following options:
- UTF-8
- Latin1 and Latin5 - western Europe and Turkic languages
- VGA
- 16x28 (framebuffer only)
An Update on Networking Problems
Previously, I had stated that I had issues when switching from WiFi to Ethernet, but I was able to do so without error as long as I re-started in-between. I believe I made some progress in isolating the source of the error: It seems that some of the Ubuntu scripts that are responsible for adjusting the routing tables and assigning IP address to interfaces are not doing so, or doing it incorrectly. In some instances, I have been able to get network access working manually by using commands like these to adjust the IP address of interfaces, or adjust the routing table. For example, this command seems to make WIFI work after unplugging the Ethernet cable:
# Delete extra default gateway to enp3s0
sudo route del default gw 192.168.0.1 enp3s0
In general, when unplugging, or dis-connecting a network interface, the interface in question sometimes doesn't seem to lose its IP address, and the routing tables don't seem to be updated properly. For example, here is the output of the 'route' command below after the Ethernet cable has been un-plugged, but also while WIFI remains connected. Note that there are two default gateways, which I believe is an error in this case.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 enp3s0
default 192.168.0.1 0.0.0.0 UG 600 0 0 wlp2s0
link-local * 255.255.0.0 U 1000 0 0 enp3s0
192.168.0.0 * 255.255.255.0 U 0 0 0 enp3s0
192.168.0.0 * 255.255.255.0 U 600 0 0 wlp2s0
Unfortunately, I haven't mastered the art of manually changing the routing table, or adjusting IP address of interfaces, so I haven't been able to get it to work in all cases, but I think I'm making progress. I suspect the root cause of this is a bug in the distribution. Here are a few more examples of commands I've been playing with:
# Delete default gateways
sudo route del default gw 192.168.0.1 enp3s0
sudo route del default gw 192.168.0.1 wlp2s0
# Add a default gateway over ethernet
sudo route add default gw 192.168.0.1 enp3s0
# Remove ip address from ethernet interface
sudo ip address del 192.168.0.102 dev enp3s0
# Add ip address to ethernet interface
sudo ip address add 192.168.0.102 dev enp3s0
August 27, 2017 - A Comment From A Reader Of This Article
I received an email from someone who described their own experience of installing Unbuntu on their laptop, and I thought it might be useful to others, so I am re-producing it here with their permission:
"Hi, thanks for the nice article about installing Linux (Ubuntu) on an MSI GE62 6QD Apache Pro notebook that you wrote in your site! (link)
I have the same exact same model and I had been thinking of installing Linux but was extremely worried of the difficulty/complexity. This would actually also be my first time installing Linux on a computer ever (I had never installed it by myself on any device beforehand - if we discount simple stuff like flashing Android OS into a smartphone). But hey, your article gave me the confidence since at least I became aware that there were actually people who had the same exact model as mine and they managed to get it working just fine. [...snip...]
First of all, I chose KDE neon. It's a pretty neat KDE's "package archive" based on Ubuntu LTS (16.04), or something like that. Before choosing this, I've had a little bit of experience in using KDE Plasma in Arch Linux (which I also only had a little bit of experience with, since I was just testing things out on a friend's recommendation), and I gotta be honest, I fell in love with it. Luckily, KDE neon is based on Ubuntu, so if you ever encounter any issue, more often than not, solutions that are available for Ubuntu will work just fine with KDE neon, so that's a plus.
Anyways, proceeding with the installation: I took the regular User Edition (not the LTS one) and wrote it into a USB flash drive using the recommended Rosa Image Writer from the KDE neon's download page. The installation seem to be using UEFI boot method by default so my notebook recognized the USB flash drive as a bootable media just fine with "UEFI" boot method in the BIOS settings (not the legacy or the one with some kind of extra support). I also did NOT disable SecureBoot.
At first, despite being able to boot to the GRUB thing where you could proceed to boot to the live image, it would always stuck in KDE neon's loading screen (just like what you encountered with regular Ubuntu). I thought it had something to do with the UEFI boot settings and all that but turns out it had something to do with the graphics card (well, just like the one you also mentioned in your article). So I rebooted the notebook then removed "quiet splash" from the GRUB entry so I could see the messages thingy while it was booting. After some Googling, the error messages which happened right before the freeze had something to do with incompatibility with nouveau driver. The solution to that, after some more Googling, was to disable nouveau driver while booting to the live image, then install the OS. After the OS had been installed, when booting to it, I'd also have to disable nouveau again (otherwise it would also freeze) and proceed to install NVIDIA's proprietary driver. To disable nouveau driver, apparently it was as simple as adding "nomodeset" to the GRUB entry. After I added "nomodeset" to the GRUB entry, I could boot smoothly to the live image. I then proceed to install the OS with. On a side note, the live image worked just fine with my wireless connection (I didn't have Ethernet back then), so it could download updates during the installation.
After all of that is done, I booted to the installed OS after adding "nomodeset" to the GRUB entry again (but of course the GRUB thing which now exists in my notebook's hard drive). Afterwards I proceed to install NVIDIA's proprietary driver. But here, I encountered an issue where it could not install if I have SecureBoot enabled (the installation immediately printed a very obvious error message about it). I ended up disabling SecureBoot in the end. Afterwards the driver installation proceeded just fine.
As for the issue you mentioned about speaker, after a few weeks of using this notebook with KDE neon, I have to say that I've had no issue with the speaker whatsoever. It also would work just fine with a USB headphone. My camera and microphone also worked just fine. As for camera, I had to enable it by pressing Fn + F6, which I also had to do in Windows, to be honest. After enabling it once, it would remain enabled in future boots as well, but the LED would only light up when it's being used by any program (just like in Windows). My keyboard also worked just fine, which i assume because it uses Generic 101-key PC layout by default.
Your article said to use the 105-key layout, which I'm not really sure why. I tried to google around for articles about it, but I couldn't really find anything helpful. So for now I'm staying with 101-key since it so far everything seem to be working just fine."
A Surprisingly Common Mistake Involving Wildcards & The Find Command
Published 2020-01-21 |
$1.00 CAD |
A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera
Published 2019-08-01 |
Why Is It so Hard to Detect Keyup Event on Linux?
Published 2019-01-10 |
The Most Confusing Grep Mistakes I've Ever Made
Published 2020-11-02 |
Use The 'tail' Command To Monitor Everything
Published 2021-04-08 |
An Overview of How to Do Everything with Raspberry Pi Cameras
Published 2019-05-28 |
An Introduction To Data Science On The Linux Command Line
Published 2019-10-16 |
Join My Mailing List Privacy Policy |
Why Bother Subscribing?
|