View Issue Details

IDProjectCategoryView StatusLast Update
0008110Kali Linux[All Projects] General Bugpublic2023-01-12 19:57
Reporternullific Assigned Tore4son  
PriorityimmediateSeveritymajorReproducibilityalways
Status assignedResolutionopen 
Product Version2022.4 
Target VersionFixed in Version 
Summary0008110: Kali-win-kex unable to connect to socket, Failed to activate virtual keyboard: 2, Error in VcXsvr.
DescriptionUnable to initialize Kex using both sudo and normal user.

Including failure to initialize virtual keyboard when sending the command:

kex --sl
sudo kex --sl
kex --win
sudo kex --win
kex --esm
sudo kex --esm
Steps To ReproduceGo through the normal installation for kali-win-kex and WSL.

kex --sl

you should get the following errors in the log (my error log as an example):

Welcome to the VcXsrv X Server
Vendor: The VcXsrv Project
Release: 1.20.14.0

OS: Windows NT 10.0 build 22000 (64-bit)
Contact: marha@users.sourceforge.net

LoadPreferences: C:\Users\57pat\AppData\Roaming.XWinrc not found
LoadPreferences: Loading \wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\system.XWinrc
(II) AIGLX: Testing pixelFormatIndex 5
(II) GLX: enabled GLX_SGI_make_current_read
(II) GLX: enabled GLX_SGI_swap_control
(II) GLX: enabled GLX_MESA_swap_control
(II) GLX: enabled GLX_SGIX_pbuffer
(II) GLX: enabled GLX_ARB_multisample
(II) GLX: enabled GLX_SGIS_multisample
(II) GLX: enabled GLX_ARB_fbconfig_float
(II) GLX: enabled GLX_EXT_fbconfig_packed_float
(II) GLX: enabled GLX_ARB_create_context
(II) GLX: enabled GLX_ARB_create_context_profile
(II) GLX: enabled GLX_ARB_create_context_robustness
(II) GLX: enabled GLX_EXT_create_context_es2_profile
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) 670 pixel formats reported by wglGetPixelFormatAttribivARB
(II) GLX: Initialized Win32 native WGL GL provider for screen 0
[xkb] Starting '"\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbcomp" -w 1 "-R\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbdata" -xkm "C:\Users\57pat\AppData\Local\Temp\xkb_a06412" -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" "C:\Users\57pat\AppData\Local\Temp\server-3.xkm"' failed: Incorrect function.
(EE) Error compiling keymap (server-3) executing '"\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbcomp" -w 1 "-R\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbdata" -xkm "C:\Users\57pat\AppData\Local\Temp\xkb_a06412" -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" "C:\Users\57pat\AppData\Local\Temp\server-3.xkm"'
(EE) XKB: Couldn't compile keymap
(EE) XKB: Failed to load keymap. Loading default keymap instead.
[xkb] Starting '"\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbcomp" -w 1 "-R\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbdata" -xkm "C:\Users\57pat\AppData\Local\Temp\xkb_a06412" -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" "C:\Users\57pat\AppData\Local\Temp\server-3.xkm"' failed: Incorrect function.
(EE) Error compiling keymap (server-3) executing '"\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbcomp" -w 1 "-R\wsl.localhost\kali-linux\usr\lib\win-kex\VcXsrv\xkbdata" -xkm "C:\Users\57pat\AppData\Local\Temp\xkb_a06412" -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" "C:\Users\57pat\AppData\Local\Temp\server-3.xkm"'
(EE) XKB: Couldn't compile keymap
XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE)
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE)
(EE) Server terminated with error (1). Closing log file.
Additional InformationRemoving, Uninstalling, and purging of Kali-win-kex doesn't work or solve the issue either.

I've also tried removing .X11-unix using

sudo rm -rf /tmp/.X11-unix/

That also didn't solve my issue.

Here's the things I tried to fix or solve the issue.

sudo kex --kill
sudo kex --stop

sudo apt remove kali-win-kex
sudo apt purge kali-win-kex
sudo apt-get install kali-win-kex

kex --sl --wtstart -s (This still gave me errors and it still doesn't fix the issue)

This issue is the same for all types and configurations for kex

--win (broken)
--esm (refused to connect to both localhost and container)
--sl (broken and virtual keyboard failed to initialize, including unable to connect)
running normal kex is also broken as you can see this is the result I receive below:

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.

Activities

nullific

2022-12-20 13:32

reporter  

image.png (10,190 bytes)
image.png (10,190 bytes)
image-2.png (3,455 bytes)
image-2.png (3,455 bytes)
image-3.png (9,634 bytes)
image-3.png (9,634 bytes)

debigare

2023-01-12 19:57

reporter   ~0017394

Reproduced on my Windows 10 machine. The issue appeared recently, as this was working perfectly fine for me on the same machine before Microsoft stopped supporting the native version of WSL in favor of the Microsoft Store version.

I suspect this is happening because WSL now mounts /tmp/.X11-unix as read-only. More details here:
https://github.com/microsoft/WSL/issues/9303

Issue History

Date Modified Username Field Change
2022-12-20 13:32 nullific New Issue
2022-12-20 13:32 nullific File Added: image.png
2022-12-20 13:32 nullific File Added: image-2.png
2022-12-20 13:32 nullific File Added: image-3.png
2022-12-20 15:48 daniruiz Assigned To => re4son
2022-12-20 15:48 daniruiz Status new => assigned
2023-01-12 19:57 debigare Note Added: 0017394