MacOS – How to Access `/dev` From Inside a `chroot` Jail

chrootchroot-jaildevmacosnfs

     How can one access /dev from within a chroot jail? I'd like to know how to do this on OS X v10.11.5 'El Capitan,' in particular. I've already tried to create an automounting NFS share in order to emulate a bind mount to do this (as described here) without success. Are there any other options?

Best Answer

MacOS has a special filesystem called devfs which can be mounted in multiple places. Just mount it inside your chroot jail, like so:

sudo mount -t devfs devfs "$jail"/dev 
Related Question