Ubuntu – How to use onboard wifi on Raspberry Pi 3 with Ubuntu Server 16.04

16.04raspberrypiserverwireless

I have a Raspberry Pi 3 and I need to run Ubuntu on it. I put the 16.04 server image for the Raspberry Pi 3 from https://wiki.ubuntu.com/ARM/RaspberryPi on a microSD card and it boots fine, and works fine when connected to Ethernet.

However, I cannot seem to get the onboard wifi working with Ubuntu 16.04. Wireless works fine with Raspbian so I know the hardware is OK.

Has anyone got the on board WiFi working with Ubuntu Server 16.04 on a Raspberry Pi 3? I feel like it's really close to working, but I just am missing some small detail.

After a fresh install, sudo lshw -C network does show wlan0, although I can't find that defined anywhere in /etc/network, and it's initially disabled.

I then installed wpasupplicant and added this to /etc/network/interfaces:

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

And put this in /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
        ssid="homewifi"
        psk="xxx"
        key_mgmt=WPA-PSK
}
network={
        ssid="phonewifi"
        psk="xxx"
        key_mgmt=WPA-PSK
}

To get those settings, I booted Raspbian, connected to those two different SSIDs, and just copied the settings to Ubuntu. However after a reboot, wlan0 does not connect to either network, never gets an IP, etc.

Is wpa-supplicant just not the way to configure WiFi for the Raspberry Pi 3 using Ubuntu Server 16.04? Or am I configuring something incorrectly?

Best Answer

For the image with apt installed

OS: Ubuntu 16.04.1 LTS  OS 
image: ubuntu-16.04-preinstalled-server-armhf+raspi3.img
HW: RASPBERRY PI 3 MODEL B

Step1:

sudo apt-get install wireless-tools

Step2:

sudo apt-get install wpasupplicant

Step3: add to /etc/network/interfaces:

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: comment from /etc/network/interfaces the line:

#source /etc/network/interfaces.d/*.cfg

the commented interfaces.d/*.cfg file contains settings for the eth0.

I do not understand why but leaving this line active and adding the wlan0 config would crash the system at boot.

Step5: reboot

For the core image without apt installed:

OS: Ubuntu Core 16 
image: (GNU/Linux 4.4.0-1030-raspi2 armv7l)
HW: RASPBERRY PI 3 MODEL B

Step1:

ifconfig wlan0 down
ifconfig wlan0 up

Step2: create wireless config file:

sudo vi /etc/network/interfaces.d/wlan0

Note: I tried without sudo but it would not let me save the changes

Step3: add the following content

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: reboot

Related Question