0

I had previously installed kali-linux in my Windows 11 computer (WSL), but I had to erase it due some display driver issues. This time when I tried to reinstall the WSL Kali-linux machine with RDP doesn't appear the GUI.

I've installed xrdp, kali-desktop-xfce then I connected through RDP but after putting in my credentials the screen turns blue, and then gets disconnected.

I've also have followed a bunch of guides as

Nothing seems to work

But after 2 days trying, I get some error

$ sudo systemctl enable xrdp
$ sudo systemctl start xrdp
Synchronizing state of xrdp.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable xrdp
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Any idea of what's happening?

(the last time I've installed ubuntu and kali with xfce and xrdp and everything was working fine)

IDK if it's the config file or xrdp with kali, or if it's trying to connect to my ubuntu config file

2
  • Edit your question to indicate if you are running Windows 10 or Windows 11.
    – Ramhound
    Commented Oct 13, 2022 at 21:35
  • Welcome to Super User! For XRDP, it really shouldn't matter too much if you are running Windows 10 or 11. But you link to two very different types of installation instructions -- The first, the official doc, is about installing XRDP. But then you link to two YouTube videos, that (in scanning through them quickly) recommend install Kex. So which are you really trying to do - Kex (of which XRDP is a part) or XRDP? Commented Oct 14, 2022 at 2:09

3 Answers 3

3

I see this frequently.

WSL is NOT a Virtual Machine APP. I suggest you not try this.

Kali is NOT well suited to WSL (answering this post from Kali).

So your best way forward for Kali is to run in Virtual Machine (VMware or Hyper-V).

3
  • 1
    That's a bit of an odd perspective, IMHO. I tend not to run Kali myself, but Kali is very well supported on WSL in general, with the Kali team releasing very tight integration and GUI capabilities for WSL a few years before Microsoft did. However, one of the most common uses of Kali is for pen-testing, and for that purpose, I do agree that WSL is not well suited. However, I don't see any indication in the OP's question that they want to use it that way -- Just that they already had it set up for GUI capabilities, uninstalled it, and now can't get that functionality to work. Commented Oct 14, 2022 at 2:13
  • It is had to image loading up Kali in WSL using USB Pass Through and running penetration tools. I see WSL as a useful tool but not any kind of decent replacement for a true virtual machine.
    – anon
    Commented Oct 14, 2022 at 11:14
  • But again, this question wasn't about using penetration tools. There are many uses for WSL where it is more suited than a VM. Note that in this year's Stack Overflow Developer Survey, 15% of developers were using WSL for development. Some of us just use it because we prefer a good CLI alternative to PowerShell, with tools like a good pager (bat/less`), terminal-mode editors (Vim, Neovim, Emacs), etc. And having WSL (with whatever distribution) load up in 2-3 seconds is far better than a VM. Commented Oct 14, 2022 at 11:49
1

Since I'm not sure what state your Kali installation is in at the moment, I'm going to give you the steps that I just followed to get a basic XRDP/Xfce4 installation running on Kali on WSL2.

  1. From a fresh Kali installation on WSL2, sudo apt update && sudo apt upgrade -y (the first steps you should take under pretty much any Debian-based distribution, of course).

  2. sudo apt install -y kali-linux-default to install the default packages for Kali, since the WSL installation is, as the MOTD says, "minimal" to start.

  3. sudo apt install xrdp kali-desktop-xfce

  4. sudo -e /etc/xrdp/xrdp.ini and change the port from 3389 to 3390 since Windows RDP defaults to 3389.

  5. sudo service xrdp start

  6. Connect via RDP to localhost:3390 and use Xorg for the session type.

That was it. This does not require Systemd, but if you want to enable that, see my Ask Ubuntu answer for how to do so using the latest WSL with official Systemd support.

This also doesn't include audio support, which I believe Kex will enable, but in this particular question you only ask for "XRDP/Xfce4".

0

A couple of years ago I built a script to download/install everything you need for an RDP-accessible Kali desktop on WSL, and does not require systemd: https://github.com/DesktopECHO/Kali-xRDP

PowerShell -executionpolicy bypass -command "wget https://github.com/DesktopECHO/Kali-xRDP/raw/main/Kali-xRDP.cmd -UseBasicParsing -OutFile Kali-xRDP.cmd ; .\Kali-xRDP.cmd"

You will be asked a few questions. The installer script determines the current Windows DPI scaling of your system but you may set your own if preferred:

 [Kali xRDP Installer 20210602]

 Hit Enter to use your current display scaling in Windows
 or set the desired value (1.0 to 3.0 in .25 increments) [1.5]: 1.25
 Port number for xRDP traffic or hit Enter for default [3399]:
 Port number for SSHd traffic or hit Enter for default [3322]:
 [Not recommended!] Type X to eXclude from Windows Defender:

The script will download the LxRunOffline distro manager to bootstrap the installation. Install times will vary depending on system performance and the presence of antivirus software. A fast system with broadband Internet can complete the install in under 10 minutes and most machines will complete within 20 minutes. Expect it to take 30+ minutes if Windows Defender is running. If you want to track progress logs are located in %TEMP%\Kali-xRDP.

 [22:18:12] Prepare Distro (~1m00s)
 [22:19:08] Install xRDP and Kali-Linux-Core packages (~3m00s)
 [22:22:53] Kali-Desktop-XFCE (~5m00s)
 [22:30:39] Additional Components (~1m00s)

At the end of the script you will be prompted to create a non-root user which will automatically be added to sudo'ers.

 Create a NEW user in Kali for xRDP GUI login. Enter username: kaliuser
 Enter password for kaliuser: **********

Open Windows Firewall Ports for xRDP, SSH, mDNS...
Building RDP Connection file, Init system...
Building Scheduled Task...
SUCCESS: The scheduled task "kali-linux" has successfully been created.

       Start: Thu 02/25/2021 @ 22:17
         End: Thu 02/25/2021 @ 22:31
    Packages: 1154

   - xRDP Server listening on port 3399 and SSHd on port 3322.

   - Link for GUI session has been placed on your desktop.

   - (Re)launch init from the Task Scheduler or by running the following command:
     schtasks.exe /run /tn kali-linux

  Installaion of xRDP GUI on "kali-linux" complete, graphical login will start in a few seconds...

A fullscreen remote desktop session will launch Kali using your stored credentials.

Convert to WSL2 instance:

Terminate the instance: wslconfig /t kali-linux

Convert the instance to WSL2: wsl --set-version kali-linux 2

Restart the Instance: schtasks /run /tn kali-linux

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .