[GH-ISSUE #3663] Unable to whitelist steamapps when using --private #2305

Closed
opened 2026-05-05 08:59:44 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @S0PEX on GitHub (Oct 11, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3663

Bug and expected behavior
When using --whitelist the jail should have access to the whitelisted folder.

No profile and disabling firejail
I tried it with --noprofile and without

Reproduce
Steps to reproduce the behavior:

  1. Run in bash firejail --noprofile --private --whitelist=/home/artur/.local/share/Steam/steamapps/
  2. When launching a game the game has to be redownloaded as the jail has no access to the steamapps folder

Environment

  • Arch Linux Linux 5.8.13-arch1-1 #1 SMP PREEMPT Thu, 01 Oct 2020 20:40:35 +0000 x86_64 GNU/Linux
  • firejail version 0.9.62.4

Additional context
I am trying to launch two steam game instances to trade my items to my other account.
When I run firejail steam the steam instance start and I can run the game. To open a second instance I run firejail --noprofile --private --whitelist=/home/artur/.local/share/Steam/steamapps/, but this instance couldn't access the steamapps folder.
Then I tried to create a folder and create a symbolic link to the steamapps folder
/home/artur/jails/1/.local/share/Steam/steamapps -> /home/artur/.local/share/Steam/steamapps/ and provided firejail with the private firejail --noprofile --private=/home/artur/jails/1 --whitelist=/home/artur/.local/share/Steam/steamapps/ without any luck.
I then ended up using mount-bind and mount the steamapps directory inside /home/artur/jails/1/.local/share/Steam/steamapps which then worked.

So I was wondering if there is a better way without mount-bind.

Regards Artur

Originally created by @S0PEX on GitHub (Oct 11, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3663 **Bug and expected behavior** When using --whitelist the jail should have access to the whitelisted folder. **No profile and disabling firejail** I tried it with --noprofile and without **Reproduce** Steps to reproduce the behavior: 1. Run in bash `firejail --noprofile --private --whitelist=/home/artur/.local/share/Steam/steamapps/` 2. When launching a game the game has to be redownloaded as the jail has no access to the steamapps folder **Environment** - Arch Linux Linux 5.8.13-arch1-1 #1 SMP PREEMPT Thu, 01 Oct 2020 20:40:35 +0000 x86_64 GNU/Linux - firejail version 0.9.62.4 **Additional context** I am trying to launch two steam game instances to trade my items to my other account. When I run `firejail steam` the steam instance start and I can run the game. To open a second instance I run `firejail --noprofile --private --whitelist=/home/artur/.local/share/Steam/steamapps/`, but this instance couldn't access the steamapps folder. Then I tried to create a folder and create a symbolic link to the steamapps folder `/home/artur/jails/1/.local/share/Steam/steamapps -> /home/artur/.local/share/Steam/steamapps/` and provided firejail with the private `firejail --noprofile --private=/home/artur/jails/1 --whitelist=/home/artur/.local/share/Steam/steamapps/` without any luck. I then ended up using `mount-bind` and mount the steamapps directory inside `/home/artur/jails/1/.local/share/Steam/steamapps` which then worked. **So I was wondering if there is a better way without `mount-bind`.** Regards Artur
Author
Owner

@rusty-snake commented on GitHub (Oct 11, 2020):

First, this is expected behaviour. --private make a new, empty, temporary private $HOME.

So I was wondering if there is a better way without mount-bind.

IDK what exactly you want to reach, but here are two ways:

  1. firejail --private=/home/user/foobar … makes everything persistent under /home/user/foobar/.local/share/Steam/steamapps (which is inside the sandbox /home/user/.local/share/Steam/steamapps )
  2. firejail --whitelist=$HOME/home/artur/.local/share/Steam/steamapps … makes only $HOME/home/artur/.local/share/Steam/steamapps appear in the sandbox.
<!-- gh-comment-id:706707123 --> @rusty-snake commented on GitHub (Oct 11, 2020): First, this is expected behaviour. `--private` make a new, empty, temporary private $HOME. > So I was wondering if there is a better way without mount-bind. IDK what exactly you want to reach, but here are two ways: 1. `firejail --private=/home/user/foobar …` makes everything persistent under `/home/user/foobar/.local/share/Steam/steamapps` (which is inside the sandbox `/home/user/.local/share/Steam/steamapps` ) 2. `firejail --whitelist=$HOME/home/artur/.local/share/Steam/steamapps …` makes only `$HOME/home/artur/.local/share/Steam/steamapps` appear in the sandbox.
Author
Owner

@S0PEX commented on GitHub (Oct 11, 2020):

I just want to run steam with the access to my local steam games library which is located under home/artur/.local/share/Steam/steamapps/. The only option that I found was working was to manually mount-bind that directory in my --private /home/artur/jails/1/. It would be nice if firejail could directly access /home/artur/.local/share/Steam/steamapps/ without any restrictions.

<!-- gh-comment-id:706762861 --> @S0PEX commented on GitHub (Oct 11, 2020): I just want to run steam with the access to my local steam games library which is located under `home/artur/.local/share/Steam/steamapps/`. The only option that I found was working was to manually `mount-bind` that directory in my `--private /home/artur/jails/1/`. It would be nice if firejail could directly access `/home/artur/.local/share/Steam/steamapps/ ` without any restrictions.
Author
Owner

@reinerh commented on GitHub (Oct 11, 2020):

That should work by default. What is your intention with running firejail with --private? This creates a temporary home directory as @rusty-snake already mentioned.

What's the behavior/error when you just run firejail steam?

Edit: sorry, I missed it in the original post. you want to run a second steam instance, but use the same steam directory.
I'm not sure if steam supports that, it's probably tracking its state etc. in there as well.

<!-- gh-comment-id:706767601 --> @reinerh commented on GitHub (Oct 11, 2020): That should work by default. What is your intention with running firejail with `--private`? This creates a temporary home directory as @rusty-snake already mentioned. What's the behavior/error when you just run `firejail steam`? Edit: sorry, I missed it in the original post. you want to run a second steam instance, but use the same steam directory. I'm not sure if steam supports that, it's probably tracking its state etc. in there as well.
Author
Owner

@S0PEX commented on GitHub (Oct 13, 2020):

Well I though running jail with --private=/home/artur/jails/1/ persists all data to the given folder. Also steam works without any issues when bind-mounting the steamapps folder into /home/artur/jails/1/.local/share/Steam/steamapps. Because otherwise the folder /home/artur/.local/share/Steam/steamapps isn't visible to the jailed steam.

<!-- gh-comment-id:707643897 --> @S0PEX commented on GitHub (Oct 13, 2020): Well I though running jail with `--private=/home/artur/jails/1/` persists all data to the given folder. Also steam works without any issues when bind-mounting the steamapps folder into `/home/artur/jails/1/.local/share/Steam/steamapps`. Because otherwise the folder `/home/artur/.local/share/Steam/steamapps ` isn't visible to the jailed steam.
Author
Owner

@rusty-snake commented on GitHub (Nov 9, 2020):

Nope, I know no better way then manually bind-mounting.

<!-- gh-comment-id:724230005 --> @rusty-snake commented on GitHub (Nov 9, 2020): Nope, I know no better way then manually bind-mounting.
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#2305
No description provided.