question

BillTkach-2852 avatar image
0 Votes"
BillTkach-2852 asked BillTkach-2852 commented

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


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-serverwindows-server-hyper-v
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered BillTkach-2852 commented

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--






· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just checking if there's any progress or updates?

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



0 Votes 0 ·

This is for a RS232 serial device, do they make such a device for a USB device?
How does the VM access this device? Do you plug the network port into an available network port on the Hyper-Visor, that somehow routes the serial traffic to the VM, and it knows it's a modem?
Is there some software that makes it appear as a modem again in the VM?

Thanks

0 Votes 0 ·

You may need a USB <-> RS232 adapter. The device connects to the comtrol, the comtrol casts the serial stream over ethernet on the configured port. Then on the other end (hyper-v guest) you install the device port driver that captures the ethernet serial stream and presents it to windows via a virtual com port.

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



1 Vote 1 ·
Show more comments
vukasinterzic avatar image
0 Votes"
vukasinterzic answered BillTkach-2852 commented

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





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for you answer, helpful as well.

0 Votes 0 ·
BillTkach-2852 avatar image
0 Votes"
BillTkach-2852 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.