分享

启动到虚拟硬盘的步骤:将 VHDX 或 VHD 添加到启动菜单 | Microsoft Docs

 利有用无 2020-10-13

启动到虚拟硬盘的步骤:将 VHDX 或 VHD 添加到启动菜单Boot to a virtual hard disk: Add a VHDX or VHD to the boot menu

本机引导,可创建虚拟硬盘 (VHDX),安装 Windows,然后启动它,或在 PC 的并排方案与现有安装,在新设备。Native Boot allows you to create a virtual hard disk (VHDX), install Windows to it, and then boot it up, either on your PC side-by-side with your existing installation, or on a new device.

本机引导 VHDX 可以用作指定的硬件,而无需任何其他父级操作系统上运行的操作系统。A native-boot VHDX can be used as the running operating system on designated hardware without any other parent operating system. 这不同于其中 VHDX 连接到具有父操作系统的计算机上的虚拟机的方案。This differs from a scenario where a VHDX is connected to a virtual machine on a computer that has a parent operating system.

适用于 Windows 10 的本机引导需要 .vhdx格式、 不.vhd 格式。Native boot for Windows 10 requires the .vhdx format, not the .vhd format.

Vhdx 可以应用于 Pc 或具有没有其他安装的 Windows,而无需虚拟机或虚拟机监控程序的设备。VHDXs can be applied to PCs or devices that have no other installations of Windows, without a virtual machine or hypervisor. (在虚拟机监控程序是软件的正在运行的虚拟计算机的操作系统层。)这使工作负荷分配更大的灵活性,因为一组工具可用于管理虚拟机的映像,并指定硬件。(A hypervisor is a layer of software under the operating system that runs virtual computers.) This enables greater flexibility in workload distribution because a single set of tools can be used to manage images for virtual machines and designated hardware.

你还可以部署到已安装的 Windows 电脑的 VHDX 和引导菜单用于现有版本的 Windows 或在 VHD 上的版本之间进行选择。You can also deploy the VHDX to a PC that already has Windows installed on it, and use a boot menu to select between the existing version of Windows, or the version on the VHD.

若要了解有关在企业环境中使用 Vhdx 的详细信息,请参阅了解具有本机引导的虚拟硬盘To learn more about using VHDXs in an enterprise environment, see Understanding Virtual Hard Disks with Native Boot.

系统必备组件Prerequisites

  • 技术人员 PC 的 Windows 评估和部署工具包 (Windows ADK) 工具安装在其上使用。A technician PC with the Windows Assessment and Deployment Kit (Windows ADK) tools installed on it.

  • 通用化 Windows 映像 (。WIM 文件)。A generalized Windows image (.WIM file). 若要了解详细信息,请参阅Sysprep (通用化) 的 Windows 安装To learn more, see Sysprep (Generalize) a Windows installation.

  • 可启动 Windows PE 驱动器。A bootable Windows PE drive. 若要了解详细信息,请参阅WinPE:创建可引导 USB 驱动器To learn more, see WinPE: Create USB Bootable drive.

  • 目标 PC 或设备在其上安装 VHDX。A destination PC or device on which to install the VHDX. 此设备需要 30 千兆字节 (GB) 或更多可用磁盘空间。This device requires 30 gigabytes (GB) or more of free disk space. 到设备已在运行其他操作系统的安装,或作为在设备上的唯一操作系统,你可以安装 VHDX。You can install the VHDX to a device already running other operating system installations, or as the only operating system on a device.

步骤 1:从 diskpart 创建 VHDXStep 1: Create a VHDX from diskpart

在技术人员 PC:On the technician PC:

  1. 从命令提示符下,打开 Diskpart。From the Command Prompt, open Diskpart.

    diskpart
  2. 创建并准备好新的 VHDX。Create and prepare a new VHDX. 在此示例中,我们创建的 25 GB 固定类型 VHDX。In this example, we create a 25 GB fixed-type VHDX.

    create vdisk file=C:\windows.vhdx maximum=25600 type=fixed
  3. 将附加 VHDX。Attach the VHDX. 这将 VHDX 作为磁盘添加到主机上的存储控制器。This adds the VHDX as a disk to the storage controller on the host.

    attach vdisk
  4. 创建的分区,为 Windows 文件、 设置其格式,并将其分配驱动器号。Create a partition for the Windows files, format it, and assign it a drive letter. 此驱动器号会在文件资源管理器中显示。This drive letter will appear in File Explorer.

    create partition primaryformat quick label=vhdxassign letter=v
  5. 退出 DiskpartExit Diskpart

    exit

步骤 2:将 Windows 映像应用于 VHDStep 2: Apply a Windows image to the VHD

在您技术人员电脑,VHDX 可创建并附加中的主分区对应用通用的 Windows 映像第 1 步On your technician PC, apply a generalized Windows image to the primary partition of the VHDX that you created and attached in Step 1.

