Resource icon

FN11.3 iocage jails - Plex, Tautulli, Sonarr, Radarr, Lidarr, Jackett, Transmission, Organizr

fixer

Cadet
Joined
Dec 23, 2017
Messages
5
After restarting FreeNAS server I cannot connect to any of the created iocage jails. Did anyone experience anything like that
When you say cannot connect do you mean that you can't access your jails via command line or the plugins aren't loading when you type in the correct address?
I couldn't access any of the jails via browser (running apps in jails). But I found out why. After restarting FreeNAS, it created new bridge1 with em0 and all the VNET connections were assigned to bridge0.

Editing tunables (rc.conf) helped me.
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
I had the same problem. Either one of your “‘s are not right or are missing. When I had that issue one of mine were upside down


Sent from my iPhone using Tapatalk
I figure it out. This line is getting word wrapped for me in the guide and needs to be on 1 line.

Code:
command_args="-p ${jackett_data_dir}/jackett.pid -f ${procname} /usr/local/share/Jackett/JackettConsole.exe -d ${jackett_data_dir}"
 

MoonPie

Dabbler
Joined
Dec 13, 2014
Messages
20
First let me say THANK YOU :) for these great instructions. Now for my question... All my jails appear to be working except for OMBI. When I stop it using IOCAGE command it displays the below errors. When I stop it from inside the jail it just hangs on trying to stop mono-sgen. Any help would be appreciated.

Below is what happens when I attempt to stop the OMBI jail using iocage command:

Code:
root@FreeNAS:~ # iocage stop ombi
* Stopping ombi
  + Running prestop OK
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
	sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
	return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
	rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
	return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
	return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
	return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/stop.py", line 54, in cli
	ioc.IOCage(exit_on_error=True, jail=jail, rc=rc).stop()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 1649, in stop
	exit_on_error=self.exit_on_error)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 52, in __init__
	self.__stop_jail__()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 142, in __stop_jail__
	stdout=f, stderr=su.PIPE)
  File "/usr/local/lib/python3.6/subprocess.py", line 291, in check_call
	raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['setfib', '0', 'jexec', 'ioc-ombi', '/bin/sh', '/etc/rc.shutdown']' died with <Signals.SIGKILL: 9>.


Below is what happens when i try to stop ombi from inside jail...

Code:

root@ombi:~ # service ombi stop
Stopping ombi.
Waiting for PIDS: 82278
(hangs in defiantly on this)

PID USERNAME	THR PRI NICE   SIZE	RES STATE   C   TIME	WCPU COMMAND
82858 root		  1  20	0 20164K  2444K CPU1	1   0:00   0.19% top
82278 media		20  20	0   198M   123M uwait   1   0:07   0.00% mono-sgen
 
Last edited:

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
First let me say THANK YOU :) for these great instructions. Now for my question... All my jails appear to be working except for OMBI. When I stop it using IOCAGE command it displays the below errors. When I stop it from inside the jail it just hangs on trying to stop mono-sgen. Any help would be appreciated.

Below is what happens when I attempt to stop the OMBI jail using iocage command:

Code:
root@FreeNAS:~ # iocage stop ombi
* Stopping ombi
  + Running prestop OK
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
	sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
	return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
	rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
	return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
	return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
	return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/stop.py", line 54, in cli
	ioc.IOCage(exit_on_error=True, jail=jail, rc=rc).stop()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 1649, in stop
	exit_on_error=self.exit_on_error)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 52, in __init__
	self.__stop_jail__()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 142, in __stop_jail__
	stdout=f, stderr=su.PIPE)
  File "/usr/local/lib/python3.6/subprocess.py", line 291, in check_call
	raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['setfib', '0', 'jexec', 'ioc-ombi', '/bin/sh', '/etc/rc.shutdown']' died with <Signals.SIGKILL: 9>.


Below is what happens when i try to stop ombi from inside jail...

