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

/run/user/1000 owner become root when pre mount a vhdx disk before start the wsl system #10473

Closed
1 of 2 tasks
lawrsp opened this issue Sep 14, 2023 · 1 comment
Closed
1 of 2 tasks

Comments

@lawrsp
Copy link

lawrsp commented Sep 14, 2023

updated:

Windows Version

10.0.22621.2283

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 22.04

Repro Steps

  1. restart windows
  2. bare mount a vhdx disk with admin powershell
    wsl.exe  --mount --partition 1 \\.\PHYSICALDRIVE$4 -o "discard,errors=remount-ro,data=ordered" --bare
    
  3. start ubuntu and check /run/user/1000

Expected Behavior

it should owned by the user (id 1000) not root (id 0)

Actual Behavior

~ cd /run/user
➜  user ll
total 0
drwxr-xr-x 2 root root 40 Sep 14 18:01 1000
➜  user
@lawrsp
Copy link
Author

lawrsp commented Jun 14, 2024

my solution is

  1. not load the vhdx to windows disk manager, if loaded, unload it
  2. direct mount to wsl, like:
    wsl.exe -d Ubuntu --mount --vhd xxxxxxx --bare

sometimes before , if the vhdx file is not on disk C:, the step 2 would fail. That's why I need my old mount steps.
But after some updates, it can directly mount the vhd, and there is no permission problems by these steps, so I will close this issue

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

No branches or pull requests

1 participant