Dism /Apply-Image /ImageFile:install.wim /index:1 /ApplyDir:V:\

步骤 3:分离 VHD,将其复制到新的设备,并将其 (可选) 附加Step 3: Detach the VHD, copy it to a new device, and attach it (optional)

你可以部署到已有一份 Windows 上安装的设备的 VHDX 或可以清理和准备目标 PC 的硬盘可使用 VHD。You can deploy the VHDX to a device that already has a copy of Windows installed on it, or you can clean and prepare the destination PC's hard drive to use the VHD.

分离 VHDX 并将其保存到网络共享或存储驱动器Detach the VHDX and save it to a network share or storage drive

  1. 使用 diskpart 分离在技术人员 PC 中的虚拟磁盘。Use diskpart to detach the virtual disk from your technician PC.

    diskpartselect vdisk file=C:\windows.vhdxdetach vdiskexit
  2. 将 VHDX 复制到网络共享或可移动存储驱动器。Copy the VHDX to a network share or removable storage drive. 以下驱动器号映射到网络共享,为 VHD,将创建的目录,然后复制 VHD。The following maps a drive letter to a network share, creates a directory for the VHD, and then copies the VHD.

    net use n: \\server\share\md N:\VHDscopy C:\windows.VHDX n:\VHDs\

清理和准备用于本机引导的新设备Clean and prepare a new device for native boot

在目标 PC:On your destination PC:

  1. 使用可启动到 WinPE 密钥启动到 WinPE 的目标 PCUse your bootable WinPE key to boot the destination PC to WinPE.

  2. 清理和准备目标计算机的硬盘驱动器。Clean and prepare the destination PC's hard drive. 创建系统分区 (S),并将在其中存储的 VHDX 的主分区 (M)。Create a system partition (S), and a main partition (M) where the VHDX will be stored.

    BIOS:BIOS:

    diskpartselect disk 0cleanrem == 1. System partition ======================create partition primary size=100format quick fs=ntfs label='System'assign letter='S'activerem == 2. Main partition ========================create partition primaryformat quick fs=ntfs label='Main'assign letter='M'exit

    UEFI:UEFI:

    diskpartselect disk 0cleanconvert gptrem == 1. System partition =========================create partition efi size=100format quick fs=fat32 label='System'assign letter='S'rem == 2. Microsoft Reserved (MSR) partition =======create partition msr size=128rem == 3. Main partition ===========================create partition primary format quick fs=ntfs label='Main'assign letter='M'exit
  3. 连接到网络驱动器或存储位置复制在 VHDX步骤 3.2Connect to the network drive or storage location where you copied the VHDX in step 3.2.

    net use N: \\server\share
  4. 将 VHDX 从网络驱动器或存储位置复制到目标 PC 的主分区。Copy the VHDX from the network drive or storage location to the destination PC's main partition.

    copy N:\VHDs\Windows.vhdx M:

附加 VHDXAttach the VHDX

  1. 虽然仍启动到 WinPE,附加到目标 PC 在 VHDX。While still booted into WinPE, attach your VHDX to the destination PC.

    diskpartselect vdisk file=M:\windows.vhdxattach vdisk
  2. 确定附加的 VHDX 的卷号。Identify the attached VHDX's volume letter. (可选:将其更改为更有意义,例如 V 的另一个字母和离开 diskpart 命令行打开下一步)。(Optional: Change it to another letter that makes more sense, for example V, and leave the diskpart command line open for the next step).

    list volumeselect volume 3assign letter=v

步骤 4:添加的启动项Step 4: Add a boot entry

  1. 从目标 PC,打开 Diskpart (如果有必要),并确定驱动器号的 VHDX 和系统分区,例如,V 和 s。From your destination PC, open Diskpart (if necessary) and identify the drive letters of the VHDX and the system partition, for example, V and S.

    diskpartlist volumeexit
  2. 添加到设备的启动项。Add a boot entry to the device. 您可以添加多个使用此方法的 VHDX 文件。You can add multiple VHDX files using this method.

    BIOS:BIOS:

    V:cd v:\windows\system32bcdboot v:\windows /s S: /f BIOS

    UEFI:UEFI:

    V:\cd v:\windows\system32bcdboot v:\windows /s S: /f UEFI
  3. 删除 Windows PE USB 密钥。Remove the Windows PE USB key.

  4. 重新启动目标 PC。Restart the destination PC.

    如果只有一个启动项,设备将立即启动到 Windows。If there's only one boot entry, the device immediately boots to Windows. 如果有多个启动项目,您将看到可以在其中选择之间可用版本的 Windows 设备上启动菜单。If there's more than one boot entry, you'll see a boot menu where you can choose between the available versions of Windows on the device.

相关的主题Related topics

了解具有本机引导的虚拟硬盘Understanding Virtual Hard Disks with Native Boot

BCDboot 命令行选项BCDboot Command-Line Options

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多