Code:

root@ombi:~ # service ombi stop
Stopping ombi.
Waiting for PIDS: 82278
(hangs in defiantly on this)

PID USERNAME	THR PRI NICE   SIZE	RES STATE   C   TIME	WCPU COMMAND
82858 root		  1  20	0 20164K  2444K CPU1	1   0:00   0.19% top
82278 media		20  20	0   198M   123M uwait   1   0:07   0.00% mono-sgen

Bump, i'm also getting this issue.
 

Ravefiend

Dabbler
Joined
Jun 1, 2011
Messages
37
Just a quick comment on these instructions. In the past there have been some issue related to special characters in filenames (like with Subsonic), due to the default locale settings within the jail.

On FreeNAS itself, this was also a problem which was sorted out by switching the default locale from C to UTF-8 (also a requirement for py-iocage)

Code:
root@freenas-vm:~ # locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

By default, the jails created with the mentioned instructions will end up with the C default:
Code:
root@mysql-vm:~ # locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

As a suggestion, what I did on for my jails on earlier FreeNAS releases was opening a shell (iocage console mysql-vm) and execute the following:

printf "\nsetenv LANG en_US.UTF-8\nsetenv LC_COLLATE en_US.UTF-8\nsetenv LC_CTYPE en_US.UTF-8\nsetenv LC_MESSAGES en_US.UTF-8\nsetenv LC_MONETARY en_US.UTF-8\nsetenv LC_NUMERIC en_US.UTF-8\nsetenv LC_TIME en_US.UTF-8\n\n" >> ~/.cshrc

Reference:
 

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80

Ravefiend

Dabbler
Joined
Jun 1, 2011
Messages
37
I was having issues getting any network connectivity in/out of the jail, which put a full halt to my project here. I found tunables that were needed to get the virtual networking corrected, and thought the tunables might be a good addition as a starter to iocage. Here was the post I referenced: https://forums.freenas.org/index.php?threads/iocage-vnet0-and-bridge0.59964/#post-425205

Yeah, I was running into the same problem as described here: https://forums.freenas.org/index.php?threads/iocage-no-route-to-gateway-from-jail.60352/
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
I'm also having quite a few issues...

This is what i get everytime i try to create a iocage jail:
Code:
root@freenas:~ # iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|192.168.1.11" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on"
plex successfully created!
Testing SRV response to FreeBSD
Error: error sending query: Error creating socket
 

snorbaard

Dabbler
Joined
Sep 11, 2014
Messages
11
I'm also having quite a few issues...

This is what i get everytime i try to create a iocage jail:
Code:
root@freenas:~ # iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|192.168.1.11" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on"
plex successfully created!
Testing SRV response to FreeBSD
Error: error sending query: Error creating socket


Yeah same issue here. I've destroyed and recreated cages five or sixe times to try and troubleshoot.. I'm obviously missing something, but I can't figure it out because, well.. I just don't know enough.
The readme site of iocage says that VNET is considered unstable, and that straight up using the share IP mode works better (due it it working for over a decade). Info about iocage and networking here.

So I tried that, and instead of the HOWTOs (for example)

Code:
iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|192.168.1.50/24" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on"

I use
Code:
iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="re0|192.168.1.50/24" defaultrouter="192.168.1.1" allow_raw_sockets="1" boot="on" 


(so use your NIC instead of the VNET0, and remove vnet="on". Instant success when creating the iocage. I can also do PKG installs, pings, etc.).
Getting past that is great, but then my Plex installation (and other) would find my media only when I fstab directly to a dataset. So it sees /media but /media/movies is blank from within the jail, so I have to create an fstab entry for /movies /shows and so on. The same applies to /config - it sees/creates the subfolder, but doesn't/can't write to it, and doesn't read them even thought it appears to have access, so plex doesn't write any metadata (or see extras in the movies).

But..
wTBMqeX.jpg


