[Solved] Serial Interface not working.

Discussions related to using VirtualBox on Windows hosts.
Post Reply
mfeicht
Posts: 7
Joined: 13. Oct 2021, 19:34

[Solved] Serial Interface not working.

Post by mfeicht »

I would like to pass through a serial interface. COM9 - for bluetooth adapter to a linux/ubuntu guest system.

The menue is greyed out. Please help.
Attachments
serial interfac greyed out.GIF
serial interfac greyed out.GIF (41.31 KiB) Viewed 3256 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 Interfaces - menue greyed out

Post by scottgus1 »

Enabling the serial adapter is like inserting a hardware card in a PC. Most PCs don't like doing that while they're on or hibernated. :lol:

If the VM is still running or is save-stated, shut it down first.
mfeicht
Posts: 7
Joined: 13. Oct 2021, 19:34

Re: Serial Interfaces - menue greyed out

Post by mfeicht »

thank you - I can change the COMs now.

I am seeking to "pass through" my bluetooth device I paired with my PC (HC-05) to a linux guest system (COM8). This is
not COM1-COM3 and physical serial with IRQ / I/O Port

Is this easy / little time effort feasible / stable?

If yes -> is there a tutorial somewhere?
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 Interfaces - menue greyed out

Post by mpack »

mfeicht wrote: This is not COM1-COM3 and physical serial with IRQ / I/O Port.
To the guest OS it is. Bear in mind why a virtual machine is "virtual".

All you need to do is enable the port and supply the host device name (COM9) in the "Pfad|Adresse" field. Don't worry about the other stuff: leave it alone.

The port number (e.g. COM1) is how the guest OS will see the virtual port, "COM1" refers to the first standard serial port - but different guest OS's will have different names for this, e.g. I think Linux uses "ttyS0" as the name for the first serial port. Leave that alone too.

Also, although you posted in "Linux Hosts", it is becoming clear that your host is Windows 10, your guest is Linux. I'll move the topic to "Windows Hosts".
mfeicht
Posts: 7
Joined: 13. Oct 2021, 19:34

Re: Serial Interfaces - menue greyed out

Post by mfeicht »

thanks.

I have connected an Arduino at my Win10 PC at COM8 / with 38400 bit/s

in Virtualbox I've configured the serial - see screenshot.
serial virtualbox.png
serial virtualbox.png (11.9 KiB) Viewed 3106 times
In the ubuntu guestOS I've run some test commands before / after configuring the serial dev. - see screenshot

ttyS0 is appearing after the config. However, with 115000 baud...

testing Ubuntu
- I've installed Putty on Ubuntu - no connection
- I've tried to connect via Node-Red - no connection

Please help
Attachments
serial virtualbox.zip
(200.35 KiB) Downloaded 4 times
Last edited by mpack on 16. Oct 2021, 10:11, edited 4 times in total.
Reason: Move important screenshot inline.
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 Interfaces - menue greyed out

Post by mpack »

I see you have it configured as a "host pipe". But COM8 isn't a pipe, it's a physical port, so the correct choice is "Host device". However I do note that I forgot to tell you about this above - I forgot that the mode option existed.

Please understand that once assigned to the VM, the host cannot use that serial port. In fact the VM can't access the serial port if you already have it open in some app - which I assume may be the case since you mention setting the bit rate somewhere else. RS232 serial ports can't be shared, and the settings applied to the port by some other app will make no difference to the VM, which will apply its own settings.
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 Interfaces - menue greyed out

Post by mpack »

p.s. I see you're a fan of GIFs, but really that format is a relic from the 1980s. There is no reason to use dithering in this day and age. The best format to use today is PNG, e.g. as created by the Windows Snipping Tool which is built into Windows 7 and later. For example, here a screenshot I made to be similar to one of yours, i.e. also taken from a 4K monitor.
Capture.PNG
Capture.PNG (11.23 KiB) Viewed 3147 times
Notice that this has no dithering artifacts, yet it is smaller: the file size is <12KB, compared to >40KB for the lower quality GIF you posted. I heartily recommend using the Windows Snipping tool and PNG format for all forum pictorial content you post.
mfeicht
Posts: 7
Joined: 13. Oct 2021, 19:34

Re: Serial Interfaces - menue greyed out

Post by mfeicht »

mpack wrote:I see you have it configured as a "host pipe". But COM8 isn't a pipe, it's a physical port, so the correct choice is "Host device". However I do note that I forgot to tell you about this above - I forgot that the mode option existed.

Please understand that once assigned to the VM, the host cannot use that serial port. In fact the VM can't access the serial port if you already have it open in some app - which I assume may be the case since you mention setting the bit rate somewhere else. RS232 serial ports can't be shared, and the settings applied to the port by some other app will make no difference to the VM, which will apply its own settings.

Thanks...

In the German VirtualBox Manager there is no "Host device"... Please see attached...

I am aware that the Windows Host can no longer access this port.
I've programmed my Arduino that he sends with 38400Baud on COM8.
Attachments
serial host pipe.PNG
serial host pipe.PNG (48.96 KiB) Viewed 3134 times
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Serial Interfaces - menue greyed out

Post by Martin »

Die deutsche Übersetzung für "Host Device" ist hier "Host-Schnittstelle" ;)
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Serial Interfaces - menue greyed out

Post by fth0 »

Und noch ein Tipp für's nächste Mal:

Du kannst in den Einstellungen des VirtualBox Managers kurzzeitig die Sprache auf Englisch umstellen, dann den entsprechenden Dialog ansehen, und die Sprache wieder zurück ändern (sofern Du die Spracheinstellung wieder findest. ;)).
mfeicht
Posts: 7
Joined: 13. Oct 2021, 19:34

Re: Serial Interfaces - menue greyed out

Post by mfeicht »

All - thank you very much. It is working now.

I can now get COM Ports passed-thorugh to my Ubuntu guest system.
(I solved an additional challenge concerning permissions in Ubuntu via : chmod 666 /dev/ttyS0)
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 Interfaces - menue greyed out

Post by mpack »

Congratulations, and thanks for reporting back.

Topic marked as solved - I also changed the title (from "menu grayed out") to better reflect the true subject matter.
Post Reply