microsoft / microsoft/WSL

`mkdir /run/user/1000/: permission denied` after WSL 2.0.0

Open
#10,498 28 comments 32 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Windows Version

Microsoft Windows [Version 10.0.22631.2338]

### WSL Version

2.0.0.0

### Are you using WSL 1 or WSL 2?

- [X] WSL 2
- [ ] WSL 1

### Kernel Version

5.15.123.1-1

### Distro Version

Ubuntu 22.04

### Other Software

_No response_

### Repro Steps

I'm sorry but I'm not sure if this issue happened after upgrading to 2.0.0 or after running `wsl --manage Ubuntu --set-sparse true`, since I did both at once.

Some programs I have, like [chezmoi](https://github.com/twpayne/chezmoi), is now failing:

```console
$ chezmoi update
chezmoi: mkdir /run/user/1000/: permission denied
```

### Expected Behavior

To work as it did before.

### Actual Behavior

```console
$ chezmoi update
chezmoi: mkdir /run/user/1000/: permission denied
```

### Diagnostic Logs

No logs.

- This is apparently related to https://github.com/microsoft/WSL/issues/10473, but since my problem happened after upgrading to 2.0.0 I'm reporting it separately.

The workaround is to:

```console
sudo mkdir /run/user/1000 && sudo chmod 700 /run/user/1000 && sudo chown $(whoami): /run/user/1000
```

Which I saw somewhere but I don't remember where.

Contributor guide

Open the contributing guide

Research direction

No source file or test is identified in the report. First reproduce the failure on WSL 2.0.0 with Ubuntu 22.04, checking whether sparse-disk management is involved; done means `/run/user/1000/` is created with usable permissions without the reported workaround and `chezmoi update` succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.