How I set up my new ultimate laptop with Ubuntu 18.04 and fix the Wi-Fi

Artiya
4 min readOct 25, 2019

Start using a laptop with Linux can be hard for everyone, especially with the newest hardware. You will run into a problem that nobody found it before and hardly to fix it.

I basically use a Linux machine for general software development work because it is really close to the production environment and Linux desktop environment is better every year.

Now I am starting my own new venture software development company. I can use new hardware I always want. I built a powerful desktop PC one already but It not suite with some workload. Sometimes I need to get more space, feel some fresh air from outside. Do my thing without sitting in my lonely room. I basically need a laptop for that.

I do some research and got a really nice looking design, light, solid build quality, powerful enough to handle my work and more importantly, don’t break my bank. I got Lenovo S540–14 with Gen 10th Core i7–10510U, 4 cores max@ 4.9Ghz 8GB DDR4-2666, Nvidia MX250 2GB, 1TB, Nvme storage. thin bezel IPS panel, aluminum body, no big logo show on the back with a great deal price from 31,990THB to 28,990THB. It checks many boxes.

But like all the power, it must come with responsibility. It comes with Windows10 Home pre-installed. I never like Windows, especially when always install the update. It is too big and slow to install but this new laptop comes with it. So I just need to install Ubuntu, my favorite Linux distro. However, It got harder than before because of Windows 10 lockup with the system. To allow it install Ubuntu I must set the BIOS to:

Security -> Intel Platform Trust Technology: Disabled,
Secure Boot: Disabled
Configuration tab, Storage -> Controller Mode: AHCI mode
Boot order-> USB drive first

It will boot Ubuntu USB and can install it to SSD storage. After I install it I quickly spot something wrong with it. It got no Wi-Fi!!! To be fair the OS was months, if not a year ago. No way it gonna knows the new hardware that just comes out a week ago but how I gonna update the OS without internet connectivity? I got an Android Phone with Bluetooth and I can share the internet for the buggy laptop as I do 10 years ago. The speed was horrible ~2Mbps. I quickly find a USB-C cable in my backpack and plug my phone on the laptop USB, enable USB tethering on my phone then I got the decent internet to update the OS.

To Setting->More->USB tethering

The OS date using sudo apt update && sudo apt upgrade cannot help with the Wi-Fi driver problem because the distro still not upgrade the Linux kernel to the latest version. This can be solve by installing the latest stable version compile from the source code. Sound hard for a beginner? But it not that hard. Just run these commands.

  1. Install the build tools:
    sudo apt install build-essential flex bison wget libssl1.0-dev
  2. Download Linux kernel from https://kernel.org
    wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.7.tar.xz
  3. Extract source files
    tar -xf linux-5.3.7.tar.xz
  4. Make build config from older kernel config, please enter if it asks anything.
    cd linux-5.3.7 && make oldconfig
  5. Build the kernel(7 is the number of threads will use to compile kernel)
    make -j 7
  6. Build the kernel modules
    make modules
  7. Install kernel modules
    sudo make modules_install
  8. Install kernel
    sudo make install
  9. reboot

Now I got the WiFi working with thanks to the newest kernel.
I can call it a day but I need to install Nvidia driver to bring more efficiency from GPU because Intel on-chip CPU really sucks. I downloaded the driver NVIDIA-Linux-x86_64–430.50.run from NVIDIA website and it cannot install when using the opensource driver(I can even type the correct name, Nouvo I guess). Don't get me wrong the opensource Nvidia driver can do everything good but I need to try it all. I need to install an NVIDIA driver from Ubuntu first.

sudo apt install nvidia-headless-430

Reboot and it cannot log in.

I need to install driver from the downloaded file. By press Ctrl-Alt-Fn-F4 and login with username and password.

sudo chmod +x NVIDIA-Linux-x86_64–430.50.run
sudo ./NVIDIA-Linux-x86_64–430.50.run
sudo reboot

It will allow using Nvidia GPU only from the NVIDIA X Server Setting tool. Now it is only one problem left to solve “screen tearing” when fast-moving video or animation, not smooth. This really annoying. Fixing it by edit a line on file /etc/default/grub using the command:

sudo gedit /etc/default/grub

Edit add nvidia-drm.modeset=1 on a line to be like this:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet nvidia-drm.modeset=1 splash”

Regenerating boot menu from config.
sudo update-grub2

Reboot the laptop.
Now I got the machine exactly I want to work in with a Linux.

Totally unrelated image.

--

--