Page 1 of 1

Stuck on creating jail

Posted: 24 Feb 2013 17:44
by Rafe
Following this guide:
http://wiki.nas4free.org/doku.php?id=do ... owto:jails

I'm at the part where it says:
Add These Lines:

### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto http://www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.domain.local" # hostname
jail_proto_ip="192.168.1.201" # ip of the jail
jail_proto_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount

I'm not sure what I'm supposed to do. My interface in ssh has changed and it says GNU nano 2.2.6 and i don't know if i'm supposed to just copy and paste that like i have done in this post or what? The guide says: Change the settings to fit your needs and save. Especially jail_proto_interface and jail_proto_ip but how?

Re: Stuck on creating jail

Posted: 24 Feb 2013 18:56
by raulfg3
nano is a file editor like notepad, you must copy & paste & save result.

if you want, you can edit file use embeded file editor in Nas4Free, you only need to locate file ( you create it with comand touch) and copy & paste & save using WebGUI, is the same.

once you create jail proto and works ( jls works), try to create a new one named minidlna, this time you do not need to fetch none , because you have the files, star in the part that uuntar fiules eg:
tar xvf /jail/work/base.txz -C /jail/minidlna/ <- look that I replace proto by minidlna

Re: Stuck on creating jail

Posted: 24 Feb 2013 19:12
by Rafe
Forgive me if this is obvious but I have the nano file editor and it appears blank. Do I need to paste this in it?

jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.domain.local" # hostname
jail_proto_ip="192.168.1.201" # ip of the jail
jail_proto_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount

and what if any of those settings do i need to change? I really don't understand what i need to do next.

Re: Stuck on creating jail

Posted: 24 Feb 2013 19:32
by raulfg3
YES, you need to paste, and after paste , save file

and remember to use your network interface, for me is re0, you can see yours in Network|Interface Management LAN:

Re: Stuck on creating jail

Posted: 24 Feb 2013 19:52
by Rafe
Probably a stupid question but should the ip of the jail be the same as my nas? I ask because all i changed was the network interface. so when i type jls it says
JID IP Address Hostname Path

with no ip host or path showing up. How do I get back to the config to change those settings i type nano conf/rc.conf.local but it appears blank to i just paste it again and change the ip of the jail to my nas?

Re: Stuck on creating jail

Posted: 24 Feb 2013 20:03
by raulfg3
IP MUST be biferent, if your NAS use default 192.168.1.250 for your jail I suggest to use 192.168.1.201 (202 for other jail, etc...)

You can easy edit file usig embeded file editor in Nas4Free and find file in /jail/conf/rc.conf.local

Re: Stuck on creating jail

