microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.32k stars 814 forks source link

Win-Kex is not working because of wsl's experimental features #11532

Open 888zxc opened 5 months ago

888zxc commented 5 months ago

Windows Version

Microsoft Windows [版本 10.0.22631.3447]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.146.1

Distro Version

kali-linux 2024.1

Other Software

VcXsrv

Repro Steps

.wslconfig

[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
useWindowsDnsCache=true
bestEffortDnsParsing=true
hostAddressLoopback=true

[wsl2]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

I followed the normal steps after installing kali-linux

sudo apt update

sudo apt install -y kali-win-kex

When I run Win-KeX Window Mode, the password window pops up and disappears, unusable, but I don't care.

Win-KeX Enhanced Session Mode

When I run the Win-KeX Enhanced Session Mode, unlike the official tutorial, the following window pops up first before the connection window. Due to the.wslConfig setting, I can only use 127.0.0.1 or localhost to connect, and the latency is very high

{624B5CB5-6F06-497c-92F8-41784DA1BDD9} {30123EE8-7409-44dd-B24B-C31020B445D2} {B35C230E-FCD2-488b-ADC5-FBFE503B316D}

However, this problem can be fixed by modifying the.wslconfig setting. Clearing the.wslconfig setting will fix the problem, although there is still a bit of latency, but it is not very high.

But what I want is to use wsl2 beyond the proxy I can use for windows, so I don't want to clear the.wslconfig configuration

Win-KeX Seamless Mode

Win-KeX Seamless Mode is the focus of this discussion and the one I hope to solve the most.

6108 I have tried most of the methods in this issue, but nothing has solved the problem on my computer.

Finally, I tried clearing the.wslconfig configuration to solve the problem.

After solving it, although kex --sl can run, but not in seamless mode, but in full-screen mode, it will cover the entire windows interface, and the resolution is not very high, it looks a little fuzzy, but the delay is very low, so low that I can't feel the delay.

I don't want to clear my.wslconfig configuration, so I'm wondering if there's another way around it

Expected Behavior

Win-Kex

Actual Behavior

This is my feedback from running without clearing.wslconfig

┌──(root@localhost)-[~]
└─# kex --sl
Starting Win-KeX server (SL)
        Unable to find Win-KeX server (SL) running on host: 127.0.0.42  Win-KeX server (SL) stopped
        Win-KeX server (SL) is running
Starting Win-KeX client (SL)
        Unable to find Win-KeX server (SL) running on host: 127.0.0.42  Enabling Win-KeX client (SL)

        Waited 100 seconds for xfDesktop (gave up)
        Try either:
 /usr/bin/kex --sl --wait [...]
                /usr/bin/kex --sl --wait [...]
                Install vcxsrv on the host outside of WSL: https://www.kali.org/docs/wsl/win-kex-sl/

This is my feedback when I run with.wslconfig cleared

kex --sl
Starting Win-KeX server (SL)
        Unable to find Win-KeX server (SL) running on host: 172.23.112.1        Win-KeX server (SL) stopped
        Win-KeX server (SL) is running
Starting Win-KeX client (SL)
        Unable to find Win-KeX server (SL) running on host: 172.23.112.1        Enabling Win-KeX client (SL)

        xfDesktop started after 39 seconds
        Enabling transparency now

        Saving Win-KeX server (SL) session
        Started Win-KeX server (SL)
{F86D3748-367E-4ac3-9F65-29336DA13F87}

This is the resolution I found, and my own computer itself has a resolution of 2560*1600, which is 16:10. And it's a full-screen mode, and I wanted a seamless mode, which I was very bothered about.

{0618C5FE-D4AF-40b1-9153-204A3A8461D8}

Diagnostic Logs

I'll try all the ideas you've come up with in the hope of solving the problem.

One more thing is that I ran xeyes without clearing.wslconfig, because seamless mode is run with VcXsrv, xeyes can run directly, but kex --sl --wtstart -s still can't

github-actions[bot] commented 5 months ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

888zxc commented 5 months ago

/question

github-actions[bot] commented 5 months ago
Diagnostic information ``` Found '/question', adding tag 'question' ```
888zxc commented 5 months ago

I have fixed the issue with KEX seamless mode opening the full screen, now it only opens with the top bar, but when my.wslconfig configuration is changed back to the following,

[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
useWindowsDnsCache=true
bestEffortDnsParsing=true
hostAddressLoopback=true

[wsl2]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

Then I run kex --sl --wtstart -s and I go from running on host: 172.23.112.1, which can run seamless mode, to running on host: 127.0.0.42, after which kex seamless mode cannot be opened

888zxc commented 5 months ago

VcXsrv is not wrong.when I use xeyes and xclock, it is activate

屏幕截图 2024-04-28 172742

But kex --sl --wtstart -s is not activate :scream::scream::scream:

888zxc commented 5 months ago

I can see why my win-kex seamless mode has such a low resolution, because my windows PC is set to 150% zoom, so the resolution displayed in seamless mode is (2560/1.5)x(1600/1.5). Which is 1706*1066 as shown in the picture, and I'll think about how to solve this problem later