[GH-ISSUE #2085] Virtual environements #1408

Closed
opened 2026-05-05 08:04:25 -06:00 by gitea-mirror · 17 comments
Owner

Originally created by @Raj2032 on GitHub (Aug 17, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2085

Is it possile to configure Firejail to have access to files in a virtual environment so any changes it does, it doesn't affect the actual files but the changed files are stored in a virtual environment?

Originally created by @Raj2032 on GitHub (Aug 17, 2018). Original GitHub issue: https://github.com/netblue30/firejail/issues/2085 Is it possile to configure Firejail to have access to files in a virtual environment so any changes it does, it doesn't affect the actual files but the changed files are stored in a virtual environment?
gitea-mirror 2026-05-05 08:04:25 -06:00
Author
Owner

@ghost commented on GitHub (Aug 17, 2018):

How would you handle the changes in the original environment?

<!-- gh-comment-id:413847885 --> @ghost commented on GitHub (Aug 17, 2018): How would you handle the changes in the original environment?
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 17, 2018):

One way you can do this is use --private-home (or --private or whatever) and manually copy over files if you want to keep changes. If you don't want the files to be changed, --private and associated options should be enough.

<!-- gh-comment-id:413871851 --> @chiraag-nataraj commented on GitHub (Aug 17, 2018): One way you can do this is use `--private-home` (or `--private` or whatever) and manually copy over files if you want to keep changes. If you don't want the files to be changed, `--private` and associated options should be enough.
Author
Owner

@Raj2032 commented on GitHub (Aug 19, 2018):

Hi @chiraag-nataraj, if I do this --private-home, would the changed files be retained in the virtual environment or would they be deleted after program termination?

<!-- gh-comment-id:414105939 --> @Raj2032 commented on GitHub (Aug 19, 2018): Hi @chiraag-nataraj, if I do this `--private-home`, would the changed files be retained in the virtual environment or would they be deleted after program termination?
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 19, 2018):

From the man-page:

Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. All modifications are discarded when the sandbox is closed.

The modified files are deleted upon termination.

<!-- gh-comment-id:414123577 --> @chiraag-nataraj commented on GitHub (Aug 19, 2018): From the man-page: > Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. All modifications are discarded when the sandbox is closed. The modified files are deleted upon termination.
Author
Owner

@Raj2032 commented on GitHub (Aug 19, 2018):

Is it possile to some how keep the files in the virtual environment
retained without firejail having to delete these files automatically?

On Sun, Aug 19, 2018 at 10:10 PM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

From the man-page:

Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. All modifications are discarded when the sandbox is closed.

The modified files are deleted upon termination.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#issuecomment-414123577,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab79BpsQUsy_UhN_6dYp9GOQfRfWySEMks5uSVW-gaJpZM4WBN5Z
.

<!-- gh-comment-id:414130182 --> @Raj2032 commented on GitHub (Aug 19, 2018): Is it possile to some how keep the files in the virtual environment retained without firejail having to delete these files automatically? On Sun, Aug 19, 2018 at 10:10 PM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> wrote: > From the man-page: > > Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. All modifications are discarded when the sandbox is closed. > > The modified files are deleted upon termination. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netblue30/firejail/issues/2085#issuecomment-414123577>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/Ab79BpsQUsy_UhN_6dYp9GOQfRfWySEMks5uSVW-gaJpZM4WBN5Z> > . >
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 19, 2018):

Not presently, no. But what exactly are you trying to do? Maybe we can help with the actual usecase.

<!-- gh-comment-id:414132944 --> @chiraag-nataraj commented on GitHub (Aug 19, 2018): Not presently, no. But what exactly are you trying to do? Maybe we can help with the actual usecase.
Author
Owner

@Vincent43 commented on GitHub (Aug 19, 2018):

I think you are looking for --overlay-named option. It will store your changes persistently in $HOME/.firejail/<NAME>, see man firejail for details:

firejail --overlay-named=<NAME> firefox

<!-- gh-comment-id:414136754 --> @Vincent43 commented on GitHub (Aug 19, 2018): I think you are looking for `--overlay-named` option. It will store your changes persistently in `$HOME/.firejail/<NAME>`, see `man firejail` for details: `firejail --overlay-named=<NAME> firefox`
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 19, 2018):

