Running X Apps on Ubuntu Devices You can install, launch, and use traditional debian-packaged X apps on Ubuntu devices. This may be unexpected given that Ubuntu devices do not seem to support user-installed debian packages, nor do they run the X Display Server. But it does work, courtesy of Mir/XMir and Libertine.
So here’s a bit of background to get started.
But first, please note that at this time, display and use of X apps on an external monitor is only available on the Pro5/M10 and on future devices. (BQ 4.5/E5 and Meizu MX4 do not support this feature.)
Hello Mir (Goodbye X)Traditionally, and still on the Ubuntu Classic desktop with Unity 7, Ubuntu runs an X Display Server. Apps are debian packaged. And, they are written for X:
Packages and the root file systemUbuntu Classic has a root file system (rootfs) that is populated through installation of a carefully curated set of debian packages. At run time, users can install debian packages to add apps or modify their system.
Ubuntu devices are designed for security and reliability. Ubuntu devices have a read-only rootfs that is small and tight, providing just what is needed and simplifying system updates. The rootfs is not modifiable by the user. Indeed it is mounted as a read-only partition. Users install apps through click packages that do not modify the rootfs.
Hello LibertineLibertine is a system to manage app containers. It is specifically designed to support the many traditional X apps that are debian packaged. Each container is a separate Ubuntu rootfs populated through debian package installations. (Currently these containers are chroots: later, LXD contains will be supported. Also, currently the containers must be of the same Ubuntu series as the device: Vivid.)
So, you can install or create a libertine container, install debian packaged X apps into it, and launch them using the XApps scope. The apps access to the user’s key directories: Documents, Downloads, Music, Pictures, and Videos. So data files created and saved by an app in one container are available to apps in any other container, and indeed outside of the containers.
Let’s take a quick look at the XApps scope.
XApps ScopeThis scope simply lists the containers and, for each container, it displays its apps. Here’s a look at a device with two containers. This system has two containers (Puritine and My Container). And each has a few apps:
- Tap an app to launch it.
- long press an app to hide it.
- If you have any hidden apps, see them from the search icon (magnifying glass) and tap Hidden X Apps. Long press a hidden app to unhide it.
- Note that a container with no apps does not display in the scope.
Libertine Container Managerlibertine-container-manager is a command line tool you use on the device to create and manage containers. This includes installing debian packaged apps into them. (These containers are created in the phablet user’s home directory and are not a part of the read-only rootfs.)
Note: libertine-container-manager currently cannot be run in the Terminal App. Instead please connect to your device from an Ubuntu system using phablet-shell.
The “puritine” container is pre-installed on many devices through the com.ubuntu.puritine click package (“Desktop Applications”):
The second container (“my-container”) was created on the device with libertine-container-manager.
Note: It is possible to pre-install customized containers through bespoke channels.
Creating a Libertine ContainerYou can create a new container on a device. The container needs a unique ID and (optionally) a name.
Note: The container must be the same Ubuntu series as the device, currently: vivid.
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
I: Valid Release signature (key id 790BC7277767219C42C86F933B4FE6ACC0B21F32)
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
Listing Apps in a ContainerIt’s easy to list the apps in a container. You just use the container’s id, as follows:
Note: We add the optional --json argument here and show only lines with “name” for display convenience.
"name": "Panel Manager",
"name": "Python (v3.4)",
"name": "Python (v2.7)",
"name": "Notification Daemon",
Installing an app in a containerTo install a debian package in a container, you just use install-package with the container id and the debian binary package name, as follows:
The package and all of its dependencies are installed in the container. After this, assuming the package installs a .desktop file, it displays in the XApps scope and is launchable with a tap as expected.
Installing an app from a specific Launchpad PPABy default, available debian packages are installed from the standard Ubuntu archive the chroot’s apt configuration points to. You can add a launchpad PPA, as follows:
(Currently, private PPAs are scheduled for an upcoming release.)
After this, you can install packages into the container as usual, including from the PPA.
Removing apps from a containerRemove a debian package from a container with:
Use the --help for top level help.
You can see details on each subcommand, for example remove-package, as follows:
usage: libertine-container-manager remove-package [-h] -p PACKAGE [-i ID] [-r]
-h, --help show this help message and exit
-p PACKAGE, --package PACKAGE
Name of package to remove. Required. -i ID, --id ID Container identifier. Default container is used if
-r, --readline Readline mode. Use text-based frontend during debconf
Updating a containerWant the debian packages in a container updated? Easy:
Executing a Command in a Container
phablet@ubuntu-phablet:~/.cache/libertine-container/my-container$ libertine-container-manager exec --command "apt-get update" --id my-container
Atteint http://ppa.launchpad.net vivid InRelease
Atteint http://ports.ubuntu.com vivid InRelease
Atteint http://ports.ubuntu.com vivid-updates InRelease
Atteint http://ppa.launchpad.net vivid/main armhf Packages
Atteint http://ppa.launchpad.net vivid/main Translation-en
Atteint http://ports.ubuntu.com vivid/main armhf Packages [...]
Note: Running the apt-get update command in a container may be useful to update the container’s knowledge of newly available packages without installing/updating them all. You can then see whether a package is available, with:
Installé : (aucun)
Candidat : 44.0+build3-0ubuntu0.15.04.1
Table de version :
500 http://ports.ubuntu.com/ubuntu-ports/ vivid-updates/main armhf Packages
500 http://ports.ubuntu.com/ubuntu-ports/ vivid/main armhf Packages
More about the Libertine ContainersAs noted, the container is a directory containing an Ubuntu rootfs. Container directories are here:
phablet@ubuntu-phablet:~/.cache/libertine-container$ cd my-container/
You can get a bash shell into the container as follows:
groups: cannot find name for group ID 1001