VirtualBox Manager crashes when checking for updates

Discussions related to using VirtualBox on Linux hosts.
Post Reply
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

I am running VBox version 6.1.26 r145957 on Linux kernel 5.14.9, Slackware-Current distro. When I run VirtualBox Manager and select File > Check for Updates, VBox Manager simply disappears. No VBox.log is created. I've been having this problem since at least Linux kernel 5.12.14 and VBox version 6.1.16 (July 2021)-- certainly for months earlier than that when I installed the 5.x.x kernels, but I have no logs before July.

I do not have this problem on Linux kernel 4.4.240 and Slackware 14.2. I end up using the VirtualBox Manger on the 4.4.240 system to check for and download VBox updates, then I've copied the .run file to my 5.x.x system. In order to run VBox on my 5.14.9 system I have to disable automatic check for updates.

Is this just me or is this a problem other people are having with the 5.x.x kernels? Is there a log file I can capture to show the problem? Has anyone solved this?
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

No one else has this issue with Linux hosts or has a solution?
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: VirtualBox Manager crashes when checking for updates

Post by fth0 »

There have been other users with similar problems, but only lately. You could try a VirtualBox test build, but that also doesn't match your description of the long-term property of your issue:

Linux kernel 5.14 is supported by VirtualBox test builds 6.1.27r146191 and newer.
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

I just installed VirtualBox 6.1.28 r147628 with Linux Kernel 5.14.15 (and KDE 5.23.2 if that matters), QT 5.15.3. Checking for updates still crashes the VirtualBox Manager. If I want to check for updates I have to do so on a system running the 4.4.x kernel and KDE4. No VBox.log is generated when this happens.

Am I the only one experiencing this problem? There seems to be little activity on this issue. This is a fairly recent kernel and I would greatly love to figure out what's wrong. I cannot upgrade my other VBox systems until this is solved. Is there some debug information I can supply?
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: VirtualBox Manager crashes when checking for updates

Post by fth0 »

Start the VirtualBox Manager from within a terminal ("VirtualBox") and reproduce the crash. Please post the terminal output (if any) and a zip file containing the contents of the (user-specific) global configuration and logging folder ~/.config/VirtualBox.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox Manager crashes when checking for updates

Post by scottgus1 »

Might also add these:

try checking if there is a mix of forked and official Virtualbox (might happen when installing official while forked is present, maybe without doing the prerequisites https://www.virtualbox.org/manual/ch02. ... nux-prereq first).

try unplugging all USB devices except basic keyboard and mouse.
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

fth0: Thanks for the suggestion. Console output:

Code: Select all

$ VirtualBox

(process:27638): GLib-GObject-WARNING **: 11:47:02.710: cannot register existing type 'NMAgentManagerError'

(process:27638): GLib-CRITICAL **: 11:47:02.710: g_once_init_leave: assertion 'result != 0' failed

(process:27638): GLib-GObject-WARNING **: 11:47:02.710: cannot retrieve class for invalid (unclassed) type '<invalid>'
Segmentation fault
Requested directory contents attached.
Attachments
VBoxConfigLoggingForUser.zip
zip file containing the contents of the (user-specific) global configuration and logging folder ~/.config/VirtualBox
(42.78 KiB) Downloaded 3 times
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

scottgus1 wrote:Might also add these:

try checking if there is a mix of forked and official Virtualbox (might happen when installing official while forked is present, maybe without doing the prerequisites https://www.virtualbox.org/manual/ch02. ... nux-prereq first).

try unplugging all USB devices except basic keyboard and mouse.
Thanks. I'll investigate these suggestions if my posting to fth0's request yields no results. This is a from-scratch VirtualBox system downloaded from the official virtualbox.org site. I update it from that site monthly. Unless a download from that site would have sent a "forked" version, I don't know how else I would have such a thing. I have no USB devices configured with my VM.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox Manager crashes when checking for updates

Post by scottgus1 »

Sounds good. I don't know if Slackware provides pre-installed forks, but Ubuntu and some other Linux distros do.

Also, the glitch I've seen over which I recommended disconnecting USB devices USB doesn't require USB devices to be inserted into the VMs, only that an unusual USB device on the host crashes Virtualbox while starting the main window, due to some incompatibility between the device and the Virtualbox USB enumeration.
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: VirtualBox Manager crashes when checking for updates

Post by fth0 »

I've recognized the console output, which I have seen a while ago, when discussing a very similar issue with ...
... you in February 2021 (VirtualBox Manager disappears on new install). We couldn't solve it, though, only work around it.

Three different ideas:

1. Questions: Did you always use the mfoley account with VirtualBox, or did you also use the root account? If you did the latter, how did you become root on your Linux host?

2. We could go the debugging route: Start the VirtualBox Manager from within a terminal, this time entering gdb /usr/lib/virtualbox/VirtualBox, then run, then reproduce the crash, then enter bt.

3. In some of the selectorwindow.log files, a certificate issue was logged, which I think may correlate with your update checks. Can you verify that? I'll try and follow this trail ...

PS: You can also try the suggestions from scottgus1, especially the USB devices removal. ;)
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

fth0 wrote:I've recognized the console output, which I have seen a while ago, when discussing a very similar issue with ...
... you in February 2021 (VirtualBox Manager disappears on new install). We couldn't solve it, though, only work around it.
Yes - I used your work-around suggestion to disable automatic checking for updates when VirtualBox manager is launched. That was the only way to actually get VBox running.
Three different ideas:

1. Questions: Did you always use the mfoley account with VirtualBox, or did you also use the root account? If you did the latter, how did you become root on your Linux host?
I've always used the mfoley account to log into KDE and launch VirutalBox manager manually. On a couple of my Slackware 14.2 systems (kernel 4.4.261) KDE auto starts VirtualBox without the user logging in via ~/.kde/Autostart. I do install VirtualBox as root.
2. We could go the debugging route: Start the VirtualBox Manager from within a terminal, this time entering gdb /usr/lib/virtualbox/VirtualBox, then run, then reproduce the crash, then enter bt.
That didn't go so well. First off, I don't have /usr/lib/virtualbox/VirtualBox. I have:

Code: Select all

# find / -mount -name VirtualBox -exec file {} \;
/opt/VirtualBox/VirtualBox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=462dae72af18f02fbcf414ef0a9823ae4690ce1d, stripped
/usr/bin/VirtualBox: symbolic link to /opt/VirtualBox/VBox.sh
And apparently gdb wants an actual binary executable, so I tried:

Code: Select all

$ gdb /opt/VirtualBox/VirtualBox
GNU gdb (GDB) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-slackware-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/VirtualBox/VirtualBox...
(No debugging symbols found in /opt/VirtualBox/VirtualBox)
(gdb) run
Starting program: /opt/VirtualBox/VirtualBox 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff2176640 (LWP 17765)]
[Thread 0x7ffff2176640 (LWP 17765) exited]
Qt FATAL: QXcbConnection: Could not connect to display 

