Active Topics

 


Reply
Thread Tools
edp17's Avatar
Posts: 600 | Thanked: 712 times | Joined on Jul 2019 @ UK
#1


This topic is created to discuss any questions and thoughts regarding the harbour-containers. This app makes it possible to easily install full Linux distributions onto Sailfish OS and use that distro as any other Sailfish app.

The harbour-containers and lxc-templates-desktop are Illyria's project and he was inspired by the work of Preflex' and Elros34 on chroot.

More info (requirements, downloads and install instructions) is available here:(Note: Once the container is started you can close the command line, and the container will stay running.)

Requirements:
  • harbour-containers requirements
  • Kernel requirements
  • install the lxc and lxc-templates packages with pkcon
  • Additional kernel requirements. All the following must be on in the kernel:
    CONFIG_DEVPTS_MULTIPLE_INSTANCES
    CONFIG_NAMESPACES
    CONFIG_UTS_NS
    CONFIG_IPC_NS
    CONFIG_PID_NS
    CONFIG_NET_NS
    CONFIG_CGROUPS
    CONFIG_CGROUP_DEVICE
    CONFIG_CPUSETS

    (You can double-check these on the device. e.g. zcat /proc/config.gz | grep CONFIG_DEVPTS_MULTIPLE_INSTANCES)

Downloads:
===========================================
Mouse and cursor support:
Important!: From SFOS4.4 qxcompositor with mouse cursor is not available.
(The cursor support is in an experimental stage, however, that works fine in portrait mode)

Add the -plugin evdevmouse parameter into "/var/lib/environment/compositor/droid-hal-device.conf"
Then install the qxcompositor package. (An older build can be downloaded from here:
qxcompositor-0.0.5+cursor_test2.20200817210502 but I do recommend to install it from the proper repo.)

For SFOS4.4, the qxcompositor can be installed from Elros's repo. As root do the following:
  • Code:
    ssu ar elros34 https://repo.sailfishos.org/obs/home:/elros34:/sailfishapps/sailfishos_4.4.0.64/
  • Code:
    zypper ref
  • Code:
    zypper in qxcompositor

Unfortunately, if you install Debian Sid fresh under SFOS4.4, the installation cannot build the Xwayland binary. If no window appears and on the console, you get this error: "/etc/X11/xinit/xserverrc: 4: exec: /opt/bin/Xwayland: not found", do the following:
  • download the latest build (Xwayland.xxx.libc-2.29.bin) from here: Xwayland for armhf(32) or Xwayland for aarch64
  • rename it to Xwayland
  • set it to be executable
    Code:
    chmod +x Xwayland
  • then copy into /home/.lxc/<container_name>/opt/bin/
If the window starts but there is an error message "Unable to contact settings server" "Failed to execute child process "dbus-launch" (No such file or directory)", then you need to attach the container and install the dbus-x11 package

Some useful scripts:
(You can download and edit as you wish. )
  • Start LXC and desktop in landscape/portrait/auto-rotation mode with mouse support: debian-mouse.sh
    (two parameters:
    $1 - container name;
    $2 - p or l or a for portrait/landscape/auto-rotate mode
    Please note: if it is called WITHOUT the second parameter, it starts with auto-rotate)
  • Start LXC and desktop without mouse support: debian.sh
