microsoft / microsoft/WSL

Running Home Assistant via wslc exits abnormally when adding the -v parameter

Open
#40,987 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug fixinbound needs-investigation wslc
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Windows Version

10.0.26200.8737

### WSL Version

2.9.3.0

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

- [x] WSL 2
- [ ] WSL 1

### Kernel Version

6.18.35.2-1

### Distro Version

_No response_

### Other Software

### Repro Steps

run command
```powershell
wslc run --rm -v d:\wslc\ha:/config -p 8123:8123 --name=ha homeassistant/home-assistant
```

### Expected Behavior

```powershell
wslc run --rm -p 8123:8123 --name=ha homeassistant/home-assistant
```
`
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started`

### Actual Behavior

`s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
Traceback (most recent call last):
File "", line 203, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 227, in
sys.exit(main())
~~~~^^
File "/usr/src/homeassistant/homeassistant/__main__.py", line 189, in main
with runner.ensure_single_execution(config_dir) as single_execution_lock:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.14/contextlib.py", line 141, in __enter__
return next(self.gen)
File "/usr/src/homeassistant/homeassistant/runner.py", line 146, in ensure_single_execution
_write_lock_info(lock_file)
~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/runner.py", line 67, in _write_lock_info
lock_file.truncate()
~~~~~~~~~~~~~~~~~~^^
PermissionError: [Errno 13] Permission denied
[09:56:51] INFO: Home Assistant Core finish process exit code 1
[09:56:51] INFO: Home Assistant Core service shutdown
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: warning: service s6rc-oneshot-runner is marked as essential, not stopping it`

### Diagnostic Logs

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown wslc command with and without the -v mount, then inspect the PermissionError from /usr/src/homeassistant/homeassistant/runner.py when it truncates the lock file. Done means isolating whether the WSL-mounted path causes the failure and identifying a confirmed WSL-side fix or a clear routing note if the problem belongs to the Home Assistant container.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.