I wanted to try Kali Linux for the first time but the installation process was not smooth sailing for me. I encountered errors some of which I did not know how to trace from the log (I was too lazy to read the manual) and fix. But in the end I still managed to fix my Kali Linux installation. I am unsure whether I was the only one who faced this issue during installation.
For the sake of simplicity, I will declare my partition layout as follows (I actually used LVM when I reinstalled the OS)
/dev/sda1 -> / /dev/sda2 -> /home /dev/sda3 -> swap /dev/sda4 -> EFI system partition (ESP)
The home partition was reused from my previous Linux installation.
Bootloader error
Symptoms
Default Boot Device Missing or Boot Failed. Insert Recovery Media and Hit any key Then select 'Boot Manager' to choose a new Boot Device or to Boot Recovery Media
In my case, the GRUB bootloader was not installed into the ESP (/boot/efi/ESP) at all during the Kali installation (for some reason).
Solution
Live boot into a Linux system. I used https://www.system-rescue-cd.org/
Mount your partitions with the following command:
mount /dev/sda1 /mnt mount /dev/sda2 /mnt/home mount /dev/sda4 /mnt/boot/efi mount -t proc /proc /mnt/proc mount --rbind /sys /mnt/sys mount --rbind /dev /mnt/dev
The /mnt directory will be used as our chroot environment root path.
chroot /mnt
If you run grub-install in the terminal, you will encounter an error “bash: grub-install: command not found“. I suspect this is the main issue that caused the bootloader installation to fail.
Add the following line to ~/.bashrc
export PATH="$PATH:/sbin:/usr/sbin"
Exit the chroot environment and chroot again. The command grub-install should no longer output an error. I had to disable grub os-probe because it keeps defaulting to sysresccd’s grubx64.efi and the error persists (it will point to a non-existing file after I remove my USB flash drive).
I added the following line into /etc/default/grub and then installed the grub bootloader into the ESP and regenerated the config
GRUB_DISABLE_OS_PROBER=true
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub update-grub
After that I rebooted the system and selected grub from the boot menu.
Black screen after login
Again, I am not quite sure what caused this problem. I guess it had something to do with SDDM and the absence of xorg and xinit (I thought KDE Plasma used Wayland, but again I’m not sure. I’m just stating my own experience)
Note: when I tried to reproduce this error, I discovered that xorg does not need to be installed. I had mistaken it with xserver, I guess?
Symptoms
- Black screen after clicking the “desktop session” dropdown at the login screen
- Black screen after login, cursor is shown
- QT_DEBUG_PLUGINS=1 plasmashell gives the following error:
"qt.qpa.xcb: could not connect to display. qt.qpa.plugin: Could not load the QT platform plugin "xcb" in "" even though. it was found
Solution
Open a TTY by hitting CTRL+ALT+F1~F12, whichever that works, and login.
First, try deleting ~/.Xauthority, ~/.config (this will reset all your application settings !!), ~/.cache (source: can’t find it again, will update later)
I installed lightdm as a workaround but I think any other display manager will work. If you still want to use SDDM I’m afraid I don’t know the way fix it.
apt install lightdm
During the installation process, you will be asked to pick between SDDM and lightdm. Pick lightdm. If you were not asked:
dpkg-reconfigure lightdm
Reboot the system and hope that it works 🙂
Hope this article helps anyone who encounters the same problem in the future
Source(s):