(Note: Once the container is started with one of the scripts above, you can close the command line, and the container will remain running.)
(Note2 03/11/2021: I've amended the scripts to handle if waydroid is also installed on the device. I also incorporated the landscape/portrait/auto-rotate modes into one script.)

===========================================

If the GUI doesn't work (for some unofficial ports, this is the case), this can be done manually from a command line. Here are the steps:
  1. sudo lxc-create -t sfos-download -n <container-name>
  2. sudo lxc-start -n <container-name>
  3. Manually change the the /usr/share/sailfish-containers/guest to /usr/share/harbour-containers/scripts/guest in the /var/lib/lxc/<container_name>/config
  4. sudo lxc-attach -n <container-name>
    then within the container:
    • /mnt/guest/setup_desktop.sh
    • /mnt/guest/setups/debian.sh
  5. Start 2! command lines and in one of them issue this as nemo:
    /usr/bin/qxdisplay --wayland-socket-name "../../display/wayland-container-0"
    (or to start with mouse cursor support use this:
    /usr/bin/qxcompositor -o portrait --wayland-socket-name "../../display/wayland-container-0"
    )
  6. In the other command-line attach the container, then:
    /mnt/guest/start_desktop.sh 0
  7. Done.

Note: If you don't have the /mnt/guest/ folder within the container, try to use this content in the /var/lib/lxc/<container_name>/config: config
In this config, there are some container-specific lines so we would like to copy them among the containers, we need to adjust these two lines accordingly:
Code:
# Container specific configuration
lxc.rootfs.path = dir:/home/.lxc/<container_name>
lxc.uts.name = <container_name>
where replace the <container_name> with your name of the container.

===========================================
V I D E O S:

Kabouik has created some very useful and impressive videos on how to use LXC with desktop Linux distributions on Sailfish OS. Many thanks for him! They're rather long so check the description to jump to any chapter that might be more interesting to you.

Last edited by edp17; 2024-10-06 at 20:22. Reason: Added link to Xwayland binary
 

The Following 24 Users Say Thank You to edp17 For This Useful Post:
Posts: 1,873 | Thanked: 4,529 times | Joined on Mar 2010 @ North Potomac MD
#2
Will this work on the original jolla phone?
 

The Following 2 Users Say Thank You to mscion For This Useful Post:
mosen's Avatar
Community Council | Posts: 1,669 | Thanked: 10,225 times | Joined on Nov 2014 @ Lower Rhine
#3
copied from the lxc instructions:
Code:
It is possible to check if your kernel support containers with:
ls -lha /dev/pts/
LXC enabled devices should see a /dev/pts/ptmx entry.
On Jolla 1, memory might be a little few.
 

The Following 2 Users Say Thank You to mosen For This Useful Post:
Posts: 1,873 | Thanked: 4,529 times | Joined on Mar 2010 @ North Potomac MD
#4
Originally Posted by mosen View Post
copied from the lxc instructions:
Code:
It is possible to check if your kernel support containers with:
ls -lha /dev/pts/
LXC enabled devices should see a /dev/pts/ptmx entry.
On Jolla 1, memory might be a little few.
Would be fun to try. Maybe there is a decent light weight distribution.

https://itsfoss.com/lightweight-linux-beginners/
 

The Following 2 Users Say Thank You to mscion For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 712 times | Joined on Jul 2019 @ UK
#5
Originally Posted by mscion View Post
Will this work on the original jolla phone?
Well, my experience so far is that even if the device meets with all the requirements, there can be some issues. Examples:
  • on my XA2, it works out of the box
  • on my Note 4 (treltexx) port (CM14.1 base) it only works/starts from the command line (not a biggie as I created a script for that and everything else work fine)
  • on my Nexus 5 (hammerhead) port (CM12.1 base) it starts but immediately stops (probably there are some other missing bits and bobs, the investigation is ongoing)
  • on my S2 (i9100) port (CM12.1 base) it doesn't start either from GUI or from the command line (I think it is similar to the hammerhead and it is also under investigation)

So, it worth a try.
 

The Following 5 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 712 times | Joined on Jul 2019 @ UK
#6
I have updated the main post with adding a video to watch it in action.
 

The Following 2 Users Say Thank You to edp17 For This Useful Post:
Posts: 1,873 | Thanked: 4,529 times | Joined on Mar 2010 @ North Potomac MD
#7
As an alternative, is there a way to boot up a Linux distribution from a sd card?
 

The Following 2 Users Say Thank You to mscion For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 712 times | Joined on Jul 2019 @ UK
#8
Originally Posted by mscion View Post
As an alternative, is there a way to boot up a Linux distribution from a sd card?
I don't know whether the path is hardcoded into the compiled executables. There are scripts but I have not checked them. So it might be possible, but in the current state that would surely require some manual preparation.
 

The Following 3 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 712 times | Joined on Jul 2019 @ UK
#9
My question is how can I mount/attach folders outside of the container e.g. the phone's internal and external sd card, network drive, etc...?
 

The Following 3 Users Say Thank You to edp17 For This Useful Post:
Posts: 2 | Thanked: 19 times | Joined on Jul 2020
#10
hello guys,
i'm the app's developer, and a long time TMO lurker.
I'm a bit surprised to see a topic here so early

First of all, i'd like to point out that this project is heavily inspired on previous works done by preflex on "XWayland Victory!" and elros34 "sailfish_linux_chroot".

As edp17 already stated, LXC and harbour-containers usually works out-of-the-box on XA2's generation devices (android base >=9), since AlienDalvik works within a container as well.

Probably the wiki's requirements page needs some updates since community ports seems to require more than just "CONFIG_DEVPTS_MULTIPLE_INSTANCES" on kernel's defconfig, as i excepted.
Unfortunately i don't own other sailfishos devices than my Pro1 to work on, i'm happy anyway to help porters to bring containers on community ports.
 

The Following 19 Users Say Thank You to illyria For This Useful Post:
Reply

Tags
application, development, linux


 
Forum Jump


All times are GMT. The time now is 06:22.