1

Not able to launch Ubuntu,

The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.
See https://aka.ms/wslinstall for details.
Press any key to continue...

Output of WSL status:

PS C:\WINDOWS\system32> Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux


FeatureName      : Microsoft-Windows-Subsystem-Linux
DisplayName      : Windows Subsystem for Linux (Beta)
Description      : Provides services and environments for running native user-mode Linux shells and tools on Windows.
RestartRequired  : Required
State            : Enabled
CustomProperties :

I have restarted many times and not able to launch Ubuntu1804.

Edit-1:

I have tried to launch .exe file using admin as well as the user privileges, through double-clicking the .exe file as well as from PowerShell itself.

2 Answers2

1

I have tried to launch .exe file using admin as well as the user privileges, through double-clicking the .exe file as well as from PowerShell itself.

You are using Windows 10 Version 1607, which means you have to use lxrun.exe and bash.exe to manage your WSL instance. wsl.exe and wslconfig.exe are not applicable to Windows 10 version 1607.

Here are the steps you must follow to use WSL on Windows 10 version 1607.

The following instructions are for users running Windows 10 Anniversary Update or Windows 10 Creators Update:

  1. Enable Developer Mode
  2. Open PowerShell as Administrator and run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  3. Reboot
  4. Open a command prompt. Type bash and hit enter

The first time you run Bash on Ubuntu on Windows, you'll be prompted to accept Canonical's license. Once accepted, WSL will download and install the Ubuntu instance onto your machine, and a "Bash on Ubuntu on Windows" shortcut will be added to your start menu.

Sources:

Ramhound
  • 44,080
0

This solved the issue for me:

  1. Run windows + R
  2. type SystemPropertiesAdvanced
  3. click settings in performance group
  4. In advanced tab, deselect the automatically manage paging file size for all drives
  5. Select custom size and enter 800 for initial size, 1024 for maximum size.
  6. Apply changes and restart.

Reference: https://github.com/microsoft/WSL/issues/849#issuecomment-322163360