Serial port blocks virtual machine start

Discussions related to using VirtualBox on Linux hosts.
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Serial port blocks virtual machine start

Post by tfmeier »

I installed the latest VirtualBox release 6.1 on a Fedora 32 system. Used non-root user as per below

When I start the VM I get this message

Failed to open a session for the virtual machine xxxxx.
Details

Failed to open host device /dev/ttySO' (VERR_DEV_TO_ERROR).
I Result
Code: NS_ERROR_FAILUR
(0x 80004005

The device is connected to /dev/ttyS0 and as you can see below it's part of the group dialout.

themeierresidence@vortexbox ~]$ ls -l /dev/ttyS0
crw-rw----. 1 root dialout 4, 64 Oct 4 19:06 /dev/ttyS0
[themeierresidence@vortexbox ~]$
[themeierresidence@vortexbox ~]$ getent group dialout
dialout:x:18:themeierresidence
[themeierresidence@vortexbox ~]$ whoami
themeierresidence
[themeierresidence@vortexbox ~]$ ^C
[themeierresidence@vortexbox ~]$

As a comparison I installed VirtualBox 5.1 on a Fedora 25 system as root and the VM started without issues.

Any ideas why this wouldn't start?
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 port blocks virtual machine start

Post by Martin »

tfmeier wrote:Failed to open host device /dev/ttySO' (VERR_DEV_TO_ERROR).
If that error message is a correct copy&paste then you have a typing error in the guest configuration ;)
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

I wish it was that easy... It's configured correctly... Just my terrible typing skills
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 port blocks virtual machine start

Post by fth0 »

Please provide a zip file containing the VBox.log file.
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

fth0 wrote:Please provide a zip file containing the VBox.log file.
Here it is. Thanks for looking at this.
Attachments
VBox.log.zip
VBox.log
(20.34 KiB) Downloaded 12 times
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 port blocks virtual machine start

Post by fth0 »

SR90 Home Assistant-2020-10-04-23-27-17.log wrote:
00:00:01.901730 /home/vbox/vbox-6.1.14/src/VBox/Runtime/r3/posix/serialport-posix.cpp:1407 int RTSerialPortQueryStatusLines(RTSERIALPORT, uint32_t*) iReq=0x5415 pvArg=00007f674697bd8c -> EIO
00:00:01.901761 /home/vbox/vbox-6.1.14/src/VBox/Runtime/r3/posix/serialport-posix.cpp:702 int rtSerialPortStsLineMonitorThrd(RTTHREAD, void*) iReq=0x545c iArg=0x1e0 -> EIO
00:00:01.901776 HostSerial#0: Getting status lines state failed with error VERR_DEV_IO_ERROR; continuing.
[...]
The serial port implementation cannot query the modem status lines (any more). The 1st log message above is created after such a failed query. But the 2nd log message above can only be created if such a query has succeeded at least once before that. From that point on, accesses to the serial port don't work any more.

The serial port configuration looks correct to me. Maybe @mpack has additional ideas, otherwise I'd suggest to create an entry in the Bugtracker. The serial port code has often been improved in recent years ... ;)
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 blocks virtual machine start

Post by mpack »

Is this a real serial port? The obvious reason to fail to get UART status is that it isn't a UART, or the UART doesn't exist.

This can't be a VirtualBox problem otherwise it would be seen by everyone who uses a serial port.
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

Yes, the serial port is real.

In fact I tried this on a Fedora 25 system running VirtualBox 5.1 and access to the serial port (/dev/ttyS0) was ok. However the install was done under root which I know is not recommended. Also trust there are plenty of changes between VirtualBox 5.1 and 6.1.

Maybe I try to install this under root on the current (Fedora 32) system to see whether that makes any difference.
smithlar
Posts: 79
Joined: 9. May 2008, 15:54
Primary OS: openSUSE
VBox Version: PUEL
Guest OSses: WinXP32 WinXP64 Win7-32 Win7-64 openSUSE64 OS2 Win10
Location: Texas, USA

Re: Serial port blocks virtual machine start

Post by smithlar »

You must INSTALL Virtualbox as "root".
Also the Host Extension pack for USB etc must be installed on the host as "root".
After installation you logon as a regular user to create virtual machines (VMs).

The VMs must belong to regular users, but Virtualbox itself must be installed as "root"
because it needs to install System level drivers.

Also, the users who create/own VMs must be made member of the "vboxusers" group.
The "vboxusers" group should be auto created by the Virtualbox installer when it was run by "root".
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

smithlar wrote:You must INSTALL Virtualbox as "root".
Also the Host Extension pack for USB etc must be installed on the host as "root".
After installation you logon as a regular user to create virtual machines (VMs).

The VMs must belong to regular users, but Virtualbox itself must be installed as "root"
because it needs to install System level drivers.

Also, the users who create/own VMs must be made member of the "vboxusers" group.
The "vboxusers" group should be auto created by the Virtualbox installer when it was run by "root".
Ok, I have recreated the above but still get the same error - attached

Code: Select all

[root@vortexbox ~]# ls -l /dev/ttyS0
crw-rw----. 1 root dialout 4, 64 Oct  6 23:57 /dev/ttyS0
[root@vortexbox ~]# getent group dialout
dialout:x:18:themeierresidence
[root@vortexbox ~]# getent group vboxusers
vboxusers:x:975:themeierresidence
[root@vortexbox ~]#
The actual connection and connected device work as verified with a Fedora25 / VirtualBox 5.1 install. Group membership should be correct as well for the non-root user I used to create the VMs.

Do you still think this is setup related?
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

Ok here's the latest...

Rebuilt the box using Fedora 30 workstation and VirtualBox 5.2.44 (the last release before 6.x) as per above instructions; i.e. install VB and extension pack under root and create VMs under normal ID which is a member of vboxusers.

Serial port /dev/ttyS0 starts up without an issue and I can connect to the serial device. I wanted to install VB 5.2.44 on Fedora 31+ but wasn't listed on the VB downloads page (). While I probably don't need the features of 6.x I still wonder why this wouldn't work...
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

Next update in this puzzle.

Fedora 30, installed VirtualBox 6.0.24 (last release before 6.1). Serial port /dev/ttyS0 doesn't work. Same error message as above.

So I tend to believe there's an issue with VB 6.x as trying to run both VB 6.0 and VB6.1 on Fedora 30 doesn't let me start the serial port whereas it runs fine on VB 5.2.44.

On another note how can I completely remove VB 6.0.24 and reinstall VB 5.2.44 to give me a working system?
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

Do you have any more insights on this or shall I raise an issue?

To recap I can confirm that I was able to activate/use the serial port /dev/ttyS0 on VB5.0 and VB5.2.44 and was not able to get it to work on VB6.x
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 blocks virtual machine start

Post by scottgus1 »

Just to let you know we're not ignoring this, Personally I have no idea how to fix it, though.

There could be issues with serial in later versions of Virtualbox. You could try a well-informed post on the Bugtracker.
tfmeier
Posts: 20
Joined: 4. Oct 2020, 10:20

Re: Serial port blocks virtual machine start

Post by tfmeier »

scottgus1 wrote:Just to let you know we're not ignoring this, Personally I have no idea how to fix it, though.

There could be issues with serial in later versions of Virtualbox. You could try a well-informed post on the Bugtracker.
Bingo... already reported here https://www.virtualbox.org/ticket/19889. Same findings as what I've found; i.e. the serial port won't work in VB6.x. At least we know this is reported. Now watching out for a fix ... :)
Post Reply