Trouble with firejail firefox downloads not persisting

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
BigAngry
Level 1
Level 1
Posts: 20
Joined: Thu May 11, 2017 6:10 pm

Trouble with firejail firefox downloads not persisting

Post by BigAngry »

I have firefox setup to run through firejail at launch. It runs fine and everything seems ok until I try to download something. As an example I was trying to download the latest mint torrent file. It downloads, and if I click to open the folder its in then the folder opens. However, that folder that opens does not contain the file itself.

Here's the way things are set up.

Boot HD contains home
Storage HD mount point contains Downloads folder. Downloads dir linked to home.

And this is the config file:

Code: Select all

# Firejail profile for Mozilla Firefox (Iceweasel in Debian)
noblacklist ${HOME}/.mozilla
include /etc/firejail/disable-mgmt.inc
include /etc/firejail/disable-secret.inc
include /etc/firejail/disable-common.inc
include /etc/firejail/disable-devel.inc
caps.drop all
seccomp
protocol unix,inet,inet6,netlink
netfilter
tracelog
noroot
whitelist ~/.mozilla
whitelist ~/.cache/mozilla/firefox
whitelist ~/.lastpass
whitelist ~/.config/gnome-mplayer
whitelist ~/.cache/gnome-mplayer/plugin
whitelist ${HOME}/Downloads*
I think theres something that I dont quite understand here. Does anyone know how to fix this?

User avatar
prestonR
Level 5
Level 5
Posts: 843
Joined: Wed Jan 07, 2015 12:24 pm
Location: Harare

Re: Trouble with firejail firefox downloads not persisting

Post by prestonR »

The only directory it can access is the Downloads folder inside home on your BootHD. You probably have to add something like:

Code: Select all

whitelist /dev/sdb/Downloads
where sdb is your StorageHD followed by the path to your target Downloads directory

BigAngry
Level 1
Level 1
Posts: 20
Joined: Thu May 11, 2017 6:10 pm

Re: Trouble with firejail firefox downloads not persisting

Post by BigAngry »

To resolve this I named my mount point and then used that name to reference the folder location (ie 'Potato', /Potato/Downloads) then I set my browser to also download to that location instead of referencing home. Seems to work perfectly now.

User avatar
phd21
Level 19
Level 19
Posts: 9552
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Trouble with firejail firefox downloads not persisting

Post by phd21 »

Hi "BigAngry",

That is one way to handle a Firejail sandboxed browser, but I do not think that changing "mount points" is necessarily a good thing to do for this, and certainly not for a new or inexperienced user. Perhaps you are using "mount points" to mean something else than what it usually means.

Another way is to just use your "Downloads" folder for storing the torrents information files and the actual file downloads, and change the torrent software client to look in those folders. For instance, you could create a "/Downloads/torrents/NewTorrents" folder for saving ".torrent" information files and a "/Downloads/torrents" folder for saving the actual downloaded files (like a "LinuxMint.iso" file) and use those.

In the Torrent software clients, you can just open the saved ".torrent" information file from the Torrent client software to start the download, some Torrent software clients, like Tixati can be set to automatically start downloads from torrents saved in a folder you set, like "/Downloads/torrents/NewTorrents", regardless whether the browser is "firejailed".

+1 And of course, you can also add a whitelist entry to Firejail for browsers and torrent software client profiles for torrent folders.

FYI-1: The Firejail sandboxing with browsers also affects other downloads, like Linux software installation files. Best to save the installation files into your "Downloads" folder, and run the installation from outside of the Firejailed browser, even if the browser automatically starts the installation file (like a ".deb" file), then close it, bring up your file manager, and browse to your downloaded file and double click it to install it.

FYI-2: When I am using a Firejailed browser, I cannot even upload screenshot pictures from my "Pictures" folder. So, I created a ScreenShots folder underneath my "/Downloads" folder for that too, "/Downloads/ScreenShots", and I save my screenshots into that folder.


Hope this helps ...

"Tixati" Torrent software client

Location Folder Settings for actual downloaded files from torrents
Image

Location Folder Settings for ".torrent" files
Image

"Ktorrent" Torrent software client
Location Folder Settings
Image


Opera browser with Firejail - saving a Linux Mint .torrent information file
Image


Example of simply opening a ".torrent" file from within a torrent software client (Ktorrent) to download the file, in this case a Linux Mint .iso file.
Image
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, 256gb SDD, only Intel 4 Graphics. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

Post Reply

Return to “Newbie Questions”