预配计算机以便进行驱动程序部署和测试 (WDK 10)Provision a computer for driver deployment and testing (WDK 10)

预配目标计算机或测试计算机是配置计算机以自动部署、测试和调试驱动程序的过程。Provisioning a target or test computer is the process of configuring a computer for automatic driver deployment, testing, and debugging. 若要预配计算机,请使用 Microsoft Visual Studio。To provision a computer, use Microsoft Visual Studio.

一个测试和调试环境具有两台计算机:主计算机和目标计算机。A testing and debugging environment has two computers: the host computer and the target computer. 目标计算机也称为“测试计算机”。The target computer is also called the test computer. 在主计算机上的 Visual Studio 中开发和构建驱动程序。You develop and build your driver in Visual Studio on the host computer. 调试程序在主计算机上运行,并在 Visual Studio 用户界面中可用。The debugger runs on the host computer and is available in the Visual Studio user interface. 测试和调试驱动程序时,驱动程序在目标计算机上运行。When you test and debug a driver, the driver runs on the target computer.

主计算机和目标计算机必须能够彼此按名称 ping 通。The host and target computers must be able to ping each other by name. 如果两台计算机已加入到同一工作组或同一网络域,则此操作可能更容易。This might be easier if both computers are joined to the same workgroup or the same network domain. 如果你的计算机位于工作组中,我们建议你使用路由器(而非集线器或交换机)连接计算机。If your computers are in a workgroup, we recommend that you connect the computers with a router rather than a hub or switch.

提示

有关 WDK 和已知问题的最新信息,请查看 WDK 支持论坛For the latest information on the WDK and known issues, see the WDK support forum.

准备要预配的目标计算机Prepare the target computer for provisioning

  1. 在目标计算机上,安装将用于运行和测试驱动程序的操作系统。On the target computer, install the operating system that you'll use to run and test your driver.

  2. 安装 WDKInstall the WDK. 不过,你不需要安装 Visual Studio,除非你计划在目标计算机上进行驱动程序开发。You do not need to install Visual Studio, however, unless you plan on doing driver development on the target computer.

  3. 如果在 x86 或 x64 目标计算机上启用了“安全启动”,请禁用该功能。If Secure Boot is enabled on an x86 or x64 target computer, disable it. 有关统一可扩展固件接口 (UEFI) 和安全启动的信息,请参阅 UEFI 固件For information about Unified Extensible Firmware Interface (UEFI) and Secure Boot, see UEFI Firmware.

    如果目标计算机使用 ARM 处理器,则安装 Windows 调试策略。If the target computer uses an ARM processor, install the Windows Debug Policy. 该操作仅可以由 Microsoft 或目标计算机制造商完成。This can be done only by Microsoft or the manufacturer of the target computer. 无需禁用“安全启动”。You do not need to disable Secure Boot.

  4. 在目标计算机上,运行与目标计算机平台匹配的 WDK 测试目标设置 MSI。On the target computer, run the WDK Test Target Setup MSI that matches the platform of the target computer. 可以在 Remote 下的 Windows 驱动程序工具包 (WDK) 安装目录中找到该 MSI。You can find the MSI in the Windows Driver Kit (WDK) installation directory under Remote.

    例如:C:\Program Files (x86)\Windows Kits\10\Remote\x64\WDK Test Target Setup x64-x64_en-us.msiExample: C:\Program Files (x86)\Windows Kits\10\Remote\x64\WDK Test Target Setup x64-x64_en-us.msi

  5. 如果目标计算机运行的是 N 或 KN 版本的 Windows,则安装适用于 N 和 KN 版本的 Windows 的媒体功能包:If the target computer is running an N or KN version of Windows, install the Media Feature Pack for N and KN versions of Windows:

  6. 如果目标计算机运行的是 Windows Server,请查找刚才通过 WDK 测试目标设置 MSI 创建的 DriverTest 文件夹。If your target computer is running Windows Server, find the DriverTest folder that was just created by WDK Test Target Setup MSI. (示例:c:\DriverTest)。(Example: c:\DriverTest). 右键单击 DriverTest 文件夹,然后选择“属性”。Right click the DriverTest folder, and choose Properties. 在“安全性”选项卡上,向“经过身份验证的用户”组授予“修改”权限。On the Security tab, give Modify permission to the Authenticated Users group.

