When built without X11 support VBoxSharedClipboard.so is not included. However, when trying to edit a running VM in phpvirtualbox ClipboardMode setting will fail. ... 00:00:37.304454 SQW03 API method name: IMachine::COMSETTER(ClipboardMode) 00:00:37.304474 SQW03 API return code: 0x80004005 (NS_ERROR_FAILURE) ... You can simulate this by running 'VBoxManage controlvm <VM> clipboard mode disabled': $ VBoxManage controlvm <VMNAME> clipboard mode disabled VBoxManage: error: Code NS_ERROR_FAILURE (0x80004005) - Operation failed (extended info not available) VBoxManage: error: Context: "COMSETTER(ClipboardMode)(mode)" at line 543 of file VBoxManageControlVM.cpp At some point vbox is trying to load VBoxSharedClipboard extension service. Copying VBoxSharedClipboard.so from the FreeBSD repo package to /usr/local/lib/virtualbox/ and reload the VM the modify to the running VM applies without issue. Is is also true when running the above with the package from FreeBSD pkg repo with the default options (this has X11 set). With that said should VBoxSharedClipboard.so from pkg-plist be unconditionally added? -%%X11%%lib/virtualbox/VBoxSharedClipboard.so +lib/virtualbox/VBoxSharedClipboard.so There are ifdefs to not build code for clipboardboard support and make access to it VERR_NOT_IMPLEMENTED however it appears to still build even with Config.kmk and LocalConfig.kmk setting VBOX_WITH_SHARED_CLIPBOARD = 0.
Found out that setting 'VBOX_WITH_SHARED_CLIPBOARD = 0' is incorrect. 'VBOX_WITH_SHARED_CLIPBOARD=' needs added to LocalConfig.kmk to set it as undefined. With this: +post-patch-X11-off: + @${ECHO_CMD} 'VBOX_WITH_SHARED_CLIPBOARD=' >> ${WRKSRC}/LocalConfig.kmk + VBoxSharedClipboard.so is not built. vboxmanage doesn't have any clipboard options as well. It appears to be fully disabled now. I'm wondering why when building with --enable-headless and --disable-qt why shared clipboard support is still built. It seems that there are parts that still use it even though you don't have a GUI. I'm still researching this. But it's possible that it shouldn't be disabled and included to the base package?
clipboard support is still enabled since vbox still provides access to the console via VRDP method. So I believe the original issue is still in play: VBoxSharedClipboard.so should be included unconditionally.
Created attachment 231572 [details] Always include VBoxSharedClipboard.so VBoxSharedClipboard.so is requires for headless/VRDP access as well.
ping?
Thanks Derek, can you: - Confirm the build passes poudriere in both X11 ON and OFF cases - Bump the port PORTREVISION
Created attachment 232921 [details] Always include VBoxSharedClipboard.so (with rev bump) Yes, with X11 on and X11 (including QT5, NLS) off. File is included in both packages. Tested with poudriere, 13amd64, interactive jail. root@13amd64-testing-vbox:~ # pkg query '%Ok=%Ov' virtualbox-ose | fgrep X11 ; pkg info -l virtualbox-ose | fgrep VBoxSharedClipboard.so X11=on /usr/local/lib/virtualbox/VBoxSharedClipboard.so root@13amd64-testing-vbox:~ # pkg query '%Ok=%Ov' virtualbox-ose | fgrep X11 ; pkg info -l virtualbox-ose | fgrep VBoxSharedClipboard.so X11=off /usr/local/lib/virtualbox/VBoxSharedClipboard.so Bumped revision.
Created attachment 234694 [details] Always include VBoxSharedClipboard.so v3 rebased on main (62c09d7c530) Rebased previous patch on main (62c09d7c530)
THanks for the patch. I'm testing the upgrade of Virtualbox to the recently released new version. I'll see if I can include this with the update.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5f02996b2b84deafaca8c5d6c3a2486695cb67ef commit 5f02996b2b84deafaca8c5d6c3a2486695cb67ef Author: Derek Schrock <dereks@lifeofadishwasher.com> AuthorDate: 2022-07-21 08:52:18 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2022-07-21 08:59:19 +0000 emulators/virtualbox-ose: Add VBoxSharedClipboard.so to non X11 builds This library is built when X11 is disabled too, since the functionality can also be used by remote protocols. PR: 261729 MFH: 2022Q3 emulators/virtualbox-ose/Makefile | 1 + emulators/virtualbox-ose/pkg-plist | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Patch committed. Thanks!
A commit in branch 2022Q3 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e82b9ce753e0a15cf5d703f8a90d132b95b7ac52 commit e82b9ce753e0a15cf5d703f8a90d132b95b7ac52 Author: Derek Schrock <dereks@lifeofadishwasher.com> AuthorDate: 2022-07-21 08:52:18 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2022-07-21 09:03:07 +0000 emulators/virtualbox-ose: Add VBoxSharedClipboard.so to non X11 builds This library is built when X11 is disabled too, since the functionality can also be used by remote protocols. PR: 261729 MFH: 2022Q3 (cherry picked from commit 5f02996b2b84deafaca8c5d6c3a2486695cb67ef) emulators/virtualbox-ose/Makefile | 1 + emulators/virtualbox-ose/pkg-plist | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)