How do I connect to a USB modem from within a VM on Hyper-V?

Bill Tkach 86 Reputation points
2022-04-08T22:15:00.957+00:00

We have a Server 2022 running Hyper-V. It has a Server 2022 VM on it, that needs to send out alarms via a USB modem. It dials out to a person with a phone, beep-boop-beep... etc. ie via phone line. Old skool.

So, I can connect the modem to the Hyper-V Host, but how can the VM see that device? And (optionally) how can only that VM see that specific device?

I know there are Enhanced Session Mode, but these seem to be more geared for when someone is logged onto an active session. How would I make it work if no one was logged on?

I also looked at this, is this something that might work?

https://devblogs.microsoft.com/scripting/passing-through-devices-to-hyper-v-vms-by-using-discrete-device-assignment/

It seems to be the right idea, but the "May cause your bare-metal server to crash" feature isn't nice. Perhaps it's improved since the writing of that article, or something has superseded it.

Thanks.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,446 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,599 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dave Patrick 426.3K Reputation points MVP
    2022-04-09T00:28:06.83+00:00

    Simplest solution may be a comtrol or lantronix device server.
    https://comtrol.com/ethernet-device-servers/devicemaster-panel-mount/devicemaster-rts-1port-db9

    We use these for virtual machines and where the serial device is miles away.

    --please don't forget to upvote and Accept as answer if the reply is helpful--


2 additional answers

Sort by: Most helpful
  1. Vukasin Terzic 341 Reputation points MVP
    2022-04-09T00:17:29.077+00:00

    Hello,

    Unfortunately, there is no native way to pass through the USB device to Hyper-V and the process of doing this is not going to be straightforward. I did this for USB drives before, but never for USB devices such as modems.

    If I'm not mistaken, the Discrete Device Management method will only work for PCI devices, such as graphics cards.

    I found these third-party tools that allow that, but I did not test them myself: https://www.usb-over-network.org/hyper-v-usb/ and https://www.incentivespro.com/hyper-v-usb.html

    If that doesn't work, you might need to install the role on the host directly, instead of using a VM on it.

    I'm sorry I don't have a solution to provide, but I hope this helps.

    Vukasin


  2. Bill Tkach 86 Reputation points
    2022-04-11T23:29:58.963+00:00

    It's quite hard to believe this feature does not exist as part of Hyper-V.

    0 comments No comments