This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to 'Restore Previous Session' without losing sandboxing?

Tags: None
(comma "," separated)
rcameron
Registered Member
Posts
105
Karma
0
OS
I am having a problem with Firefox not resuming in a new session as sandboxed, when it had that status as the session was saved

In Session Management - System Settings -> Restore manually saved session, I'd like to know how to make Firefox restart under the control of Firejail. Firejail is in the LinuxMint repo, and probably in others, as well.

Before troubleshooting, set KDE Session Manager to "Restore manually saved session".

How to reproduce the problem:
    Start synaptic
    Install firejail
    Install firetools
    Open firetools, double-click on Firefox icon
    Firefox loads and runs
    Right-click on firetools window, select Tools
    Window opens, "Firejail Tools and Stats"
    In Sandbox List, note firefox is running in firejail

In Kickoff Application Manager, select Leave -> Save session
    Log off/reboot to terminate session. KDE then restores session.
    Firefox loads and runs, however it is now running outside of the sandbox.
I want to make Firefox resume inside the sandbox. To make it easier, I wouldn't mind to always resume inside the sandbox, regardless of its status when the session was saved.

I've tried placing a symlink into /usr/local/bin as described here, but then there were problems with Firefox finding its Profile.

??? Could someone please let me know how it's possible to make, or force, Firefox to always restart in the Firejail sandbox?

Firejail v0.9.30-1


System information:
Linux Mint 17.3 | KDE Platform Version 4.14.2, and
Linux Mint 18.0 | KDE Platform Version 5.28.0
luebking
Karma
0
The clients are required to tell the SM the command to use to restart them.
It seems firejail is a wrapper to call the firefox binary, but firefox (the actual process) doesn't know that and simply asks to restart firefox.

You could edit ~/.config/ksmserverrc to alter the restart command for firefox after saving the session.
If the path isn't absolute (ie, "firefox", not "/usr/bin/firefox") you could try to shadow the binary by something higher up in $PATH (often /usr/local/bin or ~/bin) with a bash script

Code: Select all
#!/bin/sh
/usr/bin/firejail /usr/bin/firefox


ensure to make it executable
Code: Select all
cmod +x /usr/local/bin/firefox
rcameron
Registered Member
Posts
105
Karma
0
OS
I have created the script and made it executable.

Now, when I run Firefox from the program launcher menu (Kickoff) I get this error message -- and then, the program's execution aborts:
Code: Select all
Profile Missing
[!] Your Firefox profile cannot be loaded. It may be missing or inaccessible.
The same thing happens when I start it by executing the script.
When I click on the Firefox icon, in Firejail Tools, the browser runs normally, after showing a box asking that it be "made the default browser".

??? Can anyone duplicate this problem of Firefox losing its profile when started in this manner, and what's the most likely cure?


System information:
Linux Mint 17.3 | KDE Platform Version 4.14.2, and
Linux Mint 18.0 | KDE Platform Version 5.28.0
rcameron
Registered Member
Posts
105
Karma
0
OS
:( Second problem:
After (what I thought was) an aborted launch when using the script -- the one with the path pre-pended to 'firejail' and 'firefox' -- and then looking at the Firejail Tools and Stats window , I see this:
Code: Select all
Sandbox List
PID    CPU(%)   Memory(KiB)      RX(KB/s)      TX(KB/s)        Command
10868  0.00        96028             0.00          0.00       /usr/bin/firejail /usr/bin/firefox
10975  5.20        548480            0.00          0.00       firejail firefox

Firefox appears to be running in duplicate, but still there's only one entry on the Task Bar.

??? Is anyone able to duplicate this behavior, seen when starting Firefox with the script, and any idea what to do about it?


System information:
Linux Mint 17.3 | KDE Platform Version 4.14.2, and
Linux Mint 18.0 | KDE Platform Version 5.28.0


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]