Can you use a host modem in a virtual machine?

This is for discussing general topics about how to use VirtualBox.
Post Reply
johnathanamber
Posts: 11
Joined: 8. Jun 2011, 17:07
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Can you use a host modem in a virtual machine?

Post by johnathanamber »

Hey everyone,

I have an internal modem in my host machine that I'd like to use in my virtual machine.

Can you setup a COM port to use the same port as the host, i.e. host device, etc. and use the modem attached to that port?

Thank you and God bless,
Johnathan
johnathanamber
Posts: 11
Joined: 8. Jun 2011, 17:07
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Can you use a host modem in a virtual machine?

Post by johnathanamber »

N/M I have figured it out and got it working.

A small tutorial:
1. Install the physical modem on your host machine... either internal or external.
2. Once installed and tested, determine what your COM port and settings are: COM port number, IRQ and I/O Range.
3. Set up a new virtual machine and shut it down.
4. Use the Serial Ports option under the virtual machine settings and enable serial port 1.
5. Have this serial port match the Port Number, the IRQ, and the I/O Port of the physical port that the modem is using as noted in Step 2.
6. Set the Port Mode to "Host Device".
7. Set the Port/File Path to "COM<#>:" Where <#> is the COM port number. e.g. COM2:, etc. NOTE: the ":" is important!
8. Accept the changes and start up your virtual machine.
9. Make sure the COM port is installed, if need be install it.
10. Make sure it matched what you installed in Step 5.
11. Then install a modem using the COM port above.
12. Once it is installed test by calling a number or via software.

For me it worked wonderfully.

I plan on replacing my host OS with something much better and using a virtual machine for all my work related purposes.

God bless,
Johnathan
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can you use a host modem in a virtual machine?

Post by mpack »

Steps 2, 5 and 10 are unnecessary. The base address and IRQ used by your physical serial port is irrelevant to the VM, so just leave the guest to use on COM1 defaults (0x3F8, IRQ4). The comm port numbers don't need to match either - again it's probably best to leave the guest using COM1.

All that's actually necessary is that the guest serial port is mapped to an existing host port.
johnathanamber
Posts: 11
Joined: 8. Jun 2011, 17:07
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Can you use a host modem in a virtual machine?

Post by johnathanamber »

@mpack,

That's exactly why Steps 2, 5 , & 10 are needed. To be sure the user knows what ports they have and which ones to use.

Most users if not directed won't know what to check for.

Now just to prove myself wrong, I tested your theory.
My physical modem is on COM2, my serial port on my VM was set to COM2 before and I was able to dial out without issue.

Using your theory you I set the COM port in the VM to COM1 and, as you've said, it should still work... it doesn't work on COM1, I am now unable to dial out. I powered down the VM, changed it back to COM2, powered the VM back up, and now it works again.

This is why you need to check which one is being used in Steps 2 and use it in 5 & 10. Having them match will make it easier for the person not so familiar.

Most likely the COM port number predefined will work and match what is being used on the host machine, so there is no need to go outside of the standard predefined COM1-4 settings already setup in VB.

Thanks for commenting and God bless,
Johnathan
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can you use a host modem in a virtual machine?

Post by mpack »

What I told you was not a theory. Please take some time to understand the difference between physical and virtual. It's perhaps best to think of this as two separate PCs: the comm port base address, IRQ number, and port number of PC A has absolutely no relevance to the correct values for PC B.

It doesn't matter what comm port values you set up inside the guest OS, provided only that they match what you configured in the VM recipe. If you left it on defaults then the guests comm port would be at 0x3F8, IRQ4 - commonly referred to as COM1 on DOS/Windows PCs. Your virtual (pretend) COM1 can quite happily be mapped to a physical COM1, or to a physical COM4, or to a physical COM14 - the host comm port numbering and other specifications makes no difference whatever.

Your post was intended to help so I don't want to be critical, but I can tell you that I'm a computer programmer with >30 years experience, plus I've been using VirtualBox since 2008... and what I'm saying is based on certain knowledge, not speculation. Please read the source code, read the user manual, and browse any other authoritative material if you continue to disbelieve me.
johnathanamber
Posts: 11
Joined: 8. Jun 2011, 17:07
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Can you use a host modem in a virtual machine?

Post by johnathanamber »

@mpack,

Thank you for the help.

I understand the differences between physical and virtual. I work with it every day with both Virtualbox, VMware, and other virtual technologies, etc. I've been trained in it and have been in and seen real-world scenarios. Along with that I've worked in front of customers; both knowledgeable and inept, for the past 20 years. (No offense to anyone of course.) I've had to sit and train some and explain things in simpler terms for them to understand and get things done. I've worked with DOS, Windows 3+ to today's flavors, SCO Unix, AIX, OS/400, various Linux distros, etc.

With that being said, this was intended to be as simple as possible while making it work. In over 90% of cases, what I've provided will work.

As I've said previously:
Physical modem is on COM2.
VM Serial Port on COM 2 works.
VM Serial Port on Com 1 does not.

For most the above is how they will see it and thus I'v explained.

I understand what you are saying, and in most cases it isn't needed. It is good to know, no doubt, but not needed 90% of the time. What you are saying can easily confuse those less experienced than you and I in getting this setup. No offense to them of course.

Knowing that you can manually configure the Serial Port settings within the VM Options, in most cases, won't make a difference since there aren't many serial ports, both physical and emulated, being used today. I'd bet that in at least 90% of cases using the predefined COM1-4 settings will work as long as they follow the instructions.

I may not have seen the VB programming, but I know how to explain things to a less experienced customers to make things work.

This thread wasn't meant to be a talent show. It was meant to simply be a quick and easy to understand tutorial to get something done.

Thank you and God bless,
Johnathan
411thetime
Posts: 1
Joined: 17. Mar 2021, 14:38

Re: Can you use a host modem in a virtual machine?

Post by 411thetime »

Hello!

Based on your information, I was able to access my Conexant D850 internal PCI Modem on COM3 with Hyperterminal in VirtualBox XP!

My next challenge is XP doesn't recognize any Modem Devices. I downloaded the specific drivers from DELL and tried forcing it to install, but its just not recognizing a "Modem"

Any thoughts on how to have the Virtual Box recognize the Modem with Drivers so I can actually use the modem?

Thanks.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can you use a host modem in a virtual machine?

Post by mpack »

VirtualBox doesn't have any role in recognizing modems. All VirtualBox provides is the hardware connection (USB or serial).

Make sure you are up to date with VirtualBox versions since ISTR that a UART bug was fixed recently.
Post Reply