@Vincent43 Oops. Completely forgot about overlay options 😂

<!-- gh-comment-id:414136851 --> @chiraag-nataraj commented on GitHub (Aug 19, 2018): @Vincent43 Oops. Completely forgot about `overlay` options :joy:
Author
Owner

@Raj2032 commented on GitHub (Aug 20, 2018):

Oh I see thanks guys, I will give this a shot =D

On Mon, Aug 20, 2018 at 1:54 AM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

@Vincent43 https://github.com/Vincent43 Oops. Completely forgot about
overlay options 😂


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#issuecomment-414136851,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab79BlYdcpc1cfH7BhIKy5uGJXcW1F6kks5uSYoogaJpZM4WBN5Z
.

<!-- gh-comment-id:414172764 --> @Raj2032 commented on GitHub (Aug 20, 2018): Oh I see thanks guys, I will give this a shot =D On Mon, Aug 20, 2018 at 1:54 AM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> wrote: > @Vincent43 <https://github.com/Vincent43> Oops. Completely forgot about > overlay options 😂 > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netblue30/firejail/issues/2085#issuecomment-414136851>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/Ab79BlYdcpc1cfH7BhIKy5uGJXcW1F6kks5uSYoogaJpZM4WBN5Z> > . >
Author
Owner

@Raj2032 commented on GitHub (Aug 20, 2018):

One last question guys, is it possible to install applications on a virtual
environment as well?

On Mon, Aug 20, 2018 at 11:20 AM Joe Smith justman111111@gmail.com wrote:

Oh I see thanks guys, I will give this a shot =D

On Mon, Aug 20, 2018 at 1:54 AM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

@Vincent43 https://github.com/Vincent43 Oops. Completely forgot about
overlay options 😂


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#issuecomment-414136851,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab79BlYdcpc1cfH7BhIKy5uGJXcW1F6kks5uSYoogaJpZM4WBN5Z
.

<!-- gh-comment-id:414288243 --> @Raj2032 commented on GitHub (Aug 20, 2018): One last question guys, is it possible to install applications on a virtual environment as well? On Mon, Aug 20, 2018 at 11:20 AM Joe Smith <justman111111@gmail.com> wrote: > Oh I see thanks guys, I will give this a shot =D > > On Mon, Aug 20, 2018 at 1:54 AM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> > wrote: > >> @Vincent43 <https://github.com/Vincent43> Oops. Completely forgot about >> overlay options 😂 >> >> — >> You are receiving this because you authored the thread. >> Reply to this email directly, view it on GitHub >> <https://github.com/netblue30/firejail/issues/2085#issuecomment-414136851>, >> or mute the thread >> <https://github.com/notifications/unsubscribe-auth/Ab79BlYdcpc1cfH7BhIKy5uGJXcW1F6kks5uSYoogaJpZM4WBN5Z> >> . >> >
Author
Owner

@Vincent43 commented on GitHub (Aug 20, 2018):

No, but there is AppImage integration. You may also look at flatpak/snap.

<!-- gh-comment-id:414308404 --> @Vincent43 commented on GitHub (Aug 20, 2018): No, but there is [AppImage](https://appimage.org/) integration. You may also look at [flatpak](https://flatpak.org/)/[snap](https://snapcraft.io/).
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 20, 2018):

One last question guys, is it possible to install applications on a virtual environment as well?

I guess I'm somewhat confused as to what level of integration you want with the rest of the system.

If you want an isolated environment, what you're really looking for is a "container" solution (e.g. Docker, LXC, etc) or a "virtual machine" (e.g. QEMU, VirtualBox, etc). If you want to restrict what programs can do within your already existing system, that's where "sandboxes" come in (e.g. firejail, AppArmor, SELinux).

Your initial question made sense within the context of sandboxing, since it's basically ensuring that you always have a known "good" base (that is, if something happens, you can wipe the overlay and start over). But your second question seems to imply that you almost want this virtual environment to function like a full system, in which case you're probably better off with a container solution.

