is it possible to chroot into arm64 from amd64?

tech-lists tech-lists at
Fri Feb 16 14:15:55 UTC 2018

On 16/02/2018 08:21, Mikaël Urankar wrote:
> Put  /usr/local/bin/qemu-aarch64-static in
> $SYSROOT/usr/local/bin/qemu-aarch64-static
> you can use "service qemu_user_static start" to add the interpreter

That did it! :D many thanks. I had a bit of a problem with ldconfig but
it seems ok so far. Here's what I did from start to finish in case
anyone else is interested:

root at sm1:/# chflags -Rf noschg crossbuild/
root at sm1:/# rm -Rf crossbuild/*
root at sm1:/# mkdir crossbuild/arm64
root at sm1:/# sh
# SYSROOT=/crossbuild/arm64
# cd /usr/src
# make -j96 cleandir && make -j96 clean && make -j96 clean
# make -j96 TARGET=arm64 TARGET_ARCH=aarch64 buildworld
# make DESTDIR=$SYSROOT TARGET=arm64 TARGET_ARCH=aarch64 installworld
# make DESTDIR=$SYSROOT TARGET=arm64 TARGET_ARCH=aarch64 distribution

# cp /usr/local/bin/qemu-aarch64-static
cp: /crossbuild/arm64/usr/local/bin/qemu-aarch64-static: No such file or
# cp /usr/local/bin/qemu-aarch64-static $SYSROOT/usr/local/bin/
cp: directory /crossbuild/arm64/usr/local/bin does not exist
# ls -lah $SYSROOT/usr/local
total 8
drwxr-xr-x   2 root  wheel   512B Feb 16 12:28 .
drwxr-xr-x  13 root  wheel   512B Feb 16 12:28 ..
# mkdir $SYSROOT/usr/local/bin
# cp /usr/local/bin/qemu-aarch64-static $SYSROOT/usr/local/bin/
# service qemu_user_static start
Cannot 'start' qemu_user_static. Set qemu_user_static_enable to YES in
/etc/rc.conf or use 'onestart' instead of 'start'.
# echo "qemu_user_static_enable="YES"" >>/etc/rc.conf
# service qemu_user_static start
# mount -t devfs devfs ${DESTDIR}/dev
# chroot -u root $SYSROOT

root at sm1:/ #
root at sm1:~ # file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, ARM aarch64, version 1
(FreeBSD), dynamically linked, interpreter /libexec/, for
FreeBSD 11.1 (1101509), FreeBSD-style, stripped
root at sm1:~ # service start ldconfig
ps: empty file: Invalid argument
start does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root at sm1:~ # which ldconfig
root at sm1:~ # /sbin/ldconfig
root at sm1:~ #
root at sm1:~ # exit


More information about the freebsd-virtualization mailing list