Evince Document Viewer - Failed to execute child process "nemo" (Permission denied)

I've recently migrated from nautilus to Nemo. I've been reading a PDF and selected File > Open Containing folder option.

This message appeared:

Failed to execute child process "nemo" (Permission denied)

Why did this happen?
What can I do?


Solution 1:

Rather than turn off protection completely, you can add a line for every admissible tool to the block /usr/bin/evince { ... } in

/etc/apparmor.d/usr.bin.evince

Lines should have the form

/path/to/binary ixr,

Then restart AppArmor:

sudo service apparmor restart

Solution 2:

This problem appears to be because AppArmor is restricting what evince can do. A work-around is to disable AppArmor for evince:

sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable/usr.bin.evince
sudo /etc/init.d/apparmor restart

For more discussion of this issue, check out this link.

Solution 3:

As OSE pointed out, this problem is due to AppArmor is restricting the programs that evince can start. You can add nemo to the list of applications Evince is allowed to launch by editing /etc/apparmor.d/usr.bin.evince (You'll need root privileges)

Find the Section of that file that looks like this:

  # By default, we won't support launching a terminal program in Xterm or
  # KDE's konsole. It opens up too many unnecessary files for most users.
  # People who need this functionality can uncomment the following:
  ##include <abstractions/ubuntu-xterm>
  ##include <abstractions/ubuntu-konsole>

  /usr/bin/evince rmPx,
  /usr/bin/evince-previewer Px,
  /usr/bin/yelp Cx -> sanitized_helper,
  /usr/bin/bug-buddy px,
  # 'Show Containing Folder' (LP: #1022962)
  /usr/bin/nautilus Cx -> sanitized_helper, # Gnome
  /usr/bin/pcmanfm Cx -> sanitized_helper,  # LXDE
  /usr/bin/krusader Cx -> sanitized_helper, # KDE
  /usr/bin/thunar Cx -> sanitized_helper,   # XFCE

Add the line: /usr/bin/nemo Cx -> sanitized_helper, # Gnome,Linux Mint,etc

Restart AppArmor with

sudo /etc/init.d/apparmor restart

Evince should now be able to launch nemo.