Alright down and dirty... As it says under my user name "Newbie" Although I have done my homework (as much as time allows) I am not an expert. I have tested worked this out and tested using a VM and I recommend you do the same before you just copy and paste these command onto your running system. Better safe then sorry! That said I have followed these steps on my FreeNAS version 11.2U2-U3 at the time of this writing and have successfully switched all my jails over the the new iocage back end.
Need to pick a zpool for iocage. I just used the same zpool I already have setup in the GUI for the warden backend. In my case it's called "jail" I used the GUI to create a dataset called "iocage" in my "jail" zpool. The name of your zpool may most likely be different. After you've chosen your zpool and created the "iocage"dataset its time to jump over to the command line of your freenas and activate iocage. This is only for the very time you use iocage. If you've tried making a jail from the new GUI this has most likely already been done for you.
Code:
iocage activate jail
list releases of freebsd. you'll be choosing number 6
create our jail. I called mine "homeassistant" and since I assign IP address from my router I create jail to use dhcp
Code:
iocage create -r 11.1-RELEASE -n homeassistant dhcp=on bpf=yes vnet=on boot=on
next to get in the jail console
Code:
iocage console homeassistant
I switch my jail to get latest updates instead of quarterly as set by default. While I personally prefer to have the latest updates I believe this step is optional.
Code:
mkdir -p /usr/local/etc/pkg/repos
ee /usr/local/etc/pkg/repos/FreeBSD.conf
copy and paste. press escape to save and exit
Code:
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
Code:
pkg update
pkg upgrade
pkg install python36 py36-sqlite3 bash gmake ca_root_nss
*Just a note here I needed gmake and ca_root_nss for the zwave component to build properly. The requirement for ca_root_nss is new after freenas 11.1 U2. It resolved an issue were ssl certs were failing to verify. I had the same issue with gmusicproxy I have running in a separate jail but that's a different post.
From this point on I believe you can finish install homeassistant following you desired method.
My preference is to create a user "hass" and install homeassistant inside a python virtualenv. My virtualenv lives in a directory I created "/srv/homeassistant". The rest of this quick guide will do the same. I should mention it has been pointed out to me that a virtualenv inside a jail is not need since the jail itself is already well... a jail! I still prefer my current method.
The next commands create a home dir and user hass. I add "hass" to the "dialer" group as required by my z-wave stick. I also assign my hass user a UID and GUID of 990. This is completely optional and just a choice I make for myself. Further explanation to this choice is beyond the scope of this quick guide.
Code:
install -d -g hass -o hass -m 775 -- /home/hass
pw addgroup -g 990 -n hass
pw adduser -u 990 -n hass -d /home/hass -s /usr/local/bin/bash -G dialer -c "Daemon user for Homeassistant"
install and create dir for virtualenv
Code:
python3.6 -m ensurepip
pip3 install --upgrade pip
pip3 install --upgrade virtualenv
install -d -g hass -o hass -m 775 -- /srv/homeassistant
change over to our user hass and finally install homeassistant!
Code:
su hass
virtualenv -p /usr/local/bin/python3.6 /srv/homeassistant
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant
deactivate
ready to test! be sure your still user "hass" if you typed exit or used 'Ctrl+D' to exit the virtualenv you may have been switched back to user "root"
you should be able to start homeassistant with this to test it out
Code:
/srv/homeassistant/bin/hass
I'll post a follow up with my auto start
Made a few edits to correct mostly spelling. Also added bash to pkg install for the virtualenv to work