No se puede conectar el enchufe: conexión rechazada (10061)

No se puede conectar el enchufe: conexión rechazada (10061)

Estoy intentando ejecutar kex --win -sKali Linux para obtener la GUI, pero aparece un mensaje de error:

Error: unable to connect socket: connection refused(10061)

Puede usted ayudar

He probado lo siguiente:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

wsl --set-default-version 2

wsl --set-version kali-linux 2

sudo apt install -y kali-win-kex



kex --win -s

Inicie vncserver para aceptar la conexión desde todas las direcciones de red:

vncserver -localhost no

Verifique el estado del kex nuevamente:

kex --status

Ahora debería enumerar las sesiones de vnc.

Escriba el siguiente comando para iniciar las ventanas de Kali:

kex --win -sl

Si ejecuto vncserver -localhost nome sale lo siguiente:

Killing Xtigervnc process ID 29... success!

tail /home/vi/.vnc/Vik.localdomain:5901.log:

Xvnc TigerVNC 1.11.0 - built 2021-03-22 21:21
Copyright (C) 1999-2020 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12010000, The X.Org Foundation


Mon May 24 18:42:53 2021
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5901
 vncext:      created VNC server for screen 0

Mon May 24 18:43:24 2021
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)

vncserver: /usr/bin/Xtigervnc did not start up, please look into '/home/vi/.vnc/Vik.localdomain:5901.log' to determine the reason! -1

Soy nuevo en Kali Linux.

Respuesta1

Una nota para todos los demás que tengan este problema:¡Asegúrate de tener WSL2 y no WSL1!Pasé horas intentando resolverlo hasta que me di cuenta de que tengo WSL1.

  • Para obtener WSL 2, siga las instrucciones enesta página.
  • Para actualizar una instalación kali-linux WSL1 existente, abra un Powershell con derechos de administrador y escriba:
    wsl --set-version kali-linux 2
    

Nota:Referenciado aquí

Respuesta2

Intentardetenertodas las distribuciones en ejecución y máquinas virtuales de utilidad ligera WSL 2.

wsl --shutdown

e inicie sesión en Win-KeX.

kali
kex

Funcionó en mi computadora.

Respuesta3

Probé todas las soluciones que encontré en Internet hasta ahora, pero nada funcionó. Mi solución: miré el estado a través de kex status:

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

Se encontró la soluciónen Documentos de Microsoft (también disponible en ruso) .

Lo agregué /mnt/c/Windows/system32a $PATH.

También creé un archivo .wslconfigen mi carpeta de Usuario y agregué estas líneas:

[wsl2]
localhostForwarding=true

Luego reinicié la computadora y funcionó.

Mi $PATH actual se ve así:

/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/usr/lib/wsl/lib:
/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:
/mnt/c/Program Files/Python39/Scripts/:
/mnt/c/Program Files/Python39/:
/mnt/c/Windows/system32:
/mnt/c/Windows:
/mnt/c/Windows/System32/Wbem:
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:
/mnt/c/Windows/System32/OpenSSH/:
/mnt/c/Program Files/Git/cmd:

información relacionada