Bug 254266 - emulators/virtualbox-ose-additions bidirectional shared clipboard not working for FreeBSD guests
Summary: emulators/virtualbox-ose-additions bidirectional shared clipboard not working...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
: 255396 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-14 02:02 UTC by Graham Perrin
Modified: 2021-04-25 21:21 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)


Attachments
Screenshot, ttyv1 view of paths within /usr/local/bin/VBoxClient-all (34.04 KB, image/png)
2021-03-14 02:02 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2021-03-14 02:02:15 UTC
Created attachment 223247 [details]
Screenshot, ttyv1 view of paths within /usr/local/bin/VBoxClient-all

emulators/virtualbox-ose 6.1.18 and emulators/virtualbox-ose-kmod 6.1.18 installed on the host. 

emulators/virtualbox-ose-additions 6.1.18 installed on two guest machines:

1. FreeBSD-based helloSystem 0.5.0 (0E18), 12.2 upgraded to 13.0-RC2

2. FreeBSD 12.1 upgraded to 13.0-RC2.

In the latter, with (for example) x11-wm/twm and editors/leafpad

* mouse integration is enabled, and so on

* the bidirectional shared clipboard is not effective. 

Bug 246330 comment 0 describes an incorrect path specified within 
/usr/local/bin/VBoxClient-all
however, the paths within the file do appear to be correct with 6.1.18 (screenshot attached). 

Graphics controller: VMSVGA (recommended)
Comment 1 Graham Perrin 2021-03-14 02:59:47 UTC
For cases 1 and 2 strangely, I can work around by running this _after_ the desktop environment appears: 

/usr/local/bin/VBoxClient --clipboard

Strange, because the line is already within: 

/usr/local/bin/VBoxClient-all

For case 2 (without helloSystem) I experimented with addition of the line to: 

~/.xinitrc

– as far as I can tell, the command is not effective in the context of .xinitrc

----

Do we have a timing/race issue, something like that?

Now, considering the workaround at bug 200388 comment 1, I begin to wonder whether this bug 254266 (for 6.1.18) is a duplicate of 200388 (for 4.3.28) …
Comment 2 Graham Perrin 2021-04-21 20:52:41 UTC
At the time of writing, I can no longer reproduce this bug. 

Ignoring the yellow alert, might VBoxSVGA be a workaround?


=====
Guest
=====

! VBoxSVGA in lieu of VMSVGA

$ date ; uptime ; uname -v
Wed Apr 21 21:46:08 BST 2021
 9:46PM  up 5 mins, 3 users, load averages: 0.41, 0.49, 0.26
FreeBSD 13.0-RELEASE releng/13.0-ea31abc26 GENERIC 
$ freebsd-version -kru
13.0-RELEASE
13.0-RELEASE
13.0-RELEASE
$ pkg info -x kde5 sddm virtualbox-ose-additions          
kde5-5.20.5.20.12.3
sddm-0.19.0_1
virtualbox-ose-additions-6.1.18
$ pkg info -x lxde
pkg: No package(s) matching lxde
$ pkg info -x vmware
pkg: No package(s) matching vmware
$ kldstat
Id Refs Address                Size Name
 1   15 0xffffffff80200000  1f11ef8 kernel
 2    1 0xffffffff82112000   680eb0 zfs.ko
 3    1 0xffffffff82918000    35b00 vboxguest.ko
 4    1 0xffffffff8294e000     3218 intpm.ko
 5    1 0xffffffff82952000     2180 smbus.ko
