microsoft / microsoft/sudo

DISM does not work properly when run with sudo

Open
#82 22 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Tracking-External
Dominant language
Rust
Stars
5.9k
Forks
180
Avg merge
1d 7h
Merged PRs (30d)
2

Description

Sudo for Windows version

1.0.0

Windows build number

10.0.26100.0

Other Software

Note that it does work if you don't use sudo and just run DISM in an elevated shell.

Steps to reproduce

sudo dism /Online /Cleanup-Image /RestoreHealth

sudo is set to inline mode

Expected Behavior

DISM works

Actual Behavior

❯ sudo dism /Online /Cleanup-Image /RestoreHealth

Deployment Image Servicing and Management tool
Version: 10.0.26100.1

Error: 31

An error occurred while creating the log file.
Ensure that the path to the log file exists and that you have Read/Write permissions on the folder where the log files will be created.

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 sudo dism /Online /Cleanup-Image /RestoreHealth on Windows build 10.0.26100.0 with sudo in inline mode, then compare it with DISM in an elevated shell. Investigate the error about creating the log file and verify the fix by confirming DISM completes through sudo without Error 31.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.