Explore Ubuntu Mobile and Embedded

Linux on a handheld device? You bet!


Before you start

This tutorial introduces you to the Ubuntu Mobile and Embedded (UME) project, its architecture, and its use. The tutorial gives you hands-on practice in running the UME environment on a native desktop Linux system. The tutorial uses the Ubuntu version 7.10 release (Gutsy Gibbon), but any recent distribution should work.

About this tutorial

In this tutorial, you learn about Ubuntu and its embedded framework. It explores and demonstrates each aspect of the various tools and the embedded framework to help get you started on your embedded project.


The primary objective of this tutorial is to get you quickly acquainted with the Ubuntu embedded framework and tools. Along the way, you learn about several tools and new approaches to Linux kernel configuration and environment construction. You also learn about some other projects with goals similar to the UME project.


This tutorial assumes some knowledge of Linux development and the Linux user-space environment. Sidebars are provided along the way to help bring you up to speed.

System requirements

This tutorial is intended to be hands-on. To run the examples in this tutorial, you need Ubuntu version 7.10. By following the instructions in this tutorial, you can use an existing UME environment and build applications for a mobile or handheld device. If you intend to install the UME and run it on your desktop, ensure that at least 4 GB of disk space is available.

The UME project

Let's begin with a short introduction to the UME, its goals, its major components, and its user interface (UI).

What is the Ubuntu Mobile and Embedded project?

The UME project aims to simplify the creation of Linux images and environments for mobile and embedded devices. While Linux is no stranger to small handheld devices, this project focuses on assisting developers with kernel and environment creation and also integrates the Hildon application framework, which is conducive to small devices with smaller screens (see Related topics for additional information).

The project also incorporates several important open source applications into the framework, including a Web browser, an e-mail client, an instant messenger client, an RSS reader, and media applications such as an MPEG player and an MP3 player.

The UML project is an important development for Linux in the handheld device space. It means that developers can use the tools and application framework for the environment and focus their time and energies where they're most important: the application space.

Project description and goals

The primary aim of the UME project is to simplify development of software for mobile and handheld platforms (so-called Mobile Internet Devices, or MIDs) as well as other non-PC architectures (such as those with ARM processors). (See the sidebar "What's an MID?" for more information.) Typical embedded development can be difficult because of the specialized nature of the platforms. But UME includes tools developed specifically for kernel and file system configuration and is compatible with several platform architectures (corresponding to the McCaslin platform).

To illustrate the simplicity of the UME process, let's look at the process required to build an embedded image (kernel and file system) from scratch. This process has three simple steps:

  1. Create a project and target with the Moblin utility (and customize it).
  2. Copy the resulting project and target to a USB Flash Drive (UFD).
  3. Boot the UFD from the embedded platform.

The devil, of course, is in the details, but UME does a pretty good job of simplifying the development process, as you'll see in later sections.


UME is primarily Ubuntu-based. Ubuntu is arguably one of—if not the—most popular GNU/Linux distributions available. Ubuntu is a derivative of the Debian project but with a strong focus on usability and simplicity of installation and administration. Ubuntu first appeared in 2004, and its latest release (version 7.10) marks its seventh shipped distribution.

Ubuntu has several variant distributions focused on education (Edubuntu), free software inclusion (Gobuntu), desktop (Kubuntu), lightweight distribution (Xubuntu), and virtual appliances (JeOS). Ubuntu's seventh release also marks its introduction into the embedded arena with the UME.

UME architecture

The UME architecture can be viewed in three distinct layers (see Figure 1). At the top are the applications that make the device useful (for example, Web and e-mail clients). In the middle is the Ubuntu operating system, configured for the particular low-level architecture. Finally, at the bottom is the platform, which adheres to the MID standard.

Figure 1. High-level architectural view of the UME target
High-level architectural view of the UME target
High-level architectural view of the UME target

The operating system itself is configured specifically for mobile and embedded devices and includes components such as Global Positioning System (GPS) interfaces and camera interfaces. Other characteristics are also managed within the kernel and application space, such as power management (because the device will be powered by a rechargeable battery) as well as thermal management (to avoid damaging parts in the event the ambient temperature raises the device temperature beyond its operational range). Policies are also supported for power management, which are configurable through the configuration application, to allow users to optimize the battery life.

A first look at the Hildon desktop

This section walks you through installing and testing the elements necessary for the Hildon desktop.

Create a new root file system

