ArchLinuxARM on BeagleBone Black: getting network working over USB
25 Jul 2015As written in title, this post will be about setting up a working USB connection for ArchLinuxARM (a port of the magnificent ArchLinux for the ARM architecture). This is made for this kind of setup:
- a shared DHCP connection through NetworkManager (can be adapted to everything else though)
- a BeagleBoneBlack connected by mini-USB to the computer.
With this tutorial you will have a working shared network between the BeagleBoneBlack and your computer, with included dynamic IP resolution (no more ssh IP_HERE).
Some thoughts:
- I’ll say when commands have to be done on the host (see: your computer/laptop), else they have to be done on the client (the BeagleBoneBlack).
- In a theoric way, this tutorial should be fine for any ArchLinuxARM device; just pay a bit more of attention.
- I assume that the users reading this tutorial are a bit experienced (else GTFO); also, the commands with before a $ will be commands that can be given as users, the ones with ! should be given by the user root.
Let’s do this
So, these are the steps:
-
Install ArchLinuxARM (from now on ALARM) on your BeagleBoneBlack; for this, I just suggest the official tutorial. For the following part of this tutorial, I assume you’ve installed your ALARM (on MicroSD or on eMMC is the same).
- From your host, share connection to your BeagleBoneBoard;
I did this by connecting the device using an Ethernet cable plus an USB for power.
Also, I allowed sharing connection through Ethernet with NetworkManager
- install dnsmasq, as it will allow shared networking through NetworkManager
- open nm-connection-editor
- Suggested: create a specific connection for the BeagleBoneBlack with nm-connection-editor
- under IPv4 settings set “Shared”
- I had then to use nmap on the host to find out the IP
- go on NetworkManager
- find out the IP of the shared Ethernet network (e.g. 10.42.0.1)
- find the actual IP of the BeagleBoardBlack by inspecting the network, doing something like:
- Actually, connect from the host to your device with SSH
- In order to work with just the USB cable, you need to download the gadget-deadbeef-dhcp package; the package was meant to enable connections through USB, I made the -dhcp version to have dynamic IP (we won’t have problem with it later). You can get it with a:
Else, you will have to build it:
Notice: people that want it to work even with Windows have to install the gadget-deadbeef-legacy-dhcp package, as the one above uses a driver which is not (still) supported from BeagleBoard official Windows drivers; so, just follow the steps above, replacing gadget-deadbeef-dhcp with gadget-deadbeef-legacy-dhcp.
PRO TIP: I had to reinstall the official BeagleBoard drivers, which can be found here. I had problems as Windows 8.1 didn’t allow me to install unsigned drivers; so, if you get to the last step of drivers installation and you get red crosses (error in installation) and you don’t know why, try reinstalling after doing this.
- Now we have to set up things for hostname resolution. Well’use Samba for this. It can be used for many more things, but in this case we’ll use just its NetBIOS ability. So, get Samba and enable the NetBIOS daemon:
- On the host, enable NetBIOS name resolution by adding wins to the /etc/nsswitch.conf file. It will look like this:
And now?
Now, just connect with a
No more fuss for looking for IP, setting things or else. This tutorial is a bit long, but I hope it can be useful to someone. Cheers.