How to View Virtualization and Container IDs in htop

This article provides a straightforward guide on how to configure and view hardware virtualization status and container IDs within the htop interactive process viewer in Linux. You will learn the specific setup steps required to display virtualization types (like KVM or VMware) and container identifiers (such as Docker or Podman IDs) directly in your system monitor dashboard.

Displaying Hardware Virtualization Status

When running Linux inside a virtual machine, htop can detect and display the underlying hypervisor. This information is hidden by default but can be easily added to your top header meters.

  1. Launch htop by typing htop in your terminal.
  2. Press F2 (or S) to enter the Setup menu.
  3. Use the arrow keys to navigate down to Meters in the first column.
  4. Move to the Available meters column (usually the far right) and locate Virtualization.
  5. Press F5 to add it to the Left column, or F6 to add it to the Right column.
  6. Press F10 to save and exit the setup.

The top dashboard will now explicitly state your hardware virtualization status, showing values like none, kvm, vmware, or xen.

Viewing Container IDs for Running Processes

If you are running containerized applications, you can configure htop to display the specific container ID associated with each process. This makes it easy to track down which Docker or Podman container is consuming system resources.

  1. Open htop and press F2 to access the Setup menu.
  2. Select Columns from the first menu column.
  3. Move to the Available columns list and scroll down to find CONTAINER.
  4. Press F5 to add it to your Active columns list.
  5. Use F7 (Move Up) or F8 (Move Down) to position the column where you want it to appear on your screen (e.g., next to the PID or Command column).
  6. Press F10 to save your changes.

Your process table will now include a dedicated column displaying the unique alphanumeric hash or ID of the container managing that specific process.