Re: [qubes-users] Qubes and Broadcom BCM4360 - A Success Story

2016-11-23 Thread kent . f . davis
On Tuesday, November 22, 2016 at 8:25:25 PM UTC-5, tfor...@gmail.com wrote:
> On Wednesday, November 16, 2016 at 11:05:52 AM UTC-5, kent.f...@gmail.com 
> wrote:
> > On Saturday, March 12, 2016 at 2:29:21 PM UTC-7, Dave C wrote:
> > > On Saturday, March 12, 2016 at 1:52:19 AM UTC-8, Marek 
> > > Marczykowski-Górecki wrote:-BEGIN PGP SIGNED MESSAGE-
> > > 
> > > Hash: SHA256
> > > 
> > > 
> > > 
> > > On Fri, Mar 11, 2016 at 10:30:35PM -0800, Dave C wrote:
> > > 
> > > > With earlier Qubes I tried to get a broadcom BCM4360 wireless card 
> > > > working, 
> > > 
> > > > but had no luck.  Recently I tried again with Qubes 3.1 and guess what, 
> > > > its 
> > > 
> > > > working.  I'm using it to post this message now.
> > > 
> > > 
> > > 
> > > Thanks!
> > > 
> > > 
> > > 
> > > I'm happy to contribute a little something back.
> > >  
> > > 
> > > See below for a little comment.
> > > 
> > > 
> > > 
> > > > # Background
> > > 
> > > > 
> > > 
> > > > I have a MacBookPro which sometimes I boot as a Mac, but also want to 
> > > > be 
> > > 
> > > > able to boot to Qubes.  Rather than install directly to the hard drive, 
> > > > I 
> > > 
> > > > installed Qubes on a portable SSD (http://amzn.com/B00N0V4JG2), but I 
> > > > don't 
> > > 
> > > > think that makes any difference in getting broadcom drivers set up.
> > > 
> > > > 
> > > 
> > > > If you try the portable SSD, I found I had to use standard partitioning 
> > > > as 
> > > 
> > > > LVM didn't not work.  Otherwise its a normal Qubes install with all but 
> > > > the 
> > > 
> > > > boot sector encrypted.  Qubes will boot just fine on the MacBookPro.  
> > > > But 
> > > 
> > > > it won't recognize the Broadcom wifi hardware.
> > > 
> > > > 
> > > 
> > > > # Getting a Network Connection
> > > 
> > > > 
> > > 
> > > > There's a chicken and egg problem here.  You'll need to get online in 
> > > > order 
> > > 
> > > > to install the software needed to make the broadcom work.  This is 
> > > > tricky 
> > > 
> > > > if like mine the macbook has no ethernet port.  There's only one USB 
> > > > PCI 
> > > 
> > > > device, you can't associate it with a netvm (i.e. to tether).  But 
> > > > there 
> > > 
> > > > are a couple thunderbolt ports.
> > > 
> > > > 
> > > 
> > > > To get online I used a thunderbolt to ethernet with USB adapter 
> > > 
> > > > (http://amzn.com/B00PY194CK).  This adapter should work with ethernet, 
> > > 
> > > > obviously, and also a USB tether through android device.  I was able to 
> > > > get 
> > > 
> > > > both to work, although the tethering was flakey.  The point of this 
> > > > awkward 
> > > 
> > > > device is to use it just long enough to get the broadcom working, then 
> > > > you 
> > > 
> > > > shouldn't need it any more.
> > > 
> > > > 
> > > 
> > > > Since I installed Qubes on the portable SSD, I could have instead taken 
> > > > the 
> > > 
> > > > portable SSD drive and booted it on some other hardware (i.e. a desktop 
> > > 
> > > > with more linux-friendly hardware) and downloaded the necessary 
> > > > software 
> > > 
> > > > there.  That's what I'd do if I had to do this all over again, but the 
> > > 
> > > > first time through it was handy to be on the machine with the broadcom, 
> > > > as 
> > > 
> > > > there was some trial and error.
> > > 
> > > > 
> > > 
> > > > # Some Assembly Required
> > > 
> > > > 
> > > 
> > > > Once online, all the steps needed to get broadcom working can be found. 
> > > >  
> > > 
> > > > It's a matter of sorting through the weeds to get to what works.  What 
> > > 
> > > > follows should help.
> > > 
> > > > 
> > > 
> > > > ## Net VM Setup
> > > 
> > > > 
> > > 
> > > > I decided not to modify sys-net directly.  I created a new net vm 
> > > > called 
> > > 
> > > > net-powerbook.  I even cloned the fedora-23 template, so my 
> > > > net-powerbook 
> > > 
> > > > uses a template called f23-broadcom.  I don't think the additional 
> > > > template 
> > > 
> > > > is necessary.  At the time, I thought I'd simply `sudo yum install 
> > > 
> > > > broadcom-wl akmod-wl` and presto I'd have the drivers.  With Qubes it 
> > > > is 
> > > 
> > > > not that simple.
> > > 
> > > > 
> > > 
> > > > Attach the right PCI device to net-powerbook.  In my case it is:
> > > 
> > > > 
> > > 
> > > > 03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac 
> > > > Wireless 
> > > 
> > > > Network Adapter (rev 03)
> > > 
> > > > 
> > > 
> > > > Note, while using the thunderbolt adapter, I also had another PCI 
> > > > device 
> > > 
> > > > attached.  It's not plugged in now, so Qubes doesn't even list the PCI 
> > > 
> > > > device, otherwise I'd paste it here.
> > > 
> > > > 
> > > 
> > > > Fire up a net-powerbook terminal.
> > > 
> > > > 
> > > 
> > > > ## Install Broadcom Driver (on net-powerbook)
> > > 
> > > > 
> > > 
> > > > As I mentioned, a simple `sudo yum install broadcom-wl akmod-wl` didn't 
> > > 
> > > > work for me.
> > > 
> > > 
> > > 
> > > I wonder how pvgrub2 

Re: [qubes-users] Qubes and Broadcom BCM4360 - A Success Story

2016-11-16 Thread kent . f . davis
On Saturday, March 12, 2016 at 2:29:21 PM UTC-7, Dave C wrote:
> On Saturday, March 12, 2016 at 1:52:19 AM UTC-8, Marek Marczykowski-Górecki 
> wrote:-BEGIN PGP SIGNED MESSAGE-
> 
> Hash: SHA256
> 
> 
> 
> On Fri, Mar 11, 2016 at 10:30:35PM -0800, Dave C wrote:
> 
> > With earlier Qubes I tried to get a broadcom BCM4360 wireless card working, 
> 
> > but had no luck.  Recently I tried again with Qubes 3.1 and guess what, its 
> 
> > working.  I'm using it to post this message now.
> 
> 
> 
> Thanks!
> 
> 
> 
> I'm happy to contribute a little something back.
>  
> 
> See below for a little comment.
> 
> 
> 
> > # Background
> 
> > 
> 
> > I have a MacBookPro which sometimes I boot as a Mac, but also want to be 
> 
> > able to boot to Qubes.  Rather than install directly to the hard drive, I 
> 
> > installed Qubes on a portable SSD (http://amzn.com/B00N0V4JG2), but I don't 
> 
> > think that makes any difference in getting broadcom drivers set up.
> 
> > 
> 
> > If you try the portable SSD, I found I had to use standard partitioning as 
> 
> > LVM didn't not work.  Otherwise its a normal Qubes install with all but the 
> 
> > boot sector encrypted.  Qubes will boot just fine on the MacBookPro.  But 
> 
> > it won't recognize the Broadcom wifi hardware.
> 
> > 
> 
> > # Getting a Network Connection
> 
> > 
> 
> > There's a chicken and egg problem here.  You'll need to get online in order 
> 
> > to install the software needed to make the broadcom work.  This is tricky 
> 
> > if like mine the macbook has no ethernet port.  There's only one USB PCI 
> 
> > device, you can't associate it with a netvm (i.e. to tether).  But there 
> 
> > are a couple thunderbolt ports.
> 
> > 
> 
> > To get online I used a thunderbolt to ethernet with USB adapter 
> 
> > (http://amzn.com/B00PY194CK).  This adapter should work with ethernet, 
> 
> > obviously, and also a USB tether through android device.  I was able to get 
> 
> > both to work, although the tethering was flakey.  The point of this awkward 
> 
> > device is to use it just long enough to get the broadcom working, then you 
> 
> > shouldn't need it any more.
> 
> > 
> 
> > Since I installed Qubes on the portable SSD, I could have instead taken the 
> 
> > portable SSD drive and booted it on some other hardware (i.e. a desktop 
> 
> > with more linux-friendly hardware) and downloaded the necessary software 
> 
> > there.  That's what I'd do if I had to do this all over again, but the 
> 
> > first time through it was handy to be on the machine with the broadcom, as 
> 
> > there was some trial and error.
> 
> > 
> 
> > # Some Assembly Required
> 
> > 
> 
> > Once online, all the steps needed to get broadcom working can be found.  
> 
> > It's a matter of sorting through the weeds to get to what works.  What 
> 
> > follows should help.
> 
> > 
> 
> > ## Net VM Setup
> 
> > 
> 
> > I decided not to modify sys-net directly.  I created a new net vm called 
> 
> > net-powerbook.  I even cloned the fedora-23 template, so my net-powerbook 
> 
> > uses a template called f23-broadcom.  I don't think the additional template 
> 
> > is necessary.  At the time, I thought I'd simply `sudo yum install 
> 
> > broadcom-wl akmod-wl` and presto I'd have the drivers.  With Qubes it is 
> 
> > not that simple.
> 
> > 
> 
> > Attach the right PCI device to net-powerbook.  In my case it is:
> 
> > 
> 
> > 03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac Wireless 
> 
> > Network Adapter (rev 03)
> 
> > 
> 
> > Note, while using the thunderbolt adapter, I also had another PCI device 
> 
> > attached.  It's not plugged in now, so Qubes doesn't even list the PCI 
> 
> > device, otherwise I'd paste it here.
> 
> > 
> 
> > Fire up a net-powerbook terminal.
> 
> > 
> 
> > ## Install Broadcom Driver (on net-powerbook)
> 
> > 
> 
> > As I mentioned, a simple `sudo yum install broadcom-wl akmod-wl` didn't 
> 
> > work for me.
> 
> 
> 
> I wonder how pvgrub2 usage would work here. 
> 
> After completing steps to enable it[1], just `sudo yum install
> 
> broadcom-wl akmod-wl` should be enough. At least in theory...
> 
> 
> 
> [1] https://www.qubes-os.org/doc/managing-vm-kernel/#tocAnchor-1-3
> 
> 
> 
> 
> 
> 
> 
> This sounds like a more future-proof approach.  No risk of future kernel 
> upgrades breaking the net vm.  Will explore this as time permits.
> 
> BTW, I think `sudo yum install broadcom-wl akmod-wl` did not work as intended 
> in Fedora 23 - nothing to do with Qubes.  While the command had no errors, it 
> doesn't seem to produce the wl module.  Running `sudo modprobe wl` afterwards 
> fails.  Regardless of how you build the module, the pvgrub2 method sounds 
> pretty clean.
> 
> -Dave

I can confirm that a variation of Dave Cohen's suggestions will get wireless 
working on the newest model MacBook Air (MacbookAir7,2).

Generally, the steps required are:
in dom0:
echo :03:00.0 | sudo tee /sys/bus/pci/drivers/pciback/permissive

in sys-net:
sudo dnf