Installing Linux Mint on a Windows 10 Lenovo laptop - lmmx/devnotes GitHub Wiki
Before entering the live USB you need to ensure the fast startup power setting is disabled, so that the machine fully powers off. To my understanding, you do so as otherwise when you exit the live USB via 'shut down' it won't actually shut down and you'll have to hard power off the machine (no bueno).
- Go to 'Power Options' > 'System Settings' ("change what the power buttons do")
- "Change settings that are currently unavailable" to allow you to uncheck "turn on fast startup (recommended)"
- Picture guide here: https://winaero.com/how-to-disable-or-enable-fast-startup-in-windows-8-1/
After burning a live USB onto a flash drive, I booted and found the keyboard wasn’t working. I used the on-screen virtual keyboard (under Accessibility in the settings) to type into the Terminal (via)
xinput list
This lists the input devices, and in my case the keyboard (“AT Translated Set 2 keyboard”) was id number 12, meaning I could enable it with:
xinput --set-prop 12 "Device Enabled" 1
xinput list
What to do if the keyboard isn't in the After exiting and re-entering the live USB, I found the keyboard was no longer in the input list.
As mentioned in this question it takes 10 minutes or so (in which time I tried pressing buttons like Alt + Tab, Enter, etc.) before the keyboard shows in the list. This indeed showed up in the dmesg
output.
In fact, the keyboard was enabled at this point, and I didn't need to use the xinput --set-prop
command!
Various approaches put forward here and here include:
GRUB_CMDLINE_LINUX_DEFAULT="i8042.direct i8042.dumbkbd"
One answer says that LED functionality can be preserved by:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.reset"
Elsewhere it's proposed to check compatibility with dmesg | grep i8042
, which gives me a few lines including one saying
PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
The keyboard worked but the trackpad ("Glass sense touchpad") did not, only the touch screen. This suggested editing the grub file (sudo xed /etc/default/grub
)
GRUB_CMDLINE_LINUX_DEFAULT="psmouse.synaptics_intertouch=0 quiet splash"
Once you have the keyboard working, proceed to the installer. I had a BitLocker encrypted Windows 10 partition, and the Linux Mint installer said that this would mean I couldn't proceed without first decrypting that, and linked me to this help thread on the Ubuntu Discourse forum. One person there however contradicted the official advice,
I ran into this BitLocker issue for the first time and was really bothered with the decrypt/install/re-encrypt approach. As the boot and recovery partitions are not encrypted, I tried a different approach which worked fine. So there is a 4th option! Here it is:
- Manage your partitions manually:
- On windows, launch the partition manager tool (type “partition” in the search bar and it should show up).
- Resize your main Windows partition to leave enough empty space for your ubuntu install (e.g. 128Gb).
- Boot on Ubuntu installer disk.
- When prompted with the different install choices, choose the option to manually manage your partitions.
- Select the free space and create at least one partition (mount as “/”). If you do not know how many and which partitions to create, there are many posts on the subject already.
- Install your Ubuntu and enjoy.
The whole process took less than 5mn to setup on my machine. I bet the decrypt is much much longer and generates a lot of unnecessary writes (bad for SSDs). Sadly, the installer is not able to automatically manage an install alongside Windows when there is free space on the disk. It is like it detects BitLocker and redirects to the help message with the link to this page. Hence the only option for now is to manage the partitions manually, which may rebute some users…
This worked correctly (I added a 1024MB swap partition and the rest as ext4 root partition, but you may choose to separate /
and /home
partitions).
During the installation I chose not to install 3rd party multimedia codecs (the installer would have prompted me to enter a password for Secure Boot for unclear reasons).
Once restarted, I got the grub menu showing the Windows boot manager as a separate entry to Linux Mint, so the installation was successful.
Graphics
The next problem was the persistent 'Check your video drivers' message
Your system is currently running without video hardware acceleration. You may experience poor performance and high CPU usage.
Searching the web for "Intel Corporation Device 9a49 linux driver" (the result of lspci -k | grep -EA3 'VGA|3D|Display'
as suggested on Intel's site) brought me to this similar sounding problem with a different laptop model:
I set up a dual-booted Ubuntu 20.04 for Asus ZenBook UX393EA, which has an integrated graphics card 'Intel(R) Iris(R) Xe Graphics'. However I find llvmpipe (LLVM 11.0.0, 256 bits) is used but not the integrated graphics card.
I believe some other issues are due to this, such as:
- xrandr failed to get size of gamma for output default
- the screen resolution can only be set to one value
- no control bar for screen brightness
I didn't try xrandr but the other 2 symptoms matched my experience. This person's diagnostic output also contained the 9a49 label, indicating some shared graphics component with my laptop.
Sure enough I grepped my dmesg
log and found I had the following error, as this other person reported:
louis@louis-Yoga-Slim-9-14ITL5:~$ dmesg | grep 9a49
[ 0.657661] pci 0000:00:02.0: [8086:9a49] type 00 class 0x030000
[ 1.364464] [drm] Your graphics device 9a49 is not properly supported by the driver in this
kernel version. To force driver probe anyway, use i915.force_probe=9a49
module parameter or CONFIG_DRM_I915_FORCE_PROBE=9a49 configuration option,
This is apparently as the hardware is too new for the current kernel of Ubuntu 20.04, and the fix is to use 20.10, via the OEMKernel package
sudo apt install linux-oem-20.04 && sudo reboot 0
Upon restarting, the scale became 2x (still on 'automatic') and I could change to fractional scaling at 150% etc. (but chose not to, as it looked blurry). The screen space was much smaller, but for a 14" screen I feel this is more appropriate.
There were horizontal lines 'glitching' on the screen when scrolling, suggestive of software rather than hardware-based graphics acceleration.
The answer also mentions at the end:
This should do the job, but if it doesn't make sure that you have the packages as mentioned here -> https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal.html
This page is a guide for "general purpose GPU (GPGPU) capabilities for Linux*-based operating system distributions" and the instructions are:
sudo apt-get install -y gpg-agent wget
wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | sudo apt-key add -
sudo apt-add-repository 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main'
sudo apt-get update
sudo apt-get install intel-opencl-icd intel-level-zero-gpu level-zero intel-media-va-driver-non-free libmfx1
and again sudo reboot 0
to restart.
The problem remained, and searching came up with the name "screen tearing" for this glitch.
This article proposed a couple of fixes, one of which caused Linux to go into 'Fallback mode' (presumably an invalid config file), and the other simpler one for GNOME crashed the GUI entirely, forcing me to delete the config file in a tty session.
Linux Mint Cinnamon (Edge)
At this point I noticed Linux Mint has a new 'Edge' option, which a commenter described as equivalent to what I just did manually:
If you install regular and then update kernel to latest, that's the same end result as Edge. If you need the latest for things to work, you need to use Edge.
When I entered the live USB, I immediately saw the screen glitches, which was:
- Bad because it didn't resolve them
- the keyboard was buggy (
|
was now>
but so was>
...) as the layout had defaulted to US (easily fixed)
- the keyboard was buggy (
- Good because it showed that this 'Edge' version was equivalent to what I'd just done, but it doesn't have an awkward OEM kernel installed and Intel PPA added to its apt repository source list to get to that point (i.e. it actually simplifies the previous process)
- also the built-in keyboard began to work, without me changing any grub flags.
dmesg | grep eyboard
showed a timestamp of 0.98 (seconds since system start). Great improvement, worth installing for.
- also the built-in keyboard began to work, without me changing any grub flags.
I went through the installation again, simply selecting "Erase Linux Mint 20.2 and reinstall".
Oddly, the screen glitches would only happen on the built-in laptop screen, and not on an external monitor and would go away on the laptop screen when an external monitor was connected.
Unfortunately, the laptop screen also froze/crashed entirely when I unplugged the external monitor once, suggesting the integrated GPU cannot drive two 4K screens on Cinnamon, and on which basis I decided to use a different distro (MATE or XFCE versions of Mint).
I was about to consider alternative distros but the Windows 10 UEFI would not recognise the live USBs made in Mint for some of them, so I revisited the dmesg
logs and searched the following error:
[ 28.672306] i915 0000:00:02.0: [drm] *ERROR* CPU pipe A FIFO underrun
...which led to this bug report in Fedora suggesting in fact it's a Linux kernel-wide problem, and is simply due to the refresh rate being too high (it is 60Hz while my external is only 30Hz).
I then simply adjusted the xrandr rate parameter to 30 (see: Setting different screen scales for multiple monitors with persistent xrandr) and the flickering went away. In the display settings, I could only change it between 48 and 60, not to 30, and 48 did not prevent the flickering.
I also reinstalled the Intel graphics packages mentioned earlier and apt upgrade/updated but this had no effect (but can't hurt stability).