From owner-freebsd-virtualization@freebsd.org Wed Jun 12 22:22:06 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10CA15C3739 for ; Wed, 12 Jun 2019 22:22:06 +0000 (UTC) (envelope-from crowston@protonmail.com) Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.protonmail.ch", Issuer "SwissSign Server Silver CA 2014 - G22" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 967258F9DC for ; Wed, 12 Jun 2019 22:22:05 +0000 (UTC) (envelope-from crowston@protonmail.com) Date: Wed, 12 Jun 2019 22:21:53 +0000 To: Grzegorz Junka From: Robert Crowston Cc: "freebsd-virtualization@freebsd.org" Reply-To: Robert Crowston Subject: Re: WebThings on bhyve and USB Message-ID: In-Reply-To: References: Feedback-ID: 2OVbcR1yHYpdkD8cgQllkFwcuMVZg_LiVMMPvptooFDfHD_03MuQO4ZaF626jWHZYFEhNR2cmIbZ53j4QGWMBQ==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch X-Rspamd-Queue-Id: 967258F9DC X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.81 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_REPLYTO(0.00)[crowston@protonmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; FREEMAIL_FROM(0.00)[protonmail.com]; DKIM_TRACE(0.00)[protonmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[protonmail.com,quarantine]; MX_GOOD(-0.01)[mailsec.protonmail.ch,mail.protonmail.ch]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.71)[ip: (-9.67), ipnet: 185.70.40.0/24(-4.90), asn: 19905(-3.91), country: US(-0.06)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[protonmail.com]; ASN(0.00)[asn:19905, ipnet:185.70.40.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[22.40.70.185.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[protonmail.com:s=default]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[protonmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2019 22:22:07 -0000 > How to best approach Mozilla IoT Gateway? I cannot speak to the meat of this question but I'll respond to the bhyve-r= elated questions. > I would need to somehow pass the USB ports to bhyve, so that Linux can > pass them to the docker container. I heard it's not possible to pass > specific USB ports but instead the whole PCI has to be passed Yes, you can pass through a whole USB controller, not its individual ports.= In practice therefore you will probably need at least two USB controllers = on your system, unless it is headless. > and it seems to be as complex as it sounds: I think the complexity is overstated in the article. A better (although sli= ghtly out-of-date) guide is https://wiki.freebsd.org/bhyve/pci_passthru. In particular I did not have to recompile the kernel or remove the xhci dri= ver. As far as I remember all that is necessary was to add three lines to /= boot/loader.conf: hw.vmm.amdvi.enable=3D"1" #=C2=A0AMD only: delete this line if you have an = Intel processor. pptdevs=3D"10/0/3" # Change 10/0/3 to the address of your USB contro= ller. vmm_load=3D"YES" #=C2=A0Load the bhyve kernel module on boot. [There are some other caveats, for instance you may need to enable directed= i/o virtualization in your BIOS.]