Installing programs in a portable version

Hello.
I want to use clients for messaging (for example tox, jabber, etc…), the idea is to install these programs in a portable version, so that the correspondence history and the program itself are stored in a folder on a USB flash drive.

Now I’m reading about snap, flatpak, appimage and this can solve my problem, but I assume that this can be implemented differently, I want to consider all the options for solving my problem.

My question: By what means is it possible to implement a portable version of the program?

P.S. I will be pleased to hear your suggestions on this issue, thank you.

1 Like

I would use flatpak --user and symlinks.

1 Like

Do you want to be able to run these programs not only on your Qubes OS but on any other Linux OS as well without installing anything in these OS?

1 Like

Yes, this is exactly the goal I am pursuing.
Any ideas on how to implement this using another method?
I will be glad to any alternative options. Thank you.

1 Like

I can only think of using appimages for this.

2 Likes

Or binaries, firefox is distributed both as flatpak or as an archive with the executable inside (and supports self update)

1 Like

I don’t think its possible to run apps installed by flatpak if flatpak is not installed in OS.
But using archive with static binaries is a way as well.

1 Like

To describe the task in more detail:
There should be no traces of installed applications on the mother operating system (correspondence history, software launch logs, etc…).
The fact that flatpak will be installed on the mother operating system does not bother me, provided that there are no traces of installed programs and that all files of these programs will be stored on a USB flash drive.

If these requirements can be met using flatpak, would you recommend flatpak instead of appimage?

1 Like

Software installed using snap/flatpak/appimage/static binaries can leave the logs in system journal.
You’ll have to configure each app specifically so it won’t write anything in the logs.
Or configure OS to not save the logs on disk.
Or you can consider running your apps in docker container, then logs will stay in docker but container start/stop logs still can be written in system log so you’ll have to configure the docker logging as well so it won’t write logs.

1 Like

they could be started from a disposable

1 Like

As far as I understand, @qn00r3 wants to run these apps from USB disk both on Qubes OS and on some general Linux OS.

1 Like

I planned to run applications in different cubes only on the Qubes OS operating system.
With this option, will the application launch logs also remain in the cube?
Will only launching from a disposable solve the problem with logs?

1 Like

When you use appimage, profiles of the applications used are saved in: /home/user/.config
The entire correspondence history remains in the cube, the portable version makes no sense =(

1 Like

Yes.

Bitnd mount the app data directory to the directory on your USB disk before you run the app.

Something like this:
First start and stop the app in the qube so it’ll create a directory in ~/.config.
Copy the app config directory to your USB disk:

sudo mount /dev/sda1 /mnt
mkdir /mnt/.config
cp -pr /home/user/.config/YourAppName /mnt/.config

Then you can bind mount the directory from USB disk to your home directory and use the app:

sudo mount /dev/sda1 /mnt
sudo mount --bind /mnt/.config/YourAppName /home/user/.config/YourAppName

You can also bind mount your flatpak directory in home to the directory on your USB disk and install and use the app using flatpak.

2 Likes

Do I understand the situation correctly?
When mounting the home directory (/home/user/.config) to a USB disk, the home directory will remain unchanged, and the correspondence data will be written to the USB disk ?

If this is true, then what is the advantage of mounting over symbolic links (symlink) ?

P.S. The idea is very interesting, I will read the documentation and implement this method, thank you.

1 Like

Bind Mount are cool. I haven’t figured it out completely yet, but I really like what I see.
Flatpak user data is located in: ~/.var/app
Flatpak configuration is located in: ~/.local/share/flatpak
The system-wide configuration is located in: /var/lib/flatpak

And so if we install Flatpak in the Qube template, basically Qube binds the attachment of the above paths to /dev/sda1, we actually get a portable application.

All this comes to mind when I read the documentation, I have not implemented this yet, I will do it in the near future, I think there should be no problems.
Thank you very much for this bright thought!

1 Like

Yes.

If you want to symbolic link for /home/user/.config then you’ll need to move/remove the .config directory and create the link instead of it. With bind mount you can just mount another directory over existing one.

You can install the flatpak for user ( flatpak --user) in disposable template (AppVM) and not system-wide in template of disposable template (TemplateVM). That way you don’t need to care about files outside the user home directory.

1 Like