Jellyfin fails to start in FreeBSD 13.5‑RELEASE‑p3 jail – “Bad system call”

I’ve searched this forum for similar issues, but the existing threads all use essentially the same configuration I’m already running.

I’m attempting to run Jellyfin inside an iocage jail on TrueNAS Core (FreeBSD 13.5‑RELEASE‑p3). The jail starts correctly, yet Jellyfin terminates immediately with the error:
Code:
Bad system call

I’ve already tried the usual work‑arounds:
  • Mounted /dev/fd, /dev/shm, and /proc inside the jail.
  • Set allow_mount=1, allow_raw_sockets=1, allow_mlock=1, allow_set_hostname=1, allow_socket_af=1, allow_sysvipc=1, allow_tun=1.
  • Added allow_mount_devfs=1
  • Kept allow_vmm=0.
  • Verified the jail config (see JSON below).
Strangely enough I had the same configuration and it worked on earlier releases; the problem started after upgrading to 13.5‑RELEASE‑p3.

I’m sorry if this question is off‑topic for "vanilla" FreeBSD – it’s about a FreeBSD‑derived system (TrueNAS) but I hope the community can still help.

After lots of troubleshooting, this is my jail config.

Jail configuration (JSON export):
Code:
{
    "allow_chflags": 0,
    "allow_mlock": 1,
    "allow_mount": 1,
    "allow_mount_devfs": 1,
    "allow_quotas": 0,
    "allow_raw_sockets": 1,
    "allow_set_hostname": 1,
    "allow_socket_af": 1,
    "allow_sysvipc": 1,
    "allow_tun": 1,
    "allow_vmm": 0,
    "assign_localhost": 0,
    "boot": 0,
    "bpf": 0,
    "cloned_release": "13.5-RELEASE",
    "comment": "none",
    "defaultrouter": "172.16.2.37",
    "defaultrouter6": "auto",
    "devfs_ruleset": "1",
    "dhcp": 0,
    "exec_fib": "0",
    "exec_jail_user": "root",
    "exec_poststart": "/usr/bin/true",
    "exec_poststop": "/usr/bin/true",
    "exec_prestart": "/usr/bin/true",
    "exec_prestop": "/usr/bin/true",
    "exec_start": "/bin/sh /etc/rc",
    "exec_stop": "/bin/sh /etc/rc.shutdown",
    "exec_system_user": "root",
    "host_domainname": "none",
    "host_hostname": "jellyfin",
    "host_hostuuid": "jellyfin",
    "host_time": 1,
    "hostid": "74902500-e057-0706-0025-907457e00e0f",
    "interfaces": "vnet0:bridge0",
    "ip4": "new",
    "ip4_addr": "vnet0|172.16.2.36/24",
    "ip4_saddrsel": 1,
    "ip6": "new",
    "ip6_saddrsel": 1,
    "ip_hostname": 0,
    "jail_zfs": 0,
    "jail_zfs_dataset": "iocage/jails/jellyfin/data",
    "jail_zfs_mountpoint": "none",
    "last_started": "2025-09-17 15:12:55",
    "mac_prefix": "022590",
    "nat": 0,
    "nat_forwards": "none",
    "notes": "none",
    "priority": "99",
    "release": "13.5-RELEASE-p3",
    "resolver": "/etc/resolv.conf",
    "rtsold": 0,
    "securelevel": "0",
    "sysvmsg": "new",
    "sysvsem": "new",
    "sysvshm": "new",
    "template": 0,
    "vnet": 1,
    "vnet0_mac": "02259029d59a 02259029d59b",
    "vnet_default_interface": "em1",
    "vnet_interfaces": "none"
}

Is there a known regression in this release that blocks a particular syscall (such as setuid, mlock, procfs mount, sysarch, etc.) that Jellyfin/.NET relies on?

Any pointers, config tweaks, or known bugs would be greatly appreciated.

Thanks!
 
Bad system call
This typically happens when you try to run a binary for an older version on a new version kernel that doesn't have the required COMPAT_FREEBSDxx compatibility shims to run that older version executable.

For example running a 13.x binary on a 14.x kernel requires COMPAT_FREEBSD13 to be included (the 'vanilla' FreeBSD GENERIC kernel has this, including versions all the way back to FreeBSD 4.x); https://cgit.freebsd.org/src/tree/sys/amd64/conf/GENERIC#n63

it’s about a FreeBSD‑derived system (TrueNAS) but I hope the community can still help.
You really should ask on the TrueNAS forums. I have no idea what is or isn't included in the kernel of TrueNAS Core.
 
Thanks for the clarification—I understand the situation now.

Unfortunately for me, TrueNAS has moved away from the FreeBSD‑based stack, so the newer kernel won’t provide the COMPAT_FREEBSD13 shims that a Jellyfin binary built for 13.5 expects.

file /usr/local/jellyfin/jellyfin
/usr/local/jellyfin/jellyfin: ELF 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.5, FreeBSD-style, BuildID[sha1]=8deb2fbc126e087bf97fcf4f4eb9dec4d11b7156, stripped

With the host still on the old 13.1‑p9 kernel, the binary will inevitably hit the “Bad system call” error.

Without trying to abuse your goodwill, do you see any potential workarounds for this issue? I'm looking to avoid placing Jellyfin into a Docker container on Linux, but I'm having trouble finding a solution to bypass this compatibility problem. Any insights would be greatly appreciated!
 
You could migrate to vanilla BSD, (and use the new Sylve GUI project) zVault, (hopefully they will have a 13.5 version soon) or XigmaNAS, (and manage jails with Bastille).

TrueNAS CORE is not something I would continue using if you want jails.
 
I appreciate your suggestions regarding migrating to vanilla BSD, zVault, or XigmaNAS.
However vanilla BSD lacks a proper GUI, which is a significant factor for me, especially for monitoring disk temperatures and I/O performance and they are handy to have.

I noticed that the last release from zVault was in May, and I hope they will promote a different version from truenas soon. It would be great to see it mature and decouple from TrueNAS CORE, as that could make the transition more appealing, for now it remains a bit unclear as to whether they will be able to support all the features once they start to promote higher FreeBSD versions. As for XigmaNAS, the GUI feels a bit outdated, which makes me hesitant to switch.

I recognize the risks associated with running an unmaintained version of TrueNAS, but I'm not in a hurry to make any changes at this time.
For now I’ll continue to evaluate my options as things progress.

Thanks again for your insights!
 
Having web ui for graphics can easily be done with www/grafana, net-mgmt/prometheus3, sysutils/node_exporter.

There is even sysutils/nginx-ui that may satisfies your needs.

In the meantime, your solution would be to either build from source the packages, or update TrueNAS to FreeBSD 13.5, so you will have to rebase whatever iX Systems did on FreeBSD.
 

Attachments

  • drive-temps.png
    drive-temps.png
    58.8 KB · Views: 34
So what is the outer OS version?

TrueNAS is running on FreeBSD 13.1-RELEASE-p9.
root@nas[~]# uname -r
13.1-RELEASE-p9

In the meantime, your solution would be to either build from source the packages, or update TrueNAS to FreeBSD 13.5, so you will have to rebase whatever iX Systems did on FreeBSD.

I’ve just retrieved the FreeBSD ports and am in the process of building Jellyfin from scratch. I’m uncertain if this will work, but we’ll see how it turns out. In the future, I might consider switching to vanilla FreeBSD and possibly installing Grafana.
 
That's great news, a native FreeBSD GUI (that looks a lot like Proxmox) will make VM and jail management as easy as TrueNAS.
I’ll keep an eye on its progress as it matures.

Thanks for pointing this out!
 
Back
Top