目标:
- 运行 Docker
要求:
- 已开启适用于 Windows 的 Hyper-V
系统信息-Powershell
PS >systeminfo
OS Name: Microsoft Windows 10 Education
Hotfix(s): 5 Hotfix(s) Installed.
[01]: KB4462930
[02]: KB4470788
[03]: KB4480056
[04]: KB4480979
[05]: KB4480116
Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes
系统信息:
OS Name Microsoft Windows 10 Education
Version 10.0.17763 Build 17763
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name DESKTOP-4AO32OM
System Manufacturer System manufacturer
System Model System Product Name
System Type x64-based PC
System SKU SKU
Processor AMD Ryzen 7 1700X Eight-Core Processor, 3400 Mhz, 8 Core(s), 16 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. 0902, 9/8/2017
SMBIOS Version 3.0
Embedded Controller Version 255.255
BIOS Mode UEFI
BaseBoard Manufacturer ASUSTeK COMPUTER INC.
BaseBoard Product ROG STRIX B350-F GAMING
BaseBoard Version Rev X.0x
Platform Role Desktop
Secure Boot State Off
PCR7 Configuration Binding Not Possible
Windows Directory C:\Windows
System Directory C:\Windows\system32
Boot Device \Device\HarddiskVolume2
Locale USA
Hardware Abstraction Layer Version = "10.0.17763.194"
User Name DESKTOP-4AO32OM\starlord
Time Zone W. Europe Standard Time
Installed Physical Memory (RAM) 32.0 GB
Total Physical Memory 31.9 GB
Available Physical Memory 27.4 GB
Total Virtual Memory 36.7 GB
Available Virtual Memory 29.6 GB
Page File Space 4.75 GB
Page File C:\pagefile.sys
Kernel DMA Protection Off
Virtualization-based security Not enabled
Device Encryption Support Reasons for failed automatic device encryption: TPM is not usable, PCR7 binding is not supported, Hardware Security Test Interface failed and device is not InstantGo, Un-allowed DMA capable bus/device(s) detected, TPM is not usable
Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions Yes
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes
问题:
尝试从设置中启用 Hyper-V 时turn windows features on or off
出现此错误:
当尝试 Powershell 方式时我也收到错误:
PS C:\Windows\system32> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enable-WindowsOptionalFeature : The referenced assembly could not be found.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
我似乎满足使用 Hyper-V 的所有要求,那么是什么阻止我启用 Hyper-V?此外,我最近全新安装了 Windows,因此这里应该不会有任何混乱。
我以为我需要一些软件包,也许需要一些更新。但 Windows 说没有可用的更新...
从这里尝试的解决方案:-无法在我的计算机上启用 Hyper-V
编辑:失败似乎并非 Hyper-V 所特有的。尝试从 GUI 启用另一项功能(.NET Framework 3.5)Turn Windows features on or off
会导致出现与上图相同的错误代码。
问题是:我该如何进一步排除故障,以找出阻止turn windows features on/off
完成开启功能的原因?
编辑-尝试 Daniel B 的回答。
我尝试删除下面的注册表子项PackageDetect
但出现错误:
手动删除一个也不起作用。
我尝试了 Powershell 方式,但是我缺乏这方面的技能。
Remove-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackageDetect\*' -Recurse
Remove-Item : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackageDetect' because it does not exist.
At line:1 char:1
+ Remove-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Co ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\...g\PackageDetect:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
是的,我以管理员身份执行此操作。
还建议删除任何额外的语言包。我现在只有英语,但仍然无法启用 Hyper-V
编辑-提供来自 fuslogvw 的错误
安装.NET Framework 4.7.2 Developer Pack
并使用fuslogvw.exe
位于 的工具C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\
。必须以管理员身份运行,从设置中打开Log bind failures to disk
并使用 powershell 命令启用 Hyper-V 触发错误(错误未通过 gui/打开/关闭 windows 功能触发)。刷新列表时出现错误,单击查看日志以文本文件形式获取错误。
Pastebin:https://pastebin.com/Zn30Kqt7
调查错误日志中引用的路径:
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.Dism.PowerShell.dll.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.Dism.PowerShell.dll/Microsoft.Dism.PowerShell.dll.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.Dism.PowerShell.dll.EXE.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.Dism.PowerShell.dll/Microsoft.Dism.PowerShell.dll.EXE.
LOG: Attempting download of new URL file:///C:/Windows/system32/WindowsPowerShell/v1.0/Modules/Dism/Microsoft.Dism.PowerShell.dll.DLL.
LOG: Attempting download of new URL file:///C:/Windows/system32/WindowsPowerShell/v1.0/Modules/Dism/Microsoft.Dism.PowerShell.dll/Microsoft.Dism.PowerShell.dll.DLL.
LOG: Attempting download of new URL file:///C:/Windows/system32/WindowsPowerShell/v1.0/Modules/Dism/Microsoft.Dism.PowerShell.dll.EXE.
LOG: Attempting download of new URL file:///C:/Windows/system32/WindowsPowerShell/v1.0/Modules/Dism/Microsoft.Dism.PowerShell.dll/Microsoft.Dism.PowerShell.dll.EXE.
PS C:\Windows\system32> Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\" -Directory
Directory: C:\Windows\System32\WindowsPowerShell\v1.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 09/15/2018 11:08 AM en
d----- 09/15/2018 11:08 AM en-US
d----- 09/15/2018 9:34 AM Examples
d----- 09/15/2018 11:11 AM Modules
d----- 09/15/2018 9:33 AM Schemas
d----- 09/15/2018 9:33 AM SessionConfig
我没有一个名为的目录Microsoft.Dism.PowerShell.dll
。我想这是个问题。
PS C:\Windows\system32> Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Dism" -Directory
Directory: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Dism
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 09/15/2018 11:08 AM en
我也没有该目录WindowsPowerShell/v1.0/Modules/Dism/Microsoft.Dism.PowerShell.dll
。
这是为什么?有什么方法可以解决这个问题?修复 Windows?虽然不到一个月前我重新安装了 Windows 10。
答案1
当您在互联网上搜索遇到的错误时,一个解决方案不断弹出:删除以下项下的所有子项:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackageDetect
(例如请参见此处。)
这显然是核选项,你应该在进行更改之前创建系统的完整备份。它可能会永久破坏 Windows CBS,即 Windows 更新、Windows 功能等一切。
显然,根本原因是您的电脑认为某些语言包已经安装,但实际上并未安装,从而导致文件“丢失”。
答案2
嗯,这是尴尬。
我决定重新安装 Windows 10 Edu。过程如下:
使用 Windows MediaCreationTool,我将 ISO 放在 USB 记忆棒上。仍然在 Windows 上,我只需双击setup
。
然后我浏览菜单并重新安装了 Windows,保留了所有文件等。没什么大问题。
安装顺利,Windows 重新启动。
我去打开或关闭 Windows 功能.我注意到.NET Framework 3.5没有勾选。我记得读过一些关于 Hyper-V 和 .NET 的内容,我勾选了该框。.NET 安装。然后我勾选 Hyper-V,Hyper-V 安装得很好。Docker 现在也能很好地安装。
我不记得之前是否勾选过 .NET 3.5,但至少现在有些问题解决了。也许是重新安装了 Windows 或 .NET 3.5。我不知道。