Mount Bootable USB using Powershell on Hyper-V Host


Unfortunately the Hyper-V manager on my local machines returns "RPC not available" so I can't see/control my VMs. But thankfully I can RDP into the Host machine!

I need – please – to understand the Powershell command-line commands to do the following:

Mount a USB stick and make it the bootable drive for a VM
I think part of the command is Set-VMDvdDrive -Path … but (a) how do I define which bootable iso (there are several) on the stick should be the active one (b) how can I force the VM to boot up from the USB (I need to recover a partition from an Acronis Back-Up) and (c) how do I then un-mount the USB stick for use with another VM? Thanks Jean

Best Answer

You can try this article to probably fix the RPC service -

First of all, you need to add the DVD drive to the VM. In case if DVD drive already exists by using Set-VMDvdDrive he can specify needed ISO. For example - Set-VMDvdDrive -VMName Test -Path E:\Acronis.iso

Regarding the bootable iso definition, you always need to specify specific ISO prior to specifying just a folder. About forcing the VM to boot up from the USB You can make by using the ling below

Un-mount the USB stick for use with another VM can be made by using Remove-VMDvdDrive cmdlet. To find the controller number, he can use Get-VMDvdDrive