Posted: 24 Feb 2013 20:33
by Rafe
Thank you raulfg3 for all your help. I think I have the jail going. I'm now getting a ip host and path. The last step says
If jls command does not work type the command below then try again (we're working on this issue).
#rehash

Then enter it:
# jexec 1 csh # enter jail 1 in our case proto

I don't need to do that do I?

Re: Stuck on creating jail

Posted: 24 Feb 2013 20:53
by raulfg3
you need to do jexec 1 csh to "enter" / log inside your jail, so all commands that you type, are inside the jail not in Nas4Free OS Base, this is the magic of jails, that isolate OS insiside jail from OS Base to avoid problems when update/upgrade Nas4Free.

Re: Stuck on creating jail

Posted: 24 Feb 2013 20:59
by Rafe
Ah i get it! Thanks again. You have been so helpful. In one of your first posts of this topic you said:
"once you create jail proto and works ( jls works), try to create a new one named minidlna, this time you do not need to fetch none , because you have the files, star in the part that uuntar fiules eg:
tar xvf /jail/work/base.txz -C /jail/minidlna/ <- look that I replace proto by minidlna"
Can clarify how to do that not sure i understand? I could try this or i could try serviio if it's easier.

Re: Stuck on creating jail

Posted: 24 Feb 2013 21:03
by raulfg3
you can create as many jails as you want, for example, I create 4 one name proto, other minidlan, other serviio, other amule, and so on.

To create second jail is easy than first because, normally you understand what to do, and only need to replace proto by minidlna in all apariences of jail ( if jails say:

tar xvf /jail/work/base.txz -C /jail/proto/

you need to do:

tar xvf /jail/work/base.txz -C /jail/minidlna/

of course minidlna must exist.

mkdir /jail/minidlna

Re: Stuck on creating jail

Posted: 24 Feb 2013 21:17
by Rafe
Ok what's confusing me is I already installed minidlna (I think) outside of the jail. Is that going to mess me up? Should I somehow delete it, move it or don't worry about it? Or if I make the new jail will it just work? I found your How To:viewtopic.php?f=79&t=2099 should I just go by that?

Re: Stuck on creating jail

Posted: 24 Feb 2013 21:20
by raulfg3
best way is to save Nas4Free Config and do a new fresh install and restore config, all job done in jails is safe because is in your data disk, so you only lose your minidlna install outside the jail.

Re: Stuck on creating jail

Posted: 24 Feb 2013 22:11
by Rafe
I'm following the jail creation guide again and substituting minidlna for proto but at what point of the guide do I start? I think I pick it up at this step:

Configuring the prototype jail
Setting a nameserver for proto
Copy /etc/resolve/conf from the NAS4Free host:
# cp /etc/resolv.conf /jail/proto/etc/
Setting timezone
Copy the necessary timezone file from: /jail/proto/usr/share/zoneinfo/ To: /jail/proto/etc/localtime
Example: (Obviously choosing your correct timezone)

Re: Stuck on creating jail

Posted: 24 Feb 2013 22:19
by raulfg3
on:
Extract

…the FreeBSD base system to your /jail/proto directory ( 256M base + 56 M lib32)

# tar xvf /jail/work/base.txz -C /jail/proto/
# tar xvf /jail/work/lib32.txz -C /jail/proto/

and next:
Configuring the prototype jail

Setting a nameserver for proto (change proto for minidlna

Re: Stuck on creating jail

Posted: 24 Feb 2013 23:26
by Rafe
When I get to
Create rc.conf.local:
# touch conf/rc.conf.local
# nano conf/rc.conf.local

It's not blank I have
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.domain.local" # hostname
jail_proto_ip="192.168.1.201" # ip of the jail
jail_proto_interface="em0" # Network Interface to use,
replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems
to mount

From when i first made the jail. I'm confused should this be showing up or should i just replace proto with minidlna?

Re: Stuck on creating jail

Posted: 25 Feb 2013 07:43
by raulfg3
this is mine , for comparasion pourpouses:

Code: Select all

### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
jail_list="kissdx minidlna amule"		# name of the jails to start "proto www..."
###
jail_serviio_rootdir="/jail/serviio"	                # path to our jail
jail_serviio_hostname="serviio"       	                # hostname 
jail_serviio_ip="192.168.1.201"		                # ip of the jail 
jail_serviio_interface="em0"		                # Network Interface to use,replace on your NAS interface name
jail_serviio_devfs_enable="YES"		                # use devfs 
jail_serviio_mount_enable="YES"		                # mount YES|NO 
jail_serviio_fstab="/jail/conf/fstab.serviio"	        # File with Filesystems to mount
###
jail_kissdx_rootdir="/jail/kissdx"
jail_kissdx_hostname="kissdx"
jail_kissdx_ip="192.168.1.202"
jail_kissdx_interface="em0"
jail_kissdx_devfs_enable="YES"
jail_kissdx_mount_enable="YES"
jail_kissdx_fstab="/jail/conf/fstab.kissdx"
###
jail_minidlna_rootdir="/jail/minidlna"		        # path to our jail
jail_minidlna_hostname="minidlna"	                # hostname 
jail_minidlna_ip="192.168.1.203"		        # ip of the jail 
jail_minidlna_interface="em0"		                # Network Interface to use, replace on your NAS interface name
jail_minidlna_devfs_enable="YES"		        # use devfs 
jail_minidlna_mount_enable="YES"		        # mount YES|NO 
jail_minidlna_fstab="/jail/conf/fstab.minidlna"	        # File with Filesystems to mount
###
jail_donkey_rootdir="/jail/donkey"		        # path to our jail
jail_donkey_hostname="donkey"	                        # hostname 
jail_donkey_ip="192.168.1.204"		                # ip of the jail 
jail_donkey_interface="em0"		                # Network Interface to use, replace on your NAS interface name
jail_donkey_devfs_enable="YES"		                # use devfs 
jail_donkey_mount_enable="YES"		                # mount YES|NO 
jail_donkey_fstab="/jail/conf/fstab.donkey"	        # File with Filesystems to mount
###
jail_amule_rootdir="/jail/amule"		        # path to our jail
jail_amule_hostname="amule"	                        # hostname 
jail_amule_ip="192.168.1.205"		                # ip of the jail 
jail_amule_interface="em0"		                # Network Interface to use, replace on your NAS interface name
jail_amule_devfs_enable="YES"		                # use devfs 
jail_amule_mount_enable="YES"		                # mount YES|NO 
jail_amule_fstab="/jail/conf/fstab.amule"	        # File with Filesystems to mount


Re: Stuck on creating jail

Posted: 26 Feb 2013 01:31
by Rafe
Hey sorry for the late reply but I got it. Not sure if I should make another topic or not but I'm now having a problem following your How To instal minidlna guide. I'm having the same problem as this person whom you answered but would like you to clarify what it is I need to do exactly.
raulfg3 wrote:
DanAddz wrote:Hay Guys,

Sorry for so many questions,

I am completing this on my nas4free and am having some trouble again.

I have been able to get into the "root@proto: / #" and have tried to add the minidlna package but am unable to get the files.

i get this everytime,

Code: Select all

Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/minidlna.tbz: No address record
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/minidlna.tbz' by URL
What am i doing wrong?

cheers,

today 2 of January, still do not exist 9.1 branch. see: ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/

So you need to use setenv like if it was in RC3 state still.

Re: Stuck on creating jail

Posted: 26 Feb 2013 05:43
by raulfg3
you need to do

Code: Select all

setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/
explain here: viewtopic.php?f=72&t=2646

and here:
viewtopic.php?f=72&t=1732

Re: Stuck on creating jail

Posted: 26 Feb 2013 13:42
by Rafe
I read both but I still don't know how to add or what to do with:
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports ... nt/Latest/
I assume I need to change the packagesite somewhere somehow to the above link? I'm sure this is something common that I should know but sadly I don't understand what I'm supposed to do with that.
Thanks again

Re: Stuck on creating jail

Posted: 26 Feb 2013 14:28
by fsbruva
Please hear this comment in the spirit it was intended - one of a helpful suggestion:

It is obvious that you do not possess the minimum skills necessary to carry out the installation of a jail. This is not an insult, but an observation. There exists a serious potential for harm to your system when you start entering commands at the terminal, and I fear you might do more harm than good by continuing. However, if this is for a server that you don't mind corrupting to the point of a re-install, then I suppose this only one way to learn.

I would highly recommend the following book : Introduction to UNIX and Linux, by John Muster. It is an excellent textbook that I used to get comfortable with both systems, and still use as a reference to this day.

While you are waiting for the book to get shipped to you, try taking a look at some of the FreeBSD (which is what Nas4Free is based upon) manual pages. You are not the first person in the world to try and figure this stuff out - and there are plenty of resources.

For instance, Googling "setenv man" pointed me to this site: http://www.s-gms.ms.edus.si/cgi-bin/man-cgi?setenv+1 among others. In general, aim for section 1 or 8 of man pages.

Re: Stuck on creating jail

Posted: 27 Feb 2013 01:48
by Rafe
No offense taken. This is just for my own personal server in my house. I don't mean to troll or bother anyone I just wanted to build a media server for my movies, music and pictures. Someone on another forum suggested nas4free but if there is something easier or more user friendly I'm all for it. Really I just want to be able to stream videos, download Usenet/Bittorent, and be able to access my server from outside my local network.

Re: Stuck on creating jail

Posted: 28 Feb 2013 11:12
by raulfg3
any news?