Change to KDE Plasma Desktop Environment
Installing KDE Plasma
Official Documentation: https://www.kali.org/docs/general-use/switching-desktop-environments/
Some deviations from the procedure for me:
sudo apt remove --purge --allow-remove-essential --auto-remove -y *xfce* lightdm && sudo apt install -y kali-desktop-kde
If prompted, choose sddm as the display manager
sudo reboot now
If required, be sure to change from Plasma (Wayland) to Plasma (X11)
Click Desktop Session: Plasma (Wayland) and change to X11
XRDP on KDE Plasma
XRDP Server on KDE Plasma | 0xBEN | Notes (benheater.com)
PolKit Network Manager Prompt
At login, policy manager keeps prompting for a password allow my non-root user to control the network manager service. We need to add a PolKit local authority config to give the non-root user account permissions to do specific things on the system.
Press Details to expand and view the desired Action of the PolKit prompt. This will inform the configuration shown below. Now, let's take a look at the default PolKit policy for org.freedesktop.NetworkManager.network-control
less /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy
When browsing the file with less press the / key and search for org.freedesktop.NetworkManager.network-control, then press Enter. Below, we can see the default policy.
<action id="org.freedesktop.NetworkManager.network-control">
<description>Allow control of network connections</description>
<!-- ... removed for brevity ... -->
<!-- ... removed for brevity ... -->
<!-- ... removed for brevity ... -->
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
In the <defaults></defaults> section is where the magic happens. The <allow_*> sections refer to how the policy is applied depending on the user session state.
<allow_any>auth_admin</allow_any> -- specifies the requirements whether the user is active or inactive
- Require admin privileges
- This action is going to take precedence over the other two.
allow_inactive>yes<allow_inactive>-- requirements for an inactive session, so allow changes when inactiveallow_active>yes<allow_active>-- requirements for an active session, so allow changes when active
sudo apt install -y polkitd-pkla
sudo nano /etc/polkit-1/localauthority/50-local.d/50-allow-network-manager.pkla
We're going to set the policy to yes for the user ben (in my case), as we want this user to be able to make modifications to the service when logged in.
[Network Manager All Users]
Identity=unix-user:ben;
Action=org.freedesktop.NetworkManager.network-control
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Note Identity=unix-user:ben; and ResultAny=yes overriding the default policy for the user ben
sudo systemctl restart polkit.service
Setting up Meta+Shift+S Screen Capture
Configure KDE Spectacle
Open Spectacle
Click Configure
General
Shortcuts
Proxmox VE Specific Changes
Kali Linux Container (LXC)
KDE uses the NetworkManager service to configure network interfaces. Howerver, Proxmox VE integrates with systemd-networkd on the Linux Container to configure interfaces, which causes a conflict between the two. So when running Kali Linux in a Linux Container, remove NetworkManager to remove the conflicting services.
sudo apt remove -y --auto-remove --purge plasma-nm
NoMachine LD_PRELOAD Errors
Running certain commands in the terminal -- wine for example -- causes an error message:
ERROR: ld.so: object '/usr/NX/lib/libnxegl.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
This is a known issue with NoMachine running in KDE Plasma as documented here: https://kb.nomachine.com/TR02W11273. A workaround is provided by the vendor.
The 'LD_PRELOAD=/usr/NX/lib/libnxegl.so' variable is inherited by all applications running in a KDE Plasma desktop. This environment variable is used when the 'EGL' screen capture method is in use, but it shouldn't be inherited by the applications running in the desktop.
As a temporary workaround, to avoid this variable being set in the environment, users can disable the EGL capture method by running the following command, then rebooting or logging out from the system.
sudo /usr/NX/bin/nxserver --eglcapture no






