Error 127 trying to run AppImage in container (Solved)

Moderator: BarryK

Post Reply
damiano
Posts: 4
Joined: Sat Mar 04, 2023 4:27 pm
Has thanked: 1 time

Error 127 trying to run AppImage in container (Solved)

Post by damiano »

Hello
I tried to create a container for an AppImage (VSCodium).

I downloaded the appimage and created the following file in /usr/bin with:

Code: Select all

#!/bin/bash
/files/portable/VSCodium-1.76.0.23062.glibc2.17-x86_64.AppImage --no-sandbox

This worked to run codium. I then made a codium.desktop file (since I noticed Easy Containers only saw programs with a desktop file). Codium shows up in Easy Containers but the container will not run when created.

When I ran it in a terminal it gave error code 127. Does that mean that it didn't find the file?

I tried to move the AppImage to the shared folder and I tried to extract it with --appimage-extract (and fixed the file in /usr/bin and recreated the containers each time), but I still got the same error.

Could someone please tell me what I am doing wrong or point me to the correct direction?

And if BarryK ever sees this: thank you for creating EasyOS and Puppy Linux. They are just great operating systems!

williwaw
Posts: 1595
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 291 times

Re: Container for AppImage

Post by williwaw »

Hi damiano,
I think the scripted container creation process also makes a proper .desktop file.
It would help to post the contents of the desktop file you are currently trying to run with.

damiano
Posts: 4
Joined: Sat Mar 04, 2023 4:27 pm
Has thanked: 1 time

Re: Container for AppImage

Post by damiano »

williwaw wrote: Sat Mar 04, 2023 8:06 pm

Hi damiano,
I think the scripted container creation process also makes a proper .desktop file.
It would help to post the contents of the desktop file you are currently trying to run with.

Yeah sorry for the confusion, I meant that for something to show in easy-containers it needs a .desktop file too (since the drop-down menu is populated by the following command):

Code: Select all

APPSLIST1="$(cat /usr/share/applications/*.desktop | grep -v '^NoDisplay=true' | grep '^Exec=' | cut -f 2- -d '=' | sed -e 's%^HOME=/files %%' | cut -f 1 -d ' ' | grep -v -E '/| ')"

But! I got it working!

The steps are:
1) manually add a .desktop file to /usr/share/applications named codium.desktop (you can use another desktop file as template)
2) make sure that the Exec line reads Exec=codium (this will be the name in the drop-down menu in easy-containers and will be the name of the container)
3) cd into the container's session files, which are found in (something equivalent to) /mnt/sda2/easyos/containers/codium/.session/usr/bin
4) create the folder codium-1.76 and move the AppImage there
5) run the AppImage with --appimage-extract to create and populate the squashfs-root folder in the codium-1.76 folder
6) create the following file (named codium):

Code: Select all

#!/bin/bash
/usr/bin/codium-1.76/squashfs-root/AppRun --no-sandbox

7) make codium executable by chmod +x codium

It works great! I was also able to install julia inside that folder to make it available to VSCode inside the container! :-)

I would love for easy-containers to have a "manual" tab where you specify the name of the container and the AppImage-file (or a binary) and it automatically creates the necessary stuff. How does the development of EasyOS work? I think I could contribute to create something like this.

damiano
Posts: 4
Joined: Sat Mar 04, 2023 4:27 pm
Has thanked: 1 time

Re: Container for AppImage

Post by damiano »

Oh, and the icon for the program is found in the squasfs-root folder after extraction if you want to change it :-)

williwaw
Posts: 1595
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 291 times

Re: Container for AppImage

Post by williwaw »

looking at /usr/share/applications/ec-www..desktop (as an example for chromium), I see on line 11, Exec=ec-chroot-www

it would be interesting to see if your method has the same capabilities as an install using /usr/local/easy_containers/ec-chroot

damiano
Posts: 4
Joined: Sat Mar 04, 2023 4:27 pm
Has thanked: 1 time

Re: Container for AppImage

Post by damiano »

williwaw wrote: Sun Mar 05, 2023 7:03 pm

looking at /usr/share/applications/ec-www..desktop (as an example for chromium), I see on line 11, Exec=ec-chroot-www

it would be interesting to see if your method has the same capabilities as an install using /usr/local/easy_containers/ec-chroot

Sorry for the confusion, the program in the container is executed by ec-chroot. There are two .desktop files: one that was created manually so that easy-containers viewed it as an installed application (named codium.desktop), and another that was created by easy-containers (named ec-codium.desktop). It's the same for all the other containerized programs too, for example ec-www.desktop has the line Exec=ec-chroot-www, but ec-chroot-www runs empty -f ec-chroot www chromium, where empty seems to be a command running a "pseudo terminal session", so it basically just runs ec-chroot www chromium, which means there are multuple .desktop files for chromium too, one regular and one containerized.

The content of codium.desktop is:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=VSCodium
Comment=Code Editing. Redefined.
Exec=codium
Icon=vscodium.png
Type=Application
Categories=TextEditor

And the content of ec-codium.desktop:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=VSCodium
Comment=Code Editing. Redefined.
Exec=ec-chroot codium
Icon=container48.png
Type=Application
Categories=TextEditor

When I ran the command ec-chroot codium in a terminal after the container was created (but before the manual installation was made inside of it) the container shut down and displayed the error: Child failed with code '127', which for bash scripts means "command not found", that's why I thought of installing it inside the container.

Post Reply

Return to “EasyOS”