<!-- gh-comment-id:414315777 --> @chiraag-nataraj commented on GitHub (Aug 20, 2018): > One last question guys, is it possible to install applications on a virtual environment as well? I guess I'm somewhat confused as to what level of integration you want with the rest of the system. If you want an _isolated_ environment, what you're really looking for is a "container" solution (e.g. [Docker](https://www.docker.com/), [LXC](https://linuxcontainers.org/), etc) or a "virtual machine" (e.g. [QEMU](https://www.qemu.org), [VirtualBox](https://virtualbox.org), etc). If you want to restrict what programs can do within your _already existing system_, that's where "sandboxes" come in (e.g. firejail, AppArmor, SELinux). Your initial question made sense within the context of sandboxing, since it's basically ensuring that you always have a known "good" base (that is, if something happens, you can wipe the overlay and start over). But your second question seems to imply that you almost want this virtual environment to function like a full system, in which case you're probably better off with a container solution.
Author
Owner

@Raj2032 commented on GitHub (Aug 21, 2018):

Oh I see,

So what is the best Linux container and which one you recommend me?

And also is it possible to encrypt a Linux container using something like
Veracrypt?

On Mon, Aug 20, 2018 at 11:26 PM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

One last question guys, is it possible to install applications on a
virtual environment as well?

I guess I'm somewhat confused as to what level of integration you want
with the rest of the system.

If you want an isolated environment, what you're really looking for is
a "container" solution (e.g. Docker https://www.docker.com/, LXC
https://linuxcontainers.org/, etc) or a "virtual machine" (e.g. QEMU
https://www.qemu.org, VirtualBox https://virtualbox.org, etc). If you
want to restrict what programs can do within your already existing
system
, that's where "sandboxes" come in (e.g. firejail, AppArmor,
SELinux).

Your initial question made sense within the context of sandboxing, since
it's basically ensuring that you always have a known "good" base (that is,
if something happens, you can wipe the overlay and start over). But your
second question seems to imply that you almost want this virtual
environment to function like a full system, in which case you're probably
better off with a container solution.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#issuecomment-414315777,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab79BoUchn_U6T5KuumW-Mh-qXciP-U7ks5uSrkHgaJpZM4WBN5Z
.

<!-- gh-comment-id:414575546 --> @Raj2032 commented on GitHub (Aug 21, 2018): Oh I see, So what is the best Linux container and which one you recommend me? And also is it possible to encrypt a Linux container using something like Veracrypt? On Mon, Aug 20, 2018 at 11:26 PM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> wrote: > One last question guys, is it possible to install applications on a > virtual environment as well? > > I guess I'm somewhat confused as to what level of integration you want > with the rest of the system. > > If you want an *isolated* environment, what you're really looking for is > a "container" solution (e.g. Docker <https://www.docker.com/>, LXC > <https://linuxcontainers.org/>, etc) or a "virtual machine" (e.g. QEMU > <https://www.qemu.org>, VirtualBox <https://virtualbox.org>, etc). If you > want to restrict what programs can do within your *already existing > system*, that's where "sandboxes" come in (e.g. firejail, AppArmor, > SELinux). > > Your initial question made sense within the context of sandboxing, since > it's basically ensuring that you always have a known "good" base (that is, > if something happens, you can wipe the overlay and start over). But your > second question seems to imply that you almost want this virtual > environment to function like a full system, in which case you're probably > better off with a container solution. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netblue30/firejail/issues/2085#issuecomment-414315777>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/Ab79BoUchn_U6T5KuumW-Mh-qXciP-U7ks5uSrkHgaJpZM4WBN5Z> > . >
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 21, 2018):

@Raj2032 Sorry, this is the wrong forum for that. I haven't really done much with containers and you're better off doing your own research. As with all other software, "best" really depends on what you want to accomplish.

As for encryption, I don't know, but I don't see why it would be out of the question. Worst case, just use encfs to create an encrypted mount and setup the container within that (the docs for encfs are pretty good).

I'm going to go ahead and close this issue now, since we're way off the original topic.

<!-- gh-comment-id:414587393 --> @chiraag-nataraj commented on GitHub (Aug 21, 2018): @Raj2032 Sorry, this is the wrong forum for that. I haven't really done much with containers and you're better off doing your own research. As with all other software, "best" really depends on what you want to accomplish. As for encryption, I don't know, but I don't see why it would be out of the question. Worst case, just use [encfs](https://vgough.github.io/encfs/) to create an encrypted mount and setup the container within that (the docs for encfs are pretty good). I'm going to go ahead and close this issue now, since we're _way_ off the original topic.
Author
Owner

@Raj2032 commented on GitHub (Aug 21, 2018):

Thanks for your help.

On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

Closed #2085 https://github.com/netblue30/firejail/issues/2085.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#event-1799494768, or mute
the thread
https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z
.

<!-- gh-comment-id:414595239 --> @Raj2032 commented on GitHub (Aug 21, 2018): Thanks for your help. On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> wrote: > Closed #2085 <https://github.com/netblue30/firejail/issues/2085>. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/netblue30/firejail/issues/2085#event-1799494768>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z> > . >
Author
Owner

@Raj2032 commented on GitHub (Aug 21, 2018):

Sorry again to distrube you I just really want to get a really good setup,
something that will work for me. On EncFS, it is not clear, is it a linux
container or not?

On Tue, Aug 21, 2018 at 6:31 PM Joe Smith justman111111@gmail.com wrote:

Thanks for your help.

On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

Closed #2085 https://github.com/netblue30/firejail/issues/2085.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#event-1799494768, or mute
the thread
https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z
.

<!-- gh-comment-id:414595624 --> @Raj2032 commented on GitHub (Aug 21, 2018): Sorry again to distrube you I just really want to get a really good setup, something that will work for me. On EncFS, it is not clear, is it a linux container or not? On Tue, Aug 21, 2018 at 6:31 PM Joe Smith <justman111111@gmail.com> wrote: > Thanks for your help. > > On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> > wrote: > >> Closed #2085 <https://github.com/netblue30/firejail/issues/2085>. >> >> — >> You are receiving this because you were mentioned. >> Reply to this email directly, view it on GitHub >> <https://github.com/netblue30/firejail/issues/2085#event-1799494768>, or mute >> the thread >> <https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z> >> . >> >
Author
Owner

@Raj2032 commented on GitHub (Aug 21, 2018):

Oh sorry yeah it is a Linux container thanks then.

On Tue, Aug 21, 2018 at 6:32 PM Joe Smith justman111111@gmail.com wrote:

Sorry again to distrube you I just really want to get a really good setup,
something that will work for me. On EncFS, it is not clear, is it a linux
container or not?

On Tue, Aug 21, 2018 at 6:31 PM Joe Smith justman111111@gmail.com wrote:

Thanks for your help.

On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ notifications@github.com
wrote:

Closed #2085 https://github.com/netblue30/firejail/issues/2085.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/netblue30/firejail/issues/2085#event-1799494768,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z
.

<!-- gh-comment-id:414596034 --> @Raj2032 commented on GitHub (Aug 21, 2018): Oh sorry yeah it is a Linux container thanks then. On Tue, Aug 21, 2018 at 6:32 PM Joe Smith <justman111111@gmail.com> wrote: > Sorry again to distrube you I just really want to get a really good setup, > something that will work for me. On EncFS, it is not clear, is it a linux > container or not? > > On Tue, Aug 21, 2018 at 6:31 PM Joe Smith <justman111111@gmail.com> wrote: > >> Thanks for your help. >> >> On Tue, Aug 21, 2018 at 6:04 PM ಚಿರಾಗ್ ನಟರಾಜ್ <notifications@github.com> >> wrote: >> >>> Closed #2085 <https://github.com/netblue30/firejail/issues/2085>. >>> >>> — >>> You are receiving this because you were mentioned. >>> Reply to this email directly, view it on GitHub >>> <https://github.com/netblue30/firejail/issues/2085#event-1799494768>, >>> or mute the thread >>> <https://github.com/notifications/unsubscribe-auth/Ab79BvWxDkns_GpbF7j6e2BPTAlAQZeJks5uS78IgaJpZM4WBN5Z> >>> . >>> >>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1408
No description provided.