Running an Apptainer Container Image on NAS Systems

Article ID: 722
Last updated: 14 Sep, 2026

If you have an existing Apptainer image that is ready to run, you should be able to run it on any platform where Apptainer is installed. This article provides information to help you run an Apptainer container image on NAS systems.

Note: A container is a runtime instance of an image. You can run multiple containers of the same image.

Unpacking the Image Tar File on NAS Systems

If you transferred your Apptainer container image to a NAS system as a compressed tar file, use the appropriate tool to uncompress and unpack the tar file. For example:

host% cd /nobackuppX/username/dir_containing_the_tar_file
host% tar -xzf your_image_name.tgz

where X in nobackuppX is one of [17-19,27-29]. Use the number of the /nobackup directory you are assigned to.

Accessing Apptainer at NAS

Apptainer is installed for use on NAS systems with either x86_64 or aarch64 architecture, and with either the TOSS4 or TOSS5 operating system. You can use Apptainer after loading one of these modules:

apptainer/x86-toss4
For use on the front ends (PFEs, AFEs, and CFEs) and compute nodes of older NAS systems with x86_64 architecture and the TOSS4 operating system, including Electra (bro_ele, sky_ele), Aitken (rom_ait, mil_ait) and some Cabeus systems (mil_a100).
apptainer/x86-toss5
For use on the front ends (ATHFEs) and compute nodes of the latest NAS Athena cluster (tur_ath) with x86_64 architecture and the TOSS5 operating system.
apptainer/arm-toss5
For use on the front ends (CGHFEs) and compute nodes of the Cabeus GH200 system (gh200) with aarch64 architecture and the TOSS5 operating system

Here are example commands for the different environments listed above:

cfe01% module load apptainer/x86-toss4

athfe01% module load apptainer/x86-toss5

cghfe01% module load apptainer/arm-toss5

Running the Container Image

Depending on what you want to do, you can use either the shell, exec, or run command of Apptainer.

Warning: Use of the --fakeroot option is not allowed on NAS systems.
shell
The shell command allows you to spawn a new Bourne shell within your container and interact with it as though it were a small virtual machine. To exit the shell, enter exit at the Apptainer prompt.
exec
The exec command allows you to execute a custom command within a container.
run
Apptainer containers may contain runscripts. These are user defined scripts that define the actions a container should perform when someone runs it. The runscript can be triggered with the run command, or simply by calling the container as though it were an executable.

For example, if you port a sandbox lolcow container (renamed from lolcow_from_sif as described in this article) to a NAS system, you may do:

host% apptainer shell lolcow
Apptainer> echo hello
hello

Apptainer> exit
host% apptainer exec lolcow which cowsay
/usr/games/cowsay
host% apptainer exec lolcow cowsay hello
 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
host%
host% apptainer run lolcow
 _________________________________
<Mon Dec 22 14:24:30 PST 2025 >
 ---------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
host%

Setting Up Environment Variables

You can modify the environment such as the $PATH within your container. For example:

host% apptainer shell lolcow
Apptainer> echo $PATH
/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Apptainer> export PATH=$PATH:/u/username/bin
Apptainer> echo $PATH
/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u/username/bin

Accessing Files on NAS Systems

You can access files on NAS systems from within the container. By default, Apptainer bind-mounts your NAS $HOME (as /u/username), /tmp, and $PWD into your container at runtime. If you run the apptainer command from your /nobackuppX/$USER directory, the $PWD variable is then /nobackuppX/$USER and you can access the files and directories there.

Warning: The automatic mount for $PWD may fail if the path contains symlinks that resolve to different locations on the host versus inside the container. This will happen when $PWD is /nobackup/username, which is a symlink to the actual /nobackuppX/username. If you want to rely on Apptainer bind-mounting your $PWD when $PWD is your NAS nobackup directory, access it as /nobackuppX/username instead of /nobackup/username. To avoid this confusion, use the --bind option to bind-mount your /nobackup directory, as described below.
host% cd /nobackuppX/username/dir_containing_lolcow_image
host% apptainer shell lolcow
Apptainer> pwd
/nobackuppX/username/dir_containing_lolcow_image
Apptainer> cd /
Apptainer> ls
bin   dev	   etc	 lib	lib64	media  nobackuppX   proc  run	singularity  sys  u    var
boot  environment  home  lib32	libx32	mnt    opt	    root  sbin	srv	     tmp  usr

You can specify additional directories to bind mount into your container with the --bind option.

Note: You can replace --bind with -B or set the environment variable APPTAINER_BIND or APPTINER_BINDPATH on the host system. See this Apptainer page for more information.

For example, if you run the apptainer command from your $HOME, and you want to be able to access files and directories under your /nobackuppX/$USER, you can do:

host% apptainer exec --bind /nobackuppX/username:/mnt lolcow ls /mnt
or
host% apptainer exec --bind /nobackup/username:/nobackup/username lolcow ls /nobackup/username

For read-only filesystems such as /nasa, optionally add :ro to the command as follows:

host% apptainer exec --bind /nasa:/nasa:ro lolcow ls /nasa

You can bind-mount multiple filesystems. For example,

host% apptainer shell --bind /nasa:/nasa:ro --bind /nobackuppX/username:/mnt lolcow
or
host% apptainer shell --bind /nasa:/nasa:ro,/nobackuppX/username:/mnt lolcow
Apptainer> cd /nasa
Apptainer> pwd
/nasa
Apptainer> cd /mnt
Apptainer> pwd
/mnt
Apptainer> exit
host%

Further Reading

Read this article for information on Using OpenMPI as host MPI for running containers in hybrid MPI mode on NAS systems.

Read this article for information on Using Cray MPICH as host MPI for running containers in hybrid MPI mode on Athena.

Also read

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.