fork-pty inside chroot in Ubuntu 18
It took way too long for me to figure this out, so maybe this will be helpful for someone else:
This is how you make fork-pty work inside a chroot in Ubuntu 18
sudo mount -t devpts none "/home/guest2/dev/pts" -o ptmxmode=0666,newinstance sudo mount --bind /home/guest2/dev/pts/ptmx /home/guest2/dev/ptmx
Where /home/guest2 is the chroot folder.
fork-pty is used to create pseuodo terminals. It's used in the nodejs pty module. Which stopped working for me when I upgraded from Ubuntu-16 to Ubuntu-18. Because I was running it in a chroot.
I also read old tutorials on how you used to do it, read the source code for pty.js and asked on IRC (where I did not get any help, although IRC is usually awesome)
Start with the manual for the command you are running.
Often we just want to get a quick fix, and get on with our lives. But sometimes "quick" can turn into hours, and even days, so sometimes it pays off to actually read the damn manual.
Written by Johan Zetterberg Mars 22, 2019.