Edit file in iocage - just SSH - But how... help me understand please

I_Tried

Cadet
Joined
Dec 13, 2022
Messages
3
Hi all,

I will try to be as detailed as possible to aid any potential helpers. I recently installed TrueNAS core on an old PC, followed guides on how to create SMB shares and installed the Home Assistant plugin, great.

What i want to do?
I want to be able to edit the config.yml in my HomeAssistant jail

I tried searching for answers, and the common solution seems to be SSH. Great so I watched tutorials on various ways to SSH into TrueNAS etc. The issue is the gap in my understanding, as there isn't a complete guide on how to do exactly what I need I have been going round in circles trying to stumble across an answer.

So I guess I am asking for a solution to several question:

:- SSH into jail - (fairly confident in this part) or is there a better way?

:- Navigate to file - (completely lost)
When i enter ls -l as root@truenas / root@homeasitstant non of the result resemble the filepath I can see but cant edit from the iocage on my windows PC (\\TRUENAS\iocage\jails\HomeAssistant\plugin\docs\_config.yml)
root@homeassistant.png
root@truenas.png

even if I could recognise where in the file directory I was I wouldn't know how to navigate to the appropriate file

:- edit file - (completely lost)
During my search Ive seen people suggest using vi others use a "cp -v -a" command, I'm not doubting either work its more my understanding on how to use them in this scenario.

Thanks in advance :smile:
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
When you log in to the NAS host via SSH you can use
Code:
iocage console <jailname>

to change into the jail.

Then use the cd command to change to the directory where the config file is located, e.g.
Code:
cd /usr/local/etc/homeassistant

I am not familiar with the plugin so I don't know where that might be.

Then use the vi or ee editor to modify the file:
Code:
ee config.yml
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Please beware, I am no longer maintaining the Home Assistant plugin. That said, the following links maybe useful.

https://github.com/tprelog/iocage-homeassistant/wiki/external_dataset

https://github.com/tprelog/iocage-homeassistant/wiki/smb_share

EDIT: Forgot to say the path to the Home Assistant config (for the community plugin) is as follows

From TrueNAS Host
- Replace $ZPOOL with name of pool you have activated iocage
- Replace $JAIL with the name of Home Assistant jail
Code:
/mnt/$ZPOOL/iocage/jails/$JAIL/root/home/homeassistant


From inside the jail
Code:
/home/homeassistant
 
Last edited:

I_Tried

Cadet
Joined
Dec 13, 2022
Messages
3
Please beware, I am no longer maintaining the Home Assistant plugin. That said, the following links maybe useful.

https://github.com/tprelog/iocage-homeassistant/wiki/external_dataset

https://github.com/tprelog/iocage-homeassistant/wiki/smb_share

EDIT: Forgot to say the path to the Home Assistant config (for the community plugin) is as follows

From TrueNAS Host
- Replace $ZPOOL with name of pool you have activated iocage
- Replace $JAIL with the name of Home Assistant jail
Code:
/mnt/$ZPOOL/iocage/jails/$JAIL/root/home/homeassistant


From inside the jail
Code:
/home/homeassistant
Perfect for what i want to do, Thank you.
 

I_Tried

Cadet
Joined
Dec 13, 2022
Messages
3
When you log in to the NAS host via SSH you can use
Code:
iocage console <jailname>

to change into the jail.

Then use the cd command to change to the directory where the config file is located, e.g.
Code:
cd /usr/local/etc/homeassistant

I am not familiar with the plugin so I don't know where that might be.

Then use the vi or ee editor to modify the file:
Code:
ee config.yml
I actually was able to edit using vi, Thank you for the clarification.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Please beware, I am no longer maintaining the Home Assistant plugin. That said, the following links maybe useful.
May I ask why?
I have recently installed it and love it. Is there perhaps a way for me to manually install it in my own jail instead of using the plugin?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
May I ask why?
I have recently installed it and love it. Is there perhaps a way for me to manually install it in my own jail instead of using the plugin?

From the TrueNAS side... plugins in general just don't have good reputation. It was hard finding motivation to maintain something most people tell not to use. I had considered spending a weekend rewriting the plugin script to also handle a regular jail installation but then

From the Home Assistant side... Home Assistant only supports Linux, OSX and Windows using WSL. FreeBSD is not supported. Recently the developers have taken a pretty hard stance on this and will no longer accept bug reports or pull requests for issues related to FreeBSD

You can keep using the Home Assistant plugin as a regular jail until it's time for a release upgrade. Just don't try to run a Plugin UPDATE from the TrueNAS UI - Most people miss the fact Home Assistant is updated from the jails console - No need to wait on an update from me.

I feel my documentation has always been lacking but I did try to make some effort.

This page is somewhat outdated now, but covers the basics for using the full RC script from the plugin, to install Home Assistant in a regular jail. It been a while since I tested these guides but they should still work if you adjust for the correct FreeBSD RELEASE and python version


And there's an old manual installation guide as well


And this guide on the Home Assistant forum

 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I rarely encounter an open source project downright refusing to support FreeBSD in any way. Disappointing. Most at least welcome reports and pull requests, even if they lack the manpower and expertise to make FreeBSD a tier-1 platform.

@victor1597 You can always run a Ubuntu VM on core and deploy Linux applications in there.
 
Top