在 Windows 10 上安装 Hyper-VInstall Hyper-V on Windows 10

启用 Hyper-V 以在 Windows 10 上创建虚拟机。Enable Hyper-V to create virtual machines on Windows 10.
可以通过多种方式启用 Hyper-V,包括使用 Windows 10 控制面板、PowerShell 或使用部署映像服务和管理工具 (DISM)。Hyper-V can be enabled in many ways including using the Windows 10 control panel, PowerShell or using the Deployment Imaging Servicing and Management tool (DISM). 本文档将逐一介绍每个选项。This documents walks through each option.

注意: Hyper-V 作为可选功能内置于 Windows -- 无需下载 Hyper-V。Note: Hyper-V is built into Windows as an optional feature -- there is no Hyper-V download.

检查要求Check Requirements

  • Windows 10 企业版、专业版或教育版Windows 10 Enterprise, Pro, or Education
  • 具有二级地址转换 (SLAT) 的 64 位处理器。64-bit Processor with Second Level Address Translation (SLAT).
  • CPU 支持 VM 监视器模式扩展(Intel CPU 上的 VT-c)。CPU support for VM Monitor Mode Extension (VT-c on Intel CPUs).
  • 最少 4 GB 内存。Minimum of 4 GB memory.

请勿在 Windows 10 家庭版上安装 Hyper-V 角色。The Hyper-V role cannot be installed on Windows 10 Home.

打开“设置” > “更新和安全” > “激活”,从 Windows 10 家庭版升级到 Windows 10 专业版。Upgrade from Windows 10 Home edition to Windows 10 Pro by opening up Settings > Update and Security > Activation.

有关详细信息和疑难解答,请参阅 Windows 10 Hyper-V 系统要求For more information and troubleshooting, see Windows 10 Hyper-V System Requirements.

使用 PowerShell 启用 Hyper-VEnable Hyper-V using PowerShell

  1. 以管理员身份打开 PowerShell 控制台。Open a PowerShell console as Administrator.

  2. 运行以下命令:Run the following command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

如果无法找到此命令,请确保你以管理员身份运行 PowerShell。If the command couldn't be found, make sure you're running PowerShell as Administrator.

安装完成后,请重启。When the installation has completed, reboot.

使用 CMD 和 DISM 启用 Hyper-VEnable Hyper-V with CMD and DISM

部署映像服务和管理工具 (DISM) 可帮助配置 Windows 和 Windows 映像。The Deployment Image Servicing and Management tool (DISM) helps configure Windows and Windows images. 在众多应用程序中,DISM 可以在操作系统运行时启用 Windows 功能。Among its many applications, DISM can enable Windows features while the operating system is running.

使用 DISM 启用 Hyper-V 角色:To enable the Hyper-V role using DISM:

  1. 以管理员身份打开 PowerShell 或 CMD 会话。Open up a PowerShell or CMD session as Administrator.

  2. 键入下列命令:Type the following command:

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

显示正在启用 Hyper-V 的控制台窗口。

有关 DISM 的详细信息,请参阅 DISM 技术参考For more information about DISM, see the DISM Technical Reference.

通过“设置”启用 Hyper-V 角色Enable the Hyper-V role through Settings

  1. 右键单击 Windows 按钮并选择“应用和功能”。Right click on the Windows button and select ‘Apps and Features’.

  2. 选择相关设置下右侧的“程序和功能”。 Select Programs and Features on the right under related settings.

  3. 选择“打开或关闭 Windows 功能”。Select Turn Windows Features on or off.

  4. 选择“Hyper-V”,然后单击“确定”。Select Hyper-V and click OK.

Windows 程序和功能对话框

安装完成后,系统会提示你重启计算机。When the installation has completed you are prompted to restart your computer.

创建虚拟机Make virtual machines

创建你的第一个虚拟机Create your first virtual machine