I recently had to disable-reenable my WSL2 on windows (because i needed to launch a VM) and after restarting, it seems like my kex stopped working.

When I simply type "kex", I get the typical "Error connecting to the KeX server". A small window opens and says "unable to connect to socket: Connection refused (10061)".

I'm used to temporary errors with kex that just require kex --stop or kex kill or similar to be fixed, but none of those worked. When I do that however, I get (2 or 4 times) the following message : tigervncserver: No matching VNC server running for this user! Doing it from my $HOME or with sudo didn't work either.

So, is there any way to fix this problem? All my packages are up-to-date.

3 Answers 3


first check if there is dbus exist or not so run this command sudo apt install dbus-x11

run those command also vncserver -kill , kex kill ,kex stop

now run vncserver -localhost no

and then to start just run kex command


I've tried every solution I've found on the Internet so far, but nothing has worked.  My solution: I looked at the status via kex status:

/usr/bin/kex: line 266: tasklist.exe: command not found

Solution was found at Microsoft Docs (also available in Russian).

I've added /mnt/c/Windows/system32 to $PATH.

Also I've created file .wslconfig in my User folder and added these lines:


Then I restarted the computer and it worked.

My current $PATH looks like this:

/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:
/mnt/c/Program Files/Python39/Scripts/:
/mnt/c/Program Files/Python39/:
/mnt/c/Program Files/Git/cmd:

First, make sure that WSL is version 2. If it isn't download and run the update. Then verify it. Then update kali to wsl 2. then verify that in command prompt: wsl -l -v. It should show kali installed and version 2. Then install win-kex. It will take a while. Then start it up in kali with ken --win -s. I found the seamless version didn't work. The window version did work.

This is on 2 Dell Windows 10 Pro machines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.