The warning you're seeing:
textWARNING: Error changing the container working directory. Using '/root' instead: chdir /scratch/loison_benjamin/apptainer: no such file or directory
means that Apptainer cannot find the directory /scratch/loison_benjamin/apptainer inside the container when it tries to set your working directory. By default, Apptainer tries to mirror your current host directory inside the container, but if that path doesn't exist in the container, it falls back to /root.
/scratch/loison_benjamin/apptainer is not automatically available inside the container unless you explicitly bind it.--writable and --fakeroot flags do not affect directory mounting.Use the --bind (or -B) option to mount your host home directory (or any directory) into the container. For example:
bashapptainer shell --writable --fakeroot --bind ~/:/host_home debian-sandbox/
~) to /host_home inside the container.cd /host_home and ls to see your host files./host for Automatic Home BindingApptainer automatically binds your host home directory to /host inside the container if you use the --contain or --home options, but the simplest way is to explicitly bind it as above.
Once inside the container, you can list the bound directory:
bashApptainer> ls /host_home
bashcd ~/apptainer/ apptainer shell --writable --fakeroot --bind ~/:/host_home debian-sandbox/ Apptainer> ls /host_home
Le Chat can make mistakes. Check answers. Learn more