Active Topics

 


Reply
Thread Tools
Posts: 1 | Thanked: 0 times | Joined on Jan 2024
#251
I have problem with system sound.
poco x3 pro SFOS 4.5.0.24

Last edited by Motomeizu; 2024-01-15 at 18:44.
 
Posts: 9 | Thanked: 12 times | Joined on Aug 2016
#252
Originally Posted by edp17 View Post
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's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#253
<code>
devel-su usermod -a nemo -G net_raw
</code>
choose nemo or defaultuser or just user depending on your use case
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Posts: 9 | Thanked: 12 times | Joined on Aug 2016
#254
Originally Posted by peterleinchen View Post
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 ...
 
Posts: 9 | Thanked: 12 times | Joined on Aug 2016
#255
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's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#256
Originally Posted by edp17 View Post
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/

Last edited by edp17; 2024-09-25 at 12:11.
 

The Following 3 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#257
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:

Last edited by edp17; 2024-10-10 at 13:44. Reason: Updated instruction
 

The Following User Says Thank You to edp17 For This Useful Post:
Reply

Tags
application, development, linux


 
Forum Jump


All times are GMT. The time now is 17:15.