chroot is a way to change a process' top directory to another directory than the root directory. chroot, other users get a cannot change root directory to …: Operation not permitted error message. systemd-nspawn runs a command or OS in a leight-weight namespace container and is therefore somewhat similar to chroot but more powerful because it fully virtualizes the file system hierarchy, process tree, IPC subsystems and host and domain name.