没有图形界面。必须在powershell里打命令
1.查找设备
Get-PnpDevice
得到一大串设备名字列表、找到你要直通的设设备
![](/wp-content/uploads/2020/08/hyv1.png)
2.通过直通设备在列表里名称得到设备的InstanceId
Get-PnpDevice -FriendlyName “LSI 适配器,SAS2 2008 Falcon”| select InstanceId
![](/wp-content/uploads/2020/08/hyv2.png)
3.禁用设备
Disable-PnpDevice -InstanceId “PCI\VEN_1000&DEV_0072&SUBSYS_11771734&REV_02\4&174110C3&0&0008”
4.得到设备的LocationPaths
Get-PnpDeviceProperty -InstanceId “PCI\VEN_1000&DEV_0072&SUBSYS_11771734&REV_02\4&174110C3&0&0008” -KeyName DEVPKEY_Device_LocationPaths
5.通过LocationPath吧设备下线
Dismount-VMHostAssignableDevice -Force -LocationPath “PCIROOT(0)#PCI(0100)#PCI(0000)”
![](/wp-content/uploads/2020/08/hyv3.png)
6.查看被下线的设备
Get-VMHostAssignableDevice
7.通过LocationPath吧设备添加到叫做“域控”的虚拟机里。
Add-VMAssignableDevice -VMName “域控” -LocationPath "PCIROOT(0)#PCI(0100)#PCI(0000)"
![](/wp-content/uploads/2020/08/hyv4.png)
![](/wp-content/uploads/2020/08/hyv5.png)
添加设备的时候虚拟机要关机。
而且要设置成物理计算机关机时虚拟机强行关机。
最后在打个命令看直通成功了没
Get-VMAssignableDevice -VMName 域控
![](/wp-content/uploads/2020/08/hyv6.png)
另外,LocationPaths=位置路径 InstanceId=设备实例路径。
嫌麻烦可以直接在设备管理器里找到
![](/wp-content/uploads/2020/08/hyv7.png)
非原创,摘自讨论:
https://www.chiphell.com/thread-1664632-1-1.html
帮那个大哥进行整理了一下