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

App run as service can't visit wsl directory and files #10622

Closed
1 of 2 tasks
lld1995 opened this issue Oct 11, 2023 · 7 comments
Closed
1 of 2 tasks

App run as service can't visit wsl directory and files #10622

lld1995 opened this issue Oct 11, 2023 · 7 comments

Comments

@lld1995
Copy link

lld1995 commented Oct 11, 2023

Windows Version

Microsoft Windows [版本 10.0.19045.3448]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

Directory.Exists("\\wsl.localhost\Ubuntu\etc") or Directory.Exists("\\wsl$\Ubuntu\etc")

Expected Behavior

it can visit the direcotry and files when app run as service.

Actual Behavior

It returns not exist when i run my app as service
And i try to set service user as system or current admin user,it all failed.
But if i run app directly,it returns exist

Diagnostic Logs

No response

@benhillis
Copy link
Member

The `\wsl.localhost' paths are all user-specific. Are you impersonating the user when trying to access this path?

@lld1995
Copy link
Author

lld1995 commented Oct 12, 2023

The `\wsl.localhost' paths are all user-specific. Are you impersonating the user when trying to access this path?

yes,i have set service loged as the wsl run user

@OneBlue
Copy link
Collaborator

OneBlue commented Oct 19, 2023

Thank you @lld1995. Can share the configuration of your service ?

@lld1995
Copy link
Author

lld1995 commented Oct 20, 2023

Thank you @lld1995. Can share the configuration of your service ?

image

image

My service is created by srvany

@OneBlue
Copy link
Collaborator

OneBlue commented May 13, 2024

/logs

Copy link
Contributor

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute 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

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.

Thank you!

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!

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

No branches or pull requests

3 participants