Containers (harbour-containers
) is a SailfishOS application to create, download, manage and run Linux containers (LXC) from a convenient GUI. It currently supports Arch- and Debian-based distributions, and can configure them with Xfce4 or i3 as default DE/WM. It relies on Xwayland
to run the associated desktop environment inside a new SailifshOS window:
Note
|
Before proceeding, make sure LXC kernel requirements are satisfied. |
-
Uninstall manually installed version, if any
If you never used
harbour-containers
before, jump to step 2. Else, if you had a version ofharbour-containers
installed from a source other than Chum (e.g., an older version before Chum or a devel build), then you need to uninstall it first because Chum is designed to not overwrite packages if they don’t match vendor (presumably installed manually):devel-su ps aux | grep -ie daemon.py | awk '{print $2}' | xargs kill -9 2> /dev/null # Kill the daemon zypper remove harbour-containers qxcompositor lxc-templates-desktop # Uninstall packages zypper remove qxdisplay # Just in case you have it too as it is obsolete now
-
Install Chum from here, then search for "Containers" in its app list. You’re done.
-
Install dependencies:
devel-su pkcon install zypper # If you don't have it installed already zypper install nemo-qml-plugin-dbus-qt5 sailfish-polkit-agent python3-base python3-gobject dbus-python3 xz
-
From the folder matching your SFOS version and device architecture, manually download the following packages:
-
lxc-templates-desktop
("noarch" subfolder), -
qxcompositor
(your architecture subfolder), -
harbour-containers
(your architecture subfolder too).
-
-
Install them either from your SailfishOS file manager or using:
cd /path/to/directory/where/you/downloaded/the/three/rpms devel-su ps aux | grep -ie daemon.py | awk '{print $2}' | xargs kill -9 2> /dev/null # Kill the daemon in case an older version was running zypper install lxc-templates-desktop-<VERSION>.rpm zypper install qxcompositor-<VERSION>.rpm zypper install harbour-containers-<VERSION>.rpm
Those three packages will have to be uninstalled manually before stable builds can be installed from Chum again, see above section.
Note
|
For now, the application requires that your SailfishOS user name is defaultuser . For nemo users from older SailfishOS versions, or custom user names, a symbolic link won’t be enough to start X from the GUI (but you can still create and manage containers from it, and launch X from CLI). See known issues.
|
The GUI of harbour-containers
should be relatively straightforward, see a brief description of GUI elements below:
Click to expand the description of each GUI element
▶ Main page
- ⨁ icon
-
Create a new container (you will need to set a device lock code in SailfishOS settings first), only Debian-based distributions are supported at the moment
▶ Container creation page
- Setup desktop
-
Execute a script after container creation to install a basic desktop environment (this can be done later too)
▶ Existing container page
- attach
-
Open a terminal window as
root
within the contained distribution - X session
-
Open a new SailfishOS window showing the X desktop of the distribution, if the desktop was set up first
- mountpoints
-
List of the default mount points for the container (you can edit it in
/var/lib/lxc/<container-name>/config
) - run onboard
-
Show a floating icon in the X session that allows opening a virtual keyboard (long press on Return to close it)
- kill Xwayland
-
May be necessary to close and reopen (with the "X session" button above" the window showing the desktop environment
- setup xsession
-
Run a script to set up your user and password, as well as default settings for your desktop environment (same as "Setup desktop" above in the container creation page)
- init container config
-
Run this first after container creation if you didn’t check "Setup desktop" in the first place; can only be ran on a stopped container
▶ Pulley menus
- Settings
-
Change container icon, destroy container (this cannot be undone), or set fixed orientation (obsolete)
- Snapshots
-
View LXC snapshots created using
lxc-snapshot
(see lxc-templates-desktop’s wiki) - Freeze/Unfreeze (all)
-
Freeze/Unfreeze container to save resources
- Start/Stop (all)
-
Start/stop container
Note
|
If unfortunately a terminal window did not appear after you created a new container, despite checking "Setup desktop", then you will have to go into the page of that new container, hit "init container config" at the bottom, start the container from the pulley menu, and then hit "setup xsession". The installation and configuration should then proceed. |
See lxc-templates-desktop’s wiki for more details and CLI usage (with extra features).
-
If your SailfishOS username is not
defaultuser
, then the GUI cannot start an X session; this is being worked on and in the mean time, you can try opening the X session from CLI -
When creating a new container from the GUI, sometimes the new icon will not appear immediately, and the Xsession setup script will not launch automatically even if you checked the option; if that happens, go into the page of that new container, hit "init container config" at the bottom, start the container from the pulley menu, and then hit "setup xsession"
-
If for some reason the GUI does not show any container, try closing it and killing the daemon with
ps aux | grep -ie daemon.py | awk '{print $2}' | xargs kill -9 2> /dev/null
before relaunching the application; if that does not help, a reboot would be recommended -
Sound may not work in Debian containers yet, and it may silence some SFOS sounds (alarms, media) as well (else, please tell us); it should work in Arch containers though
-
If using i3, dead keys may not work immediately in the default terminal, but usually work after a minute or so; please don’t ask us why
-
No hardware acceleration
-
Only prebuilt binaries of Xwayland can be used at the moment inside containers (this is automated when setting up xsession from the GUI), because latest sources don’t support the XDG_WM_Base protocol that we need
See the TMO thread.
-
Debian with i3 WM on a Pro1x running SailfishOS, with dynamic rotation (and rotation lock with keyboard opening):
-
The containers run in their own window alongside SailfishOS:
-
You can run any Linux desktop application that has been compiled for your architecture. See for instance
rofi
andDarktable
below: -
While LXC containers of desktop Linux distributions are most convenient with a hardware keyboard phone like the F(x)tec Pro1 and Pro1x,
Onboard
is also preinstalled for compatibility with other smartphones: -
More pics:
-
A video showcasing what LXC containers can do on SailfishOS is available here. Moar videos here.
Many thanks to all contributors and testers:
-
r3vn (main dev) - g7 - kabouik - eLtMosen - elros34 - edp17 - vaskas - dashinfantry - HengYeDev
-
i3 configuration modified from addy-dclxvi’s starterpack