How to build Armbian SD Card image for Orange Pi, Banana Pi, cubieboard …

Armbian offers to download images ready to be installed on SD card, but it is also possible to compile oneself the Linux system for many Mini PC card including Orange Pi. In December 2016, the Linux kernel moved to version 4.9 Which will improve the support of the Allwinner SoC (microprocessors) that equip the Orange Pi. It is the association to do the first tests on this branch. We will see how to create a virtual machine using Virtual Box running Ubuntu 16.04 LTS, install the Armbian compilation tools and create an image for an Orange Pi Plus 2e (comparative of the Orange Pi range to read here). It may sound a bit frightening like that, but in fact everything is done by itself after selecting the desired configuration. We owe this work to Igor Pečovnik.

System Requirements to Compile Armbian

To compile Armbian, we are going to need a machine running Linux, Igor advocates Ubuntu 16.04 x64. If you do not have a PC running on Ubuntu, it does not matter, we’ll create one in the form of a virtual machine or a Docker (temporarily). There are therefore several possible solutions

As you can see, we will create a virtual machine using VirtualBox, a free and open source virtualization software supported by Oracle. On the configuration side, it is better to have a PC or Mac with at least 4GB of Ram so that it can allocate at least 2 to the virtual machine. For this tutorial, I used a Mac Mini (Late 2012) equipped with an i7@2.3Ghz and 4GB of Ram. It is not a state-of-the-art machine but I can compile an image in about 30 minutes (after the first compilation that lasts … a few hours because you have to download all the sources and compile all the Linux libraries). This Mac runs under MacOS Sierra (10.12.1). In conclusion, no need to have an overpower machine to get there!

Create a Ubuntu 16.04 LTS Virtual Machine

Install the version of VirtualBox that corresponds to your machine. The download page can be found here.

virtualbox

Take advantage of this to install the expansion pack to manage USB 2.0 and 3.0, which will allow you to prepare the SD card using Etcher at the end of the creation of the image. Once downloaded, just run the executable to add the extension to VirtualBox.

Then go to retrieve the image of Ubuntu 16.04 Desktop version here. The choice of language is made at the time of installation.

Once recovered, launch VirtualBox and click New

Name the machine, for example Ubuntu 16.04. VirtualBox is able to pre-select the system type and version. Next

virtualbox installation ubuntu 16.04 lts

Specify 2048MB for the memory size (or more if you want). It is possible to change the amount of memory at any time (when the virtual machine is stopped).

Choose Create virtual hard disk now and then Create.

virtualbox installation ubuntu 16.04 lts

Choose the type of hard drive. For example the VDI type, the standard format of Virtual Box.

virtualbox installation ubuntu 16.04 lts

I advise you to create a disk whose size is dynamic, ie it increases as the needs of Ubuntu. As all sources must be downloaded and compiled, this option is all indicated.

virtualbox installation ubuntu 16.04 lts

Create a virtual hard disk of at least 30GB for more comfort.

virtualbox installation ubuntu 16.04 lts

Now press Start (green arrow).

In the dialog box that opens, specify the path of the Ubuntu image (it is in the downloads folder) and then Start

virtualbox installation ubuntu 16.04 lts

The Ubuntu installer starts up as on a Live CD (ie a version that can be started from a CD or a USB key to test Linux without having to install it). We need to install Ubuntu on the virtual machine, first choose the language of installation then Install Ubuntu.

virtualbox installation ubuntu 16.04 lts

Choose Clear Disk and install Ubuntu. There’s no need to encrypt the disk.

virtualbox installation ubuntu 16.04 lts

Choose keyboard layout

virtualbox installation ubuntu 16.04 lts

Finally, define your user account. Enter a password (note that the numeric keypad is not active by default). Check Automatically log on.

virtualbox installation ubuntu 16.04 lts

Press Continue to start the installation.

virtualbox installation ubuntu 16.04 lts

Find the Terminal

If you’re starting out on Linux and Ubuntu, no worries, you’ll quickly find your brands relative to Windows or MacOS. Ubuntu comes with the office suite LibreOffice, Firefox internet browser, Thunderbird (email), Rhythmbox music … Here we will just need the Terminal!

virtualbox installation ubuntu 16.04 lts terminal

Installing VirtualBox Tools

To use the SD card directly under Ubuntu, you must install the VirtualBox tools. Go to the VirtualBox Devices menu and select Insert Guest Additions CD Image

A CD Rom is mounted on Ubuntu which offers you to automatically install the software it contains. Accept. Your password will be asked

virtual box installation outils guest tools

Installing Armbian compilation tools

