Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsltty 3.7.6.2 and later exits immediately unless run as administrator #363

Open
yamam opened this issue Dec 23, 2024 · 5 comments · May be fixed by Biswa96/wslbridge2#47
Open

wsltty 3.7.6.2 and later exits immediately unless run as administrator #363

yamam opened this issue Dec 23, 2024 · 5 comments · May be fixed by Biswa96/wslbridge2#47

Comments

@yamam
Copy link

yamam commented Dec 23, 2024

With wsltty versions 3.7.6.2 and 3.7.7, wsltty now exits immediately. It can run with WSL1, but for WSL2, it can only start when launched as an administrator.

When attempting to run wslbridge2.exe, the following error is displayed:

> .\wslbridge2.exe
failed to open the process, error: 5
@yamam
Copy link
Author

yamam commented Dec 27, 2024

I figured out how to reproduce the issue. If WSL2 is started with administrator privileges initially, an error occurs in the following part of wslbridge2 when there is no permission to obtain information about wslhost.exe:

    HANDLE process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);

Why does it not result in an error in wsltty 3.7.6?

@yamam
Copy link
Author

yamam commented Dec 27, 2024

Why does it not result in an error in wsltty 3.7.6?

In wsltty 3.7.6, obtaining the VMID from the registry did not require administrative privileges.

@mintty
Copy link
Owner

mintty commented Dec 27, 2024

Thanks for the analysis.
@Biswa96 , is there any chance to tweak this so it works in all cases reported so far?

@Biswa96
Copy link
Contributor

Biswa96 commented Dec 27, 2024

No idea 😔I do not use WSL anymore.

@yamam
Copy link
Author

yamam commented Dec 27, 2024

I have written the patch, so I will submit a pull request tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants