dynamic
Posts: 1
Joined: Mon Jun 11, 2018 3:55 pm

Ubuntu 18 Server on Raspberry Pi 3B+

Mon Jun 11, 2018 4:06 pm

Hi,

Has anyone been able to get the ubuntu-18.04-preinstalled-server-armhf+raspi2.img.xz on a Raspberry Pi 3B+ working according to these instructions: https://wiki.ubuntu.com/ARM/RaspberryPi ... B.2F3B.2B-? I have followed them and restarted 10 different times, and I can't get past the cloud-init pre-networking job. I have an ethernet cable plugged in.

Here's a screenshot of the error: Image

I've tried disabling several cloud-init and network service settings to no avail. This is my first time trying to get Ubuntu 18 running on a Pi, so let me know if there is anything I need to provide.

Thanks in advance!

User avatar
z3n
Posts: 4
Joined: Fri Sep 28, 2018 4:43 pm
Location: 5280

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Fri Sep 28, 2018 5:48 pm

Booting the official Pi 2 image on the Pi 3B+

This Tutorial assumes the user will be using Ubuntu 18.04 LTS to prepare the SD card for the
ubuntu-18.04.1-preinstalled-server-armhf+raspi2.img.xz and to configure its file system.

You will need to have your Raspberry Pi connected via Ethernet to get started
___________________________________________________________________________________________________________________________________________

Step 1 - Prepare SD card:

• Erase all contents of the SD card and format it with the FAT file system.


• Use etcher (or similar product) to burn the .img file onto the SD card.


• Mount the SD card. You will see two partitions listed:

◦ The first partition (system-boot) contains the Linux boot loader file system.
◦ The second partition (cloudimg-rootfs) contains the Linux root file system.

◦ You will be making changes to both of these partitions
___________________________________________________________________________________________________________________________________________

Step 2 - Reconfigure the file system:

• Open the system-boot partition and delete everything except for the config.txt file.


• Open the config.txt file and change the kernel line(s) to the following:

◦ kernel=vmlinuz
◦ initramfs initrd.img followkernel
◦ #device_tree_address=0x02000000


• Open a terminal and cd into the Downloads directory.


• Download and extract this firmware:
◦ wget http://archive.raspberrypi.org/debian/p ... rig.tar.gz
• Unzip the tar.gz file:
◦ tar -xvzf raspberrypi-firmware_1.20180910.orig.tar.gz


• Copy ALL files in the boot folder (including the overlays folder) of raspberrypi-firmware-1.20180910 into the system-boot partition.


• Copy the following firmware files into /cloudimg-rootfs/boot/firmware

◦ sudo cp /home/username/Downloads/raspberrypi-firmware-1.20180910/boot/bcm2710-rpi-3-b-plus.dtb /media/username/cloudimg-rootfs/boot/firmware

◦ sudo cp /media/username/cloudimg-rootfs/boot/vmlinuz /media/username/cloudimg-rootfs/boot/firmware

◦ sudo cp /media/username/cloudimg-rootfs/boot/initrd.img /media/username/cloudimg-rootfs/boot/firmware

___________________________________________________________________________________________________________________________________________

Step 3 - download and prepare necessary .deb files for installation:

1.Download .deb files:

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb

◦ wget http://archive.raspberrypi.org/debian/p ... _armhf.deb


• Create a folder called deb_files and put all the .deb files you just downloaded into the deb_files folder.


• Move the deb_files folder into the root folder of the cloudimg-rootfs partition

◦ sudo -s

◦ mv /home/username/Downloads/deb_files /media/username/cloudimg-rootfs/root

◦ exit (return to non-root user)
___________________________________________________________________________________________________________________________________________

Step 4 - Update flash-kernel database:

• Gain access to the all.db file

◦ cd /media/username/cloudimg-rootfs/usr/share/flash-kernel/db

◦ sudo chmod 666 all.db


• Delete the Raspberry Pi 2 machine & Raspberry Pi 3 machine, replacing them with the Raspberry Pi 3 Model B Plus machine.

◦ sudo nano all.db (or just open all.db in gedit)

◦ Raspberry Pi 2 machine: <---delete
▪ # Raspberry Pi 2 (BCM2709)
▪ Machine: BCM2709
▪ Machine: Raspberry Pi 2 Model B
▪ Machine: Raspberry Pi 2 Model B Rev 1.1
▪ Machine: Raspberry Pi 2 Model B Rev 1.2
▪ DTB-Id: bcm2709-rpi-2-b.dtb
▪ U-Boot-Script-Name: uboot.env.rpi2
▪ Required-Packages: u-boot-tools
▪ Boot-DTB-Path: /boot/firmware/bcm2709-rpi-2-b.dtb
▪ Boot-Kernel-Path: /boot/firmware/vmlinuz
▪ Boot-Initrd-Path: /boot/firmware/initrd.img
▪ Boot-Script-Path: /boot/firmware/uboot.env
▪ # XXX we should copy the entire overlay dtbs dir too

◦ Raspberry Pi 3 machine: <---delete
▪ # Raspberry Pi 3 (BCM2710)
▪ Machine: BCM2710
▪ Machine: Raspberry Pi 3 Model B
▪ Machine: Raspberry Pi 3 Model B Rev 1.2
▪ DTB-Id: bcm2710-rpi-3-b.dtb
▪ U-Boot-Script-Name: bootscr.rpi3
▪ Required-Packages: u-boot-tools
▪ Boot-DTB-Path: /boot/firmware/bcm2710-rpi-3-b.dtb
▪ Boot-Kernel-Path: /boot/firmware/vmlinuz
▪ Boot-Initrd-Path: /boot/firmware/initrd.img
▪ Boot-Script-Path: /boot/firmware/boot.scr
▪ # XXX we should copy the entire overlay dtbs dir too

◦ Raspberry Pi 3 Model B Plus machine: <--add
▪ # Machine: Raspberry Pi 3 Model B Plus (BCM2710)
▪ Machine: Raspberry Pi 3 Model B Plus
▪ DTB-Id: bcm2710-rpi-3-b-plus.dtb
▪ Boot-DTB-Path: /boot/firmware/bcm2710-rpi-3-b-plus.dtb
▪ Boot-Kernel-Path: /boot/firmware/vmlinuz
▪ Boot-Initrd-Path: /boot/firmware/initrd.img

• Save the reconfigured file once finished.


• Dismount the SD Card.


Note:
If you encounter the following message, "Volume is busy. One or more applications are keeping this volume busy", Press cancel and do not eject anyway. Try to dismount periodically until the volume will allow the dismount.

___________________________________________________________________________________________________________________________________________

Step 5 - Install .deb files:

• Place the SD card in your Pi and turn it on!


• Press enter after GRUB is done booting to get a login prompt:

◦ Default Username: ubuntu
◦ Default Password: ubuntu

• You will be prompted to change the password once entered.


• Install .deb packages

◦ sudo -s

◦ cd /root/deb_files

◦ dpkg -i *.deb

• After the .deb files are finished installing:

◦ cd ..

◦ rm -r deb_files

◦ exit (return to non-root user)

◦ sudo apt-get clean

◦ reboot
___________________________________________________________________________________________________________________________________________

Activate WiFi (optional)

• Make a directory for WiFi firmware:

◦ sudo mkdir wifi-firmware
◦ cd wifi-firmware

• Download the following WiFi firmware:

◦ sudo wget https://github.com/RPi-Distro/firmware- ... 5-sdio.bin
◦ sudo wget https://github.com/RPi-Distro/firmware- ... o.clm_blob
◦ sudo wget https://github.com/RPi-Distro/firmware- ... 5-sdio.txt

• Copy the firmware to the appropriate directory:

◦ sudo cp *sdio* /lib/firmware/brcm
◦ cd ..

• Update:
◦ sudo apt-get update

• Install the following tools:
◦ sudo apt-get install build-essential bison flex
◦ sudo apt-get install wireless-tools wpasupplicant iw

• if you receive a prompt to “run apt --fix-broken install” during the above installation, it is likely due to dependencies issues, nothing to worry about, just run the following command and then re-attempt the installations:
◦ sudo apt --fix-broken install

• Upgrade:
◦ sudo apt-get upgrade

• you should now enter package configuration mode:
◦ Configure accordingly


• After completing package configuration mode, reboot your pi:
◦ reboot

• After your pi is booted, issue the following command:
◦ iwconfig

• You should see wlan0 (wifi).


• Activate WiFi
◦ sudo ifconfig wlan0 up

• Scan for Wireless Access Points
◦ sudo iwlist wlan0 scan | grep ESSID
▪ If you see a return of Wireless Access Points, you’re ready to configure your netplan file and connect wirelessly.


• Configure netplan file
◦ sudo nano /etc/netplan/50-cloud-init.yaml

• Your current netplan file will look like this (or similer to).

network:
version: 2
ethernets:
enxb827ebe812a1:
dhcp4: true
match:
macaddress: b8:27:eb:e8:12:a1
set-name: enxb827ebe812a1

• You will need to modify the netplan file to the following:

network:
ethernets:
eth0:
dhcp4: true
dhcp6: no
match:
macaddress: b8:27:eb:03:91:12
set-name: eth0
version: 2
wifis:
wlan0:
dhcp4: true
dhcp6: no
access-points:
"your_ssid":
password: "your_password"
nameservers:
addresses: [8.8.8.8]

• Apply your configurations
◦ sudo netplan apply

• Reboot your system
◦ reboot
▪ upon reboot, you may encounter a "Start job" with no limit.
Be patient, the system will boot.

• Type the following command:
◦ iwconfig
▪ You should see the ESSID:"name" along with an Access Point:
MAC Address. You are now connected.
Last edited by z3n on Mon Oct 29, 2018 1:10 am, edited 5 times in total.
den1z3n

twakkie
Posts: 1
Joined: Fri Oct 26, 2018 7:25 pm

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Fri Oct 26, 2018 7:30 pm

@z3n, your awesome dude, thanks a mil.... been struggling with this all day, your guide was spot on....

User avatar
z3n
Posts: 4
Joined: Fri Sep 28, 2018 4:43 pm
Location: 5280

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Sat Oct 27, 2018 2:07 am

No problem, glad I could help. You can Download my comprehensive guide for Ubuntu 18.04 Server on Raspberry Pi 3B+ from my Mega at:
https://mega.nz/#!bCRzAawR!w4E_R4R89eLZ ... BPMVoqvwLY
den1z3n

pboh
Posts: 13
Joined: Wed Oct 31, 2018 2:26 pm

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Wed Oct 31, 2018 2:34 pm

Hi there.

Thanks for writing such a comprehensive guide! I'm having trouble accessing the second partition referenced in your doc (cloudimg-rootfs). I'm using the LTS image referenced in your doc as well as a number of other variants from the Ubuntu site, but can't seem to get the second partition to mount correctly. I am using a Mac.

I'm fairly proficient at the command line and have flashed an SD card using etcher and dd and am still having difficulty. Here's a view from diskutil:

/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *32.0 GB disk2
1: Windows_FAT_32 system-boot 134.2 MB disk2s1
2: Linux 2.2 GB disk2s2

And then when I try to mount the disk as a whole:

sudo diskutil mountDisk /dev/disk2
Volume(s) mounted successfully

> df -h | grep disk2
/dev/disk2s1 128Mi 38Mi 90Mi 30% 512 0 100% /Volumes/system-boot

> mount | grep disk2
/dev/disk2s1 on /Volumes/system-boot (msdos, local, nodev, nosuid, noowners)

Or just the volume:

> sudo diskutil mount /dev/disk2s2
Volume on disk2s2 failed to mount
If the volume is damaged, try the "readOnly" option

