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.

shaik moeed
  • 113
  • 1
  • 6
  • 1
    Probably you are using old Windows 10 version. wSL feature is out of beta in several years ago. Clean install of latest Windows 10 OS may solve your issue. – Biswapriyo Feb 07 '20 at 05:14
  • 1
    @shaikmoeed - Why does it say `Windows Subsystem for Linux (Beta)`, that isn't right, what version of Windows 10 are you running? You would have to be running 1703 which is 2 years old. – Ramhound Feb 07 '20 at 07:10
  • Try using lxrun instead. – Ramhound Feb 07 '20 at 08:15
  • @Ramhound Current version is `1607`. Maybe I need to update it to the latest version `1909`. – shaik moeed Feb 07 '20 at 08:39
  • @shaikmoeed - Windows 10 version 1607 has not been supported for nearly 2 years. You really should upgrade to the most recent version. Your issues are due to the fact, you have a version with only the beta version, which means your WSL Ubuntu instance will be 4 years old – Ramhound Feb 07 '20 at 08:54

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
  • 41,734
  • 35
  • 103
  • 130
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