microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.42k stars 822 forks source link

Can't install the windows feature #931

Open Simbaclaws opened 8 years ago

Simbaclaws commented 8 years ago

Whenever I install the windows feature: Windows Subsystem for Linux (Beta). I am prompted to restart. Whenever I restart my computer it hangs for about a second on 56% installing the update and then restarts again. It then tells me that the windows update could not be installed and that it's reverting back changes made. I've tried installing the windows feature from within both the command prompt and powershell.

I've ran the following commands on the command prompt: REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0 DISM /Online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux/

And the following commands on the powershell: New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Value 1 Add-WindowsCapability –Online -Name Tools.DeveloperMode.Core~~~~0.0.1.0 Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Both which ended in the same result as when trying to do it from within the windows feature menu in windows 10.

I've checked my event log and couldn't find anything related to the update. Neither in my update history. So I used the following command to gather a log file of my windows updates: Get-WindowsUpdateLog

I will attach the log file to this post.

I expected the installation to go through smoothly so I would be able to start installing bash and start using it.

Instead, windows update tells me that it fails updating.

My windows OS build number is: 14393.51

I hope you guys can help me out, I was thinking: perhaps my anniversary update is corrupt somehow? Causing it to install corrupted files? Or does it install from an external source?

WindowsUpdate.txt

Anyways, I hope you can help me out. I would love to try this feature.

Simbaclaws commented 8 years ago

I've tried using the fix-it for windows update and it actually fixed a few things but it didn't help for installing this windows feature.

iamrockhopper commented 8 years ago

Exactly same symptoms here. Followed same procedure. No luck.

Windows 10 Enterprise, OS build number 14393.51

Windows Logs under Setup kicks out Event ID 11 - can't install package lxss.

iamrockhopper commented 8 years ago

The eventlog as follows:

System

dkager commented 8 years ago

I triggered this by:

Lutten commented 8 years ago

Same problem here. Everthing was working fine until i had to restore my windows installation to an earlier point. After this i cant reactivate it again. On the required reboot the windows update could not install it and is reverting back changes. Maybe important (or not), the systemlanguage is "german". This is the win10 logmsg:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Servicing" Guid="{BD12F3B8-FC40-4A61-A307-B7A013A069C1}" />
    <EventID>11</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>1</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2016-09-09T21:28:23.175364900Z" />
    <EventRecordID>44</EventRecordID>
    <Correlation />
    <Execution ProcessID="1684" ThreadID="1712" />
    <Channel>Setup</Channel>
    <Computer>T460S</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <UserData>
    <CbsUpdateChangeState xmlns="http://manifests.microsoft.com/win/2004/08/windows/setup_provider">
      <UpdateName>Microsoft-Windows-Subsystem-Linux</UpdateName>
      <PackageIdentifier>Microsoft-Windows-Lxss-Optional-Package</PackageIdentifier>
      <ErrorCode>0x800f0922</ErrorCode>
      <Client>Windows Optional Component Manager</Client>
    </CbsUpdateChangeState>
  </UserData>
</Event>"
Simbaclaws commented 8 years ago

