# ZFS, beadm, 64 bits host, 32 bits jail



## yom (Jul 25, 2012)

Hello,

I've set up a 64 bits VM with ZFS and sysutils/beadm, and used beadm to create some boot environment for two jails:
- a 64 bits jail, just like the host
- a 32 bits jail, created from *beadm create -e default jail32* and some commands I could find in the ZFS Madness thread in this forum

My 64 bits jail is running fine and I can install everything with no problem.
My 32 bits jail is also running, but it seems something got wrong in the process because it seems it can't build perl at some point telling me libperl.so is not found.

Here is what I did to create the jail:

- I've created a BE with *beadm create -e default jail32*
- made the jail32 snapshot to be mountable on /jails/jail32
- configured rc.conf with the following


```
jail_jail32_rootdir="/jails/jail32"
jail_jail32_hostname="jail32.domain.com"
jail_jail32_ip="172.32.0.200"
jail_jail32_devfs_enable="YES"
jail_jail32_procfs_enable="YES"
jail_jail32_exec_start="/bin/sh /etc/rc"
jail_jail32_exec_stop="/bin/sh /etc/rc.shutdown"
```

- I've mounted my jail32 snapshot
- On the host, I got to cross compile buildworld for TARGET=i386, and installed it in the jail32 path with TARGET=i386 DESTDIR=/jails/jail32
- configured my jail32 /etc/rc.conf


```
hostname=jail32.domain.com
network_interfaces=""

syslogd_flags="-ss"

sshd_enable="YES"
```

- and started my jail with */etc/rc.d/jail start*

I can ssh to my jail32.
once there:

```
# uname -a
FreeBSD jail32.domain.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Mon Jul 23 13:54:24 CEST 2012     root@host.domain.com:/usr/obj/usr/src/sys/GENERIC  i386
```

Things seems to be running fine.
But the Perl port does not build, and I get this error:


```
...
Making all in dist/threads-shared
 make all PERL_CORE=1 LIBPERL_A=libperl.so LINKTYPE=dynamic
LD_LIBRARY_PATH=/usr/ports/lang/perl5.14/work/perl-5.14.2  ./perl -f -Ilib pod/buildtoc --build-toc -q
Shared object "libperl.so" not found, required by "perl"*** Error code 1

Stop in /usr/ports/lang/perl5.14/work/perl-5.14.2.
*** Error code 1

Stop in /usr/ports/lang/perl5.14.
*** Error code 1

Stop in /usr/ports/lang/perl5.14.
```

I've tried to cd to /usr/ports/lang/perl5.14/work/perl-5.14.2 and start manually the command, and I'm also getting the same error.
It seems like even though the LD_LIBRARY_PATH is set, perl does not seem to get it.

I'm thinking that since *beadm* creates a snapshot of a 64bits system, even if I install a 32bits system over it, some thing's got wrong.
Can anyone help me with this please?


----------



## vermaden (Jul 25, 2012)

Try with clean /jails/jail32 directory, do not create it from 64bit boot environment or delete all files from there before making buildworld i386 target there.

Do these steps:
1. Create empty directory or ZFS dataset as /jails/jail32 or just remove all files from that boot environment You already have as /jails/jail32
2. Do cross compile buildworld for TARGET=i386 and install it there with TARGET=i386 DESTDIR=/jails/jail32
3. Configure jail32 upon Your needs
4. Now start the jail32 and check if there are still perl errors


----------



## yom (Jul 25, 2012)

It's working.

I guess I should have created a clean zfs dataset from the start instead of installing over the 64bits snapshot.

Thanks


----------



## vermaden (Jul 25, 2012)

Welcome.


----------