$ service -e | sort
/etc/rc.d/bgfsck
/etc/rc.d/cleanvar
/etc/rc.d/cleartmp
/etc/rc.d/cron
/etc/rc.d/devd
/etc/rc.d/devmatch
/etc/rc.d/dmesg
/etc/rc.d/gptboot
/etc/rc.d/hostid
/etc/rc.d/hostid_save
/etc/rc.d/ip6addrctl
/etc/rc.d/kldxref
/etc/rc.d/mixer
/etc/rc.d/motd
/etc/rc.d/netif
/etc/rc.d/newsyslog
/etc/rc.d/os-release
/etc/rc.d/rctl
/etc/rc.d/resolv
/etc/rc.d/savecore
/etc/rc.d/sendmail
/etc/rc.d/sshd
/etc/rc.d/syslogd
/etc/rc.d/virecover
/etc/rc.d/zfs
/etc/rc.d/zfsbe
/etc/rc.d/zpool
/etc/rc.d/zvol
/usr/local/etc/rc.d/dbus
/usr/local/etc/rc.d/vboxguest
/usr/local/etc/rc.d/vboxservice
$ xrandr
Screen 0: minimum 64 x 64, current 976 x 721, maximum 32766 x 32766
VGA-0 connected primary 976x721+0+0 0mm x 0mm
   976x721       60.00*+
   2560x1600     60.00  
   2560x1440     60.00  
   2048x1536     60.00  
   1920x1600     60.00  
   1920x1080     60.00  
   1600x1200     60.00  
   1680x1050     60.00  
   1400x1050     60.00  
   1280x1024     60.00  
   1024x768      60.00  
   800x600       60.00  
   640x480       60.00  
   974x722_vbox   0.06  
$ 


=====
Host
=====

% date ; uptime ; uname -v
Wed 21 Apr 2021 21:50:19 BST
 9:50p.m.  up  8:41, 7 users, load averages: 1.53, 1.40, 1.45
FreeBSD 14.0-CURRENT #92 main-n246123-21afed4b1d1: Sat Apr 17 15:59:28 BST 2021     root@mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
% freebsd-version -kru
14.0-CURRENT
14.0-CURRENT
14.0-CURRENT
% pkg info -x kde5 sddm virtualbox
kde5-5.20.5.20.12.3
plasma5-sddm-kcm-5.20.5
sddm-0.19.0_1
sddm-freebsd-black-theme-1.3
virtualbox-ose-6.1.18
virtualbox-ose-kmod-6.1.18_1
% kldstat
Id Refs Address                Size Name
 1  199 0xffffffff80200000  1f28058 kernel
 2    1 0xffffffff82129000    55560 iwn100fw.ko
 3    1 0xffffffff8217f000    71e98 iwn6000fw.ko
 4    1 0xffffffff821f1000    ae1f0 iwn135fw.ko
 5    1 0xffffffff822a0000    acd10 iwn2000fw.ko
 6    1 0xffffffff8234e000     61a8 sysctlinfo.ko
 7    1 0xffffffff82355000    a8d10 iwn6000g2bfw.ko
 8    1 0xffffffff823fe000    a84b0 iwn6000g2afw.ko
 9    1 0xffffffff824a7000    554c0 iwn5150fw.ko
