wsl2+kali-rolling+win kex+Connection refused 10061

本文介绍了如何在Windows 10 WSL2环境下安装并配置Kali Linux,特别是解决Kali Win-Kex启动时的10061错误。通过更换国内镜像源加速下载,并利用VNC提供GUI体验。遇到连接问题时,通过`vncserver-localhost no`命令允许非本地连接。此外,还提供了各种Kex命令的使用示例和退出GUI的方法。
摘要由CSDN通过智能技术生成

wsl2+kali,可以在win10下运行一个效率高于virtualbox等虚拟机的linux,kali-win-kex基于VNC(In computing, Virtual Network Computing (VNC) is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical-screen updates back in the other direction, over a network.),可以提供一套GUI系统,虽然不如原生的好看,但是还是可以用的。
我使用的是win10版本为20H2,默认启动kex会报10061的错,后面需要特殊处理一下,
winver

kali国内源

以下源,根据自己网络速度任选一个即可。

#中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 
#阿里云
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 
#清华大学
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 
#浙大
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
 
#东软大学
deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
 
#官方源
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
kali win kex
sudo apt install -y kali-win-kex
$ kex --help

        Win-Kex 2.7 provides a GUI desktop experience for Kali Linux
        in Windows Subsystem for Linux 2 (WSL 2)

        Usage:
                kex <mode> <command> <parameters>

                Mode:
                --esm            : Launch KeX desktop in a dedicated window using Windows native RDP
                --sl             : Seemlessly integrate KeX into the Windows desktop
                --win            : Launch KeX desktop in a dedicated window

                Command:
                [none]           : start KeX server and launch KeX client
                --start          : start kex server
                --start-client   : start kex client
                --stop           : stop kex server
                --status         : show kex server status
                --kill           : stop kex server and kill all related processes
                --passwd         : set kex server password
                --wtstart        : start kex server and launch win-kex client
                                   in Windows Terminal session
                --start-sound    : start Windows sound server
                --stop-sound     : stop Windows sound server
                --help           : display help
                --version        : display version

                Parameters:
                -i               : Use container IP address instead of "localhost"
                -m               : Optimized for Multiscreen (Win mode only)
                -s               : Sound support


        Examples:
                kex -s           : Start KeX server in window mode and launch KeX client with sound support
                kex --sl -s      : Start KeX in seemless mode and launch KeX client with sound support
                kex --esm -i -s  : Start KeX in ESM mode with arm workaround and launch KeX client with sound support
                sudo kex         : Start KeX server as root in window mode and launch KeX client

直接执行

kex -s

报如下的错误,
10061 error

此时需要执行以下命令,不让VNC只接收本机的数据包(wsl2和win10 ip是两个网段),

# [-localhost [yes|no]]    if enabled, VNC will only accept connections from localhost.
vncserver -localhost no
kex -s

win kex

再次执行后,一切正常!

exit

如果需要从GUI退出,可以按F8,然后Exit Viewer,否则再次进入的时候又会报错。如果报错,可以再次执行vncserver的命令。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值