Linux Jails (sandboxes / containers) with Jailmaker

Hey there I’m having issues getting one docker container to be able to access the files of another. For example I have this compose for Handbrake

version: "3"
    image: jlesage/handbrake
      - PUID=3003
      - PGID=3003
    privileged: true
      - 8081:5800
      - /mnt/data/handbrake/config:/config:rw
      - /mnt/data/handbrake/watch:/watch:rw
      - /mnt/data/MakeMKV/movies:/storage:ro
      - /mnt/DataStorage/Media/Movies:/output:rw
      - /mnt/DataStorage/Media/TVShows:/output:rw

But when I open the web GUI it can only access the base default folders which are all empty and can’t seem to access the MakeMKV folder at all nor output to the Media folders. I have a JellyFin container that works perfectly in accessing the data in the DataStorage pool so I know that Docker can do this. But for reasons I can not figure out the two I’ve set up fail to recognize either the non-Docker media folder or the docker storage set up for MakeMKV.

I’ve been unable to find any information that is related to TrueNas Scale as most seems to either deal with URaid or creating a VM. Any help would be great.

Hi, when i start the jlmkr docker - i get this error

Does anyone know how to fix this?

Search for “too many open files” error in this forum or on the jailmaker github page.

1 Like

Been beating my head over getting NVIDIA hardware encoding working in Jellyfin docker with the jlmkr script. Spent days searching various resources, finally this thread did it, esp @mooglestiltzkin 's guide!

The key was manually installing the NVIDIA toolkit within the docker instance. I followed all the other bind/env/compose deploy statements above with /dev/dri - none of which worked.

I did not see the requirement for manually installing NVIDIA toolkit within docker mentioned specifically anywhere except for @mooglestiltzkin’s writeup - kept getting error with runtime:nvidia statement. I had assumed that the code in the default jlmkr config would have already installed the nvidia toolkit - it did not in my case even with passthrough = 1.

Thank you!

1 Like

Maybe it’s time someone contributes a nice jellyfin config template. It has a lot of overlap with the docker template… but since so many people ask about it and run into issues I’d accept such a PR.

1 Like

glad it helped. though it was a hard find cauz it was nested in a mega sized thread, sorry about that :sweat_smile:

yeah i had to google up and trial error to figure that one out.

few key points

  1. jailmaker script, there is a nvidia reference there to add so that jlmkr can know you have a nvidia card and how to connect to it

  2. installing the nvidia toolkit. you have to do that in the jlmkr shell for your docker jail to install that. and from time to time i guess you should also apt update everything.

  3. in your docker compose, add the nvidia code.

  4. test your docker app e.g. jellyfin, immich see if the nvidia graphics card features worked.

i checked logs and also trying app to confirm it worked.

so now whenever i try do live transcoding for jellyfin it’s way more responsive without much lag/stutter when playing or fast forwarding.

that said, i would still recommend doing direct play back whenever possible. like i managed to do so using android jellyfin app, then it uses an external video player (mx player) which has the ffmpeg codec setup, so i can do software playback and it supports the codec, which then avoids any live transcoding from triggering.

@Jip-Hop, @Stux, thanks so much for building Jailmaker and providing the guides on setting it up and getting Docker running. I have moved from TrueCharts (and avoided the issues it’s now having) and a VM running Home Assistant OS to everything in Docker. I’ve duplicated all the functionality I previously had and have added to it thanks to everything available in Docker.

Thanks again, it’s given me something to do this summer while I’m trying to avoid the heat.


Took a lot longer than I planned!


I am a simple person.

Stux makes video. I watch video. Life is good.


I am new to Linux and Truenas. I am confused about this jailmaker (it has similar name than FreeBSD jails function).
What is this jailmaker? Can please somebody explain this to me in hardware therms as I have tried here.

1 Create a Dataset and Install Jailmaker
2 Run Jailmaker when System Starts
My question: after those two steps bacisaly there is nothing to use? In hardware terms this would be like to have all hardware for server running, but completely empty/blank. Am I correct?
At this stage for an instance I can’t install Apache web server?

Then I have to install Linux?
./ create --start --distro=ubuntu --release=jammy myjail --bind-ro=/mnt
Is this like that my brand new server has just got Ubuntu installed and nothing else?

So I can use this Linux jail as a ‘normal’ standalone Linux server?
After that I can install Apache web server?

Am I correct?

It has a similar name to the BSD jails because its attempting to implement the BSD jails concept, but on Linux :slight_smile:

The jailmaker startup command is literally just to “start” your jails

Have you watched my video on the subject?

And yes, once you create a jail with jailmaker you could install Apache in it. I would personally use docker to run Apache (and in fact do), it simplifies updating the Apache instance.

1 Like

I’ve seen the video. It has way too fast pace for foreigners and first time experiences with the subject. In some cases you can’t even see what command you typed. :smiling_face: :disappointed:

If I understood you correctly this time I have to create a jail with this command

./ create --start --distro=ubuntu --release=jammy myjail --bind-ro=/mnt

and then I can install the LAMP stack or should I say just the AMP stack?

And do I have to use docker? What about some CRM apps that don’t have docker images, will they still run in jailmaker?

I’d really appreciate it if you could clarify this to me.

Thank you.

I believe the above should basically create a jammy jail which has access to all your pools.

To do with as you will. You don’t need to install docker. You may have to increase the permissions assigned to the jail.

I agree he does run fast even for an English speaking person. I did a lot of replay stop replay etc… But if you look at comment section of the video there is the text of what he is saying.

Youtube lets you pause at any time, there’s also a playback speed selector.

Yep. I did a lot of pause rewind play rinse/repeat when I first got it running. That plus I found out in the comment section is a text version of what is being said. With those 2 it was pretty easy to get jailmaker up and running.

Apologies for that, I wanted to get it under 20 minutes :wink:

Which was not easy!

How many milliwatsons? :slightly_smiling_face:

Robert Watson - FreeBSD veteran and professor for systems at Cambridge - is famous for his talking speed allegedly nobody ever matches.

So in the FreeBSD community talking speed is measured in milliwatsons.


Any good tech focused YouTube requires plenty of pause and rewinds. If you aren’t doing that then it means the author is just wasting a lot of your time talking about non-essentials and taking an hour to walk through a 20 min concept. They do that because they like the sound of their voice. Plus wouldn’t you prefer to pause rewind vs skip forward blindly?

1 Like

:laughing: That takes me back. He is one of the few folks I would legitimately need to adjust the playback speed to slow it down. I think Robert just perceives time different than the rest of us mere mortals.