virtualbox-ose 6.1.36 can't open URLs or User Manual

Hi,

I'm running FreeBSD 13.1, and have virtualbox-ose 6.1.36 installed from the pkg. The problem is that the VM manager (not the guest!)
cannot open any URLs. E.g. if I select Help -> VirtualBox Web Site, I get the message

Failed to open https://www.virtualbox.org. Make sure your desktop environment can properly handle URLs of this type.

Similarly, for the User Manual, Help -> Contents says

Failed to open file:///usr/home/ko/.config/VirtualBox/UserManual.pdf. Make sure your desktop environment can properly handle URLs of this type.

Does anyone have any ideas?
 
The only DE I have on FreeBSD at hand right now is fluxbox. There I have the same issue as you're describing. I did a quick check on why that is. Long story short VirtualBox should be able to detect 4 browsers automatically (via QT's DesktopServices API): google-chrome,firefox,mozilla and opera. I don't understand why it's failing on that (seems /usr/local/bin is not used in PATH search). But that API is aware of two environment variables: BROWSER and DEFAULT_BROWSER. So if you put that into your profile next run of manager would be able to resolve it.

I use bash so in my ~/.bashrc I've added:
Code:
export BROWSER="/usr/local/bin/firefox"
 
Thanks. I use xfce. I also looked at the source and got as far as QT's DesktopServices API, but I gave up after that.
Using export BROWSER=/usr/local/bin/firefox did the trick.
 
Similarly, for the User Manual, Help -> Contents says

Failed to open file:///usr/home/ko/.config/VirtualBox/UserManual.pdf. Make sure your desktop environment can properly handle URLs of this type.
Package (or port) emulators/virtualbox-ose is build without a manual:
Code:
/usr/ports/emulators/virtualbox-ose % make showconfig
     MANUAL=off: Build with user manual
Download the manual and place it in the VirtualBox's search path.
 
Package (or port) emulators/virtualbox-ose is build without a manual:
Code:
/usr/ports/emulators/virtualbox-ose % make showconfig
     MANUAL=off: Build with user manual
Download the manual and place it in the VirtualBox's search path.

Yes, I saw that when I looked at the port's Makefile.
But when I pressed Help->Contents for the first time, the manual got downloaded (by default, I guess) into the path I showed above: /usr/home/ko/.config/VirtualBox/UserManual.pdf. Where should it be?
 
But when I pressed Help->Contents for the first time, the manual got downloaded (by default, I guess) into the path I showed above: /usr/home/ko/.config/VirtualBox/UserManual.pdf
That path looks odd. On my system the missing manual is searched under /usr/local/share/doc/virtualbox-ose/UserManual.pdf (pop-up window), which would be the correct path:

emulators/virtualbox-ose/pkg-plist:
Code:
%%MANUAL%%%%DOCSDIR%%/UserManual.pdf
DOCSDIR gets expanded to PREFIX/share/doc/PORTNAME (/usr/local/share/doc/virtualbox-ose/).
 
Thanks. I use xfce. I also looked at the source and got as far as QT's DesktopServices API, but I gave up after that.
You were on the right track then. :) I was not in mood to compile the VirtualBox on my odroid box, I kinda forgot FreeBSD doesn't ship debug symbols with prebuilt packages.

I wanted to keep the answer simple so I didn't share the source links. But as you did look, I will. So the issue is here, in detectWebBrowser() which gets called by DesktopServices when you open the help items (URI handlers).
In my setup (fluxbox) code should land in line 155 where it starts parsing the static browser names. Check executable is wrapper around findExecutable() where the issue is, at least most likely. It seems the proper env PATH isn't used. As a test I created symlink /usr/bin/firefox pointing to actual location in /usr/local. It worked without the additional environment variables. Removing the link made it fail again.
I didn't have time yet to check, I will recompile virtualbox and most importantly QT with debug option to see what it does.
 
That path looks odd. On my system the missing manual is searched under /usr/local/share/doc/virtualbox-ose/UserManual.pdf (pop-up window), which would be the correct path:

emulators/virtualbox-ose/pkg-plist:
Code:
%%MANUAL%%%%DOCSDIR%%/UserManual.pdf
DOCSDIR gets expanded to PREFIX/share/doc/PORTNAME (/usr/local/share/doc/virtualbox-ose/).

As a test, I renamed /usr/home/ko/.config/VirtualBox/UserManual.pdf to /usr/home/ko/.config/VirtualBox/UserManual-ko.pdf.

Now when I click on Help->Contents, I get

Could not find the VirtualBox User Manual /usr/local/share/doc/virtualbox-ose/UserManual.pdf. Do you wish to download this file from the Internet?

If I say yes, I get

