'The requested operation requires elevation' when installing WSL as SYSTEM
Windows Version
Microsoft Windows [Version 10.0.26200.6584]
WSL Version
0.0.0.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
No response
Distro Version
No response
Other Software
No response
Repro Steps
This issue occurs on a fresh Windows installation when carrying out the following steps;
- Run cmd as Administrator
- Use PSExec to run cmd as SYSTEM (psexec -s -i -cmd.exe)
- Verify cmd is running as SYSTEM (whoami returns nt authority\system)
- Run wsl install (in our use case, wsl.exe --install --no-distribution --web-download --enable-wsl1, but the same occurs when just running wsl.exe --install)
Expected Behavior
WSL should install as expected.
Actual Behavior
The error 'The requested operation requires elevation' is returned, and wsl.exe exits.
While it might seem odd to run wsl.exe --install as SYSTEM, this is required when using deployment tools such as ConfigMgr to deploy a working WSL installation to end users. Using PSExec to run cmd.exe as SYSTEM allows us to test wsl.exe in this situation, without using ConfigMgr.
Diagnostic Logs
No response
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How 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 script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
/emailed-logs
Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'
As a workaround for now, if anyone else is having the same issue when deploying using ConfigMgr, we have scripted the following steps;
- Enable Windows Subsystem for Linux feature (only required for WSL1)
- Enable Virtual Machine Platform feature
- Install latest WSL MSI (https://github.com/microsoft/WSL/releases/latest)
- Set WSL2 as default (wsl.exe --set-default-version 2, this does work as SYSTEM)