You can install and run pkgs in an embedded install via unionfs_mount. I have done this for over 12 years (as of mid-2025) without any problems whatsoever. No jails or VM, and it's quick and easy to set up.
INSTRUCTIONS:
-
Choose one of your data discs (NOT system disc). Mine is /mnt/HDD.
-
Enter the following commands (change the name "extensions" to whatever you choose):
cd /mnt/HDD
mkdir extensions
mkdir extensions/usr
mkdir extensions/usr/local
mkdir extensions/var
mkdir extensions/var/db
mkdir extensions/var/db/pkg
mkdir extensions/var/cache
mkdir extensions/var/cache/pkg
- Then go to "Command Scripts" and add the following commands in this order (all PostInit and usually the first commands). They're all important!
rsync -a /usr/local/ /mnt/HDD/extensions/usr/local/
mount_unionfs -o rw /mnt/HDD/extensions/usr/local/ /usr/local/
mount_unionfs -o rw /mnt/HDD/extensions/var/db/pkg /var/db/pkg
mkdir /var/cache && mkdir /var/cache/pkg
mount_unionfs -o rw /mnt/HDD/extensions/var/cache/pkg /var/cache/pkg
-
Of course, you should modify the above commands to reflect the name of your selected data disc and the name you choose for your primary directory (in my case /extensions)
-
Reboot XNAS
You should now be able to add (and later upgrade) all desired pkgs, and they will remain and operate the same as if you did a full install.
You might hear of the so-called "dangers" of unionfs_mount - THEY DON'T APPLY TO AN EMBEDDED INSTALL, which by its very nature makes it impossible to screw up your system. Should there ever be any problem installing a package(and I've never experienced any), all one has to do is disable the command script items and reboot for a "clean" install.