Serial Port Connection issue

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Mlima
Posts: 5
Joined: 26. Mar 2023, 16:08

Serial Port Connection issue

Post by Mlima »

Hi!

After all these years, I came across this topic and realized that I have been facing the same problem. However, I am unable to implement the suggested solution.

I followed the steps mentioned, setting the ports to COM1 through COM4 (in my situation), but it did not work. I received the error log:

VM name: WinXP32
Failed to open host device 'COM4' (VERR_INVALID_HANDLE).
Código de Resultado:
E_FAIL (0X80004005)
Componente:
ConsoleWrap
Interface:
IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}


I also noticed that my device is listed in hidden mode in the device manager on my Windows 10 system:
--Ports Com
-----"USB-SERIAL CH340 (COM4)" <- this is hidden

I have a physical device connected and I need to transmit data from my virtual OS to my host OS.

Can anyone assist me with this issue?

Thank you.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Serial Port Connection issue

Post by scottgus1 »

Mlima
Posts: 5
Joined: 26. Mar 2023, 16:08

How to: Add a Serial Port in Windows XP and 7 Guest.

Post by Mlima »

Hi Jorgensen, Congrats for this tutorial.

I followed the steps mentioned, setting the ports to COM1 (host windows 10) through COM1 (guest windows XP), but it did not work. I received the error log:

VM name: WinXP32
Failed to open host device '\\.\com1' (VERR_INVALID_HANDLE).
Código de Resultado: E_FAIL (0X80004005)
Componente: ConsoleWrap
Interface: IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

I also noticed that my device is listed in hidden mode in the device manager on my Windows 10 system:
--Ports Com
-----"USB-SERIAL CH340 (COM1)" <- this is hidden

I have a physical device connected and I need to transmit data from my virtual OS to my host OS.

Can anyone assist me with this issue?

Thank you.
Mlima
Posts: 5
Joined: 26. Mar 2023, 16:08

Re: Serial Port Connection issue

Post by Mlima »

scottgus1 wrote:Please see How to: Add a Serial Port in Windows XP and 7 Guest for some ideas.
Thank you, Scottgus.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Serial Port Connection issue

Post by scottgus1 »

Glad to help so far. I brought your post on the linked tutorial over here to keep your specific questions together.
Mlima wrote:Failed to open host device '\\.\com1' (VERR_INVALID_HANDLE).
I think this is wrong.
How to: Add a Serial Port wrote:For a host port number higher than 9, the naming \\.\comX where X is the port number, is required.
I believe all that is needed is
How to: Add a Serial Port wrote:Port Number: COM1
Additionally, you might need to have the "COM" in all caps, unless that's a bug in the error message.
Mlima
Posts: 5
Joined: 26. Mar 2023, 16:08

Re: Serial Port Connection issue

Post by Mlima »

scottgus1 wrote:Glad to help so far...
Thank you so much!!
Mlima wrote:Failed to open host device '\\.\com1' (VERR_INVALID_HANDLE).
Image

I tried using capslock, but it failed. Perhaps it's because the port is in hidden mode

Image

What do you think?
Attachments
Captura de tela 2023-03-28 104400.png
Captura de tela 2023-03-28 104400.png (14.87 KiB) Viewed 1789 times
Captura de tela 2023-03-28 094935.png
Captura de tela 2023-03-28 094935.png (27.58 KiB) Viewed 1789 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Serial Port Connection issue

Post by scottgus1 »

try taking off the \\.\

Only put:

COM1

or

COM4


The # should match what the device is showing in the host's Device Manager.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Serial Port Connection issue

Post by mpack »

The "\\.\comXX" notation was introduced to allow port numbers higher than 9, but it works for any port number.

I've never heard of a "hidden port". A hidden port basically doesn't exist, and that's why you can't use it. I'd say that the host is lacking the proper drivers for the CH340 USB/serial chipset.

And just to clarify, the host port (when it exists) is com4, not com1. COM1 is how the guest OS labels it.
Mlima
Posts: 5
Joined: 26. Mar 2023, 16:08

Re: Serial Port Connection issue

Post by Mlima »

mpack wrote:The "\\.\comXX" notation was introduced to allow port numbers higher than 9, but it works for any port number.

I've never heard of a "hidden port". A hidden port basically doesn't exist, and that's why you can't use it. I'd say thta the host is lacking the proper drivers for the CH340 USB/serial chipset.

And just to clarify, the host port (when it exists) is com4, not com1. COM1 is how the guest OS labels it.
The problem was with my device, which caused the port to not function properly, and as a result, the host operating system identified it as hidden mode. Once I changed the device, the port appeared normally and the guest operating system was able to recognize the COM port.

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

Re: Serial Port Connection issue

Post by mpack »

Please do not use the post reporting system to attract attention (note to readers: you see nothing because I closed the report). It should only be used to report e.g. abusive posts or spam.
Post Reply