..so I'm obviously bypassing a problem or an inherent assumption by doing the VNET workaround. Using the beta UI, creating a Jail is obviously using the iocage backend, but it's a long list of variables to enter that I know nothing about, and so far things Just Don't Work™.
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Ahaha, thanks for not making me feel like to only one who has no clue... I'll wait march for when iocage is supposed to be implemented properly from the GUI. Until then i'll just follow the thread. Thanks for taking the time to write all down :)
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
I'm also having quite a few issues...

This is what i get everytime i try to create a iocage jail:
Code:
root@freenas:~ # iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|192.168.1.11" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on"
plex successfully created!
Testing SRV response to FreeBSD
Error: error sending query: Error creating socket
You aren't putting in a subnet. It should look like this.

Code:
vnet0|192.168.1.11/24
 

MoonPie

Dabbler
Joined
Dec 13, 2014
Messages
20
Not sure if this helps but I have been using the below command with reserved DHCP addresses without any issues...

iocage create -n "<jail name>" -p /tmp/pkg.json -r 11.1-RELEASE vnet="on" bpf="yes" dhcp="on" allow_raw_sockets="1" boot="on"
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Not sure if this helps but I have been using the below command with reserved DHCP addresses without any issues...

iocage create -n "<jail name>" -p /tmp/pkg.json -r 11.1-RELEASE vnet="on" bpf="yes" dhcp="on" allow_raw_sockets="1" boot="on"
Where do you set the MAC that you've reserved?
 

MoonPie

Dabbler
Joined
Dec 13, 2014
Messages
20
Where do you set the MAC that you've reserved?

The MAC is associated with the IP address within your DHCP application. Depending on your environment, DHCP server running on a Windows / Linux OS or DNSMASQ running on a router, where/how you do the association differs. You can find the MAC address of the jail using the following command:

Code:
iocage exec <jail name> ifconfig
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Ah, I assumed you were assigning a MAC, but you're just taking whatever is generated by iocage.
 

NamoMitK

Dabbler
Joined
Sep 3, 2015
Messages
28
Is there a way to set the MAC address of the jail during creation?
 

MoonPie

Dabbler
Joined
Dec 13, 2014
Messages
20
Is there a way to set the MAC address of the jail during creation?

AFAIK not at this time.

You could always try this to change it after creation...
Code:
ifconfig fxp0 ether xx:xx:xx:xx:xx:xx

This should be able to be done without needing to take the interface down and back up.
 
Last edited:

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Stupid question: What is the difference between going for:
Code:
iocage exec jailname pkg install nano

or
Code:
jexec jailname tcsh
and then
Code:
pkg install nano
?
 

kazooless

Dabbler
Joined
Aug 9, 2013
Messages
32
Thank you for this guide. It has been very helpful.

I have been using the instructions as a guide to setup nzbget. I'm not sure if the comment "All other jails (currently nzbget and saznzbd) all commands should be run from in that jail that is created from the old UI" means it won't work at all with an iocage jail, or if it means something else. I thought I'd try with iocage.

I've been successful except if I have the CertCheck turned on. I followed the instructions to use "CertStore=/etc/ssl/cert.pem" but there is no cert.pem in the directory. I checked my old Warden jails and they don't have it either.

How do you create this file?
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
Thank you for this guide. It has been very helpful.

I have been using the instructions as a guide to setup nzbget. I'm not sure if the comment "All other jails (currently nzbget and saznzbd) all commands should be run from in that jail that is created from the old UI" means it won't work at all with an iocage jail, or if it means something else. I thought I'd try with iocage.

I've been successful except if I have the CertCheck turned on. I followed the instructions to use "CertStore=/etc/ssl/cert.pem" but there is no cert.pem in the directory. I checked my old Warden jails and they don't have it either.

How do you create this file?
I don't see why it wouldn't work with iocage I just think he hasn't written and tested the scripts yet.
 
Top