Installing ports on FreeNAS base system

Status
Not open for further replies.

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Considering the FreeNAS system is wiped on every boot I assume we are not supposed to install anything on the base system is that correct? For example I wanted to use something called oh-my-zsh to augment my shell experience. I could put the configuration files in my home directory but it requires curl and git to install. I assume you're not supposed to do this, the base system is supposed to be left unchanged right?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yep, you can't do this (well, you can, but it's a very very bad idea) but it's not because the system is wiped on every boot (where did you get that idea?), it's because you can break something without even knowing it.

If you want to install something, use a jail ;)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It's probably a bit hard to understand if you're coming from a Linux or FreeBSD background, but FreeNAS is an appliance. You're not supposed to "augment your shell experience" by messing with the system. However, you COULD set up a user account that exists on the ZFS pool, and then install a copy of the shell there, and then use /bin/csh as your login shell and have it exec your custom shell when you log in. This avoids puttering with the base system.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
It's probably a bit hard to understand if you're coming from a Linux or FreeBSD background, but FreeNAS is an appliance. You're not supposed to "augment your shell experience" by messing with the system. However, you COULD set up a user account that exists on the ZFS pool, and then install a copy of the shell there, and then use /bin/csh as your login shell and have it exec your custom shell when you log in. This avoids puttering with the base system.
Yeah I realize that it's set up to be that way so that it secure and you're not messing with the system I was just thinking about how I would do this if I wanted to. I could put the config file in my directory on my pool but I was wondering what I would do about certain dependencies. Is it possible to install what I want to use for my shell in a jail and then tell it to use that?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That's just a fancier version of what I suggested.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Cool. I'm pretty new to FreeBSD so I wasn't sure if that was doable.
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Cool. I'm pretty new to FreeBSD so I wasn't sure if that was doable.
Of course, you can set up ports in a jail very easily. That's what I do. I have all sorts of shit installed.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Of course, you can set up ports in a jail very easily. That's what I do. I have all sorts of shit installed.

Yeah I knew I could install ports in a jail, I just wasn't sure if I could run them from the main system. I guess you would use jexec right?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Yeah I knew I could install ports in a jail, I just wasn't sure if I could run them from the main system. I guess you would use jexec right?
? I would use jexec for what, exactly? You mean to get into the jail to install things? You could. Or, you could simply set up ssh in the jail like a civilized person and ssh into it.

:)
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
? I would use jexec for what, exactly? You mean to get into the jail to install things? You could. Or, you could simply set up ssh in the jail like a civilized person and ssh into it.

:)
Or you could use "warden chroot jailname", bringing the total number of people using the "warden chroot" command to two. The advantage of using jexec / warden is that you can quickly transition from 'half-awake' to 'fully-awake' by realizing that you executed that crappily-written script inside your main system rather than inside a jail. It works better than coffee.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Or you could use "warden chroot jailname", bringing the total number of people using the "warden chroot" command to two.

Or he could use rm -rf /*
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
It works, everywhere, but some OS show a warning and ask for confirmation :)
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Define "doesn't work" :)
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Ok, so it's compatible with what I said :)

Fork bomb is funnier anyway :D
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
? I would use jexec for what, exactly? You mean to get into the jail to install things? You could. Or, you could simply set up ssh in the jail like a civilized person and ssh into it.

:)
What I meant is if I'm on the main system and I want use the shell that is installed inside of jail , how do I tell the system to use run something installed in the jail? I found someone talking about using the command:

Code:
jexec ${jailID} /bin/${shell}


Would this not be used to run something from outside the jail? Am I looking at this wrong ?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yes, use jexec to run any program you want in a jail ;)

NB: using the jail name instead of the jail id is probably a good idea.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Yes, use jexec to run any program you want in a jail ;)

NB: using the jail name instead of the jail id is probably a good idea.
Is that the best way to do it? I don't see how SSH would let you do this, was DrKK referring to something just accessing the jail?
 
Status
Not open for further replies.
Top