I understand firejail does a lot more but FYI, you can do this simply by typing `HOME=/path/to/folder <app>` in your shell.
Or do this in a wrapper script, for example:
#!/bin/sh
export HOME=/path/to/dir
firefoxWould you (or anyone else) happen to know if there's any risks for an unknowledgable user like me to do that, e.g. of breaking my system without knowing how to repair it?
In my workflow, I keep things mostly manual and configure each app I want to sandbox explicitly by creating a shortcut (usually I create a "launcher" in /usr/local/bin so that it takes priority over whatever is in /usr/bin). Here is the one I have for Firefox as an example in "/usr/local/bin/firefox":
firejail --profile=/etc/firejail/firefox.profile --private=~/.sandboxes/firefox/ /usr/bin/firefox --no-remote $@
In terms of risks, are you mostly concerned about security risks? Or breakage?
Your approach sounds viable though, so I might look into setting something similar up for myself as well. Thanks for sharing.
- The "virtual home" specified with --private=/path/to/folder runs the app with the specified folder as a home folder. I use this for all the apps I sandbox to make sure my real home does not get polluted by tens of config files, cache, etc. Removing all traces of an app is now as easy as deleting /path/to/folder; I find this pretty neat to keep my home folder organized (each app gets its own home in ~/.sandboxes/<app name>).
- Starting an app with --private (without any argument) will run it into a temporary/disposable home folder which will be cleaned up when the app is stopped. I use it to run some apps I don't really trust and don't need persistence for (e.g. I start Chrome with this option so that I get a fresh home, hence profile, every time I need it, same for Zoom when I need to join a meeting---not very often).
And of course all the profiles that are built-in to customize the sandboxing to most popular apps is great!
I'm really thankful for the work being done on this project.