Bug 264835 - Linux: USB-IP tool fails to run: setsockopt - IP_PKTINFO: Protocol not available
Summary: Linux: USB-IP tool fails to run: setsockopt - IP_PKTINFO: Protocol not available
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: needs-qa
Depends on:
Reported: 2022-06-22 21:42 UTC by mario felicioni
Modified: 2022-06-25 13:06 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (trasz)
koobs: maintainer-feedback? (dchagin)
koobs: mfc-stable13?
koobs: mfc-stable12?


Note You need to log in before you can comment on or make changes to this bug.
Description mario felicioni 2022-06-22 21:42:41 UTC
Hello to everyone.

Just for educational purposes I've virtualized MacOS with Virtualbox in FreeBSD. Problem is that Virtualbox does not support the USB 3.0/3.1 plugin/addon. So,I've thought to some ideas to overcome the problem. My idea is to use a tool called USB over IP,sharing the USB disks I have from an OS that can mount them to the MacOS that / which can't. At the beginning my idea was to install the server part on a bhyve virtual machine,let's say for example Linux or Windows. But I've soon realized that I can't run both bhyve and VirtualBOX at the same time. (if someone knows about a trick to do it,please share it :p) ; so,the only place where I can install it is on FreeBSD itself and I will install the client on the MacOS. And since there is no known USB over IP tool which can run on it (again : if someone knows about it,please share it), I'm evaluating virtualhere usb server :

www.virtualhere.com www.virtualhere.com

and I tried to install it with the linuxulator. Surprisingly it started,but unfortunately it reported another error,telling that it can't find an IP protocol to communicate with the client :

mario@marietto:/home/mario# ./vhusbdi386

VirtualHere USB Server is running...press CTRL-C to stop
setsockopt - IP_PKTINFO: Protocol not available

what to do here to fix it ?
Comment 1 Dmitry Chagin freebsd_committer 2022-06-23 10:50:42 UTC
As far as I remember, the option IP_PKTINFO does not exist in the FreeBSD kernel, so to emulate it we first have to implement it in our network stack.
What matters here is #network's opinion, do we need this feature or not?
Comment 2 mario felicioni 2022-06-23 11:16:25 UTC
yes,I need it. I find very comfortable to share the USB disks from freebsd to any guest OS using the virtualhere usb/ip tool. Despite the network protocol error,it seems that it can start without so much problems. So,why not adding a new feature to freebsd ? sharing usb drives from freebsd host and a virtualbox vm is nice. This can be the only way to do that, because virtualbox does not support the usb 2 and 3 addon. So,passing thrue an USB disk with it will result in a very slow speed (1.0 !).
Comment 3 Dmitry Chagin freebsd_committer 2022-06-23 12:15:06 UTC
(In reply to mario felicioni from comment #2)
well, I'll try. There's nothing difficult here, except for this one:
If IP_PKTINFO is passed to sendmsg(2) and ipi_spec_dst is not zero, then it is used as the local source address for the routing table lookup and for setting up IP source route options.  When ipi_ifindex is not zero, the primary local address of the interface specified by the index overwrites ipi_spec_dst for the routing table lookup.
Perhaps I will omit this.
Comment 4 mario felicioni 2022-06-23 14:58:40 UTC
very thanks.