Now that Linux is ready, we will be able to install Armbian compilation tools. To do this, execute these commands successively. The first is to add the git command to manage source code from GitHub. The second one allows the Igor project to be retrieved locally.

Compile Armbian (3.x) for an Orange Pi Plus 2e

So I suggest you create an Armbian image for an Orange Pi Plus 2e. The preparation of the system is carried out by the script compile.sh that is launched like this ./compile.sh. It is possible to pass parameters at launch or modify the parameters before launching it by editing the latter with nano.

This is what we will start by doing to change the default language so as to have the system directly in French (with the exception of the keyboard). Open the sudo nano compile.sh script and go to the DEST_LANG line. Change the value. Save (CTRL + X then Y).

All available parameters are detailed on the official Armbian documentation here. We will not go into all the technical details in this first tutorial.

Now run the build script with the command

The KERNEL_CONFIGURE = YES option lets you choose the kernel branch (optional). It is necessary to grant Root privileges to the script, enter your password.

armbian build start compile

A short summary of the situation before continuing

armbian build compilation

Choose OS Image for Installation to SD card

armbian build compilation image sd u-boot

Select your card and model correctly. Be careful not to go wrong because the compilation lasts a long time

armbian build compilation choix carte board

You can create an image based on Ubuntu Xenial 16.04 LTS (the same as the virtual machine) or Jessie, the Raspbian base of the Raspberry Pi

armbian build compilation jessie xenial ubuntu

Finally choose the version server (without desktop) or Desktop (with desktop)

armbian build compilation server desktop

It’s gone for compilation. On my Mac Mini (configuration above), it takes about 30 minutes for the server version and about 70 minutes for the Desktop version. Much of the work is done in the output folder (cache, final image …). At the end of the creation, the image of the system is in the image folder. The image weighs about 1.3GB for the server version and 2.3GB for the desktop version.

armbian creation image terminee

Preparing the SD card with Etcher

One can realize the SD card in command line, but Etcher does very well this work with a nice GUI so why make it complicated. Download Etcher for Linux x64 here.

After the decompression, Ubuntu will propose you to install Etcher, accept. Open Etcher from the Ubuntu menu.

Insert the SD card (for example, using a USB flash drive). This must be mounted automatically. If it is not, verify that it was not mounted on the host computer. In this case, check the following points

  • Virtual Box Tools have been installed
  • The expansion pack that supports USB 2/3 has been installed
  • The USB key has been assigned to the virtual machine (in the Device / USB menu)

Select image Armbian

armbian gravure etcher selection image

Etcher automatically selects the SD card. If this is not the case, it certainly has not been mounted on the virtual machine. Start the copy. Your password will be requested.

armbian etcher authentification necessaire

The operation lasts only a few minutes.

armbian preparation carte sd etcher en cours

After verification, the SD card is automatically disassembled.

Starting on the SD card

So, the system is ready. It only remains to follow this tutorial to complete the configuration (creation of a user, configuration of the keyboard, adjustment of the video output …).

Warning. Like all models in the Orange Pi familly, you may experience display problems on older DVI or VGA monitors. Connect the Orange to a TV. Everything is explained in the tutorial indicated above.

And here, Armbian is perfectly functional.

armbian orange pi plus 2e build linux sd card image

The XFCE4 desktop is installed on the Ubuntu distribution. Many productivity software are already pre-installed

logiciels installes armbian ubuntu xfce

Compiling Armbian with kernel 4.x) for Orange Pi

I also tried to compile Armbian for an Orange Pi Lite (Wi-Fi version) and an Orange Pi Plus 2e. If the image creates works perfectly with the stable branch of linux 3.x and 4.4.x, this is unfortunately not the case for the branch under development that interests me. The SD card starts but the OS does not boot. I am entitled to the flashing red LED. The Orange Pi Lite seems for the moment excluded from this branch. If someone has solved the problem, do not hesitate to share your experience in the comments.

In the next tutorial, we’ll see how to install Armbian on the eMMC memory that equips more and more Mini PC cards.

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

  • Flávio Lima

    Hello, I followed all the steps but did not generate the .img file. Gave the following message:
    O.k.] Kernel build done [@host]
    [O.k.] Target directory [/ home / kainat / output / debs /]
    [O.k.] File name [linux-image-sun8i_5.32_armhf.deb]
    can you help me? Thank you very much in advance.

    • Hi Flavio. Everything seems to have worked. Normally you have to get a debian image. Did you choose OS image for installation to SD Card in the beginning?

    • Mostafa Yasin

      You will find the .img file in output/images/ Directory .