The Ubuntu Gutsy Gibbon version 7.10 distribution was used for this tutorial (as recommended by the UML project). It's the latest Ubuntu distribution, so it's a good idea to update to it if you haven't already done so. Otherwise, you can install and run it in one of the many virtualization solutions (Xen, QEMU, KVM, or VMware). The framework is also reported to work on the prior version of Ubuntu (Feisty Fawn, version 7.04).

Start by creating a new root file system, which will be the alternate root for the UME that's executed on the Ubuntu host operating system. The following instructions are tailored from the excellent Ubuntu Mobile Guide (filling in a couple of missing pieces). (See Related topics for a link to the Guide.)

  1. Install the Xephyr server.

    Xephyr is an X Server used to host the UME display. On Ubuntu, the Advanced Packaging Tool (APT) package-management system makes this installation easy (see Related topics for links to Xephyr and APT):

    $ sudo apt-get install xserver-xephyr
  2. Create a directory to serve as the root file system for your UME.

    I put this directory in my home directory, /home/mtj/chrenv:

    $ mkdir /home/mtj/myroot
    $ export DIR=/home/mtj/myroot
  3. Bootstrap another Debian installation into this directory by using the debootstrap utility.

    This utility creates a new Debian base system from scratch (downloading directly from an Ubuntu mirror site):

    $ sudo debootstrap --arch i386 gutsy ${DIR} \

    This command downloads the Gutsy Gibbon (version 7.10) distribution into the directory, which can take some time.

  4. For your current shell, rebind some of the environment to the new root directory. This is accomplished with the following three lines:
    $ sudo mount --bind /tmp ${DIR}/tmp
    $ sudo mount -t proc none ${DIR}/proc
    $ sudo mount --bind /sys ${DIR}/sys
  5. With that complete, use chroot to change the root directory.

    This change occurs for the current process (and all children of the current process). When the next command is executed, the root file system is that of /home/mtj/myroot, instead of the current root '/' file system.

    $ sudo chroot ${DIR}

Update the root file system

With a new root file system of Ubuntu version 7.10 installed, the next step is to perform an update and add a new package. To do so, complete the following steps:

  1. Edit the sources.list file in /etc/apt within your new chroot-ed file system, and add the following line:
    deb gutsy main restricted universe

    This line added to /etc/apt/sources.list makes visible a set of packages (from the universe repository) that would not normally be visible to the package-management system.

  2. Update the system using the apt command:
    $ sudo apt-get update
  3. Install the ubunto-mobile package by using the apt-get command:
    $ sudo apt-get install ubuntu-mobile

At this point, your chroot-ed file system should be up-to-date and include the Ubuntu mobile package. Next, you add a script to test.

User and script setup

Again within your chroot-ed file system, add a new user using the adduser utility. You also restart the dbus daemon before changing users:

$ sudo adduser ume
$ /etc/init.d/dbus restart

Provide the necessary defaults for this user as the utility requests them. Change to this user as:

$ su ume
$ cd

and provide the password that you initialized. Next, add a simple script that will start the UME (Hildon desktop). Because doing so involves a few different binaries, a script is the best way to go. Add this script to the new user's home directory (/home/ume), as shown in Listing 1.

Listing 1. Start-up utility /home/ume/start-hildon


export DISPLAY=:1

export GTK2_RC_FILES= \
export LANG=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8
export LANGUAGE=en_GB.UTF-8

exec /usr/lib/libgconf2-4/gconfd-2 &

exec ${PREFIX}/bin/matchbox-window-manager -display ${DISPLAY} \
                                  -theme ${THEME}/matchbox/theme.xml \
                                  -use_titlebar yes \
                                  -use_desktop_mode plain \
                                  -use_lowlight no \
                                  -use_cursor yes \
                                  -use_super_modal yes &

exec ${PREFIX}/lib/sapwood/sapwood-server &

exec ${PREFIX}/bin/hildon-desktop

Start the desktop

With the new script created (Listing 1), make it executable with the command:

$ chmod +x start-hildon

Now, in another window (not associated with the chroot-ed environment), start Xephyr with the command:

$ Xephyr :1 -host-cursor -screen 800x480x16 -dpi 96 -ac