10    1 0xffffffff824fd000    561a0 iwn5000fw.ko
11    1 0xffffffff82554000   66c720 openzfs.ko
13    1 0xffffffff82be3000    55538 iwn1000fw.ko
14    1 0xffffffff82c39000     d1c0 autofs.ko
15    1 0xffffffff82c47000    1be28 geom_eli.ko
16    1 0xffffffff82c63000     36f0 sysctlbyname_improved.ko
17    1 0xffffffff82c67000    afa08 iwn2030fw.ko
18    1 0xffffffff82d17000    30d10 iwn4965fw.ko
19    1 0xffffffff82d48000    759e0 iwn6050fw.ko
21    1 0xffffffff83443000     bdf8 cuse.ko
22    3 0xffffffff8344f000    8f088 vboxdrv.ko
23    1 0xffffffff834df000    ab4d0 iwn105fw.ko
24    1 0xffffffff83c8f000     3530 fdescfs.ko
25    1 0xffffffff83c93000    388f8 linux.ko
26    4 0xffffffff83ccc000     db70 linux_common.ko
27    1 0xffffffff83cda000    31ac8 linux64.ko
28    1 0xffffffff83d0c000     2260 pty.ko
29    1 0xffffffff83d0f000     639c linprocfs.ko
30    1 0xffffffff83d16000     3284 linsysfs.ko
31    1 0xffffffff83d1a000    11f10 fusefs.ko
32    1 0xffffffff83d2c000     2320 usbhid.ko
33    1 0xffffffff83d2f000     31f8 hidbus.ko
34    3 0xffffffff83d33000    7f4c8 drm.ko
35    3 0xffffffff83db3000     cbc8 linuxkpi_gplv2.ko
36    1 0xffffffff83dc0000     2328 lindebugfs.ko
37    1 0xffffffff83dc3000     3378 acpi_wmi.ko
38    2 0xffffffff83dc7000     4218 vboxnetflt.ko
39    8 0xffffffff83dcc000     aac8 netgraph.ko
40    1 0xffffffff83dd7000     31c8 ng_ether.ko
41    1 0xffffffff83ddb000     55e0 vboxnetadp.ko
42    1 0xffffffff83de1000     2280 uhid.ko
43    1 0xffffffff83de4000     3268 ums.ko
44    1 0xffffffff83de8000     4c20 ng_ubt.ko
45    2 0xffffffff83ded000     a238 ng_hci.ko
46    3 0xffffffff83df8000     25a8 ng_bluetooth.ko
47    1 0xffffffff83dfb000     c4d0 snd_uaudio.ko
48    1 0xffffffff83e08000     2380 umodem.ko
49    1 0xffffffff83e0b000     4d68 ucom.ko
50    1 0xffffffff83e10000     34c0 if_cdce.ko
51    1 0xffffffff83e14000     3178 uether.ko
52    1 0xffffffff83e18000     e250 ng_l2cap.ko
53    1 0xffffffff83e27000    1ce48 ng_btsocket.ko
54    1 0xffffffff83e44000     3980 ng_socket.ko
55    1 0xffffffff83e48000     4700 nullfs.ko
56    1 0xffffffff83e4d000     2a08 mac_ntpd.ko
57    1 0xffffffff83e50000   150c70 radeonkms.ko
58    1 0xffffffff83fa1000     f778 ttm.ko
59    1 0xffffffff83fb1000     3258 radeon_TURKS_pfp_bin.ko
60    1 0xffffffff83fb5000     3658 radeon_TURKS_me_bin.ko
61    1 0xffffffff83fb9000     2cd8 radeon_BTC_rlc_bin.ko
62    1 0xffffffff83fbc000     7ef8 radeon_TURKS_mc_bin.ko
63    1 0xffffffff83fc4000     8138 radeon_TURKS_smc_bin.ko
64    1 0xffffffff83fcd000    341f0 radeon_SUMO_uvd_bin.ko
% service -e | sort
/etc/rc.d/bgfsck
/etc/rc.d/cleanvar
/etc/rc.d/cron
/etc/rc.d/devd
/etc/rc.d/devmatch
/etc/rc.d/dmesg
/etc/rc.d/gptboot
/etc/rc.d/hostid
/etc/rc.d/hostid_save
/etc/rc.d/ip6addrctl
/etc/rc.d/linux
/etc/rc.d/mixer
/etc/rc.d/motd
/etc/rc.d/netif
/etc/rc.d/newsyslog
/etc/rc.d/ntpd
/etc/rc.d/os-release
/etc/rc.d/powerd
/etc/rc.d/rctl
/etc/rc.d/resolv
/etc/rc.d/savecore
/etc/rc.d/sendmail
/etc/rc.d/sshd
/etc/rc.d/syslogd
/etc/rc.d/virecover
/etc/rc.d/zfs
/etc/rc.d/zfsbe
/etc/rc.d/zpool
/etc/rc.d/zvol
/usr/local/etc/rc.d/cupsd
/usr/local/etc/rc.d/dbus
/usr/local/etc/rc.d/netdata
/usr/local/etc/rc.d/sddm
/usr/local/etc/rc.d/sndiod
/usr/local/etc/rc.d/vboxnet
/usr/local/etc/rc.d/webcamd
%
Comment 3 Guido Falsi freebsd_committer 2021-04-22 10:49:08 UTC
I know virtualbox insists showing a warning when using a FreeBSD (or linux) VM and choosing any graphics driver except VMSVGA, but my experience is that this is bad advice if one is using the proper additions (6.1).

If additions are installed the best driver (and correct one) is VBoxSVGA.

VMSVGA makes sense when there are no additions installed. It can be marginally better than the old legacy VBoxVGA.
Comment 4 Graham Perrin 2021-04-22 21:46:19 UTC
I previously gave almost no thought to the graphics driver, for two reasons: 

1. the in-application recommendation to use nothing other than VMSVGA

2. I spent so many years with text alone on the shared clipboard, I completely forgot that the clipboard might be useful for something other than text!

