Bit Cannon

Void Linux (musl) on the Huawei MateBook X Pro

I recently returned from a 3-week trip to Broome to escape the awful Melbourne weather. The first week I worked remotely and the latter two were holiday. A week before leaving I acquired a new laptop: a Huawei MateBook X Pro (2018). In the days before heading off I worked to set up the new machine into a state that would allow me to perform all my work duties. I wanted to take the new laptop as it is considerably lighter and smaller than the XPS 15 it's replacing.

To make things even more interesting instead of going for my tried and true Arch Linux setup I wanted to try out Void Linux. Specifically the musl libc variant. This post describes the trial by fire that the laptop and Void Linux received on this trip.

Huawei MateBook X Pro (2018) running Void Linux (musl)

My XPS 15 is two years old now. I was using it for work until recently but replaced it with a Ryzen 9 small form factor desktop PC. Given my laptop use was now more casual and for when travelling I wanted something smaller and lighter. I did a bit of research and found the Huawei MateBook X Pro, specifically the 2018 model. There is a 2019 model but it has not been released in Australia. Seeing as it was last years model I was able to get it on sale for AU$2219, which compares quite favourably to the AU$3144 I paid for the XPS 15.

The MateBook X Pro has a unibody all aluminium construction, 3K 3000×2000 HiDPI touchscreen display, Intel Core i7-8550U CPU (4 core, 8 thread), 16Gb RAM, 512Gb NVMe SSD, NVIDIA GeForce MX150 graphics, 4 speaker Dolby Atmos audio, and weighs around 1.33 kg (compared to the 2.06 kg XPS 15). It has 2 USB-C ports, 1 supporting Thunderbolt 3, 1 USB-A port (Apple take note) and a headphone jack.

The laptop was delivered a week before heading off on the trip and it presented an opportunity to try out a new Linux distribution. I installed Void Linux (musl libc version) instead of my usual Arch Linux. musl appeals to me because I'm Australian and a sucker for an underdog it has a clean code base, permissive licensing, and is not a GNU project.

Hardware Impressions

The laptop comes packaged very nicely and includes a USB-C charger with detachable cable, and USB-C dongle with: USB-C, VGA (😳), HDMI, and USB-A ports. Some quick impressions:

  • Build quality is excellent.
    • Approaching if not matching Apple fit and finish.
    • Definitely superior to the XPS.
  • Display is excellent. 3:2 aspect ratio is nice for reading and coding.
  • Trackpad is large, precise, and has an adequate button. I'd rate it 8/10 where I'd give the MacBook one 10/10 and the XPS 7/10.
  • The keyboard is great.
    • Better feel than my old 2013 MacBook and XPS keyboards.
    • It's firm and fairly quiet but with a good amount of travel still.
    • Nothing like the newer MacBook butterfly keyboards.
    • It copies the dumb Apple arrow key layout, which is a shame.
  • Dongle included in box with a good port selection is a nice touch.
  • The charger and cables feel well-made.
  • When charging there's a tiny white led on the side of the laptop that blinks while charging and goes constant when charged.
  • Audio is noticeably better than the XPS 15. It is very clear and precise, especially in the treble range. Having top and bottom speakers is a good feature.

My Broome office

Battery life was excellent even when working on Rust code and repeatedly recompiling. I estimate about 5 or 6 hours of battery life doing this. My typical workflow was to work on battery all morning, charge over lunch and then work all afternoon on battery, which worked fine.

Even working in the warm ambient temperatures of Broome (~30℃) with computationally expensive workloads the fan, whilst active, remained fairly subdued. For whatever reason the fan is much more active when booted into Windows.

Performance wise the XPS is definitely faster, especially when compiling code with multiple cores. This is mostly due to the base clock speed being about 1Ghz lower in the MateBook. UserBenchmark comparison of the two CPUs.

Incidentally I also discovered that video playback in Firefox is not GPU accelerated on Linux. This results in over 100% (more than 1 core) CPU utilisation when watching HD videos on YouTube. Watching the same video in VLC with GPU accelerated video playback uses only about 20% CPU and the laptop runs a lot cooler.

Linux support is great. Hardware that worked out of box:

  • Wi-Fi
  • Audio
  • Graphics (integrated)
  • Trackpad
  • Battery level
  • Touch screen
  • Volume controls
  • Keyboard backlight
  • Brightness/backlight controls
  • Web cam

As other reviews noted the angle of the web cam is not great. Hiding the camera in a keyboard button is nice for ensuring it can't surreptitiously be used though.

After I bought the laptop it was reported that Huawei would start shipping some MateBook models with Linux in China. It's no real surprise then that the hardware is very well supported.

Life in the Void

My Void Linux musl experience has so far been quite smooth but is not without its compromises. Installation was quite hands on like Arch but there is at least an installer to help you with some tasks. I was able to set up my usual Awesome desktop environment easily. Binary packages were available for most of my usual software.

The main thing I did not manage to get working was properly was gnome-keyring. On my other systems this acts as ssh and GPG agent and is automatically unlocked when I log in so I don't need to enter ssh or GPG key passwords all the time.

When setting the machine up for work I also run into a GCC 9 bug that another Void using coworker had hit. The bug prevents the Mercury compiler from being able to be built. My coworker was able to downgrade to an older gcc. I had no such package on hand I resorted to using Podman to do builds in a container. This worked fine for the duration of my remote work.

The primary place where using a musl based distro becomes apparent is with pre-compiled binaries, often linked against glibc. In my case these were all proprietary software:

For Netflix I was able to reboot into Windows at the end of the day. Instead of CLion I just went back to using Neovim. For BeyondCompare, there isn't a great replacement, which is why I paid for a licence in the first place. For the odd merge conflict I needed to deal with I used Meld.

The lack of NVIDIA drivers is not much of an issue, in fact I used bbswitch on the XPS to disable the discrete graphics. However, I thought I might start processing some photos from the trip in darktable and it benefits greatly from OpenCL. In the end I deferred doing the photos until I got home and could use my Arch desktop.

Over the course of the three weeks I ran into a handful of packages missing from the Void repos that are available in the Arch repos:

Being Rust tools I was readily able to cargo install shotgun, viu, and watchexec myself. I created a package for PureScript, and Crystal. I did not tackle CopyQ or Universal ctags.

Closing Thoughts

I like XBPS and the void-packages/xbps-src repo. Feels much like the FreeBSD ports tree except with bash instead of make and a familiar git based workflow.

Void splits packages into the main package and -devel ones like Debian. Having spent more than 2 years with Arch and FreeBSD that don't do this I find it quite annoying. I know there are some minor space savings to be had but I prefer to have the complete upstream package installed, so I don't have to remember to go install the -devel version as well.

So far I've enjoyed my time with the MateBook and Void Linux and plan to keep using it as the primary OS on this laptop. I can also highly recommend the MateBook as beautiful, well-built, Linux hardware.

Comments