The VirtualBox User Manual has been successfully downloaded from [URL]https://download.virtualbox.org/virtualbox/6.1.36/UserManual.pdf[/URL] and saved locally as /usr/home/ko/.config/VirtualBox/UserManual.pdf.

Next, I created /usr/local/share/doc/virtualbox-ose and put the manual there. Now I get

Failed to open file:///usr/local/share/doc/virtualbox-ose/UserManual.pdf. Make sure your desktop environment can properly handle URLs of this type.
 
You were on the right track then. :) I was not in mood to compile the VirtualBox on my odroid box, I kinda forgot FreeBSD doesn't ship debug symbols with prebuilt packages.

I wanted to keep the answer simple so I didn't share the source links. But as you did look, I will. So the issue is here, in detectWebBrowser() which gets called by DesktopServices when you open the help items (URI handlers).
In my setup (fluxbox) code should land in line 155 where it starts parsing the static browser names. Check executable is wrapper around findExecutable() where the issue is, at least most likely. It seems the proper env PATH isn't used. As a test I created symlink /usr/bin/firefox pointing to actual location in /usr/local. It worked without the additional environment variables.
/usr/bin sounds like a Linux remnant to me.
Removing the link made it fail again.
I didn't have time yet to check, I will recompile virtualbox and most importantly QT with debug option to see what it does.

Well, thanks, but it may not be worth it to spend all this effort on it.
 
As a test, I renamed /usr/home/ko/.config/VirtualBox/UserManual.pdf to /usr/home/ko/.config/VirtualBox/UserManual-ko.pdf.

Now when I click on Help->Contents, I get

Could not find the VirtualBox User Manual /usr/local/share/doc/virtualbox-ose/UserManual.pdf. Do you wish to download this file from the Internet?

If I say yes, I get

The VirtualBox User Manual has been successfully downloaded from [URL]https://download.virtualbox.org/virtualbox/6.1.36/UserManual.pdf[/URL] and saved locally as /usr/home/ko/.config/VirtualBox/UserManual.pdf.

Next, I created /usr/local/share/doc/virtualbox-ose and put the manual there. Now I get

Failed to open file:///usr/local/share/doc/virtualbox-ose/UserManual.pdf. Make sure your desktop environment can properly handle URLs of this type.
Manual downloaded from the VirtualBox gui and placed in .config/Virtualbox. After failure to open moved to /usr/local/share/doc/virtualbox-ose/UserManual.pdf.

Apparently my window manager (x11-wm/openbox) can't "handle URLs of this type" neither way:
Code:
Qt WARNING: Unable to detect a launcher for 'file:///home/online/.config/VirtualBox/UserManual.pdf'

Qt WARNING: Unable to detect a launcher for 'file:///usr/local/share/doc/virtualbox-ose/UserManual.pdf'

It's not an issue for me, I prefer the html manual.
 
Failed to open file:///usr/local/share/doc/virtualbox-ose/UserManual.pdf. Make sure your desktop environment can properly handle URLs of this type.
You're right, I get the same error message. But if I launch this URL with
xdg-open "file:///home/joe/.config/VirtualBox/UserManual.pdf" it works. This file is opened with my favorite PDF reader.
 
You're right, I get the same error message. But if I launch this URL with
xdg-open "file:///home/joe/.config/VirtualBox/UserManual.pdf" it works. This file is opened with my favorite PDF reader.
But you're doing this by hand, not through VirtualBox, right? (It also works for me to open this file by hand with my PDF reader.)
 
It's not an issue for me, I prefer the html manual.
If you have any pdf reader installed that xdg-open is able to open manager should be able to open it. It's the same issue as with the web browser. Some sort of PATH parsing is not done correctly in QT library. This is also why ko56 has above error on pdf too (coming from the same API call).

Well, thanks, but it may not be worth it to spend all this effort on it.
Yeah, I won't spend too much time on it. If anything I'm just curious why.
 
I've opened a PR 266778.

After quick debugging of QT's DesktopServices I've noticed VirtualBox process has PATH set to a default one. I was digging through the VBox code when I realized /usr/local/bin/virtualbox is a shell script that is actually overwriting user's PATH. One could edit this script and expand PATH to include at least /usr/local/bin.
 
Thank you for the effort _martin.

After including /usr/local/bin to PATH in the virtualbox script, URLs from gui 'Help' menu are launched with the default internet browser, UserManual.pdf (Help -> Contents or F1) with a pdf viewer, if present.
 
Does Alpine Linux still have network connectivity for you? (the standard version, not the VM version)

I have the following two problems:

Screenshot_2022-10-23_09-31-09.png


Screenshot_2022-10-23_09-20-31.png


Edit
I didn't have vboxnet_enable="YES" in rc.conf
This was the issue..
VirtualBox works well again for me:
Screenshot_2022-10-23_11-17-38.png
 
Back
Top