验证主计算机和目标计算机是否可以彼此 ping 通。Verify that the host and target computers can ping each other. 打开命令提示符窗口,输入“ping ComputerName”。Open a Command Prompt window, and enter ping ComputerName.

如果主计算机和目标计算机已加入到一个工作组,但位于不同的子网上,则可能必须调整某些防火墙设置,以便主计算机和目标计算机可以通信。If the host and target computers are joined to a workgroup and are on different subnets, you might have to adjust some firewall settings so that the host and target computers can communicate. 请执行下列步骤:Follow these steps:

  1. 在目标计算机上的“控制面板”中,转到“网络和 Internet”>“网络共享中心”。On the target computer, in Control Panel, go to Network and Internet > Network Sharing Center. 请注意活动网络。Note your active network. 这将是公用网络专用网络This will be Public network, Private network, or Domain.
  2. 在目标计算机上的“控制面板”中,转到“系统和安全”>“Windows 防火墙”>“高级设置”>“入站规则”。On the target computer, in Control Panel, go to System and Security > Windows Firewall > Advanced settings > Inbound Rules.
  3. 在入站规则列表中,查找用于活动网络的所有网络发现规则。In the list of inbound rules, find all Network Discovery rules for your active network. (例如,查找具有专用 配置文件的所有网络发现规则。)双击每个规则,并打开“作用域”选项卡。在“远程 IP 地址”下,选择“任何 IP 地址”。(For example, find all Network Discovery rules that have a Profile of Private.) Double click each rule and open the Scope tab. Under Remote IP address, select Any IP address.
  4. 在入站规则列表中,查找用于活动网络的所有“文件和打印机共享”规则。In the list of inbound rules, locate all File and Printer Sharing rules for your active network. 对于其中每个规则,双击该规则,并打开“作用域”选项卡。在“远程 IP 地址”下,选择“任何 IP 地址”。For each of those rules, double click the rule, and open the Scope tab. Under Remote IP address, select Any IP address.

预配目标计算机Provision the target computer

现在,可以随时在 Visual Studio 中通过主计算机预配目标计算机。Now you're ready to provision the target computer from the host computer in Visual Studio.

  1. 在主机计算机上的 Visual Studio 中,单击“扩展”菜单,依次指向“驱动程序”、“测试”,然后单击“配置设备” 。On the host computer, in Visual Studio, click the Extensions menu, point to Driver, point to Test, and click Configure Devices.

  2. 在“配置设备”对话框中,单击“添加新设备” 。In the Configure Devices dialog, click Add new device.

  3. 对于网络主机名,输入目标计算机的名称或本地 IP 地址。For Network host name, enter the name or local IP address of your target computer. 选择“预配设备并选择调试程序设置”。Select Provision device and choose debugger settings.

    “设备配置”对话框的屏幕截图

  4. 单击 下一步Click Next.

  5. 选择某种调试连接类型,并输入所需的参数。Select a type of debugging connection, and enter the required parameters.

    有关通过各种类型的连接设置调试的详细信息,请参阅 CHM 中的手动设置内核模式调试Windows 调试工具的联机文档。For more information about setting up debugging over various types of connections, see Setting Up Kernel-Mode Debugging Manually in the CHM or online documentation for Debugging Tools for Windows.

  6. 预配过程将需要几分钟时间,并且可能会自动重新启动目标计算机一到两次。The provisioning process takes several minutes and might automatically reboot the target computer once or twice. 预配完成后,单击“完成”。When provisioning is complete, click Finish.

提示

不支持通过 WDK 的自动预配过程来预配虚拟机。Provisioning virtual machines through the WDK's automatic provisioning process is not supported. 但是,可以通过手动设置目标 VM 来测试 VM 上的驱动程序,如分步回显实验室中所述。However, you can test drivers on a VM by setting up the target VM manually as described in the step by step echo lab.

另请参阅See Also

将驱动程序部署到测试计算机Deploying a Driver to a Test Computer