About the use of bwrap sandboxing in nautilus thumbnailer

Hi All,

I’m a F3D dev, a simple opensource 3D viewer which also provide thumbnails for many file formats.
It came to my attention that thumbnails were not working with nautilus.
After some investigation, it seems to be caused by the use of bwrap in nautilus thumbnailer code.

While it make sense to sandbox such mechanism, I’m trying to find solutions for our users.
First a few questions.

  1. Is there way to let application use Xorg server while still using bwrap in your code ? Is this supported or planned ?

  2. Is there a way to disable bwrap cleanly in nautilus for users that do not want to use it ?

  3. If I build my app to support rendering with EGL or OSMESA, will it work (I assume it will) ?

  4. Any other work around I should have thinked of ?
    Right now, I suggest our users to use Xvfb in the .thumbnailer file. It works but it is very slow to start Xvfb for each thumbnail, this is merely a expansive work around and not a long term solution.

Our issue is there for the curious: Segfault when thumbnailing with nautilus (Headless support in binary release) · Issue #439 · f3d-app/f3d · GitHub

Thanks /r/gnome for pointing the discourse out to me.

For question 1 & 2: the sandbox doesn’t have access to the Xserver (that would be insecure) and it can’t be disabled. The open feature request for configurable sandboxing looks related to these questions and also answers to the “why” of the sandbox.

I don’t know for question 3 & 4. If you’re familiar with bwrap and what would be needed to allow rendering with EGL or OSMESA you could browse the code here where bwrap is set up.

1 Like

Thanks for your answer, I’m not familier with bwrap but we will try using EGL anyway and see if it works.

Is that low effort to try? Else maybe let this topic run for a bit to see if somebody else can provide a better answer on 3 & 4.

I’m just a user trying to help a bit with relevant links. Sorry for throwing you in the deep end with the bwrap code.

EGL is the best solution if you need off-screen OpenGL. Xvfb is unnecessary. OSMesa is not very useful now as its functionality can be done with surfaceless EGL or headless Vulkan.

You can have your application generate the thumbnails of files when opening them and/or saving them. You don’t need to wait for Nautilus to generate them, especially if your application has very specific requirements.

As long as you follow the thumbnailing specification, you can generate the thumbnails from your application whenever you need them.

1 Like

Is that low effort to try?

Yes, it actually is, VTK support EGL natively.

surfaceless EGL

Not supported by VTK yet, but maybe in the future.

You can have your application generate the thumbnails of files when opening them and/or saving them

This is not at all how F3D has been designed. This is a lightweight viewer, you dont want to open every single file to generate a thumbnail. Moreover, there is no crossplatform/cross-de way to find out the location to write a thumbnail into.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.