Kali Linux Install xRDP

From WikiMLT

In­stall xRDP

sudo apt update
sudo apt install xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp
sudo systemctl status xrdp

Set­up Pulseau­dio

sudo apt install pulseaudio-module-xrdp
sudo apt install pulseaudio-module-xrdp-dbgsym
pulseaudio -k

Au­then­ti­ca­tion is re­quired to cre­ate a col­or man­aged de­vice

To by­pass this au­then­ti­ca­tion that is re­quired at each log-in, we need to cre­ate the file /etc/polkit‑1/localauthority/50-local.d/color.pkla.

sudo nano /etc/polkit-1/localauthority/50-local.d/color.pkla
[Allow colord for all users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile;org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes
sudo systemctl restart polkit
Figure 1. Kali Lin­ux: 1) In­stall desk­top en­vi­ron­ment, 2) Set the de­fault desk­top en­vi­ron­ment.

Switch the Desk­top En­vi­ron­ment

In or­der to change the desk­top en­vi­ron­ment for xRDP you need to in­stall a dif­fer­ent (new) kali-desktop-${environment}. The avail­able de­sc­top en­vi­ron­ments are list­ed at Fig­ure 1. Let's as­sume we want to in­stall Gnome.

sudo apt update && \
sudo apt install kali-desktop-gnome

Then you need to set-up the de­fault desk­top en­vi­ron­ment as it is shown at Fig­ure 1.

sudo update-alternatives --config x-session-manager

Tweak the Browsers

If your are con­nect­ing to a vir­tu­al ma­chine which doesn't have ded­i­cat­ed video card, you may want to dis­able the hard­ware ac­cel­er­a­tion with­in the browsers in use in or­der to achieve bet­ter per­for­mance – Fig­ure 2.

#Screen­shot
Figure 2. Fire­fox and Chromi­um browsers – dis­able the hard­ware ac­cel­er­a­tion for bet­ter per­for­mance with­in RDP con­nec­tion to a vir­tu­al ma­chine.

Add Key­board Lay­out

The source of this sec­tion is this an­swer at Ask Ubun­tu. The firs step is to find the xRDP's key-map name for the lan­guage you want to add. For ex­am­ple the key-map code for Bul­gar­i­an lan­guage is 0x0402. So to gen­er­ate key-map for this lan­guage you need to per­form the fol­low­ing com­mands and then log-out and restart rdp.service via SSH or just re­boot the in­stance.

xrdp-genkeymap km-0402.ini
sudo mv km-0402.ini /etc/xrdp/km-00000402.ini
sudo chown root:root /etc/xrdp/km-00000402.ini

Af­ter the most re­cent up­date of xRDP (Sep­tem­ber 2022) I was need to add the fol­low­ing di­rec­tives in­to the file xrdp_keyboard.ini.

sudo nano /etc/xrdp/xrdp_keyboard.ini
[default_rdp_layouts]
rdp_layout_bg=0x00000402

[default_layouts_map]
rdp_layout_bg=bg

[rdp_layouts_map_mac]
rdp_layout_bg=bg

See al­so

Ref­er­ences