MSI-WS60 running Linux
Last year I was the victim of a break in which involved me losing nearly all of my electronics. I had backups of my data, the import stuff, but since that time I had been using a work laptop for most of my personal work. I later purchased a Surface Pro2 and had it dual booting Linux, but I found the tablet/laptop difficult to deal with. The lack of a sold connection between keyboard and device made it impossible to use while sitting on a couch like a normal laptop. While visiting Melbourne I decided to purchase an MSI laptop that’s typically marketed for gamers, and turn it into my primary Linux development laptop.
The MSI WS60 is a pretty tough beast. Clocking in at around $3,000 AUD, it has a Core i7, UHD (3840×2160) display, nVidia GTX 970M + Intel integrated video, 1TB standard hard drive and dual 128GB SSD drives in RAID0 to form a 256GB drive. I knew I wouldn’t use all the gaming features of this laptop as it would primarily be my Linux development system, but I was able to install Steam and play the games I have which have been ported over to Linux.
Getting the hardware to work was a little difficult. The RAID controller was a “fake RAID” controller that was really software based. There’s full Linux support for this software RAID, and it’s comparable to the built in MD software RAID that’s part of the Linux kernel. Originally I had tried to work with the dm-raid and get my old Gentoo image working on the laptop. I ran into several problems trying to get the dm-raid to load correctly on startup.
I knew I could use MD raid, but that would mean totally removing my Windows partition and being able to dual boot. I eventually went that route and attempted installs of Gentoo, Arch and even Ubuntu. I was able to get Ubuntu to work with the default install, and although Ubuntu isn’t a bad Linux distribution, I really didn’t want to lose the flexibility and development community I had come to love about Gentoo. Arch would have been a good alternative as well. I hadn’t tried it yet and was encouraged by their own community and the way the operating system was heavily customizable; geared at Linux developers.
It turns out most of my frustration was simply due to using inadequate initrd tools. The initrd is the “Initial Ram Disk” and is started up by the Linux kernel in order to preform tasks that need to happen before the root partition in Linux can be mounted. This can involve starting software RAID arrays, unlocking encrypted disks or mapping logical volumes. In my setup, I wanted to have RAID0 across the two SSDs for speed, and then have an encrypted volume on top of that which would contain logical volumes for both root and swap (keeping them in logical volumes on a single encrypted volume means you only have to enter in the encryption password once).
The Gentoo encryption guide suggest using Genkernel or Dracut to make an initial ram disk. Genkernel is a Gentoo kernel configuration tool that I’ve never really used (I compile my kernel manually) and if you’re not careful with its options, it will wipe out your kennel config file and change it radically. It also didn’t provide me an initrd image that would boot. Dracut is Redhat’s tool and is pretty equally worthless.
I struggled with either tool to get my RAID setup recognized and luks-encryption initialized. Part of the problem was I hadn’t used Linux software RAID in years, and back when I had, RAID arrays were auto-detected at boot. What I didn’t realize is that this only occurred when using RAID metadata version 0.9 and when the partition type was set to Linux RAID. I struggled for quite a bit trying to figure out why RAID was only auto-initializing on one of my partitions (The /boot parition; the EFI partition was 0.9 metadata but had the partition type set to EFI). On modern systems, the /etc/mdadm.conf
must be placed in the initial ramdisk so that it can build the arrays on startup.
Eventually, I found a solution: better-initramfs. This simple tool created an initial ram disk that was able to load my RAID partitions and decrypt my LUKS device (the LVM mapping happens automatically after that). I’m pretty sure if I had started off with better-initramfs, I would have been able to get the build-in fake RAID controller working and easily saved over a day of setup (or I could have just stuck with Ubuntu which installed everything correctly and encrypted to start with).
After I was able to boot my Gentoo image, the next big roadblock was Wi-Fi. The MSI WS-60 uses an 802.11ac chip, one that’s not entirely supported in Linux. I started looking up forum posts and bug threads, scrolling down only to find that there were still firmware issues and the last comment was less than a week old. For two weeks or so, I found myself turning on Wi-Fi on my cellphone and then tethering it to my laptop. When doing this, remember to turn on Wi-Fi before you tether. I forgot once and burned through $50 of mobile data in an hour.
One of the people on the bug report, through a combination of old mailing lists posts and talking to the ath10k Linux kernel developer, was able to extract the firmware needed from the Windows and get the wireless card working in Linux. It’s documented in a launchpad bug and I used the scripts provided to create the firmware needed and placed it in a fork of the ath10k firmware on github. I did have to compile a kernel using the latest branch of Kvalo’s ath kernel branch, compile the ath10k driver as a module and add options ath10k_core skip_otp=y
to /etc/modprobe.d/ath10k.conf
(see the bug report for more details).
Wi-Fi has been working flawlessly since. Bluetooth has never worked. It uses an ath3k chip and the kernel logs show the following problem:
[ 1.358547] Bluetooth: Patch file not found ar3k/AthrBT_0x00000200.dfu [ 1.358548] Bluetooth: Loading patch file failed
Ubuntu has an open bug for this issue indicating the original reporter should report this problem upstream to the Linux kernel bluetooth team. I couldn’t find a generated bug, so I created a bug report after exhausting all other options, links, mailing list posts and resources. Until then, I can live without bluetooth.
The only other real challenge was the dual graphics cards, common to many laptops (one for 3D/games and the other for non-3D mode to save power). The power button on the MSI switches from blue to orange when going from Intel to nVidia graphics. Switching between the two is as simple as installing the bumblebee
package and ensuring it runs at startup. I wasn’t able to get the open source Nouveau drivers to work (the laptop would freeze on boot), but the proprietary drivers from nVidia work fine.
I won’t go into detail about the bumblebee setup as there are plenty of existing guides out there for it. I am disappointed I wasn’t able to get the Nouveau drivers working. On my past workstation, I had switched from the proprietary ATI drivers to the open source ones to attempt to solve some issues in certain video games and I was shocked at just how much better the open source drivers were and how absolutely horrible the official ATI drivers were in comparison.
Overall, I’m pretty satisfied with this laptop. I’ve been using it as a Linux workstation for several weeks. It has fully functional software suspend and resume via uswsusp.
Granted I could have achieved this with a lot less fuss by just using Windows, or slightly less fuss by using a distribution that takes care of complex installations such as Ubuntu or Fedora, but getting Gentoo running helped me learn more about my laptop, Linux and the underlying stack that makes the development work I do possible.
Comments
I have an MSI GS70, for the same reasons as yours. Ran into the same issue with wifi. Bluetooth is still not working. Any progress on this issue?