Thread 1 "VirtualBox" received signal SIGABRT, Aborted.
0x00007ffff296d848 in raise () from /lib64/libc.so.6
(gdb)
3. In some of the selectorwindow.log files, a certificate issue was logged, which I think may correlate with your update checks. Can you verify that? I'll try and follow this trail ...
I see the line:

Code: Select all

00:00:18.915905 refreshCertificates/#1: InMem.Cert.TbsCertificate.T3.Extensions.papItems[#].ExtnValue.NameConstraints.T0.PermittedSubtrees.papItems[#]: Unexpected sequence type/flags: 0x2/0x80 (expected 0x10/0x20)
This could be a clue. That "error" seems to only appear in th selectorwindow.log files when I tried to check for updates. However, I don't really have a clue what this Cert is or where to find it.
PS: You can also try the suggestions from scottgus1, especially the USB devices removal. ;)
Aside from the keyboard/mouse, I only have two USB devices attached: APC battery backup and bluetooth. I did unplug those and tried again. Same problem. This hardware, including USBs, is unchanged from when I was running the Slackware 14.2 kernel and I didn't have a problem then. When I get to a good rebooting point, I'll try swapping out the logitech wireless dongle and plugging in a wired keyboard and mouse and try again, but I'm not very confident with that experiment.
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: VirtualBox Manager crashes when checking for updates

Post by fth0 »

Regarding the certificate issue, I did some investigations. VirtualBox collects CA certificates from several places in the host OS (see below), to verify the Update Check later on. One of the found certificates leads to the log message (and perhaps to the crash), and I'd suggest that we try to identify it:

First, check which files and folders (see below) exist on your host, then rename (part of) them, see if the error persists, and rename them back. If you're proficient with certificates, you can check yourself which of the certificates contain an X.509 Name Constraints extension, and shorten the list of candidates that way. Please post the certificate that leads to the log message afterwards.

Code: Select all

/** System PEM files worth looking at.
 * @remarks Several of these could be symlinks to one of the others.
 */
static const char *g_apszSystemPemFiles[] =
{
    UNIX_ROOT "/etc/ssl/certs/ca-certificates.crt",
    UNIX_ROOT "/etc/ssl/cert.pem",
    UNIX_ROOT "/etc/ca-certificates/extracted/tls-ca-bundle.pem",       /* Arch linux (ca 2015-08-xx) */
    UNIX_ROOT "/etc/ca-certificates/extracted/email-ca-bundle.pem",
    UNIX_ROOT "/etc/ca-certificates/extracted/objsign-ca-bundle.pem",
    UNIX_ROOT "/etc/ca-certificates/extracted/ca-bundle.trust.crt",
    UNIX_ROOT "/etc/ca-certificates/extracted/ca-bundle.trust.crt",
    UNIX_ROOT "/etc/pki/tls/certs/ca-bundle.crt",                       /* Oracle Linux 5 */
    UNIX_ROOT "/etc/pki/tls/cert.pem",
    UNIX_ROOT "/etc/certs/ca-certificates.crt",                         /* Solaris 11 */
    UNIX_ROOT "/etc/curl/curlCA",
};

/**
 * System directories containing lots of pem/crt files.
 */
