1

I have been using firejail for sandboxing my application in Ubuntu. It has a --private option. I was using

firejail --private=/home/user/Desktop firefox

When I try to download a file from Firefox it stores it in a directory called Download inside firejail. Is it possible to get it to store in /home/user/Desktop?

0

1 Answer 1

2

Firejail manpage says:

--private Mount new /root and /home/user directories in temporary filesystems. All modifications are discarded when the sandbox is closed.

  Example:
  $ firejail --private firefox

--private=directory Use directory as user home.

  Example:
  $ firejail --private=/home/netblue/firefox-home firefox

So this means that Firefox will see /home/user/Desktop as /home/user/, and you should be able to store downloaded files in /home/user/Desktop without doing anything else (assuming default profile). I have tested it with firejail 0.9.58.2 with the default profile plus the --private=/home/user/Desktop flag on Debian 10.

If Firefox is automatically saving it to the newly created Downloads folder when run with the --private=dir flag, then you should just disable the auto saving feature of downloaded files in Firefox: Preferences -> General -> Files and Applications -> Always ask where to save files. When you do that, and when firefox asks for where to download, the folder that you see as user (home dir) in firefox is actually /home/user/Desktop.

Edit: It is normal that the Firefox settings get reset every time you start in --private=dir, because to Firefox this is your home folder and it looks for the config files .mozilla. If it cannot find it, it will create one for you, with the default settings. Invoke firefox normally with /usr/bin/firefox, then change the download setting I mentioned. After that copy ~/.mozilla directory to /home/user/Desktop and finally you can run firefox with the --private=/home/user/Desktop option.

2
  • Yes i did disable the auto save feature but somehow the settings that i change keeps on reverting back after i close the sandbox..actually i maybe not be able to convey it that we'll in the question..it stores in /home/user/Desktop/Downloads on using the above filter..If i change the filter to /home/user/Documents it will store in /home/user/Documents/Downloads Commented Jan 14, 2020 at 3:10
  • @network I have edited my answer. Try it and let us know. Commented Jan 14, 2020 at 10:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.