View Full Version : Kali in WSL + WiN KeX

2021-05-01, 12:06
Hi, I posted this on reddit aswell but usually you never get answers to support questions there. I will paste both of my threads here so that you get the full picture of what's going on and what I need help with.

I've ran Kali before natively on a few laptops and also through VirtualBox but I got intrigued by the integration with windows that lets me run and access windows stuff directly from Kali/XFCE. And thus I followed all the guides on Microsoft's and Kali's website to try and get this running.Kali is running on WSL2, directly downloaded from Microsoft Store. And then I installed the following packages to get some stuff:

sudo apt install -y kali-win-kex kali-linux-large.
Now to my problem, after many hours of googling and reading posts that say "Bro, just do kex stop / kex kill and then it will work", and many many posts on tigervncserver, kex and various other topics. I'm still left with a few problems.

I can only get Kali/XFCE to run in --esm mode. I have no idea why. I'm on a regular AMD 64-bit processor.
If I kill kex, it will also kill tigervncserver which needs to be restarted. Not actually a problem, just something im curious about.
If I run kex --esm, xrdp creates a folder in my home folder that gives errors when ls'ing and can't be entered. umounting the drive helped one time but it keeps remaking it. There is an old issue on their github stating this but none of the solutions work for me.
No sound available (i guess because of windows rdp client?)

If I try to run kex I get the error message saying "no matching security types" and it displays this in terminal:
Win-KeX server sessions:


:1 5901 2047

You can use the Win-KeX client to connect to any of these displays.
If I run kex --sl I get the following:
Checking /home/user/.cache/sessions/xfce4-session-
Enabling SL mode
Desktop started after 1 seconds, enabling transparency now
But it never actually starts - it sits there forever. It also starts VcXsrv in windows which I thought I uninstalled already, I guess it needs it for seamless mode.
Any suggestions?

After I made that thread I got it working again with the fix suggested, using vncserver -localhost no seemed to fix it. But everytime I reboot my computer I run into the same problem. Posting my second thread below.

I had this running for quite some time now but now it won't start again and I just have no idea why.I run the following commands, like suggested in the other thread: vncserver -localhost no (aliased as vnc in my .bashrc) and then kex and it gets stuck on:
Win-KeX server sessions:
x Display # RFB PORT # Process ID Server
:1 5901 3462 Xtigervnc
and nothing happens. Not even esm mode is working anymore. All I did was reboot my computer and everytime I do, this happens. I have to completely re-install kali from windows store and then it might work again, all my settings are of course gone by then. I really love being able to use kali with gui in windows and I hope there is a fix for this but I just can't find it.
I tried emptying out the .vnc folder, I tried killing kex multiple times, I tried killing wsl in terminal. Please help.

For the ones who are interested, here are the reddit threads:

Any suggestions please? I don't even know where to begin to look. I'm not by any stretch a complete linux newbie but I just don't know enough about WSL and VNC/KeX to figure this out. Starting to get desparate here.

Kind regards.