3

I am trying to enable WSL with Ubuntu on a VM with Windows Server 2019. I am using the Powershell, running as Admin and following instructions here : https://docs.microsoft.com/en-us/windows/wsl/install-on-server .

After enabling WSL, I restarted and run :

Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

I can status shows as enabled. When I run wsl command I get a access denied message:

PS C:\> wsl
Access is denied.

I went ahead and downloaded Ubuntu distro and ran the executable:

PS C:\Users\ad_svoorakk\Ubuntu> ./ubuntu1804.exe
Installing, this may take a few minutes...
Access is denied.
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:

When I enter a username, I see an access denied message and am prompted for username again.

Enter new UNIX username: xxxxxxx
Access is denied.
Enter new UNIX username:

Is there something happening here because this is a VM and there is something I need to do differently? Or does WSL run on VMs at all?

Sridhar
  • 131
  • 4
  • 1
    Yes, WSL 1 works in VMs. With WSL 2, things are a little more complicated but it is not yet generally released. – Daniel B May 18 '20 at 11:15
  • 1
    @0xC0000022L Please read the question again. OP is asking whether WSL can run in a VM. It can, because WSL 1 does not use a VM. – Daniel B May 18 '20 at 11:22
  • Fair enough, but VMs can run nested. It's been years since this became available. – 0xC0000022L May 18 '20 at 11:24
  • 1
    Yes they can, but not universally. Hyper-V in particular is very picky about this. Depending on the exact software setup it may or may not work. – Daniel B May 18 '20 at 12:51
  • Thanks! Is there a specific setting that I need to check? – Sridhar May 18 '20 at 12:52
  • No, your problem isn’t about running in a VM. Googling “wsl access denied” yields some results, bot no solutions. Well, one: apparently communication with the LxssManager service can somehow fail or the service itself or whatever. – Daniel B May 18 '20 at 13:29

1 Answers1

1

I had the same exact issue. For my particular issue, the root cause was traced to McAfee End Point Security. McAfee End Point has a McAfee-defined Access Protection rule that blocks WSL execution. Once this rule was disabled, WSL and Ubuntu started working without issue.

David Frautnick
  • 363
  • 2
  • 8