About
This post covers the installation of a GUI for Kali Linux running on WSL(Windows subsystem for Linux). A quick note if you are looking for Linux with a GUI this might not be the best solution. Depending on your wants and needs it might be a good idea to take a look at running a virtual machine or dual booting(or maybe just installing Linux on your machine).
This tutorial only covers the GUI installation. I am assuming that you already installed Kali. If you haven’t I have a tutorial here that goes over installing WSL and Linux on your computer.
WSL GUI Instalation for Kali Linux
Old (Doesn't work anymore)
wget https://kali.sh/xfce4.sh
The Other Way To Install XFCE
sudo apt update sudo apt upgrade
sudo apt-get install xfce4
sudo apt-get install xrdp
sudo /etc/init.d/xrdp start
Possible Problem
If xrdp is running on port 3389 and not on port 3390 you will get this error:
Your computer could not connect to another console session on the remote computer because you already have a console session in progress.
sudo nano /etc/xrdp/xrdp.ini
sudo /etc/init.d/xrdp restart
this fix my problem. i changed the port to 3390 and it works
Thanks for the writeup… found this on GitHub too:
https://github.com/DesktopECHO/Kali-xRDP
Works with WSL1 and WSL2. Just ran the installer and waited a few minutes. Next thing I know I’m in a Kali desktop session!!!
Remote desktop connection doesn’t work… :/
It says:
“Remote Desktop can’t connect to the remote computer for one of the reasons:
1) Remote access to the server is not enabled
2) The remote computer turned off
3) The remote computer is not available on the network
Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.”
I don’t know what’s the problem…
I have to install dbus-x11 in order to successfully connect.
Thank God for this! I had been searching for a working version for me (hex or whatever it was wasn’t working and crap) I’ve been looking so hard to find this! Thank You for the Tutorial. Very Helpful.
Hi, thanks for your post.
I just had a small problem, different then you, my sudo nano /etc/xrdp/xrdp.ini had a lot of 3389, I changed all of them to 3390, but when I log in into the “DTPC” at the remote desktop, I just get a black screen for 10sec and it shuts down.
I don’t know if you can help me out, but I’ll show de difference in the code bellow.
PS:All these 3390’s were 3389.
space between multiple occurrences
;
; Examples:
; port=3390
; port=unix://./tmp/xrdp.socket
; port=tcp://.:3390 127.0.0.1:3390
; port=tcp://:3390 *:3390
; port=tcp://:3389 192.168.1.1:3390
; port=tcp6://.:3390 ::1:3390
; port=tcp6://:3390 *:3390
; port=tcp6://{}:3390 {FC00:0:0:0:0:0:0:1}:3390
; port=vsock://:
port=3390
; ‘port’ above should be connected to with vsock instead of tcp
; use this only with number alone in port above
; prefer use vsock://: above
You only had to change the “port=3389” to “port=3390”. Changing anything else should be unnecessary, also it’s all commented out with “;” so those settings won’t actually do anything.
All in all your settings file should be fine. 🙂
Connect to this address: localhost:3390
When prompted enter your username and password.
Note: “DTPC” is my username in the tutorial, you should enter yours when trying to connect.
Starting Remote Desktop Protocol server: sesman already running xrdp already running.
Do you get this error when you try to connect via RDP? Do you get this error message in the terminal or in the GUI is what I am trying to ask?
getting message in terminal !!
Do you get this message after running this: “sudo /etc/init.d/xrdp start” command?
Is it possible the service is actually already started? Maybe you can just try to connect using RDP.
It’s amazing how integrated everything is now. Now WSL just needs to support monitor mode!
sleep: cannot read realtime clock: Invalid argument
HELP PLZ
This is a bit out of scope here. But I was able to find this: https://github.com/microsoft/WSL/issues/4898
It seems they fixed it 5 days ago, but it’s currently in preview. So once the fix is released you need to update Windows. This should then hopefully fix your problem.
Edit /var/lib/dpkg/info/libc6\:amd64.postinst
and comment out the line
# set -e
this works
sudo -i
sudo mv /bin/sleep /bin/sleep~ ; touch /bin/sleep ; chmod +x /bin/sleep
Starting Remote Desktop Protocol server: sesman already running xrdp already running.
same issue im facing for past 5days, !! if u got solution .. help mee !!
terminal and fire fox crashes plzzzz helppp plzz
if i connet it saying that remote desktop cannot connect to the remote computer plzz help
Thank you so much !!! I’ve been struggling with this, I wanted to avoid using a VM because it’s just really slow and with my laptop it’s kinda annoying to use + my fan start screaming. I’ve watched a lot of youtube videos, some too old, some more recent but when I wrote “127.0.0.1:3389” it did’nt find kali linux running, I literally spent hours, reinitialising my kali linux after the failures, and tried this tutorial I found thanks to a yt comment as a last ressort.
Anyway, it’s really clear and finally worked so I just want to express how glad I am that you made this. Now all that’s left for me is learning how to use it lmao ^^
It’s great to hear that. I wish you good luck and lots of fun with learning.
after connected to remote desktop i got only terminal in remote desktop not GUI
Thank you! Finally got it to work! I DID have to edit the ini file to 3390, then (Write Out ^O), (Exit ^X), which saves the changes in nano editor. Not sure what happened the first time. I knew it was trying 3389 because i saw the ini file later, and if i just put in 3389 it would say session already in progress. Fixed and saved the ini. Killed Remote Desktop. Did the xrdp restart. Connection made, Kali GUI screen!
Thanks again amigo!
I’m glad to hear my post helped you out.
helpppppp
Connecting to kali.sh (kali.sh)|45.79.158.143|:443… failed: Connection refused.
This doesn’t work anymore. Read the tutorial from: “The Other Way To Install XFCE” .
I really hope you reply because I have been seeking help for a week… restlessly. The blue screen after typing (127.0.0.1:3390 or localhost:3390
, and then my username and password) freezes and doesn’t connect..i really don’t know what to do but I suspect it is from the script on the nano menu. Your help would really be appreciated because I have tried so hard and I have no IT knowledge.
Can you post the init.d file contents so I can see if that is indeed the problem? But if you get to the login screen I think that the XRDP settings file we are talking about should be fine. Sounds like the problem could be with xfce. So maybe also try installing that again. You can do it by using this command: sudo apt-get install xfce4
When I enter the command:
wget https://kali.sh/xfce4.sh
I get this error:
GnuTLS: The TLS connection was non-properly terminated.
Unable to establish SSL connection.
This doesn’t work anymore. Read the tutorial from: “The Other Way To Install XFCE” .
the terminal is not opening it says “failed to open default terminal and input/output error”. it’s also not connected to internet
You mean the when you are in windows and try to start up Linux you then get an error. Or did you already successfully log in to Linux via remote desktop and the terminal application in there doesn’t’ work?
yes i already login in linux via RD and terminal application inther is not opening and no internet too
https://askubuntu.com/questions/899391/getting-input-output-error-running-anything-on-remote-desktop
I resolve it like this :
Application, setting, setting manager, preferred application, Uilities, Terminal emulator: Xfce Terminal
(A existing terminal)
best regards,
I installed as you have mentioned ö but Remote Desktop never appeared??
The commands worked – but no change in picture
Do you get any errors? And by “Remote Desktop never appeared” do you mean it failed to connect or did it connect and you have a blank screen?
sudo /etc/init.d/xrdp start
Starting Remote Desktop Protocol server: xrdp-sesman xrdp.
after this command REMOTE DESKTOP not appearing ,plz help
I think you misunderstood the xrdp start command. It starts the remote desktop service on the Linux OS. I won’t start a GUI(like the startx command). After the remote desktop service has been started you need to open something like the Remote Desktop Connection application on Windows and connect to the Linux OS with it. This is the address you need to connect to: localhost:3390 See the screenshot in the tutorial above.
I was super glad to find this tutorial since the GUI linux subsystem seems to be a way to solve some up-to-now unsolved issues. Every step worked out fine until I wanted to log in to RDP. Obviously you need to have Win 10 Pro to use it, right? Haven’t understood yet if using teamviewer could an option. Should give it another try tomorrow. Any advice would be appreciated.
I don’t think TeamViewer can connect via RDP. For TeamViewer to work it would have to be installed on both systems.
I don’t know if the RDP application that comes with windows is exclusive to the pro version. But you can use any other RDP software. You can just google “free RDP software” and get one.
Seeing this only now. Thank you very much, I’m gonna try this out.
continuo ad accedere da desktop remoto , però compare scritto “impossibile connettersi al PC remoto.Verifica che il PC sia acceso,connesso alla rete e con l’accesso remoto abilitato. ho provato in tutti i modi .
You could either be connecting to the wrong IP, wrong port or both.
Also are you sure that the xrdp service is running? You can use this command to see if it is: sudo service xrdp status
when i type sudo /etc/init.d/xrdp start it says Remote Desktop Protocol server: xrdp-sesman xrdp failed!
when i run it first time it works fine but now it is not working what i do i also change port 3390
Maybe try port 3391. See if that works.
Okay, I followed all these steps. My port 3389 was being used, so I changed it to successfully. I can open RDP and get the login screen, but after it tries to connect, it throws an error message saying: “Oh no! Something has gone wrong. A problem has occured and the system can’t recover. Please contact a system administrator.”
Any idea what this might be? I went and purged my xrdp install and reinstalled it (like you had someone do above). After still getting this error message though, I went ahead and did a full install, just to make sure I didn’t miss anything. But after having it install all night and following your instructions again, I still get the same issue.
I wouldn’t know why this happens. But I did find this post that might help you:
http://parthpatel02.blogspot.com/2015/12/oh-no-something-has-gone-wrong-problem.html
hello I need help when i try strating the rdp by the following command using sudo /etc/init.d/xrdp startit only returns me Starting Remote Desktop Protocol server: xrdp-sesman xrdp. and there is no ip address or port number what should i do
What if you try to connect localhost:3390 anyway? See if it maybe works.
Nothing happens. I also have this issue. Nothing is listed when I run the start command.
Can you post the contents of the /etc/xrdp/xrdp.ini file here?
I am having the same problem. i tried to connect using remote desktop connection and it does not wok plz help
Hello.
anyone can help i wasn’t able to do any installation process. i always get this message
( #1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for chess:
and doesn’t allow me to type my password.
I think what is happening is that you are actually typing in the password. But the terminal doesn’t show any * or dots therefor you thought that it is not letting you type in the password.
This is meant to be this way and is normal. Just type your password in and press enter.
you have to stop the service before changing the port number otherwise it doesn’t take effect.
Hi,
i have install Kali Linux with WSL2. But i can’t connect with RDP. I’ve used the IP (172.26.242.X) for the VM, change the Port. Have you an idea?
Sorry but I haven’t used WSL2 yet so I don’t know how much different it is to WSL. I can just suggest you double-check everything and make sure that xrdp is running on the correct port. As I said I am not familiar with WSL2 but the IP address you are connecting to doesn’t seem right to me. I think you should be connecting to localhost:3390 or 127.0.0.1:3390 .
I had a working solution using WSL but after switching to WSL2, I also can’t connect anymore with RDP.
It looks like the port just isn’t available but I can’t put my finger to it.
Starting xrdp returns this
—————————————–
sudo /etc/init.d/xrdp start
Starting Remote Desktop Protocol server: xrdp-sesman xrdp
[20200114-20:29:08] [DEBUG] Testing if xrdp can listen on 127.0.0.1 port 3390.
[20200114-20:29:08] [DEBUG] Closed socket 6 (AF_INET6 ::1 port 3390)
Netstat looks ok though
—————————————–
netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 ::1:3350 :::* LISTEN
tcp6 0 0 ::1:3390 :::* LISTEN
nmap otoh shows the port is closed
————————————————————
nmap localhost -p 3390
Starting Nmap 7.80 ( https://nmap.org ) at 2020-01-14 20:36 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000098s latency).
PORT STATE SERVICE
3390/tcp closed dsc
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds
/var/log/xrdp.log shows the following
————————————————————–
[20200114-20:29:08] [DEBUG] Testing if xrdp can listen on 127.0.0.1 port 3390.
[20200114-20:29:08] [DEBUG] Closed socket 6 (AF_INET6 ::1 port 3390)
[20200114-20:29:10] [INFO ] starting xrdp with pid 32564
[20200114-20:29:10] [INFO ] listening to port 3390 on 127.0.0.1
psping started from my host machine also show a closed port
—————————————————————————————————–
psping -4 localhost:3390
PsPing v2.10 – PsPing – ping, latency, bandwidth measurement utility
Copyright (C) 2012-2016 Mark Russinovich
Sysinternals – http://www.sysinternals.com
TCP connect to 127.0.0.1:3390:
5 iterations (warmup 1) ping test:
Connecting to 127.0.0.1:3390 (warmup): from 0.0.0.0:11858:
The remote computer refused the network connection.
=> So I’m not sure what to make all of this.
Starting the service shows a closed socket but netstat and the xrdp.log file show port 3390 being used and listened to.
Testing the port using nmap or psping on the other had show that the port is closed.
If you have any idea how to proceed from here, much appreciated
“The remote computer refused the network connection.” I am not sure but one thing that comes to my mind is a problem with the firewall? The log files show that the services are running on those ports but you are unable to connect to them. This also seems like it could be the firewall blocking the connection.
Thank you for you reply. I didn’t manage to nail it down and switched for the time being back to a virtual machine.
Terminal and firefox crash,,,,how to fix it???
how
Try updating Kali.
sudo apt update
sudo apt upgrade
my Kali is up to date and it still crashes and they still fail to execute. help me
Hi Tsla, thank you for your tutorial, I successfully put in place the GNU but something is off, I just can’t seemt o use any of the programs in it beside docs and text editor. If I open terminal it says: Failed to execute default Terminal Emulator. Input/Output error.
Whereas other programs such as mozilla, Kali docs, Kali bugs and so on it opens a Mozilla page and crashes instantly saying:”Firfox had a problem and crashed”
same problem, people please help
Try updating Kali.
sudo apt update
sudo apt upgrade
what I did wrong?
Try updating Kali.
sudo apt update
sudo apt upgrade
You really helped me. Especially the tip about updating the port from 3389 to 3390! Thanks!
🙂
I changed 3389 to 3390, but now how do I save the file?? Thankyou!!!
Upon making the change press CTRL + X to exit the nano text editor.
Before exiting, the editor will ask you if you want to save the changes.
Press Y and then enter.
Hey. Thanks for the instructions.
Still got a problem : Everything works but when I connect to the Remote it starts up a Terminal / Console not the GUI. So yeah if you could help me that’d be very nice. Thanks 🙂
Maybe something didn’t install/install correctly.
Try updating your Linux installation and then try install xfce again.
sudo apt-get upgrade
sudo apt-get install xfce4
Thank you so much!!!!!!!!!!!!!!!!!!!!! it worked perfectly after trying for several months!!!!!!!!!
🙂
Sorry to bother you. But I have this problem
I changed my port to 3389 to 3390. then when I restart the xrdp, nothing happens.
There is no “ok” text as your screen shows when you start the xrdp,
Do you know what is going on ?
Oh I login into remote desktop connection, GuI is not displayed, it just shows the connection log messge.
Do you know what is wrong here?
When you say nothing happens is there no output at all not even an error? And if you change the port back does it start up then? Is it possible that you unknowingly modified something in your config file and broke it as a result?
that’s the exact case for me
Sorry to bother you, but I am receiving the error message with the remote desktop connection
Remote Desktop can’t connect to the remote computer for one of these reasons:
1) Remote access to the server is not enabled
2) The remote computer is turned off
3) The remote computer is not available on the network
This happens despite all the other installations working and running fine. I can ping the internet in the Kali wsl console so it is connected to my network and the wsl terminal is open and turned on. I can’t understand what is going wrong.
It sounds like you are either connecting to the wrong address or xrdp isn’t installed/isn’t running. But as you said you have installed xrdp and you have it up and running. Could you post the IP you are connecting to? You should be connecting to localhost or 127.0.0.1.
Thanks for the advice. I checked what port it was trying to use and it turned out that it was trying to run on port 3389 so it was just that problem, I used your solution and it worked fine. Thanks a lot 🙂
I am glad to hear it works now. 🙂
I used 3390 but it still doesnt connects
When you start up xrdp what does it say in the command line? What port is xrdp running on?
what password should i use and the username
You need to put in whatever username and password you used whenever you first installed kali Linux on wsl.
Thank you for your post, Tsla! It was really informative and useful for me.
I am glad you found it useful.
–2019-10-07 02:23:10– https://kali.sh/xfce4.sh
Resolving kali.sh (kali.sh)… 45.79.158.143
Connecting to kali.sh (kali.sh)|45.79.158.143|:443… failed: Resource temporarily unavailable.
Retrying.
It seems to be down
Yes, wget https://kali.sh/xfce4.sh doesn’t work anymore. Follow the “The Other Way To Install XFCE” section.
You need to do this instead to install xfce:
sudo apt-get install xfce4
There appears to be no default browser installed. For the life of me, I can’t get one installed.
If you look in the taskbar you should see an icon with a compass(4th icon in the row). That is the default browser. Or is that icon somehow not present?
why “sudo apt-get install xfce4” get 415 more?
Sorry, I don’t quite understand your question. If you are being asked to install more packages confirm it by pressing Y and then press the enter key.
Hi,
Thanks for the tutorial, but i’m encountering an error where I start up the Remote Desktop Connection,
I can login succesfully with my credentials (Xorg) but when after I press ok, it just gives me another Kali terminal which i was getting in my command prompt anyways, there is no GUI.
Please help.
Sounds like xfce is not installed or not installed properly.
Try this to remove it: sudo apt-get purge xfce4
Then follow the tutorial to reinstall it.
You are a life saver. I was working on it for a full day.
Thanks a million!
Hi,
Using ^W I found that that there were two entries for 3389 within the ini file. I was mistakenly editing the one at the bottom of the file only.
I have now edited both to be 3390 and can connect by RDP to XRDP but get a terminal screen rather than a GUI.
I will continue reading
I followed the instructions and changed port 3389 to 3390 then saved and exited. However, whenever I restart xrdp or stop then start xrdp over it is still on port 3389.
Any ideas what I missed or what I’m doing wrong? Thus far your directions are the clearest and most recent I’ve found. I’d really appreciate your help.
Type cat /etc/xrdp/xrdp.ini
This will print the contents of the xrdp config file. Just to be sure look if the port in the config file was changed.
If the port is correct then the problem is most likely that xrdp isn’t reading the newly changed config file.
Now, restarting xrdp should usually fix it. But as you said you did that and it hasn’t helped.
So next thing that I can think of is rebooting kali and then trying to start xrdp.
But to restart Linux running on WSL you can’t just do a sudo reboot.
You will have to open up PowerShell(do it as admin to avoid any potential problems).
Run this: Get-Service LxssManager | Restart-Service
PS:
I just remembered if you type sudo service xrdp you will get a list of possible commands:
Usage: /etc/init.d/xrdp {start|stop|status|restart|try-restart|force-reload}
So maybe you can also try something like this: sudo service xrdp force-reload to restart xrdp.
This is a noob question for the remote log in what username and password is it asking for ?
The username and password you chose when you installed Kali.
Here is my tutorial for installing Linux on Windows.
It’s for Ubuntu but is pretty much identical for Kali. Scroll down a little bit and you will see the “Enter a username and password.” part.
This is the username and password you need to enter.
Ah well… How do I check what my username is ?
Type whoami in to your terminal. As for your password if you forgot it I think the only to fix that is to reinstall Linux.
Thank You so much Tsla…!!!
I was trying to figure out this problem for a month. Finally, I modified my search as :
wget https://kali.sh/xfce4.sh not found fix
Then your post appeared on Google.
That’s why, I request you kindly make some tags, so that people who are in experiencing this issue, can easily find you. Thanks Alot!
Thanks for the advice I will.
Instead of installing XFCE, if you want XFCE and all the packages available for Kali, use “sudo apt-get install kali-linux-all” and you get XFCE plus all the goodies.
am trying to start xrdp by typing ‘sudo /etc/init.d/xrdp start’
this is the feedback i get
‘-bash: sudo/etc/init.d/xrdp: No such file or directory’
how can i go through this
Try this: sudo service xrdp start
If this fails make sure that xrdp is installed.
When I run Kali on windows 10 and open remote desktop I get the sign in and after that I just get a terminal screen on the remote desktop and not the interface. The line reads “bash: interface: command not found”. I’m searching all over the internet to figure out what to do but getting nowhere. Any help would be much appreciated. I’d really like to get this to work.
Sounds like xfce is not installed or not installed properly.
Try this to remove it: sudo apt-get purge xfce4
Then follow the tutorial to reinstall it.
I’ve done it. but it shows the same. What to do?
i’ve tried reinstalling it, but when connected, it is all black and it shows ” username@computer username:~$”
*username is just an example. infact, it shows my username here please help
Could you post a screenshot so I can see what exactly is going on?
i have been trying to install kali for a while now and i couldn’t do it completely because of this problem, so thank you so much!! a lot of love from Brasil.
Thanks.
how exactly can i change the port?? because i can change the number but i dont know how to save it
Upon making the change press CTRL + X to exit the nano text editor.
Before exiting the editor will ask you if you want to save the changes.
Press Y and then enter.
How can i save the port that i have changed??
You are amazing man I was so confused and you explain these steps so easily and clearly. Thank you very much brother.
I am glad my post helped you.
Anyone else having issues downloading the script? I keep getting “Connecting to kali.sh (kali.sh)|45.79.158.143|:443… failed: Resource temporarily unavailable. Retrying”
Yes, wget https://kali.sh/xfce4.sh doesn’t work anymore. Follow the “The Other Way To Install XFCE” section.
You need to do this instead to install xfce:
sudo apt-get install xfce4
When I follow the instructions to a T, it just brings me to a blank command line screen (after logging in to remote desktop)
Any ideas why?
I don’t know why. But does RDP close first and then the Kali console pops back up or is it that somehow that the console is inside the actual RDP window? (If XRDP is running and you can connect using RDP but don’t get a GUI it could be that XFCE wasn’t installed/installed properly)
remote desk top bounce off
If remote desktop doesn’t connect make sure xrdp is running:
sudo /etc/init.d/xrdp start
After starting xrdp it should tell you what port it’s running on. If the port is 3389 then you have to change it. You can follow the tutorial(scroll down a bit where I describe the issue and show how to solve it).
Connect to:
localhost:(the port that xrdp is running on)
Or you could try connecting to 127.0.0.1 instead of localhost
127.0.0.1:(the port that xrdp is running on)
This is all the help I can give you with the inforamtion you have provided me so far.
Tesla when I started the xrdp it show slide this
“Starting remote desktop protocol server: xrdp ses man xrdp[20190820-03:24:47] [debug] testing if xrdp can listen on 0.0.0.0 port 3389.
[20190820] debug closed socket 6 (AF_INET6:: port 3389)
OK ”
And then I open my RDC type local host3390 and connect
It showas that RDC can’t connect to remote computer
1.remote access to the server is not enabled
2.the remote coklputer is turned off
3.the remote computer is jot available on the network what to date? Please give me a fast reply
I have also the port default ly 3389 I checked it please solve myour problem
So, if I understood you correctly I think your problem could be:
1. You might have misspelled this when you were typing the comment, but if you are actually trying to connect to this: local host3390 it won’t work. Change it like so: localhost:3390
2. I also think your xrdp is still running on the port 3389. You need to change that port to 3390 in the xrdp configuration file. Follow the tutorial for instructions, it’s under the “Possible Problem” title.
Same problem , unable to set up a remote connection , can someone help me please?
What error do you get exactly?
I had the same problem using “localhost:3390”
I had success using my “(computer’s IP):3390”.