This command creates a new window (as the device's framebuffer) that currently displays nothing. Now, start the Hildon desktop with the following command (from the chroot-ed window), which populates the Xephyr window:

$ ./start-hildon

The result is shown in Figure 2, which is the Hildon desktop environment provided through Xephyr on a standard desktop.

Figure 2. The UI showing orientation and sample applications
The UI showing orientation and sample applications
The UI showing orientation and sample applications

After selecting the Web Browser application and providing a URL, the page shown in Figure 3 appears. Note that the Web browser provides full rendering of Web content (Firefox).

Figure 3. Using the Web browser from Hildon
Using the Web browser from Hildon
Using the Web browser from Hildon

Let's dig in a little further and decompose the desktop environment to see what's provided.

The UI

The UI for the UME project is the Nokia-developed Hildon application framework (well known on the Nokia 770 and N800 devices). The Hildon application framework is a lightweight desktop environment for handheld devices that have smaller screens and is an ideal environment for the UME. In addition to providing a framework for a common look and feel, it supports other characteristics for small devices such as touchscreens, gesture-oriented computing, and finger-oriented navigation (see Related topics for details). Figure 4 shows the home screen, which we'll decompose into its representative parts.

Figure 4. The home screen of the Hildon desktop
Home screen of the Hildon desktop
Home screen of the Hildon desktop

The desktop has two areas: the panel at the top is similar to the common desktop panel in many operating systems, and the larger area is the home area. When an application is running, the home area is filled with that application. The home area currently shows the set of available applications.

The desktop panel includes several elements that are context sensitive depending on what's running. Currently, the home applet is running, so minimal information is shown. The upper left shows the current application in view (in this case, the home applet). The user can select the application to view by clicking this menu. In the center is the clock showing the current date and time. At the right (currently blank), an X icon appears for a running application; users click that icon to exit the running application. Also, a set of icons appears on the right showing battery status and WiFi status.

Other portions of the screen can be context sensitive, such as a scroll bar on the right for applications that present more than a screen's worth of data. Also, recall from Figure 3 that the bottom of the screen is used for location information (for the browser) as well as navigation controls.

Building a development environment for a mobile device

Now let's look how to build a development environment for a mobile device as well as how to create an executable image with the root file system.

Basic process

We start with an overview of the entire process, then dig down into each stage. Figure 5 shows the five steps of the process for building a new Linux environment and image. This process is performed using the Moblin (Mobile Linux image creator) utility (see Related topics for a link).

Figure 5. Image-generation process with Moblin
Image-generation process with Moblin

To create an image (a Linux image with the associated root file system for the target device), Moblin starts with a project that defines the platform-specific build environment. The project also defines the Linux file system that will occupy the embedded device. Next, Moblin requires the target, which is the specific platform for which the image is intended. Finally, a feature set is specified that defines the packages to be used on the embedded device. The result of this process is an image build specifically for the target platform (copied to a bootable USB device or CD).

You can modify the project (that is, the file system for the target device) for your specific applications. The details of this process are covered below.

Now that you have a general flow of the process, let's look at the detailed flow for creating an image.

Install the Moblin utility

The first step is to install the Moblin utility (developed by Intel and licensed under the GNU Public License [GPL] version 2). With Ubuntu, this process is simple using the APT package-management system:

$ apt-get install moblin-image-creator

When this process is complete, the image-creator application is available. You can use this application within a graphical user interface (GUI) or from the command line. This tutorial relies on the command-line interface, but the fundamental process is the same. For help on the image creator, type sudo image-creator --help from the command line.

Create a new project

The process begins with the creation of a new project. You use the Moblin utility and the command create-project. The command results in a new working directory for the project for the platform you define.

Note: The only supported platform at this time is called McCaslin, which is an ultra-mobile PC (UMPC) platform (see Related topics for a link).

$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ export LANGUAGE=en_US.UTF-8
$ sudo image-creator -c create-project      \	--platform-name mccaslin               \	--project-name "my-project"            \	--project-path "/home/mtj/my-project"  \	--project-description "My McCaslin Project"

This command requires that you have Internet access and can take a considerable amount of time, because it uses APT to update packages. In the end, you get a message indicating that the apt-get installation was successful. If you look into the ./my-project subdirectory, you see that it looks just like a root file system (because that's what it is for your embedded device) but with a targets subdirectory. Next, you create the target system.

Create a target system

In the previous step, you created the project directory, which resulted in a root file system and a special targets subdirectory. This next step specifies the target-specific information. Start by creating a target for your project using the create-target command of the image-creator utility:

$ sudo image-creator -c create-target \	--project-name "my-project"      \	--target-name "test-target"

This command populates the ./targets subdirectory within ./my-project.

Install a feature set

Next, you install what's called the functional sets (or feature sets). In this step, you install packages and their dependencies on the target.

$ sudo image-creator -c install-fset \	--project-name my-project       \	--target-name test-target       \	--fset-name "samsung-q1-ultra-config"

Other feature sets are included (zi9-config, zi9-full-mobile-stack, ubuntu-mobile, gnome-mobile, and so on), but they don't appear to be ready for prime time.

Create an image

You can now create an image using the image-creator. Using the create-live-usb command and referencing the project and the target, the result is an image file that contains both a kernel and a root file system:

$ sudo image-creator -c create-live-usb \	--project-name my-project          \	--target-name test-target          \	--image-name my-project-test-target-live-usb.img

The resulting image (on my system, with the project at /home/mtj/my-project) can be found in /home/mtj/my-project/targets/test-target/image/. Also in this subdirectory is a manifest file that defines all the packages that are present. This image file would be suitable for burning onto a UFD, and then booting on one of the supported embedded platforms (such as the Samsung Q1 Ultra). You can also create a USB installation image (which installs the operating system from the UFD onto an available hard disk).

The components of the image reside in ./my-project/targets/test-target/fs (the root file system for the environment). In this subdirectory is the compressed Linux kernel (vmlinuz) and the initial ramdisk image (initrd.img).

Develop applications on the UME

Because the target platform and the development platform are the same (Linux running Hildon), application development is simple. In the first part of this tutorial, you learned how to get the Hildon desktop running on a standard Linux desktop with Xephyr (the chroot method). This environment is ideal for host-based development of applications (in C, C++, or Python). When the application is ready to be shipped, it simply needs to be integrated into the root file system for the embedded device.

Other mobile platforms

While Ubuntu Mobile and Embedded is a great step forward for Linux in embedded systems, it's not the only one. Other options exist for simplifying Linux development in embedded environments.

GNOME Mobile

GNOME Mobile is an effort to advance the use of GNOME components in mobile technologies. GNOME is a desktop environment and development platform for developing and integrating applications (with the same look and feel) onto the GNOME desktop.

GNOME Mobile's current efforts are toward a standardization between the GNOME desktop and the mobile environment and simplifying the development of applications for mobile devices. It supports not only the graphical elements of the desktop but also additional elements for device communication (Bluetooth) and service discovery (Avahi). Technologies in incubation include geographic information services and audio elements.

GNOME Mobile supports application development through the C and C++ languages as well as the Python object-oriented scripting language.

You can see where GNOME Mobile is going today in the One Child Per Laptop (OLPC) XO laptop. This low-cost laptop uses Linux and GNOME as its desktop environment, with a special UI called Sugar developed specifically for children. See the developerWorks tutorial "Application development for the OLPC laptop" for additional details.


OpenEmbedded is another software framework for building Linux distributions for embedded devices (a so-called meta-distribution). With OpenEmbedded, you can produce a full Linux base for a defined target architecture (including tools). The result is a full Linux distribution (potentially cross-compiled) with all the necessary software packages, Linux kernel, and bootloader for a particular processor architecture.

OpenEmbedded evolved from the OpenZaurus project, which was a Debian-based Linux distribution for the Sharp Zaurus PDA. It enjoys use by several universities for education and research as well as by a variety of companies doing internal and external development.


OpenMoko is another Linux-based development platform for mobile phones, but it's based on the OpenEmbedded platform. Its focus is mobile handset platforms, and it extends the framework for a variety of applications specific to that platform (for example, dialers, GPS interfaces, phone lists, and book readers).

OpenMoko also makes development simpler, providing interfaces for experienced programmers and novices alike. Therefore, the platform is ideal for anyone who wants to extend a mobile platform (in particular, the Neo 1973) or personalize it with new applications.

The Maemo platform

Maemo is one of the more stable Linux-based platforms, currently focused on the Nokia Internet tables (Nokia 770, N800, and N810). This project is leveraged in the Ubuntu Mobile and Embedded project, particularly the UI (Hildon and GNOME).

Nokia drove this development for its handheld devices to use open source technologies specifically to result in a user-modifiable platform. It also helped to solidify GNU/Linux's place in mobile embedded devices.

Because Maemo is leveraged in the UME, you'll find many strong similarities in the projects, including the use of the Moblin utility (for Linux environment and image creation).

The Embedded Debian (Emdebian) project

The Debian project realized very early that Linux was not confined to the desktop or server environment. Linux was being found on tiny embedded devices with no Memory Management Unit (MMU) to fast and complex multiprocessor devices. But the core was always the same.

To support the proliferation of Linux, Debian started the Embedded Debian (Emdebian) project with the goal of providing a distribution that would cover a wide range of usage models. Additionally, the project would provide minimal versions of packages, optimized for small-footprint devices with little storage.

Also, Emdebian includes support for creating cross-compilation environments (for example, to build ARM applications on x86 host systems for execution in ARM target environments). You'll find packages for the supported architectures, build tools, and support for building custom root file systems, as well.

Google's Open Source Mobile Platform (Android)

A newcomer to the handheld platform, Google's Android (Open Handset Alliance Project) refers to 30 or more companies focusing on building Android and its associated applications. Like the others, Android is a platform (or software stack) that provides a Linux kernel, libraries, an application framework, and applications for handheld devices.

In addition to supporting the commonly needed handheld elements (such as an integrated browser, dialer, Bluetooth capability, GPS, and camera support), Android allows every application to be replaced (no implementation is better than another). Applications are developed in the Java™ language and executed on the integrated Dalvik virtual machine (VM).

From Google's Web site devoted to Android (see Related topics), it's clear that they're serious about building the next handheld platform.


The Ubuntu Mobile and Embedded project is a great first step for simplifying the development of Linux environments for specialized handheld and mobile devices. The Gutsy Gibbon release is the first formal release; and while it's not without its warts, it's a great start and indicative of Ubuntu's goal of simplifying the development of mobile Internet devices.

Downloadable resources

Related topics

  • Ubuntu is a community-developed Linux distribution that is ideal for servers, desktops, and laptops (and now embedded devices). If not the best distribution out there, it's one of the most popular.
  • The Hildon desktop, used by UME as its desktop environment and GUI, was initially developed by Nokia but has now been open sourced for all products to enjoy. It's used by many projects, so this tutorial isn't the last place you'll see it.
  • Xephyr is an X Server that runs within another X Server.
  • The APT is the Debian package management system used to manage systems for package installation and uninstallation. Not only does it simplify installation and uninstallation, it also takes care of dependencies, automatically downloading other packages that the desired package requires.
  • Avahi is a service-discovery system that facilitates discovery of services on a local network. It's similar to the Service Location Protocol.
  • Steve Friedl's Unixwiz tips describes chroot and its use. The chroot utility alters the root file system for the current process and subsequent child processes. The new environment is commonly called a jail and is one of the early operating system virtualization methods.
  • Moblin (Mobile and Internet Linux Project) is an umbrella open source project for building Linux distributions for embedded devices.
  • Besides Ubuntu Mobile and Embedded, you'll find OpenEmbedded, OpenMoko, the Maemo Project, Embedded Debian, and the newcomer, Google's Android in the mobile handheld platform space, which is getting quite crowded, with numerous old and new platforms.
  • "Designing for finger-driven UIs" provides excellent guidance for creating finger-driven interfaces. Ubuntu Mobile and Embedded is more than just a great platform for mobile and embedded applications.
  • At the 2008 CES, the first platform that will support the Google Android was introduced, the Wistron NeWeb hybrid GSM/VoWiFi phone. This platform is based on the TI OMAP 1710 chipset with a 2.5" QVGA TFT-LCD touchscreen and full QWERTY keyboard. The phone currently uses Trolltech's Qtopia phone edition software on Montavista's 2.6 Linux.
  • The McCaslin MID platform is the first step in building a standardized architecture. In 2008, the Menlow platform will be released, which will sport much lower power consumption for even longer battery life. This release will be followed in the 2009/2010 time frame with the Moorestown platform, which will reduce power even further and improve the graphical capabilities of the Menlow platform.
  • "Application development for the OLPC laptop" (developerWorks, December 2007) gives a technology primer and hands-on introduction to writing applications for the OLPC's XO-1 laptop.
  • In the developerWorks Linux zone, find more resources for Linux developers, and scan our most popular articles and tutorials.
  • See all Linux tips and Linux tutorials on developerWorks.


Sign in or register to add and subscribe to comments.

Zone=Linux, Open source
ArticleTitle=Explore Ubuntu Mobile and Embedded