static const char *g_apszSystemPemDirs[] =
{
    UNIX_ROOT "/etc/openssl/certs/",
    UNIX_ROOT "/etc/ssl/certs/",
    UNIX_ROOT "/etc/ca-certificates/extracted/cadir/",
    UNIX_ROOT "/etc/certs/CA/",                                         /* Solaris 11 */
};

Regarding debugging, I forgot to tell that the file locations were based on my Linux Mint installations (Ubuntu based). But you probably found the correct binary yourself anyway. :)

The reason why the gdb command didn't work for you seems to be Linux distribution specific, because in Linux Mint it works as described. One way to possibly discover the correct call would be to run the VirtualBox shell script verbosely without gdb first (sh -x /usr/bin/VirtualBox) ...
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

Thanks for your time on this. The only one of the your suggested cert directories found was /etc/ssl/cert. running:

Code: Select all

openssl x509 -in [b][u]certfile[/u][/b] -text | grep -i "name constraint"
On all the files in that directory turned up only one with Name Constraint: Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem. Moving that completely out of the /etc directory generated the same error. Is there something else in the error string, "InMem.Cert.TbsCertificate.T3.Extensions.papItems[#].ExtnValue.NameConstraints.T0.PermittedSubtrees.papItems[#]: Unexpected sequence type/flags: 0x2/0x80 (expected 0x10/0x20)" I could look for? Perhaps the 0x2/0x80 flag?

There are 261 cert files in the /etc/ssl/cert directory, so it will take a bit of time to fox-and-fence them to find the culprit.

As to your sh -x /usr/bin/VirtualBox suggestion ...

Code: Select all

$ sh -x /usr/bin/VirtualBox
+ PATH=/usr/bin:/bin:/usr/sbin:/sbin
++ readlink -e -- /usr/bin/VirtualBox
+ TARGET=/opt/VirtualBox/VBox.sh
+ MY_DIR=/opt/VirtualBox
+ test -f /usr/lib/virtualbox/VirtualBox
+ test -f /opt/VirtualBox/VirtualBox
+ test -x /opt/VirtualBox/VirtualBox
+ INSTALL_DIR=/opt/VirtualBox
+ '[' '' = shutdown ']'
+ lsmod
+ grep -q vboxdrv
+ '[' '!' -c /dev/vboxdrv ']'
+ '[' -f /etc/vbox/module_not_compiled ']'
++ awk '{ print $1 }'
++ grep VBoxSVC
+++ whoami
++ ps -U mfoley
+ SERVER_PID=
+ '[' -z '' ']'
+ '[' -n mfoley ']'
+ rm -rf /tmp/.vbox-mfoley-ipc
+ '[' '' = true ']'
++ basename /usr/bin/VirtualBox
+ APP=VirtualBox
+ case "$APP" in
+ exec /opt/VirtualBox/VirtualBox
If I interpret this output correctly, the file to gdb would be /opt/VirtualBox/VirtualBox, which is the one I tried. :(

Meanwhile, I'll keep searching for that elusive cert file! That's at least a clue.
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: VirtualBox Manager crashes when checking for updates

Post by fth0 »

MarkFoley wrote:There are 261 cert files in the /etc/ssl/cert directory, so it will take a bit of time to fox-and-fence them to find the culprit.
It should take approximately 10 attempts with a binary search: Start with moving all of them away. If the problem persists, did you also check the single files in g_apszSystemPemFiles? If the problem didn't persist, put half of the certificates back and check again. If the problem didn't persist, put half of the remaining certificates back in, otherwise, take out half of the certificates. I'm confident you've got the idea (if you didn't know the binary search principle already ;)).

Regarding further details of the error message, I'd have to check the VirtualBox source code, which could take an hour or two, and I'm too lazy to do that right now. It could be that I already misinterpreted the error message, and NameConstraints is a red herring because of a confusion of ASN.1 values.

Regarding the debugging, I'd come to the same conclusion as you. When you tried the terminal command (without gdb), did the VirtualBox Manager successfully start, or did you get the Qt error like when using gdb?
MarkFoley
Posts: 150
Joined: 19. Aug 2016, 03:20

Re: VirtualBox Manager crashes when checking for updates

Post by MarkFoley »

I moved half of the certs out of /etc/ssl/certs (then half again, then half again ...). The culprit seems to be ca-certificates.crt. When only that cert file is present in /ec/ssl/certs I get the "NameConstraints" error. If that file is missing from the last group tested I don't get the error. I still get the VirtualBox command line error:

Code: Select all

(process:22648): GLib-CRITICAL **: 09:48:54.898: g_once_init_leave: assertion 'result != 0' failed

(process:22648): GLib-GObject-WARNING **: 09:48:54.898: cannot retrieve class for invalid (unclassed) type '<invalid>'
Segmentation fault
I need to do some more testing because when ALL files are back in the cert directory except ca-certificates.crt I still get the error, so there may be more than one cert with the issue, or maybe I screwed up the test, or since all those files appear to have links to each other, maybe a link to ca-certificates.crt is still in effect.

Regarding the debugging, no, VirtualBox starts find at the command line w/o gdb.
Post Reply