After trying to talk to tech support from microsoft (in the hopes they might be able to solve my issue) I was redirected almost (I haven't even counted) times from tier 1 to tier 2 to tier 3 etc.... including 3 missed appointed schedules from their end and having to pay around 50 bucks to call from the netherlands to the united states, I got to the point where they wanted me to pay for a professional tech support team that would cost me 500$ to fix the issue.

In which case I decided to reinstalled my windows 10 and everything worked like expected. I suppose my anniversary update for WSL got corrupted somehow (which I also claimed in the beginning of talking to tech support and in my first post in this page) and apparently I was right.

Great... I payed 50 bucks for nothing and avoided having to pay 500 dollars for something I could easily fix myself....

I honestly can't beleave why they wouldn't agree with me on that it could've been corrupted and suggest me to reinstall but whatever, I'm never going to contact microsoft support again. It's hell. After 8 days I kind of lost my patience....

yann-scheydeker commented 8 years ago

Hello,

Same issue for me :

Installing the subsystem, which was successful.
Starting Bash, creating a user and updating packages with apt.
Using System Restore to go back to an earlier point (for unrelated reasons).
Reinstalling the subsystem, since System Restore reverted the installation. Now it fails to install.
dfishman222 commented 8 years ago

Agree, the folks at MSFT want me to pay for hours of support fixing, but I don't think they know how to fix.

chadius-maximus commented 8 years ago

Getting the same issue on my desktop (laptop is fine though), no idea how to make it work.

afarra commented 8 years ago

I have the same issue as well, also caused by going to a system restore after having already installed the windows linux subsystem. I wonder if some files or registry keys need to be deleted/added manually or something. I hope the devs can provide a fix / recommendation for this. I thought I was the only one, but seems it's a common problem for anyone who's done a system restore after installing it.

imWillX commented 7 years ago

+1

Installing the subsystem, which was successful.
Starting Bash, creating a user and updating packages with apt.
Using System Restore to go back to an earlier point (for unrelated reasons).
Reinstalling the subsystem, since System Restore reverted the installation. Now it fails to install.
sunilmut commented 7 years ago

Thanks for the bug report and really apologize for the super delay in the response. @jackchammons has a repro of this (thanks, Jack) and we are looking into it. We have also opened a bug on our end to track it. And, please keep the feedback coming. We do appreciate it!

sunilmut commented 7 years ago

@all As a workaround, after the system restore and prior to installing bash again, can you try a full uninstall of WSL by doing lxrun /uninstall /full? You will need to have the WSL enabled in the optional features prior to this step.

dkager commented 7 years ago

I re-enabled it, but prior to reboot the lxrun command doesn't seem to be installed yet. Of course after the reboot it rolls back.

chadius-maximus commented 7 years ago

Experiencing exact same issue as @dkager , I enable it in the optional features, but it doesn't install properly on reboot.

sunilmut commented 7 years ago

@dkager - lxrun is part of the optional feature and will only show up after the reboot. Just to be clear, is that not the case for you?

@filoleg - Can you please clarify what you mean by 'doesn't install properly? Islxrun` not showing up for your after reboot?

dkager commented 7 years ago

@sunilmut Upon reboot the installation progress is briefly shown, then it starts to roll back/revert and reboot once more to undo the installation. My guess is that fully uninstalling the feature would work, but it seems like it is stuck halfway with the packages downloaded from the Store but not properly installed.

Are there any logs I can share?

chadius-maximus commented 7 years ago

@sunilmut That is correct. I enable WSL in the optional features (tried through powershell as well, same outcome), it runs installer, then says "reboot to finish installing," it reboots, tries to do install, then quickly flashes "Updates failed to install", and then boots normally. After that, everything is back to square one, WSL feature is unchecked in the optional features, lxrun doesn't show up as a valid command.

afarra commented 7 years ago

@sunilmut I'm experiencing same issue as @dkager and @sunilmut. I can't uninstall the feature because after system restore, the feature doesn't even show that it is installed, and if I 'install it' so that I can uninstall it with lxrun /uninstall /full the installation doesn't complete because during reboot it says it is being rolled back (as @dkager mentioned) so after reboot it again shows that it is not installed, so can't uninstall it with lxrun

sunilmut commented 7 years ago

@dkager, @filoleg @afarra - Sorry to hear about your experience. Can you enable the feature by doing the below from a cmd prompt: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux And, after the reboot (and failed installation of the feature), share the log: %windir%\Logs\DISM\dism.log We might be able to get a better idea what is going on with the feature installation.

chadius-maximus commented 7 years ago

@sunilmut same thing happened with cmd, archive with my dism.log is attached. dism.zip

sunilmut commented 7 years ago

Thanks @filoleg for sending the logs. Just heard from the dism team that we also need the %windir%\logs\cbs logs. Could you provide them too?

chadius-maximus commented 7 years ago

@sunilmut no problem. CBS.zip

afarra commented 7 years ago

@sunilmut I've also ran that command and have the logs (dism.log/cbs.zip) from the failed update. Let me know how I can share them with you/WSL team (I'd rather not attach it here in case there's sensitive info in the logs)

sunilmut commented 7 years ago

@filoleg Thanks much, appreciate it.

@afarra - I have shared logs from @filoleg with the DISM team and if they are not conclusive, I might ask for your logs using the Insider email address.

Just out of curiosity, after you restore the system using the system restore, is developer mode enabled at that time?

afarra commented 7 years ago

@sunilmut Developer mode remains on, yes. But WSL turns back off.

afarra commented 7 years ago

Oh, sorry, you mentioned restore (I read restart). No, after restoring the system with System Restore both WSL and Developer mode are off, I think it was because the system restore was taken before turning on developer mode.

sunilmut commented 7 years ago

@dkager, @filoleg @afarra and everyone else here who is stuck in the optional feature installation after a system restore, can you please try this workaround:

schtasks /query /tn "\Microsoft\Windows\Windows Subsystem for Linux\AptPackageIndexUpdate" and share the output in GitHub

  1. schtasks /delete /tn "\Microsoft\Windows\Windows Subsystem for Linux\AptPackageIndexUpdate" /f N.B - Do not do this if your optional feature is fully installed and working.
  2. Enable the WSL optional feature (if not already)
  3. Reboot
  4. lxrun /uninstall /full
  5. Install bash
afarra commented 7 years ago

@sunilmut That task does not exist. Running that query gives: ERROR: The system cannot find the file specified. Similarly, running the /delete command complains that this task does not exist. I've also listed all the tasks by running schtasks and I don't see it in the last, neither through command line, nor through the "Task Scheduler" program

chadius-maximus commented 7 years ago

@sunilmut running the /query command in cmd returned "ERROR: The system cannot find the file specified."

sunilmut commented 7 years ago

ok. For step 1, instead, can you see if %windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux folder exists and a file within it called AptPackageIndexUpdate. If so, can you delete both the folder and file and proceed with the steps. Even if it doesn't exist, the above step might have deleted it, can you just do a reboot to see if the WSL optional component gets installed?

dkager commented 7 years ago

@sunilmut %windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux exists, but the folder is empty. I deleted it anyway, and can try your other suggestions in ~8 hours.

imWillX commented 7 years ago

@sunilmut Tested your method. Works!

dkager commented 7 years ago

@sunilmut Removing the (empty) folder and installing the feature does indeed work.

sunilmut commented 7 years ago

@imWillX @dkager - I am glad to know that! And, thanks for confirming. Now, if we can get few more confirmations, we will officially add the workaround to our list of known issues, while we work on the real fix. We have an understanding of the issue.

afarra commented 7 years ago

@sunilmut Worked for me too! I removed the empty folder (at %windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux (requires admin permission)) then restarted. This time the update went through and didn't roll back, then when windows started I could see bash.exe in start menu. To be safe I first ran lxrun /uninstall /full:

C:\WINDOWS\system32> lxrun /uninstall /full
This will uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications, new applications, and user data.
Type "y" to continue: y
Uninstalling...

Then I installed it again via bash.exe:

-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowterms

Type "y" to continue: y
Downloading from the Windows Store... 100%
Extracting filesystem, this will take a few minutes...
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: root
Found UNIX user: root
Installation successful!
The environment will start momentarily...
Documentation is available at:  https://aka.ms/wsldocs

and I was up and running again with Bash on Ubuntu on Windows :)

sunilmut commented 7 years ago

@afarra - Glad to know. Welcome aboard (again)! :)

cmdrDatalink commented 7 years ago

I had worked from a previous install of WSfL. Like many here I was not able to install the WSfL feature. Like many here, I had been unable to run the schtasks commands. I had known about the %windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux folder existing and being empty prior to finding this thread. Upon deleting the folder, the feature installed almost instantly and I installed Ubuntu as soon as I typed bash in an administrator PS prompt.

From what I can tell, the install script doesn't force the folder creation, and instead errors out if the folder exists, even if that folder is empty. Perhaps the dev team could update the feature's install script to make it force the install folder for the feature or verify the folder isn't empty before reverting?

I think Rollback isn't removing the root folder for WSfL for some reason and then this error occurs.

Until then, empty WSfL folders should be a check people do if they encounter this error and remove those folders.

ryselgh commented 7 years ago

Same scenario here. Installed ubuntu embedded, did a system restore for a video driver issue, couldn't install lxss anymore. I can't believe that empty folder was at the center of the entire problem. I confirm that deleting %windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux fixes the problem. Thank you.

the-mighty-mo commented 7 years ago

For some reason the folder doesn't even exist for me. Additionally, I can't even get to the Restart Now. I already did a full DISM repair followed by SFC. I get an Error 0x80073701: Referenced assembly could not be found. Any ideas? I have Windows 10 14393.693 and did need to do a System Restore once before for other reasons, and I did not have the subsystem installed at the time.

leodotcloud commented 7 years ago
PS C:\Windows\System32\Tasks\Microsoft\Windows> DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Windows-Subsystem-Linux /NoRestart

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Image Version: 10.0.14393.0

Error: 0x800f080c

Feature name Microsoft-Windows-Subsystem-Linux is unknown.
A Windows feature name was not recognized.
Use the /Get-Features option to find the name of the feature in the image and try the command again.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
PS C:\Windows\System32\Tasks\Microsoft\Windows>

Even I am having trouble installing the Linux Subsystem.

%windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux folder doesn't exist on my machine.

FYI, I am running "Windows Server 2016" on AWS.

sunilmut commented 7 years ago

@leodotcloud - WSL did not come to server until Windows Server Build 16237, see post. You are running 14393, which is way older.

pentacore commented 6 years ago

Have this issue, Fresh windows 10 build 16299.125, The aforementioned folder does not exist, tried most suggestions here..

abalakersky commented 6 years ago

I am in an identical situation as @pentacore above. Tried all the options and still cannot get it installed.

sunilmut commented 6 years ago

@pentacore, @abalakersky - There are many things going on in this issue. So, I am not clear on what is exactly failing for you. Can you please post more details on exactly what is failing? And, also post the output of the command that you are trying and that is failing?

pentacore commented 6 years ago

@sunilmut well, i try to enable WSL, restart the computer i get back in and its unticked and not installed.

No empty folder to delete in "Tasks" folder, Running the powershell command throws some error about missing or not enabled DISM features and whatnot

abalakersky commented 6 years ago

I did find a solution to this at the following thread

https://answers.microsoft.com/en-us/windows/forum/windows_10-update/kb4054517-error-0x80070bc2/1000777a-fa1f-4754-b6cc-93151615f425?auth=1

open CMD as administrator, an type one by one

SC config wuauserv start= auto [Press Enter] SC config bits start= auto [Press Enter] SC config cryptsvc start= auto [Press Enter] SC config trustedinstaller start= auto [Press Enter]

reboot system

On Jan 16, 2018, at 15:16, Martin Claesson notifications@github.com wrote:

@sunilmut well, i try to enable WSL, restart the computer i get back in and its unticked and not installed.

No empty folder to delete in "Tasks" folder, Running the powershell command throws some error about missing or not enabled DISM features and whatnot

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

pentacore commented 6 years ago

@abalakersky ill try that and report back!

EDIT That seems to have solved my issues, thanks!

EnzeCheng commented 6 years ago

When I want to turn on WSL. Everything works fine, but after reboot update gets stuck on 32%. Then it reboots again and says update cannot complete and undo the update. I tried all method listing here, but none of them works.

CCarrMcMahon commented 6 years ago

I have tried everything so far and nothing works. Restarting after checking the box for the feature or using cmd results in it restarting, then restarting again right after. Once I get back on my system, the box is unchecked and I am back to square one. I had also tried a diagnostic boot while only loading the necessary drivers and programs just in case something I had installed was the culprit, it did not work. The only change I saw was a new message that said: "We couldn't complete the features, Undoing changes, Don't turn off your computer." I would like to know if anyone else is having this issue, and see if we can find a solution.