fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 110 forks source link

Prevent ACT_CREATE_WRAPPERS when Junest is bundled in read-only file system #334

Closed ivan-hc closed 1 year ago

ivan-hc commented 1 year ago

Hi, I have built an AppImage containing Junest tu run OBS Studio:

before this release I've done many tests on my machine, then I've uploaded everything on GH Actions

However I don't know for what reason I'm no more able to run this.

./OBS-Studio_29.1.1-2-x86_64.AppImage 
bwrap: Can't mkdir parents for /home/ivan: Read-only file system
/tmp/.mount_OBS-StunhFOU/.local/share/junest/lib/core/wrappers.sh: riga 30: /tmp/.mount_OBS-StunhFOU/.junest/usr/bin/junest_wrapper: File system in sola lettura

but in my previous tests (with custom $HOME directories separated) all worked fine.

The only way I have to made it work is to extract the AppImage.

./*AppImage --appimage-extract

So I think I should include something in the AppRun to prevent the reload of junest_wrapper

How can I do?

EDIT: I've found that the Appimage works only if it is compiled on the same machine with the same user.

ivan-hc commented 1 year ago

UPDATE: I have created a repository to build AppImages using Junest

https://github.com/ivan-hc/ArchImage

The App I'm working on for now is OBS Studio, this is the workflow to build it

mkdir tmp
cd tmp
wget https://raw.githubusercontent.com/ivan-hc/ArchImage/main/apps/obs-junest.sh
chmod a+x ./obs-junest.sh
./obs-junest.sh

The issue here is to setup a dinamic /home ito the package.

Due to bwrap errors that is unable to mkdir because the file system is read-only, the AppImage cannot be portable.

You can test this issue by uncommenting the line 51 (and optionally 52) of this script.

You will see that whatever is the place and the user, you will be unable to run the app.

Any solution to prevent these checks?

Do you know any system variable I can use to redirect the wrappers out of the Appimage?

fsquillace commented 1 year ago

Hey @ivan-hc ,

I am not familiar with AppImages but have you tried to mount the home directory belonging to junest from another (configurable) place? bwrap allows you to do that using the --bind* options (see man here).

You may not need to remove the home directory here but simply mounting another directory on top of it when running a junest session.

Hope that helps!

Filippo

ivan-hc commented 1 year ago

Hi @fsquillace , I've tried to use junest -b "--bind /home $HOME and also --bind /etc $HOME/.cache because then some messagges are appeared about cannot remove /etc/something.conf, read only file system.

However the message is still bwrap: Can't mkdir parents for /home/ivan: Read-only file system

ivan-hc commented 1 year ago

Seems that Junest expects I have a /home/ivan directory into it. I've tried with /home, /home/user, /home/'$USER' (ie a directory named $USER) to bypass this check, but still no success.

ivan-hc commented 1 year ago

Also changed the script this way:

rm -R -f ./$APP.AppDir/.junest/home
mkdir -p ./$APP.AppDir/.junest/home

this is essential for portability.

ivan-hc commented 1 year ago

Just tried to change the AppRun this way:

echo "obs $@" | $HERE/.local/share/junest/bin/junest -n -b "--dev-bind /home $HOME --dev-bind /etc $HOME/.cache"

still no success, the message is always the same.

ivan-hc commented 1 year ago

I've solved with proot, thank you for this amazing project! I love JuNest!

https://github.com/ivan-hc/ArchImage/issues/1