headless build fails with the following error: VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98:42: error: ‘PSHCLFORMATDATA’ has not been declared bug is upstream, introduced here https://www.virtualbox.org/changeset/83624/vbox PSHCLFORMATDATA was renamed to PSHCLFORMATS, but obviously forgotten in VBoxSharedClipboardSvc-x11-stubs.cpp bug is reported upstream and will be fixed in a future version of virtualbox. temporary fix: replace "PSHCLFORMATDATA" with "PSHCLFORMATS" at VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98 Reproducible: Always Steps to Reproduce: 1. USE="headless" emerge -v virtualbox
Created attachment 634186 [details] ebuild with patch
Created attachment 634188 [details, diff] patch file files/virtualbox-6.1.6-headless-fix.patch
Can you add the URL to the upstream issue please?
Created attachment 634190 [details, diff] revised patch file fixed patched file path
(In reply to Lars Wendler (Polynomial-C) from comment #3) > Can you add the URL to the upstream issue please? Virtualbox bug reporting policy states that build errors are not submitted as bugs but instead reported to the mailing list. My report is here, devs responeded: https://www.virtualbox.org/pipermail/vbox-dev/2020-April/015446.html
Created attachment 635756 [details] Build log (gzip-ed) with provided patch, with "headless" USE flag. Hello, Thank you Vedran Vrbanc for this report, the patch you provided through attachment 634190 [details, diff] works, simplify by writing its content under the "/etc/portage/patches" directory; unfortunately the build is unsuccessful, related to another error which should have its own issue. Full-disclosure: /var/tmp/portage/app-emulation/virtualbox-6.1.6/work/VirtualBox-6.1.6/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h:58:11: fatal err or: X11/Xlib.h: No such file or directory 58 | # include <X11/Xlib.h> | ^~~~~~~~~~~~ But this issue brings another root issue: why does an headless configuration pull a file about a clipboard sharing feature, which looks like related to a graphic environment? I might be wrong, but shouldn’t this file be discarded when headless configuration is set? Isn’t something wrong with the configuration part? Anyway, here the log of the (failed) build, as you can see the user patch is applied, and the main error is fixed (the file VBoxSharedClipboardSvc-x11-stubs.cpp is compiled without issue): ================================ * Applying renamed_PSHCLFORMATDATA.patch ... patching file src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp Hunk #1 succeeded at 95 with fuzz 1. [ ok ] * User patches applied. ================================ Best regards,
(In reply to Thibaud "thican" CANALE from comment #6) It compiled on my system but only because I had libX11 and other stuff installed already. Your issue probably predates virtualbox-6.1.6. I have tried emerging virtualbox on a clean gentoo system and it looks like virtualbox now needs additional dependencies, even if it does not use a GUI. required dependencies: media-libs/libglvnd x11-libs/libX11 x11-libs/libXext x11-libs/libXmu x11-libs/libXrender x11-libs/libXt package.use: app-emulation/virtualbox headless -qt5 media-libs/libglvnd X If you emerge those manually, and set the above use flags, it should compile. I see that most of these dependencies are pulled in non-headless builds, so maybe some older version of VirtualBox didn't require these for a headless build, but now it does. I tried to compile it manually and disabled pretty much everything in the ./configure script, including opengl, but still it wanted GL/glx.h, Xlib.h + others. I will dig a bit more and see if this can be made to work without X11/GL stuff, but that should probably be fixed upstream. A quick and dirty fix would be to just add above dependencies as hard dependencies to the ebuild.
(In reply to Vedran Vrbanc from comment #7) ../.. > I will dig a bit more and see if this can be made to work without X11/GL > stuff, but that should probably be fixed upstream. A quick and dirty fix > would be to just add above dependencies as hard dependencies to the ebuild. Thanks for your answer, but I think it’s better (I guess Gentoo’s devs will agree) to report those information in the dedicated bug 720736, and to keep this ticket to its main root issue. I agree it is possible to make it compiling and running by providing the required dependencies, however as you said this is something which should be fixed upstream. For conclusion, this subject should be move to the bug 720736. Thanks again for your research. If you agree, I can copy your last comment. Best regards.
Still an issue with virtualbox-6.1.10?
(In reply to Lars Wendler (Polynomial-C) from comment #9) > Still an issue with virtualbox-6.1.10? +headless works for me on 6.1.10-r1
Created attachment 645002 [details] Build log (gzip-ed) without user patch from comment 4. Hello, I disagree, I think there is still some issues with VirtualBox 6.1.6 and the headless flag, specially about this issue about "PSHCLFORMATDATA". I just tried to compile this version without user patch from comment 4, I still have the same issue (see new attachment): /var/tmp/portage/app-emulation/virtualbox-6.1.6/work/VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98:42: error: ‘PSHCLFORMATDATA’ has not been declared 98 | PSHCLFORMATDATA pFormats) | ^~~~~~~~~~~~~~~ With the user patch, I meet the issue described in bug 720736. Just because it (might) work(s) with version 6.1.10 as you asked (spoiler alert, it doesn't) and because this version, 6.1.6, is still in Portage tree, I don't think this bug should be considered as fixed. I guess this user patch is missing from your archive of patchsets for this version, but I still think this is not enough for fixing this build on an headless system. Please reopen this bug until the user patch is provided from ebuild. Thanks.