79631027

Date: 2025-05-20 19:16:08
Score: 0.5
Natty:
Report link

I think you need to make the following changes:

Change

sei.lpVerb = L"runas";

to:

sei.lpVerb = NULL;
std::wstring wDistribution = L"Debian"; // Make sure case matches exactly, you can run wsl --list --verbose to find out 

Make sure your application is compiled for x64, not x86.

Change:

WaitForSingleObject(sei.hProcess, 2000);

To:

WaitForSingleObject(sei.hProcess, 10000); 

I ran your program with the above changes on my machine (which has WSL Ubuntu) and it appeared to work. Take a look at a relevant stackoverflow question.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Pratik Mathur