I've created a Debian-based chroot environment using debootstrap under Arch Linux, and fill it with life like this:#!/bin/shmount -t proc proc $CHROOT/procmount -t devpts devpts $CHROOT/dev/ptschroot $CHROOT /bin/bash --login -c /etc/init.d/ssh startThe problem is that after executing the script above, I'm not able to open new terminals on the host system anymore:urxvt: can't initialize pseudo-tty, aborting.Shutting down the chroot (stopping sshd, unmounting proc and dev/pts) does not bring back new terminals on the host.What am I missing here?
Debian chroot blocking PTTYs on host
tty;chroot;urxvt
When you run mount -t devpts devpts $CHROOT/dev/pts, this mounts a separate instance of the devpts filesystem in the chroot. An alternative way of making devpts available in the chroot is to use a bind mount, which makes the same instance of the filesystem available at a new location. Bind mounts are like making a hard link, only for mount points instead of files.mount --bind /dev/pts $CHROOT/dev/ptsSeparate instances of devpts shares the same files (if you create or remove a terminal or change its metadata, it's reflected in all instances). However there is evidently some difference under the hood which makes it not work. A bind mount ensures that everything that needs to be synchronized is synchronized since it's the same filesystem and not merely an identical one.