jails How to install "pkg" inside a jail for a machine without Internet connection?

ikevin8me

Active Member

Reaction score: 12
Messages: 198

I have a FreeBSD box with no Internet connection. Somehow I had installed "pkg" into the host system previously (if I remember correctly, it was from the mounted dvd1.iso).

I created a jail and tried to install some packages. The "pkg" is not available in the jail. I tried to mount the same dvd1.iso inside the jail, but it says "Operation not permitted". I tried to copy "pkg" from the host into the jail and it didn't work.

I'm running out of ideas. So, how to I install "pkg" inside a jail?

Thanks!
 
OP
I

ikevin8me

Active Member

Reaction score: 12
Messages: 198

I managed to resolve this using “pkg -r” from the host.
 

im

Active Member

Reaction score: 44
Messages: 108

I tried to mount the same dvd1.iso inside the jail, but it says "Operation not permitted"
Instead of mounting inside the jail, mount it at host to the directory within the jail.
Another way: mount everything as usual at host, and try to use mount_nullfs() for remounting specified directory from the host to the jail.
It is very useful to specify mount.fstab jail's option, and mount everything during the jail startup.

Example of my /etc/fstab.jailname for using with jail's mount.fstab:
Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/usr/ports      /home/jails/jailname/usr/ports/   nullfs  ro      0       0
/usr/local/distfiles /home/jails/jailname/usr/local/distfiles     nullfs  rw      0       0
/home/jails/jailnameold/home /home/jails/jailname/home   nullfs  rw      0       0
 
Top