How to install java in jail and mount procfs and fdescfs?

testcb00

Dabbler
Joined
Feb 3, 2021
Messages
31
Today I want to test a java program in jail.
My TrueNAS version is TrueNAS-12.0-U2.1 and jail is a Clone Jail (12.2 RELEASE).

After the creation, I use those command to install the Java Runtime Environment
Code:
pkg update
pkg install vim wget openjdk11-jre


After the install, the post-install note remind me to do the follow settings.
Code:
======================================================================

This OpenJDK implementation requires fdescfs(5) mounted on /dev/fd and
procfs(5) mounted on /proc.

If you have not done it yet, please do the following:

    mount -t fdescfs fdesc /dev/fd
    mount -t procfs proc /proc

To make it permanent, you need the following lines in /etc/fstab:

    fdesc   /dev/fd      fdescfs       rw    0    0
    proc    /proc        procfs        rw    0    0

======================================================================


I have done a research and found an old solution.
The solution require me to mount the filesystem from Host but I am not sure if I can follow the solution directly as the Jail Manager is bhyve in TrueNAS.

Any suggestion are welcome. Thank you.
 
Joined
Jul 10, 2016
Messages
521
The easiest way is to do this from the command line:

Code:
iocage stop <your-jail>
iocage set mount_fdescfs=1 <your-jail>
iocage set mount_procfs=1 <your-jail>
iocage start <your-jail>

Once you've set these iocage jail properties, the system will automatically mount every time you start your jail.

It is also possible to do this via the Web UI in FreeNAS 11.3, but this functionality was removed in TrueNAS 12 as per:
 
Top