Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Resource icon

FN 11.2 iocage -- Home Assistant jail & plugins for Node-RED, Mosquitto, Amazon-Dash, TasmoAdmin

tprelog

Member
Joined
Mar 2, 2016
Messages
86
Last edited:

Vidman

Neophyte
Joined
Nov 26, 2014
Messages
5
I had a few issues when following this guide. I think I manage to resolve most of then except the start of the log shows the following error:

2019-04-03 17:22:52 ERROR (SyncWorker_30) [homeassistant.util.package] Unable to install package PyNaCl==1.3.0: The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Building wheel for PyNaCl failed: [Errno 13] Permission denied: '/.cache/pip/wheels'
Could not build wheels for PyNaCl which use PEP 517 and cannot be installed directly
2019-04-03 17:22:52 ERROR (MainThread) [homeassistant.requirements] Not initializing mobile_app because could not install requirement PyNaCl==1.3.0
2019-04-03 17:22:52 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Could not install all requirements.
2019-04-03 17:22:52 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: mobile_app
2019-04-03 17:22:52 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.


Any ideas how to resolve this?

Edit: I just installed the package manually in the jail shell and restarted the jail and the same errors occur
 
Last edited:

tprelog

Member
Joined
Mar 2, 2016
Messages
86
Hello I have had the same issue

Edit: I just installed the package manually in the jail shell and restarted the jail and the same errors occur
This should work but you install in the HA virtualenv as user `hass`

Code:
iocage console homeassistant

su - hass
source /srv/homeassistant/bin/activate
pip3 install --upgrade PyNaCl==1.3.0
deactivate && exit
 

aschaapherder

Neophyte
Joined
Sep 11, 2015
Messages
11
Thanks for this, appreciated. I will have to read it properly (just found it) but why would you use a virtualenv when you are running in a dedicated iocage? There is nothing wrong with it as far as I know but it does not add anything either, or am I missing something?
 

tprelog

Member
Joined
Mar 2, 2016
Messages
86
Thanks for this, appreciated. I will have to read it properly (just found it) but why would you use a virtualenv when you are running in a dedicated iocage? There is nothing wrong with it as far as I know but it does not add anything either, or am I missing something?
I think when I was starting with HA it was the recommend approach. I realize it may not be needed in a jail but when I got started I was just running HA on my main Linux computer where the virtualenv definitely made sense to use.

When I switch to running HA on FreeNAS a saw no reason to move away from the virtualenv. I try to avoid running programs as `root` and it seemed using the virtualenv was the best (or at least easiest) approach to run HA as a non-elevated user. Another reason is because I also run AppDaemon in the same jail. AppDaemon cannot be installed straight into the same place as HA so this would require creating a virtualenv anyways.

It's my understanding that a virtualenv has zero overhead. Even though it seems like it's adding more, over time I have found it simplifies things and has saved me from completely recreating a jail on several occasion were between updates and my own error I have completely crashed HA to the point of needing to reinstall. Honestly I've gone through this setup so many times I can, starting from scratch: Create a jail, install HA, restore config and be back operational again in about 10 min. However using the virtualenv, if I just want to reinstall HA, I can just delete (or rename) that folder, reinstall HA in a new virtualenv and be back up running in about 3 min. These days it's not often I need to reinstall my main HA. Now I just occasionally install multiple instances (just use seperate virtualenv) at the same time if I want to test something but not be messing up my main HA instance.
 

diode_ee

Newbie
Joined
Mar 13, 2020
Messages
3
Does this install Home Assistant or Home Assistant Core? I know they changed the name here recently.

Also, does this instance allow for snapshots within HA or the ability to install the plugins through the front end of HA?
 

tprelog

Member
Joined
Mar 2, 2016
Messages
86
Does this install Home Assistant or Home Assistant Core? I know they changed the name here recently.

Also, does this instance allow for snapshots within HA or the ability to install the plugins through the front end of HA?
This will install Home Assistant Core. Basically, this is just a simple bash script to install HA in a virtualenv. This does not use docker. No you can not install plugins from the HA GUI. -- If you want to install the formerly known as Hass.io ( what ever they call it these days ) that allows installing plugins from HA you can follow this post in the Home Assistant Forums.

If you were using Hass.io, these would called Home Assistant Plugins and they would be managed from within Home Assistant -- To be clear this is not Hass.io -- If your on FreeNAS 11.3, check the community plugins. There are a few common things available that you would find in Hass.io -- In this case these are referred to as FreeNAS plugins and they are managed from FreeNAS.
1584227805352.png


Yes you can take snapshots of any iocage jail running on FreeNAS. ( iocage is what manages the jails on FreeNAS ) It does require the command line but the command is simple, For example, to snapshot a jail named homeassistant...
Code:
iocage snapshot homeassistant -n NAME_YOUR_SNAPSHOT_HERE



If your still considering to use this, have a look at this updated post for FreeNAS 11.3
 
Top