maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Full linux distros on Sailfish OS (https://talk.maemo.org/showthread.php?t=101080)

levone1 2022-08-21 12:10

Re: Full linux distros on Sailfish OS
 
I have qxdisplay 0.1 here - https://mega.nz/file/Ew9xgQQT#HMgNUi...Yu25I3e1Iyua8Q

Not sure what is different/better, but in case anyone wants...

Kabouik 2022-08-22 08:29

Re: Full linux distros on Sailfish OS
 
harbour-containers is undergoing testing in Chum repo (not available in the main repository yet, we found a couple non-critical bugs we'd like to resolve before pushing to the main repository). Meanwhile, I'm working on making Arch available out of the box:

https://rehost.diberie.com/Picture/Get/r/84315

Testers welcome. It's in the devel-k branch for now: https://github.com/sailfish-containe...s/tree/devel-k

Kabouik 2022-08-22 08:45

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by levone1 (Post 1574554)
I have qxdisplay 0.1 here - https://mega.nz/file/Ew9xgQQT#HMgNUi...Yu25I3e1Iyua8Q

Not sure what is different/better, but in case anyone wants...

You should lose nothing by switching to latest qxcompositor, and if your device is in a SFOS version higher than 4.2, then you'd get dynamic auto-orientation. This requires editing a script from harbour-containers to reflect the change, but this is taken care of in the new version that will be available in Chum. Before it hits the main Chum repository, you can try it from here: https://github.com/sailfish-containe...e-devel-builds

edp17 2022-08-22 14:43

Re: Full linux distros on Sailfish OS
 
I've updated the debian-mouse.sh script in the first post. (If some would like to start the guest os from the command line or (like me) with a custom .desktop icon)
It has 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. :)

Kabouik 2022-08-25 13:27

Re: Full linux distros on Sailfish OS
 
Testers welcome for the devel-k branch: https://github.com/sailfish-containe...e-devel-builds

If tests pass well enough, then we might be able to merge it to master and make it available right from the Chum app store, for a one click install.

https://github.com/sailfish-containe...ian-i3_800.jpg

https://github.com/sailfish-containe...rch-i3_800.jpg

https://github.com/sailfish-containe...-xfce4_800.jpg

Make sure you have a stable connection to avoid package installation failures. The i3 and xfce4 default configuration are very basic, but should make use on mobile easier than the real default not adapted to hidpi or touch use.

If you picked i3 as your window manager, Alt is your $mod, so Alt+Return to open a terminal, and Alt+d for dmenu. Your i3 configuration can be changed in ~/.config/i3/config.

Changelog
Code:

* Tue Aug 24 2022
- Add a script to install Arch-based distributions
- WM choice when installing (xfce4 or i3), should work for all supported types of distros (Arch, Debian)
- Better default configs for both WMs (scaling, right click (only in Arch), touch scrolling in Firefox)
- Possibility to run the script multiple times on a container without breaking things, with failsafes (to some extent)
- Prompts at important steps during install scripts (in case of overwriting config, or long compilations)
- New icon, better for small screens
- Custom wallpapers for Debian, Arch and Kali

* Thu Aug 19 2022
- Updated description and license for Chum repository
- Bumped version to avoid dep resolution issues
- README overhaul
- Fixing debian.sh
- Fixing GUI typos
- Sane xsession defaults for xfce4 and onboard
- New icon
- Back to qxcompositor instead of qxdisplay (autorotation)

Known issues/limitations:
- 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.
- 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
- No sound in some devices, and it may silence some SFOS sounds (alarms, media) as well (else, please tell us)
- 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

Kabouik 2022-08-30 18:34

Re: Full linux distros on Sailfish OS
 
harbour-containers is now in the Chum repository, hence easy to install!

https://github.com/sailfish-containe...18_001_480.png

Please let us know if there are any issues (but check the known issues first), preferably as issues in the repositories so that we get notifications.

It's only tested by me so far, and on a single device, so I hope it will work well enough for other devices.

edp17 2022-10-14 15:35

Re: Full linux distros on Sailfish OS
 
Question:
On the "lxc-attach -n Deb" command, I get the following error:

"Operation not permitted - Failed to rexec as memfd
free(): invalid pointer
Aborted"

Sfos 4.4 (On older versions it works.)

Has anybody experienced this?

Edit: strace log

edp17 2023-04-19 14:06

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by edp17 (Post 1574684)
Question:
On the "lxc-attach -n Deb" command, I get the following error:

"Operation not permitted - Failed to rexec as memfd
free(): invalid pointer
Aborted"

Sfos 4.4 (On older versions it works.)

Has anybody experienced this?

Edit: strace log

Same error on SFOS 4.5.

qoh 2023-04-27 13:55

Re: Full linux distros on Sailfish OS
 
I followed the instructions yesterday and now I found that AlienDalvik doesn't come up any more on my XA2.

It says "cannot start" in the Android App Support settings page. I can hit "Start", then it will say "started", but when I try to open an Android application it says again on the top of the screen that it's starting the app support.

EDIT: Not sure how exactly, but after uninstalling both, AlienDalvik and "Containers" and rebooting, the app support was back - even though I hadn't installed it again at that point. Files like /opt/alien were still around though.

edp17 2023-05-16 08:10

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by qoh (Post 1575208)
I followed the instructions yesterday and now I found that AlienDalvik doesn't come up any more on my XA2.

It says "cannot start" in the Android App Support settings page. I can hit "Start", then it will say "started", but when I try to open an Android application it says again on the top of the screen that it's starting the app support.

EDIT: Not sure how exactly, but after uninstalling both, AlienDalvik and "Containers" and rebooting, the app support was back - even though I hadn't installed it again at that point. Files like /opt/alien were still around though.

I do wonder how the AD support came back after reboot when that package was removed.
Containers can have an impact on the Android Support as both uses LXC containers. Although, unlikely that installing a Linux desktop distro into an LXC container would ruin Android Support because they are independent containers. Please let us know what packages you had installed and how did you installed/configured the desktop distro (step by step) Also, some logs also can be useful to see what's happening under the hood.

Motomeizu 2024-01-14 20:17

Re: Full linux distros on Sailfish OS
 
I have problem with system sound.
poco x3 pro SFOS 4.5.0.24

qoh 2024-05-12 08:23

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by edp17 (Post 1575251)
Please let us know what packages you had installed and how did you installed/configured the desktop distro (step by step) Also, some logs also can be useful to see what's happening under the hood.

In the end, I think it all had to do with the system generally only having some hundred megabytes of space available.

Over the last couple of weeks I've implemented several workarounds to the various issues of SFOS itself and now the containers work as expected!

One issue still standing is that normal users do not get network access.

root can connect normally, but:

Code:

# lxc-attach alpine
# adduser user
# groups user
user

# su user -c 'ping 1.1.1.1'
PING 1.1.1.1 (1.1.1.1): 56 data bytes
ping: can't create raw socket: Permission denied

# su user -c 'dig maemo.org'
net.c:141:try_proto(): socket(): Permission denied (13)
net.c:141:try_proto(): socket(): Permission denied (13)
dig: can't find either v4 or v6 networking

# su user -c 'curl 1.1.1.1'
curl: (7) Failed to connect to 1.1.1.1 port 80 after 0 ms: Couldn't connect to server

# adduser  user wheel
# adduser  user root
# adduser  user netdev
# groups user
user root wheel netdev

# su user -c 'curl 1.1.1.1'
curl: (7) Failed to connect to 1.1.1.1 port 80 after 0 ms: Couldn't connect to server


peterleinchen 2024-05-12 08:57

Re: Full linux distros on Sailfish OS
 
<code>
devel-su usermod -a nemo -G net_raw
</code>
choose nemo or defaultuser or just user depending on your use case

qoh 2024-05-12 09:23

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by peterleinchen (Post 1576060)
Code:

devel-su usermod -a nemo -G net_raw

Is the idea there to match the UID of the SFOS user with the one in the container?

My results:

Sailfish:

Code:

# useradd -G net_raw lxcuser

# groups lxcuser
lxcuser net_raw

Container:

Code:

# adduser -u 100001 -s /bin/ash -D lxcuser

# su lxcuser -c 'curl 1.1.1.1'
curl: (7) Failed to connect to 1.1.1.1 port 80 after 0 ms: Couldn't connect to server

Adding the SFOS user to many other groups didn't influence the result ...

qoh 2024-06-05 18:46

Re: Full linux distros on Sailfish OS
 
It turned out the service user inside the container has to have GID 3003 "inet" as primary, not supplementary group.


Insufficient:


Code:

# groups i2pd
i2pd : i2pd inet


Working:


Code:

# usermod -g inet -G i2pd i2pd
# groups i2pd
i2pd : inet i2pd


edp17 2024-09-25 10:58

Re: Full linux distros on Sailfish OS
 
Quote:

Originally Posted by edp17 (Post 1574684)
Question:
On the "lxc-attach -n Deb" command, I get the following error:

"Operation not permitted - Failed to rexec as memfd
free(): invalid pointer
Aborted"

Sfos 4.4 (On older versions it works.)

Has anybody experienced this?

Edit: strace log

Okay, I've played with this a bit more and found out that sfos updates also install newer version of lxc packages (more precisely: lxc-libs, lxc-templates & lxc).
On sfos 4.2 and 4.3 the lxc version 3.0.1 were installed. However, sfos 4.4 upgrade did install lxc version 4.0.10. This was the point when the lxc-attach started crashing.
It seems my kernel has got some missing elements therefore the newer than 3.0.1 version of lxc-attach has stopped working.

There were two ways to solve this issue.
1. backport all necessary kernel/device changes for supporting that memfd
2. install older version of lxc packages and try how they work on the newer sfos version

The first option would the best and comprehensive as it will ensure compatibility with newer lxc versions. However, it can be challenging and time consuming. Therefore I've chosen the second option. :)
I downloaded those lxc packages from older sfos version of jolla repositories and tested them.
The latest 3.0.1 version (3.0.1+git4-1.4.3) from this repo works well even on sfos 4.6.:
Code:

https://releases.jolla.com/releases/4.3.0.15/jolla/armv7hl/

edp17 2024-10-06 20:54

Re: Full linux distros on Sailfish OS
 
Here, I've put together a little guide about how to install Debian Bookworm SailfishOs 4.6. This guide covers both arm32 and aarch64 architectures. (Two examples for the aarch64 architecture: Motorola G7 Power (ocean) and Sony Xperia XA2.)
In this instruction the container name is: Debian

As all steps must be done in command line, I suggest to do it via ssh because typing all in Fingerterm on the device is very difficult and expose risk of typos.

1. Add chum repo and install Chum-gui app as root:
If you already have Chum-gui installed, you can skip this step.
Code:

ssu ar sailfishos-chum https://repo.sailfishos.org/obs/sailfishos:/chum/4.6.0.15_aarch64/
ssu ur
zypper ref
zypper in sailfishos-chum-gui


2. Install LXC, qxcompositor, containers app and some other as root:
Code:

zypper in qxcompositor lxc lxc-templates-desktop harbour-containers sudo

3.1. Create container and install debian as root:
When it pops up a few questions, answer to those with:
Distribution: debian
Release: bookworm
Architecture: arm64 (or armhf)
Code:

lxc-create -t sfos-download -n Debian

3.2. Add the following two lines into /var/lib/lxc/Debian/config file as root:
(Without this, there won't be /mnt/guest folder within the container!)
Code:

# mount guest additions readonly
lxc.mount.entry = /usr/share/harbour-containers/scripts/guest mnt/guest/ none bind,ro,create=dir 0 0


3.3. Start container as root:
Code:

lxc-start -n Debian

3.4. Attach container as root:
Code:

lxc-attach -n Debian

3.5 Now you should be within the Debian where execute two .sh scripts:
(this will take for a while and will ask to chose desktop environment (I used xfce) and root password. (When the script is finished it will quit and stop the container.)
Code:

/mnt/guest/setup_desktop.sh

3.6. Execute the next script which originally was meant to download & compile Xwayland binary. Unfortunately, that bit doesn't work anymore, so we will download the Xwayland binary in a different way. However, this script still should be executed.
Start and attach & attach the container, then execute the second .sh script as root:
(When the script is finished it will quit and stop the container.)
Code:

lxc-start -n Debian
lxc-attach -n Debian
/mnt/guest/setups/debian.sh


3.7. Download Xwayland.xxxxx.libc-2.29 .bin binary: Xwayland for armhf(32) or Xwayland for aarch64
Rename the downloaded file to Xwayland, then copy the Xwayland into the container as root:
(if bin folder doesn't exist there you'll need to create it)
Code:

cp Xwayland /home/.lxc/Debian/opt/bin/
then set it to be executable:
Code:

chmod +x /home/.lxc/Debian/opt/bin/Xwayland
3.8. Now you are good to go.

Start Debian

1. I wrote a .sh script to easily start the container from command line. It can be used in a .desktop file, so can be there as a native app. Download the debian-mouse.sh file Copy the debian-mouse.sh into your home and make it executable:
Code:

chmod +x debian-mouse.sh

2. For starting the container you just need to execute the script.
It has two parameters:
$1 - your container name (e.g Debian)
$2 - layout: p (portrait) or l (landscape) or a (auto-rotate)
Example:
Code:

debian-mouse.sh Debian p

3. The container should open as an app.

Update:
If you'd like to have an icon in your app grid and start your container as an app, please download lxc-debian.zip file, extract it and as root copy its content to the relevant folders on your Sailfish system.
This is how it looks on my XA2:
https://i.ibb.co/D7dwBjD/Debian-on-XA2.png

Kabouik 2025-03-02 16:49

Re: Full linux distros on Sailfish OS
 
Thanks for putting together that how-to that helps in your situation where LXC updates coming with SFOS updates would fail. I'm not entirely sure what could be the part that helps in your case, probably just being able to use the older LXC packages due to kernel requirements not entirely met on your port. Aside from that, it's likely that not everything else is necessary. I recommend trying those instructions after the LXC downvrade part at least to see where is the culprit, before going fully manual (but if so, it's best doing it using the install script supplied with harbour-containers to pinpoint where it fails): https://github.com/sailfish-containe...#start-desktop

In most cases, installing from the Chum repository should still work out of the box and be a one-click action, with better upgradability and dependence resolving. I understand that this may fail on some devices that might be missing some kernel requirements, and it's great that you found how to keep using containers and configuration scripts despite those issues, but it would be good to disambiguate that these are peculiar cases and the official method should still be attempted first by other users.

I haven't done it in a long time and have no updated SailfishOS device to try, but even the precompiled xwayland download still seems to work from the automated scripts (which fetch them from the repo itself so Mega is not necessary: https://github.com/sailfish-containe...eleases/tag/b1).

Some people have installed both Debian and Kali today successfuly on SailfishOS 5 (they have not tested Arch, so not sure if that one still works), so that's good news that the thing still works!


All times are GMT. The time now is 21:21.

vBulletin® Version 3.8.8