View Full Version : New WSL2 issue with win-kex

2021-03-17, 17:45

I've been using Kali trough wsl2 on Windows 10 for a while, but since a few days, I cannot connect anymore.
I've done some research, but can't find anything that works.

I've uninstalled kali completely and reinstalled it from the store.
Then I installed win-kex exactly like described in the tutorial, and afterwards, whenever I type "kex" in the terminal, now I receive this:

Error connecting to the KeX server.
Please try "kex start" to start the service.
If the server fails to start, please try "kex kill" or restart your WSL2 session and try again.

I launch the command from home path ("~"), but not working.

Inside the folder ~/.vnc, there is a log file:

Wed Mar 17 18:28:40 2021
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
3NI3X0 New Xtigervnc server 'DESKTOP-PE9SK8H.localdomain:1 (sylvain)' on port 5901 for display :1.
3NI3X0 Use xtigervncviewer -SecurityTypes VeNCrypt,TLSVnc -passwd /home/sylvain/.vnc/passwd DESKTOP-PE9SK8H.localdomain:1 to connect to the VNC server.
ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)
/usr/bin/startxfce4: X server already running on display :1
xrdb: Connection refused
xrdb: Can't open display ':1'
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.

If I start the server "manually", by typing

vncserver :1 -SecurityTypes VncAuth --PasswordFile ~/.vnc/passwd
the server is start, but then, when I start kex, the VNC Client is launched but displays this message:
"No matching security types"

Please can you help me ?

2021-09-15, 12:46
Similar situation. I had win-kex running fine on WSL2.
After a new install of win10 I installed kali and then win-kex by exact same process but now i keep getting VNC errors.
When i run kex --win or kex --s the tigervnc client on windows says unable to connect, connection refused.
In the kali terminal i get unable to run tigervnc pl see log. The log has a lot of xkbcomp errors saying could not resolve keysym and a "failed to create listner"
Buy kex --esm works fine, I get an RDP windows with the kali desktop.
Can't do the seamless or other vnc options.

2021-09-26, 09:28
Hey there, Ive come across the same issue when i just installed win-kex on WSL 2.

Ive run the first boot config of the server with TigerVNC.

After that TigerVNC refused to connect.

I found a way to still be able to connect to the VNC server.

It seems that -win and kex share a different config file :p

When you first run kex --win it asks for a password. the same happens when you run kex without --win.

If you, after you close the session, try to connect with only kex, it would spawn a session without problems.

I hope this helps as a temporal solution to bypass this bug.