(In reply to Guido Falsi from comment #3)

Thank you! Most useful advice. 

A package message might be one way of raising awareness.
Comment 5 Guido Falsi freebsd_committer 2021-04-22 21:52:13 UTC
(In reply to Graham Perrin from comment #4)

> Thank you! Most useful advice. 

> A package message might be one way of raising awareness.

If you're interested in contributing, providing a patch adding the comment to the port could be a very good starting point for you, to get your feet wet , so to say.

I'm not very good at this kind of documentation, so if you really have an idea what the message should tell users, this is a good chance for you.

No programming experience required, just some basic knowledge of the tools involved (very basic git (clone, diff), basic Makefile knowledge and some reading of the porter's handbook [1] just to know how things work (first few chapters should give you all you need for the purpose of a message))


[1] https://docs.freebsd.org/en/books/porters-handbook/
Comment 6 Graham Perrin 2021-04-24 13:42:28 UTC
(In reply to Guido Falsi from comment #3)

> … (or linux) …

Cross-reference <https://forums.virtualbox.org/viewtopic.php?f=6&t=102050>. 


(In reply to Guido Falsi from comment #5)

Will do, although maybe not today.
Comment 7 Guido Falsi freebsd_committer 2021-04-24 14:10:13 UTC
I have checked some docs around and I gathered this:

VBoxSVGA is the official virtualbox device, the one the additions provide a specific driver for. It supports 3D acceleration, is based on the VMWare driver but extended. Obviously performance can be ass good as the driver is. FreeBSD not being officially supported it is possible the driver is suboptimal.

VMSVGA is a device compatible with the VMWare one. It has less functionality than VBoxSVGA (in my case screen auto sizing is not working for example). The additions provided driver does take advantage of it, but is not tailored for this one. Looks like this is provided to allow using already existing drivers for VMWare when additions are not available.

VBoxVGA is the legacy device from virtualbox <6.1, obviously only available to provide compatibility with old systems where additions 6.1 are not available.

These findings support my idea. Whatever the warnings given in the UI, IF additons 6.1 are available the best choice is VBoxSVGA.

If only old additions are available (for example on FreeBSD i386 guests with 5.x additions) VBoxVGA should be preferred.

When additions are not available it obviously depends on what the guest is. In FreeBSD there is a VMWare graphics driver available (x11-drivers/xf86-video-vmware) and maybe (not tested) that could be used with VMSVGA without installing the additions and should work and give some acceleration, but what's the point? in that case you'd miss clipboard and other integrations anyway.

For other legacy OSes testing case by case would be needed.

On FreeBSD we do have working additions, let's take advantage of them together with the virtual graphics device the additions are designed to work with: VBoxSVGA.

I don't even know if it is possible, on FreeBSD to make clipboard integration work with VMSVGA device, but why spend time on it when there is a better alternative?
Comment 8 Guido Falsi freebsd_committer 2021-04-24 14:50:17 UTC
(In reply to Guido Falsi from comment #7)

Please note that I'm talking about FreeBSD hosts. If the host is another OS please follow that OS best practices!
Comment 9 Graham Perrin 2021-04-24 18:43:48 UTC
(In reply to Guido Falsi from comment #7)

Excellent. Thank you. I know that information gathering is sometimes a chore with VirtualBox-related content.
Comment 10 Guido Falsi freebsd_committer 2021-04-25 18:20:11 UTC
*** Bug 255396 has been marked as a duplicate of this bug. ***
Comment 11 Graham Perrin 2021-04-25 21:21:18 UTC
<https://community.kde.org/FreeBSD/Setup#Quick_start> is updated, with reference to 
<https://www.freshports.org/emulators/virtualbox-ose-additions/#message>. 


(In reply to Guido Falsi from comment #5)

> … a patch adding the comment to the port …

I might get to this tomorrow (Monday). 

The package message refers to 
<http://wiki.freebsd.org/VirtualBox>, which is pleasantly concise but a little outdated. (As far as I know, `Xorg -configure` is rarely required nowadays … and so on.)

<https://wiki.freebsd.org/VirtualBox> refers to 
<https://wiki.freebsd.org/VirtualBox/ToDo>, which should be easier to update. (Multiple virtual displays do work (with VBoxSVGA); for seamless mode, I just posted to #freebsd-vbox … and so on.)