• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

nixos-container : Command Examples in Linux

by Deepika

“nixos-container” is a tool for starting NixOS containers using Linux containers. NixOS is a Linux distribution that uses the Nix package manager, and “nixos-container” allows NixOS containers to be run on top of existing Linux installations.

A container is a lightweight, isolated environment that runs on top of a host operating system. “nixos-container” allows NixOS containers to be created and run on Linux systems, providing a convenient way to test or run NixOS-based applications and services.

The tool makes it easy to start, manage, and stop NixOS containers, and it provides a simple and intuitive interface for controlling the containers. It allows containers to be configured using NixOS configuration files, and it provides access to the full range of NixOS packages and services.

nixos-container Command Examples

1. List running containers:

# sudo nixos-container list

2. Create a NixOS container with a specific configuration file:

# sudo nixos-container create {{container_name}} --config-file{{nix_config_file_path}}

3. Start, stop, terminate, or destroy a specific container:

# sudo nixos-container {{start|stop|terminate|destroy|status}}{{container_name}}

4. Run a command in a running container:

# sudo nixos-container run {{container_name}} -- {{command}}{{command_arguments}}

5. Update a container configuration:

# sudo $EDITOR /var/lib/container/{{container_name}}/etc/nixos/configuration.nix && sudo nixos-container update{{container_name}}

6. Enter an interactive shell session on an already-running container:

# sudo nixos-container root-login {{container_name}}

Filed Under: Linux

Some more articles you might also be interested in …

  1. Linux OS Service ‘irqbalance’
  2. Sa Command Examples in Linux
  3. mktemp: command not found
  4. minikube Command Examples
  5. getent: command not found
  6. chars: Display names and codes for various ASCII and Unicode characters and code points
  7. kpackagetool5: command not found
  8. i3lock: command not found
  9. tcptraceroute Command Examples in Linux
  10. getfacl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright