Поделиться через


Provision a computer for driver deployment and testing (WDK 8)

Provisioning a target or test computer is the process of configuring a computer for for automatic driver deployment, testing, and debugging. To provision a computer, use Microsoft Visual Studio.

Note  Windows Driver Kit (WDK) 8 is not the most current version of the Windows Driver Kit (WDK). We recommend that you get the current version of the WDK and provision your target computer according to the provisioning instructions here.

A testing and debugging environment has two computers: the host computer and the target computer. The target computer is also called the test computer. You develop and build your driver in Visual Studio on the host computer. 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.

Prepare the target computer for provisioning

The procedure for preparing the target computer depends on whether your computers are joined to a network domain or to a workgroup.

Note  We do not recommend running the Driver Testing feature with BitLocker enabled on the target computer, as it will require you to re-enter the bitlocker key after every reboot.

If the host and target are joined to a network domain:

  1. On the target computer, install the operating system that you want to use to run and test your driver. Join the target computer to the same network domain as the host computer.

    Note  If you cannot join the target computer to the same domain as the host computer, you can still provision the target computer. Enable the Administrator account on the target computer. For more details, see Host and target are joined to a workgroup. Then when you start the provisioning wizard on the host computer, enter the credentials of the target computer's Administrator account.

  2. On the target computer, go to Control Panel > Network and Internet > Network and Sharing Center. Under View your active networks, verify that the active network type is Domain.

    Note  If your target computer has an ARM processor, see Notes for ARM target computers.

  3. On the target computer, go to Control Panel > Network and Internet > Network and Sharing Center > Change advanced sharing settings. You will see a list of network types: Private, Domain, Guest or Public, and the like. Expand Domain. Select Turn on network discovery and Turn on file and printer sharing.

    Note  If the target computer is running Windows Server, see Notes for Windows Server Target Computers.

  4. If BitLocker is enabled on the target computer, disable it. For information about how to enable and disable BitLocker, see Help protect your files using BitLocker Drive Encryption.

  5. If Secure Boot is enabled on an x86 or x64 target computer, disable it. For information about Unified Extensible Firmware Interface (UEFI) and Secure Boot, see UEFI Firmware.

    If the target computer uses an ARM processor, install the Windows Debug Policy. This can be done only by Microsoft or the manufacturer of the target computer. You do not need to disable Secure Boot.

If the host and target are joined to a workgroup:

  1. On the target computer, install the operating system that you want to use to run and test your driver. Join the target computer to the same workgroup as the host computer.

  2. On the target computer, enable the Administrator account (if it is not already enabled). Go to Control Panel > System and Security > Administrative Tools > Computer Management. Navigate to Local Users and Groups > Users, and double click Administrator. Clear the Account is disabled check box.

  3. On the target computer, sign in as Administrator. If the Administrator password is currently blank, create a password for the Administrator account. Press Ctrl-Alt-Delete, and choose Change a Password.

  4. On the target computer, go to Control Panel > Network and Internet > Network and Sharing Center. Under View your active networks, note the active network type (Private or Public).

    Note  If your target computer has an ARM processor, see Notes for ARM target computers.

  5. On the target computer, go to Control Panel > Network and Internet > Network and Sharing Center > Change advanced sharing settings. You will see a list of network types: Private, Domain, Guest or Public, and the like. Expand the heading that matches your network type (Public or Private). Select Turn on network discovery and Turn on file and printer sharing.

    Note  If the target computer is running Windows Server, see Notes for Windows Server Target Computers.

  6. Verify that you are signed in to the target computer as Administrator.

    Note  It is not enough to sign in as another user that has administrative privileges. You must sign in as Administrator.

  7. If BitLocker is enabled on the target computer, disable it. For information about how to enable and disable BitLocker, see Help protect your files using BitLocker Drive Encryption.

  8. If Secure Boot is enabled on an x86 or x64 target computer, disable it. For information about Unified Extensible Firmware Interface (UEFI) and Secure Boot, see UEFI Firmware.

    If the target computer uses an ARM processor, install the Windows Debug Policy. This can be done only by Microsoft or the manufacturer of that target computer. You do not need to disable Secure Boot.

  9. Verify that the host and target computers can ping each other. Open a Command Prompt window, and enter ping ComputerName.

  10. If the host and target computers 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. On the target computer, in Control Panel, navigate to Network and Internet > Network Sharing Center. Note your active network. This will be either Public network or Private network.
    2. On the target computer, in Control Panel, navigate to System and Security > Windows Firewall > Advanced settings > Inbound Rules.
    3. In the list of inbound rules, locate all Network Discovery rules for your active network. (Example: Locate all Network Discovery rules that have a Profile of Private.) For each of those rules, double click the 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. 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

After you have prepared the target computer, you can provision the target computer from the host computer in Visual Studio.

  1. On the host computer, in Visual Studio, on the Driver menu, choose Test > Configure Computers.

    Click Add new computer.

  2. For Computer name, enter the name of your target computer. Select Provision computer and choose debugger settings.

    Screen shot of computer configuration dialog box

    Click Next.

  3. Select the type of debugging connection you intend to use, and enter the required parameters. In this example, we select a connection type of Serial. We specify that we will use com5 on the host computer and com1 on the target computer.

    Screen shot of debugging configuration dialog box

    For detailed information about setting up debugging over various types of connections, see Setting Up Kernel-Mode Debugging in Visual Studio in the CHM or online documentation for Debugging Tools for Windows.

  4. The provisioning process takes several minutes and might automatically reboot the target computer once or twice. When provisioning is complete, click Finish.

Note  If your computers are joined to a workgroup, you might be asked for credentials to access the target computer. Enter TargetComputerName\Administrator, where TargetComputerName is the name of your target computer. Enter the password for the Administrator account on the target computer.

Note  If you are using network debugging, and if your host and target computers are connected through a router, verify that the network adapters on your host and target computers have obtained IP addresses from a Dynamic Host Configuration Protocol (DHCP) server. The kernel debugging driver on the target computer attempts to use DHCP to get a routable IP address for the network adapter that is being used for debugging. If the driver fails to obtain a DHCP-assigned address, it uses Automatic Private IP Addressing (APIPA) to obtain a local link IP address. Local link IP addresses are not routable, so a host and target cannot use a local link IP address to communicate through a router. You can use local link IP addresses for network debugging if the host and target computers are plugged into the same network hub or switch.

Debugging after provisioning

After you provision a target computer, you can establish a kernel-mode debugging session from Visual Studio on the host computer. For more information, see Performing Kernel-Mode Debugging Using Visual Studio. You can also debug a user-mode process on the target computer from Visual Studio on the host computer. For more information, see Debugging a User-Mode Process Using Visual Studio.

Note  

If you are using separate host and target computers, do not install Visual Studio and the WDK on the target computer. Debugging is not supported if Visual Studio and the WDK are installed on the target computer.

Notes for Windows Server target computers

If the target computer is running Windows Server, enable these services before you turn on network discovery.

  • Function Discovery Resource Publication
  • SSDP Discovery
  • UPnP Device Host

Notes for ARM target computers

If your target computer has an ARM processor, enable file and printer sharing by opening an elevated Command Prompt window and entering the following commands.

sc.exe config lanmanserver start=auto
sc.exe start lanmanserver
netsh.exe advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes

Developing, Testing, and Deploying Drivers

What happens when you provision a computer (WDK 8.0)

 

 

Send comments about this topic to Microsoft