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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. What Are Dirty Pages in Linux
  2. chntpw Command Examples in Linux
  3. df Command Examples in Linux
  4. UNIX / Linux : Send mail with attachment using mutt
  5. asciiart Command Examples in Linux
  6. How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  7. CentOS / RHEL 7 : How to disable IPv6 on a specific interface only
  8. Linux OS Service ‘setroubleshoot’
  9. How To Disable MD5-based HMAC Algorithm’s for SSH
  10. chronyc : command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright