microsoft / WSL

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

Can't boot after WSL 2 Install #4784

Open spottedmahn opened 4 years ago

spottedmahn commented 4 years ago

Happy to provide any additional details to troubleshoot but I'm not sure what else to provide at this point in time. I've painstakingly tracked this can't boot issue down to WSL 2 install (6 PM an on in blog post).

spottedmahn commented 4 years ago

I've been able to use Windows Restore Points to fix not being able to boot so I'm happy to run the WSL 2 install again and collect the necessary info (though I can't boot into windows so how does one do that? 🤔).

emersonclaireiaquinto commented 4 years ago

Having the same issue, it also occurs while enabling the virtual machine platform through the windows features GUI, though it at least got to 15% updating before it hung

ev-dev commented 4 years ago

Same issue, I enabled the 2 windows features separately tho.

First windows subsystem for linux, which reboot normally, but then enabling windows virtualmachineplatform caused the system to fail at boot.

More specifically, the bootloader does seem to load Windows but just stalls at black screen until forced shutdown.

ev-dev commented 4 years ago

Duplicate of #4780

spottedmahn commented 4 years ago

After some continued troubleshooting, the root problem appears to be I can't enable Hyper-V on Version 10.0.19536.1000 of Windows. Enabling/installing it prevents my PC from booting.

I formatted and started over to get back to build 1909 and I can install Hyper-V and therefore run WSL (v1 of course).

Windows Feedback Hub link, My blog post w/ some additional details


I feel like I should close this issue as it doesn't appear to be a WSL 2 issue but a Hyper-V/Windows 10 issue. 🤔

therealkenc commented 4 years ago

Very probably a recent(ish) regress because there'd be more screeching when WSL2 was released to Insiders last Spring, and these two (w/ #4780) came in back-to-back.

Windows Feedback Hub link, My blog post w/ some additional details

Windows feedback hub was the right thing to do (thanks!). The feedback hub isn't as black a hole as some might imagine it to be. If a lot of people report a problem they do get looked at.

Technet hyper-v forum not a bad place to post too.

I feel like I should close this issue

Open, closed; not a big difference in this instance. It was constructive to post here so folks doing a search know they're not alone.

spottedmahn commented 4 years ago

If a lot of people report a problem they do get looked at.

Everyone, please upvote the Windows Feedback Hub Problem Report so this gets addressed, thanks!

Upvote == Add similar feedback in app

image

ev-dev commented 4 years ago

The issue is coming from one of the last few insider builds, I had no trouble getting WSL2 going on a clean install last month.

I'm not sure exactly how Hyper-V is involved though, I'm currently running 19541 build with the Hyper-V and Windows Hypervisor Platform features enabled without boot issues. The specific cause for my own failure to boot is when enabling the Virtual Machine Platform feature, is that the case for you @therealkenc or are you not able to boot with Hyper-V feature alone?

My understanding is that the Virtual Machine Platform is a thinner version of Hyper-V that is used for specific features like WSL2 (maybe exclusively for WSL2?). If that is the case, than this issue may not be coming from Hyper-V itself, hopefully those more knowledge will chime in though

ev-dev commented 4 years ago

Actually I was now just able to manually enable all the features needed to run WSLv2 on latest insiders build (10.0.19541)!

I had enabled each of the following features separately restarting after each:

Then I installed Ubuntu from the Windows Store which gave me a WSLv1 distro working normally. I followed by running the command in powershell: Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform and finally before rebooting I ran wsl --set-version Ubuntu 2 which converted my disto to WSLv2 running on Virtual Machine Platform.

After reboot, Windows was able to configure the new optional features correctly however interestingly, the new WSLv2 distro is having networking issues, likely something to do with Hyper-V or Virtual Machine Platform...

Annotation 2020-01-15 182236
ev-dev commented 4 years ago

Still convinced the original stated issue exists though, my comment above was just a strange no-reboot workaround. A clean install of latest insider's build still does fail to boot after enabling both Windows Subsystem for Linux & Virtual Machine Platform as per the WSL2 install docs.

Fixed my above network issue via https://github.com/microsoft/WSL/issues/4285#issuecomment-522201021 in case anyone else runs into same problem

therealkenc commented 4 years ago

is that the case for you @therealkenc or are you not able to boot with Hyper-V feature alone?

I'm personally able to boot no problem. Haven't touched the Windows features since I can remember.

spottedmahn commented 4 years ago

Still convinced the originally stated issue exists though, my comment above was just a strange no-reboot workaround

So I'm not crazy! I thought I had WSL 2 working too! I know I was running wsl -l -v and saw v1 labels. Until I rebooted (or did something else).


Haven't touched the Windows features since I can remember

Fresh install of Windows for me.


I don't know what this means but I suspect it is related to the underlying issue:

image

Notice the "partial checked state" but both sub-items are checked? 🤔

therealkenc commented 4 years ago

I don't know what this means

Me either. Mine looks like this FWIW.

image

benhillis commented 4 years ago

"Virtual Machine Platform" is the only component required for WSL2. The various Hyper-V features include subsets or supersets of the required functionality.

NikolasTzimoulis commented 4 years ago

Actually I was now just able to manually enable all the features needed to run WSLv2 on latest insiders build (10.0.19541)! [...]

@ev-dev I tried this and it didn't work for me. I rolled back my Windows to version 19541. Then installed Hyper-V through dism and restarted. I tried to do the same for Windows Hypervisor Platform and Windows Subsystem for Linux but they were already installed. Next I ran wsl --set-version Ubuntu 2 which didn't work; it said Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. (which I've done). Then I enabled VirtualMachinePlatform like you said and after that I attempted a restart and got stuck on the Windows logo screen during reboot. (I got out of that by running BCDedit /set hypervisorlaunchtype Off but obviously now I have no virtualization features.)

Any advice?


EDIT: Everything seems to be working now after I updated to the just-released Windows build 19551. I converted from WSL1 to WSL2 with no issues using the normal procedure.

kevinfaveri commented 4 years ago

It is happening with me in a Windows 10 Pro Version 19041.21. Just after enabling WSL2 with Docker Desktop Edge and installing a VM using WSL2 from Windows Store i could not boot anymore... My "solution" was to restore a point in time through windows recovery, but I still havent found a solution for using WSL 2 without bricking the boot.

jbooth-sr commented 4 years ago

Also have Win 10 Pro V19041.21, WSL2, and Docker Desktop Community and getting the black screen on boot periodically -- have to hold the power down and hope the next boot comes up normal which is about half the time.

makenum commented 4 years ago

By typing BCDedit /set hypervisorlaunchtype Off I no longer have a problem with the black screen not booting and my wsl works.

It is not work for me

kunzig940 commented 4 years ago

Once you allow Virtual Machine Platform, boot fails and you end up having to boot in safe mode and set hypervisorlaunchtype off in 'bcdedit'. It's not an issue with the bios nor hardware. Attempted on both Windows 10 Pro and Win10 Home on 2 desktops both build 19041...

I've found something odd after a week of attempts. Let the boot fail 3 times, go into Troubleshoot, then choose to "Debugging Mode" under Advanced Startup Options. After this, it for some reason just finished the install of Hyper-V, Hypervisor, and Virtual Machine Platform. I can now run WSL2 etc but I guess it's at the expense of some of my drivers not running? The quest for a proper solution continues...

Turns out having ESEA Client for csgo installed on my computer broke Hyper-V/VirtualMachinePlatform/Hypervisor etc...

brucek2 commented 4 years ago

Reproducible for me:

  1. Do fresh install of build 19041 from USB
  2. Accept all updates from Windows Update, which required a reboot.
  3. Open explorer, follow prompts to download the new Edge browser (*probably not necessary to reproduce, but it's what I did all 3 times this happened to me.)
  4. Open powershell (admin)
  5. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  6. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  7. Restart.

Result: Boot hangs at vendor splash screen. Will keep hanging at splash screen until safe mode is entered, which reverts the dism command(s).

Fixes/Workarounds:

  1. Adding step 4.5 "BCDedit /set hypervisorlaunchtype Off" worked for me as far as fixing the hang on boot (although it meant I could not use WSL)
  2. I did not have this issue when I installed 2004 via the Update process. (UPDATE: I have since spent many hours trying to reproduce this brief initial success but did not find any way to do it.)
NoelTautges commented 4 years ago

I have been encountering a problem like this since September 2019 both on stable and Insider versions of Windows and have only just found this issue. I am not 100% sure it is the same problem, but on the off chance it is, I would like document my experience.

Booting Windows results in it hanging on a black screen after the progress circle when virtualization (AMD SVM) is enabled in the BIOS. The fan runs at full blast and the shell never starts.

I did some bisection with system drivers and found that when I disabled atikmpag.sys, the AMD integrated graphics display driver, the system booted fine with virtualization enabled. Since my system did not work well without the driver, I decided to live with the issue and not use WSL 2.

Today, after reinstalling Windows 1909 in another attempt to fix the issue, I found that it was fixed and I could boot with virtualization enabled. However, after installing the Virtual Machine Platform feature, as required by WSL 2, my machine stopped booting again. I updated to the Fast ring, build 19631.1, and the issue continued to appear.

My uneducated guess is that having SVM and the Virtual Machine Platform enabled means something is triggered in atikmpag.sys to make the system hang during bootup. I will attempt to debug the issue once my cable arrives in 2 days' time.

jbooth-sr commented 4 years ago

Try disabling fast boot and see if that helps.

NoelTautges commented 4 years ago

Try disabling fast boot and see if that helps.

Regretfully, it did not.

brucek2 commented 4 years ago

(@jbooth-sr: The BIOS on my Gigabyte Aero 15 does not offer a Fast Boot option one way or another.)

I've spent many hours since my last post trying to find a successful combination of build version, updates taken or skipped, updating or not updating drivers on my own, and previously installing WSL 1 or not. They all failed. In every combination I tried, I was left with a binary choice of enabling Virtual Machine Platform and not being able to boot, or not enabling it and not being able to use WSL.

Clearly many other users are in fact using WSL 2 successfully, leading me to wonder whether the issue is about a specific incompatible driver or other quirk on my machine; or is about a subsequent patch to Windows or WSL that has made it impossible for new WSL 2 users to get past the initialization stage.

My initial, one brief success may have hinged on either something I installed/configured during my regular use of the machine that was lost once I did a fresh install; or perhaps was enabled by being prior to some system firmware update being applied (do the Intel microcode updates work that way?)

I am not savvy on debugging windows boot issues so do not know how to proceed further. I'm open to suggestions. I'd also appreciate any tips if there are shortcuts that would speed up my testing cycle: right now each try is very painful, requiring multiple failed reboots to access safe mode, having to say "I forgot my PIN" because that process locks out the normal log in mechanism, and not being able to access the recovery command console because it will not take my password.

I've also filed this as a new issue via the feedback hub. Given it is reproducible on at least my machine I feel like someone in QA should confirm whether the documented install procedure works on a fresh install of build 19041 with the current applicable updates on at least some machines.

NoelTautges commented 4 years ago

The BIOS on my Gigabyte Aero 15 does not offer a Fast Boot option one way or another.

The Fast Boot option in Windows is located in Control Panel > Power Options > Choose what the power buttons do (on the left side).

Side note: the Gigabyte Aero 15 doesn't have an AMD processor, so that rules out the exact same root cause as mine, driver-wise.

I'd also appreciate any tips if there are shortcuts that would speed up my testing cycle

Try turning off virtualization/VT-x/d in the BIOS. That let me boot when I installed VirtualMachinePlatform.

You could try the driver bisection method I mentioned in my earlier comment to diagnose if it's a driver thing, but it's very annoying and requires manual registry editing. Let me know if you're open to that and I can give you more details!

brucek2 commented 4 years ago

The Fast Boot option in Windows is located in Control Panel > Power Options > Choose what the power buttons do (on the left side).

Oh! Thank you. I tried it, but no difference.

Try turning off virtualization/VT-x/d in the BIOS. That let me boot when I installed VirtualMachinePlatform.

Interesting. That hack lets me survive the reboot following enabling VirtualMachinePlatform, which lets Windows complete its setup, and gets me access to the wsl console command. This lets me enter the third command from the setup instructions (set wsl default version to 2). But when I go to the Store after that and go to the Ubuntu page, it hangs on a spinning circle. I rebooted, re-enabled VT-X, but was right back at the hang on boot problem.

You could try the driver bisection method I mentioned in my earlier comment to diagnose if it's a driver thing, but it's very annoying and requires manual registry editing. Let me know if you're open to that and I can give you more details!

Thank you for the offer! Having spent my weekend on this issue as it is, it's past due for me to return to current work, and that process does not sound quick. Maybe I'll try again next weekend.

chanyut commented 4 years ago

The Fast Boot option in Windows is located in Control Panel > Power Options > Choose what the power buttons do (on the left side).

Oh! Thank you. I tried it, but no difference.

Try turning off virtualization/VT-x/d in the BIOS. That let me boot when I installed VirtualMachinePlatform.

Interesting. That hack lets me survive the reboot following enabling VirtualMachinePlatform, which lets Windows complete its setup, and gets me access to the wsl console command. This lets me enter the third command from the setup instructions (set wsl default version to 2). But when I go to the Store after that and go to the Ubuntu page, it hangs on a spinning circle. I rebooted, re-enabled VT-X, but was right back at the hang on boot problem.

You could try the driver bisection method I mentioned in my earlier comment to diagnose if it's a driver thing, but it's very annoying and requires manual registry editing. Let me know if you're open to that and I can give you more details!

Thank you for the offer! Having spent my weekend on this issue as it is, it's past due for me to return to current work, and that process does not sound quick. Maybe I'll try again next weekend.

Thanks, you save my day. I got the same issue in my T495 (AMD). After enter bios and disable AMD virtualization. I can boot into windows.

dlford commented 4 years ago

Same issue here, SVM on AMD = black screen after installing virtualization platform, turning off fastboot did not help, I went back to Manjaro on this machine until this gets sorted out.

alanlal commented 4 years ago

I'm running Windows 10 Home Version 10.0.19631.1 with AMD Ryzen 5 3550H. I used to have the same issue after turning Virtual Machine Platform on.

But, I was able to boot normally after doing the following steps.

  1. Turn off virtualization in your BIOS.
  2. Go to "Turn windows features on or off " and turn on :
    • Virtual Machine Platform
    • HyperVisor Platform (I understand there's no HyperVisor in Home Edition,but it's still showing)
  3. Restart the machine
  4. Turn on "Windows Subsytem for Linux"
  5. Install your favourite distro
  6. Go to BIOS and turn virtualization on
  7. Restart windows

Although, I should mention that I have received blue screen of death a couple times after doing this. But I'm attributing that to my OS being in the fast track insider edition.

I even installed wsl2 version of docker later.Its working fine.

NoelTautges commented 4 years ago

But, I was able to boot normally after doing the following steps.

Regretfully, I was not able to replicate your results.

In other news, I have received my cable and got debugging working. However, the connection drops when the boot process hangs. I will try again later.

brucek2 commented 4 years ago

The procedure from two posts up did not work for me on 19041.264. I haven't tried it on later versions yet. In any event I'm hoping to use WSL 2 on the public release version of 2004 (non Insider Builds.)

hanhwi commented 4 years ago

I also have the same issue on my AMD laptop (Thinkpad T495, AMD ryzen 7 3700U, Windows 10 19041.264.)

kyeongsoo commented 4 years ago

I also have the same issue on my AMD laptop (Thinkpad T495, AMD ryzen 7 3700U, Windows 10 19041.264.)

The same for my T495 but with AMD 3500U.

gasuketsu commented 4 years ago

@hanhwi @kyeongsoo I had the same issue with my AMD ryzen APU laptop (Thinkpad T495) but solved by changing "UMA Frame buffer size" value to "1G" or "2G" in BIOS.

NoelTautges commented 4 years ago

I had the same issue with my AMD ryzen APU laptop (Thinkpad T495) but solved by changing "UMA Frame buffer size" value to "1G" or "2G" in BIOS.

I just tried this and it worked!

With SVM off, my BIOS had Auto, 256MB, and 512MB options. With SVM on, it removed 256MB from the list.

I previously had 512MB selected. After changing it to Auto, I turned SVM on and Windows booted successfully! Thank you so much!

I will let you all know if WSL 2 works correctly in a moment.

EDIT: It works great!

brucek2 commented 4 years ago

I'm assuming that "UMA Frame Buffer Size" is a BIOS option? If so sadly I do not have that option on my laptop. My system has an Intel i7-7700HQ CPU with nvidia optimus, meaning the system can use either the discrete nvidia 1060 gpu when needed (which has its own 6 GB vram), or the embedded gpu in the cpu (which I believe might be a shared system/video ram setup like UMA.) Most likely at boot the discrete GPU is dormant but I'm not an expert at how optimus works.

I can split off into another bug if you guys want to make this one specifically for AMD.

arulsrinivas commented 4 years ago

@hanhwi @kyeongsoo I had the same issue with my AMD ryzen APU laptop (Thinkpad T495) but solved by changing "UMA Frame buffer size" value to "1G" or "2G" in BIOS.

This worked for me too! I have an ASUS laptop with AMD Ryzen 5 3550H. I went to my BIOS settings, and changed my UMA Buffer Size from '128M' to 'Auto' (those were the only 2 options. 1G, 2G weren't there for me). Restarted. Enabled Virtual Machine Platform. Restarted.

It reboots! After that, successfully installed WSL 2 and updated my WSL Ubuntu to version 2 as well.

Thanks @gasuketsu

hanhwi commented 4 years ago

@gasuketsu Thanks a lot. As you said, increasing the UMA buffer size solves the problem. My initial setup was 128MB for the buffer.

I also tested it with various buffer sizes. Except for 128MB and 512MB, all configurations work fine.

kyeongsoo commented 4 years ago

@gasuketsu This is a follow-up:

Per your suggestion, I increased UMA buffer size to 1G and could boot after enabling the virtual machine platform (step 1) and WSL2 (step 2) based on the MS instructions (https://docs.microsoft.com/en-us/windows/wsl/install-win10); before, I couldn't boot after step 2.

Then, I installed Ubuntu 20.04 LTS from the store and docker desktop on Windows together with vscode with "remote - wsl extension". Because I had no problems in installing and using them, I thought that this problem was finally gone. So I happily rebooted but ended up with the same issue again 😢

As mentioned above, I am using Thinkpad T495 (AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx). The support for AMD processors in those cutting-edge features like WSL2 doesn't seem to be on par with that for Intel processors yet.

johnniewalkerde commented 4 years ago

Also using the Thinkpad T495 and hint of @gasuketsu worked (increasing the UMA buffer size). Thanks a lot!

anqingchen commented 4 years ago

Once you allow Virtual Machine Platform, boot fails and you end up having to boot in safe mode and set hypervisorlaunchtype off in 'bcdedit'. It's not an issue with the bios nor hardware. Attempted on both Windows 10 Pro and Win10 Home on 2 desktops both build 19041...

I've found something odd after a week of attempts. Let the boot fail 3 times, go into Troubleshoot, then choose to "Debugging Mode" under Advanced Startup Options. After this, it for some reason just finished the install of Hyper-V, Hypervisor, and Virtual Machine Platform. I can now run WSL2 etc but I guess it's at the expense of some of my drivers not running? The quest for a proper solution continues...

Turns out having ESEA Client for csgo installed on my computer broke Hyper-V/VirtualMachinePlatform/Hypervisor etc...

Can reproduce, same here! Did you ever figure out a fix so I can have both ESEA and WSL2?

AlexanderFadeev commented 4 years ago

I have black screen after logging in with error:

Unpacker.exe
---------------------------
z
---------------------------
ОК   
---------------------------
genio commented 4 years ago

Still happening on a Dell XPS 15 9560, Intel. Anything that works? Is MS looking at this? The Feedback Hub is a joke - tons of reports on the same problem and no responses on any of them from Microsoft.

spottedmahn commented 4 years ago

The Feedback Hub is a joke - tons of reports on the same problem and no responses on any of them from Microsoft.

Sad 😢 isn't it?

goldfix commented 4 years ago

Hello.

Same problem on: MSI - B450M-PRO-VDH-V2 with AMD Ryzen 5 2400G (video card integrated). I solved set on BIOS the management of video memory on "Auto".

ciao p

decipherDev commented 4 years ago

I had the same issue with my AMD ryzen APU laptop (Thinkpad T495) but solved by changing "UMA Frame buffer size" value to "1G" or "2G" in BIOS.

I just tried this and it worked!

With SVM off, my BIOS had Auto, 256MB, and 512MB options. With SVM on, it removed 256MB from the list.

I previously had 512MB selected. After changing it to Auto, I turned SVM on and Windows booted successfully! Thank you so much!

I will let you all know if WSL 2 works correctly in a moment.

EDIT: It works great!

Thanks, this worked for me too. I just changed UMA buffer size value to AUTO and it worked.

PC model :- Asus TUF

senorwatsonsan commented 4 years ago

@hanhwi @kyeongsoo I had the same issue with my AMD ryzen APU laptop (Thinkpad T495) but solved by changing "UMA Frame buffer size" value to "1G" or "2G" in BIOS.

This worked for me too! I have an ASUS laptop with AMD Ryzen 5 3550H. I went to my BIOS settings, and changed my UMA Buffer Size from '128M' to 'Auto' (those were the only 2 options. 1G, 2G weren't there for me). Restarted. Enabled Virtual Machine Platform. Restarted.

It reboots! After that, successfully installed WSL 2 and updated my WSL Ubuntu to version 2 as well.

Thanks @gasuketsu

Thank y'all so much! My AMD machine needed the "Auto" setting for the UMA Buffer Size. Working like a champ, now!

udbhav-s commented 4 years ago

Same issue here on an HP omen with the Ryzen 5 4600H. Windows will boot with either Virtual Machine Platform or virtualization in bios enabled, but having both on causes a blue screen. Unfortunately I can't change the UMA buffer size since HP doesn't provide that option in the bios.

BreeceW commented 4 years ago

Same issue here on an HP omen with the Ryzen 5 4600H. Windows will boot with either Virtual Machine Platform or virtualization in bios enabled, but having both on causes a blue screen. Unfortunately I can't change the UMA buffer since HP doesn't provide that option in the bios.

I have a similar issue on a Lenovo Flex 5 on Ryzen 5 4500U. The computer is able to work fine and use virtual machines and WSL 2, but on restarting (by clicking restart, not shutdown and turn back on), it gets stuck on a boot menu (Windows Boot Manager listed but selecting does nothing), which can only be escaped by pressing the power button. Then it continues restarting fine. This only happens when I have Hyper-V, WSL 2, or Windows Sandbox enabled.

I also have no option to change UMA buffer in BIOS.

josefmtd commented 4 years ago

I have a Ryzen 3400G powered Mini PC, changing UMA Buffer Size to Auto still doesn't help. Could it be something else?