I've tried several different SD cards (new from package) and also installed FUSE on the Mac in case the filesystem for the second partition was not recognized. Sorry if this question has been answered before, I just couldn't find it. Any help very much appreciated!

User avatar
z3n
Posts: 4
Joined: Fri Sep 28, 2018 4:43 pm
Location: 5280

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Wed Oct 31, 2018 8:08 pm

The easiest, headache free way to get started is to (Using your Ubuntu 18.04 LTS Operating System) format your SD card with the FAT file system using the Disks application, and then use etcher to put the server image onto the SD card. Once etcher has the server image on the SD card, re-open the Disks application and mount your SD card from there. Then, open your file browser and you should see the cloudimg-rootfs and system-boot partitions. If something isn't working for you in the terminal, you may have to improvise by jumping out into the GUI.

If you encounter anymore issues with the installation and configuration, don't hesitate to let me know and I'll assist the best I can. I hope this helps.
Attachments
image.png
image.png (147.01 KiB) Viewed 40240 times
den1z3n

AbelCS
Posts: 4
Joined: Thu Oct 25, 2018 11:35 pm

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Thu Nov 01, 2018 11:03 am

Hi all!

A few days ago I've made a preinstalled image for myself, with all the drivers, dtbs, etc. It's working fine, so maybe it could be useful for some of you.

I've uploaded it here: https://github.com/AbelCS/ubuntu-server ... s/releases

b99
Posts: 13
Joined: Mon Jun 11, 2018 10:45 am

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Thu Jan 17, 2019 1:10 pm

@z3n
Thank you very much! Following your detailed instructions I have successfully installed Ubuntu 18 Server on a Pi 3B+.

I have an issue which I don't think is normal. I can not simultaneously ssh in to the Pi with the LAN and WLAN. Which ever is loaded first grabs the ssh and in order to use the other I need to either physically disconnect the ethernet cable or ifconfig eth0 down.


Here's my Netplan YAML:

Code: Select all

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        enxb827eb61c7e0:
            addresses: [10.100.102.10/24]
            gateway4: 10.100.102.1
            dhcp4: no
            match:
                macaddress: b8:27:eb:61:c7:e0
            set-name: enxb827eb61c7e0
            nameservers:
                addresses: [8.8.8.8,8.8.4.4]

    wifis:
        wlan0:
            addresses: [10.100.102.11/24]
            gateway4: 10.100.102.1
            dhcp4: no
            dhcp6: no
            access-points:
                MyAccess1:
                    password: xxxxxxx
                MyAccess2:
                    password: xxxxxxx
            nameservers:
                addresses: [8.8.8.8,8.8.4.4]
Here's my ip a

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enxb827eb61c7e0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:61:c7:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.100.102.10/24 brd 10.100.102.255 scope global enxb827eb61c7e0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe61:c7e0/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:34:92:b5 brd ff:ff:ff:ff:ff:ff
    inet 10.100.102.11/24 brd 10.100.102.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe34:92b5/64 scope link
       valid_lft forever preferred_lft forever

paotg66
Posts: 1
Joined: Fri Jan 18, 2019 7:25 am

Re: Ubuntu 18 Server on Raspberry Pi 3B+

Fri Jan 18, 2019 7:42 am

Hi
I was able to boot my Pi 3B+ by the pre-built ARM image above .... However, it seems that I am stuck with the wifi.

I followed the instructions by z3n for the wifi activation and configuration - and apparently it went smoothly, with just one difference:
no configuration screen pops up after the upgrade. I do not know if this is relevant for the following.

During installation II was able to scan the SSIDs in the area, including mine, and configure the netplan accordingly.

However, after the final reboot, I get now every few seconds the error:

brcmfmac: brcmf_cfg80211_scan: scan error(-110)
brcmfmac: brcmf_run_escan: error(-110)

The wlan0 is correctly listed by ifconfig, but of course not connected.
Any idea about what could have gone wrong...?

thank you in advance for any help!.

Return to “Ubuntu”