Skip to content

Instantly share code, notes, and snippets.

@dmknght
Last active February 14, 2026 09:58
Show Gist options
  • Select an option

  • Save dmknght/a6bdffdb18caac08440eaa3de6b7acec to your computer and use it in GitHub Desktop.

Select an option

Save dmknght/a6bdffdb18caac08440eaa3de6b7acec to your computer and use it in GitHub Desktop.
Try to use Desktop Environment (XFCE) from WSL

I. Disclaimer

  • This script is a copied of https://gist.github.com/tdcosta100/7def60bccc8ae32cf9cacb41064b1c0f but "converted" for Kali inside WSL
  • Set DPI inside WSL doesn't work (command xfconf-query -c xsettings -p /Gdk/WindowScalingFactor -n -t int -s 2 works but it creates a glitch that windows manager won't run). To increate DPI, user can change WSL settings (however, the quality of text in WSL will be really bad) (check https://github.com/microsoft/wslg/issues/590)

Save this file C:/users/username/.wslgconfig, then wsl --shutdown. File's contents:

[system-distro-env]
WESTON_RDP_HI_DPI_SCALING=true
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING=true
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=150

II. Installation

  • Install XFCE4 and dconf-cli (dconf's database is required, kali-menu will allows X11 to find shortcuts / launchers) sudo apt install xfce4 dconf-cli kali-menu xfce4-terminal
  • Generate dconf sudo mkdir -p /etc/dconf/db/local.d then sudo dconf update (make sure ls /etc/dconf/db/local -lah shows a file (not empty file)
  • Removed lightlocker because it cause session error in message sudo apt purge light-locker -y
  • (MAYBE need to mask lightdm service first) sudo systemctl mask lightdm.service

III. Running

  • First, shutdown wsl wsl --shutdown
  • Start this command
DESKTOP_SESSION=lightdm-xsession \
GDMSESSION=lightdm-xsession \
XDG_CURRENT_DESKTOP=XFCE \
XDG_SESSION_TYPE=x11 \
GDK_BACKEND=x11 \
LIBGL_ALWAYS_SOFTWARE=1 \
startxfce4

(Can replace startxfce4 by xfce4-panel to have only panels from XFCE)

What worked:

  • XFCE4 panels and windows manager

What didn't work / error:

  • XFCE4 and Windows Manager are running in 2 different processes
  • Scale doesn't work so small monitor might have trouble
  • XFCE shows popup of wayland compositor error. Compositor doesn't work (neither does xfce4 tweak manager)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment