Getting Com port device through to guest

Discussions about using Windows guests in VirtualBox.
Post Reply
Conrad
Posts: 5
Joined: 9. Aug 2017, 16:23

Getting Com port device through to guest

Post by Conrad »

Hi everybody, I have a Hasp device used for activation that i plug into the COM port on the host PC(win10), the software it runs is not suitable for win 10
so i have an xp VM, what is the easiest way to get the hasp communicating with the guest os via COM?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Getting Com port device through to guest

Post by scottgus1 »

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

Re: Getting Com port device through to guest

Post by mpack »

It should be a straightforward matter of configuring a serial port using the VM settings. See section 3.9 of the user manual. You would enable the port, set the port mode to "Host Device", and set the Path/Address to "\\.\comX:" where X is whatever number your host gives to the port (check "Ports and LPT" in host Device Manager).

The XP guest will see the port as COM1, no matter what the host calls it.
Conrad
Posts: 5
Joined: 9. Aug 2017, 16:23

Re: Getting Com port device through to guest

Post by Conrad »

Does it have to be \\.\com as i was just using COM2:, i tried that first but to no avail, the only way i can test if it works, is to run the software. It gives an error if the HASP is not seen.
Is there a simpler way to test the connection
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Getting Com port device through to guest

Post by scottgus1 »

Does your host OS shoe a COM2 in the Device manager? To my understanding the COM#: or \\.\COM# must match what the host OS actually sees.
Conrad
Posts: 5
Joined: 9. Aug 2017, 16:23

Re: Getting Com port device through to guest

Post by Conrad »

yes my host has a com2, i enabled a port in VB, called it COM 2 and set the path as COM2:, the software isnt seeing the device though so im trying to find a way to test the connection
Last edited by socratis on 9. Aug 2017, 17:00, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Getting Com port device through to guest

Post by scottgus1 »

I think you can have the guest COM port still be COM1, even though the host port is COM2.

Serial is not plug-n-play. Does your software have a configuration page to set the correct port & handshake & parity & all the other stuff USB sent into the trashcan years ago? :)
Conrad
Posts: 5
Joined: 9. Aug 2017, 16:23

Re: Getting Com port device through to guest

Post by Conrad »

no unfortunately, the software just pops up an error saying HASP NOT FOUND and then closes, but i presume its looking at the only COM port on the PC and it just cannot contact the host
Last edited by socratis on 9. Aug 2017, 16:59, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Getting Com port device through to guest

Post by scottgus1 »

COM1 wouold probably be more common than COM2. Try setting Port Number to COM1 and keep the Path/Address at COM2: (with the : colon) or \\.\COM2
Conrad
Posts: 5
Joined: 9. Aug 2017, 16:23

Re: Getting Com port device through to guest

Post by Conrad »

I set those up, however, the port on the guest still shows as COM2
Last edited by socratis on 9. Aug 2017, 17:00, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Getting Com port device through to guest

Post by mpack »

The port in the guest will not show as COM2 if you followed the instructions I gave above, which did not include calling the port COM2. I can't imagine why you'd possibly want to override that. We can easily establish what you did if you post a zipped copy of the .vbox file for your VM.

No, you do not have to use "\\.\comX" as the syntax for your host device name, you can continue to use legacy naming (COMx) for conditions where x<10, the difference is that the new (since 1995!) syntax works for all numbers, not just a few. Again I can't imagine why you'd want to do this however.
Post Reply