我试图kex --win -s
在 kali linux 中运行以获得 GUI,但收到一条错误消息:
Error: unable to connect socket: connection refused(10061)
你能帮我吗
我已经尝试过以下方法:
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
启动 vncserver 以接受来自所有网络地址的连接:
vncserver -localhost no
通过以下方式再次检查 kex 的状态:
kex --status
现在应该列出 vnc 会话
键入以下命令启动 kali windows:
kex --win -sl
如果我运行vncserver -localhost no
我会得到以下信息:
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
我是 kali Linux 新手
答案1
答案2
答案3
到目前为止,我已经尝试了在互联网上找到的所有解决方案,但没有任何效果。我的解决方案:我通过以下方式查看了状态kex status
:
/usr/bin/kex: line 266: tasklist.exe: command not found
我已添加/mnt/c/Windows/system32
到 $PATH。
.wslconfig
我还在我的用户文件夹中创建了文件并添加了这些行:
[wsl2]
localhostForwarding=true
然后我重新启动了电脑,它就工作了。
我当前的 $PATH 如下所示:
/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: