Skip to content
/ lxkns Public

Discover Linux kernel namespaces in Go. Almost everywhere. Aware of various OCI container engines, even engines in containers.

License

Notifications You must be signed in to change notification settings

thediveo/lxkns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,071 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lxkns logo

Linux kernel Namespaces

Manual PkgGoDev GitHub

build and test Coverage goroutines file descriptors Go Report Card

Discover how containers are using Linux kernel namespaces...

container namespaces

...or the mounts inside your containers, and how over-mounts make other mounts invisible.

container mounts

Quick Start

Docker Compose

First, ensure that you have the Docker compose v2 plugin version 2.34.0 or later installed. Version 2.34.0 was released March 2025. Make also sure you have a Linux kernel of at least version 4.11 installed, however we highly recommend at least kernel version 5.6 or later.

docker compose -f oci://ghcr.io/thediveo/lxkns/app:latest up

Finally, visit http://localhost:5010 and start looking around Linux kernel namespaces, as well as mount points with their hierarchies.

Siemens Industrial Edge

  1. download latest lxkns.zip
  2. Import the included lxkns.app into your IEM.
  3. Deploy the "Linux kernel namespace namespace discovery" app to your IE (virtual) devices.
  4. On your IE (virtual) device, navigate to https://ied-address/lxkns.

Overview

lxkns discovers...

  • Linux namespaces in almost every nook and cranny of your hosts (from open file descriptors, bind-mounts, processes, and now even tasks and from open sockets) – please see the table below,
  • the mount points inside mount namespaces (correctly representing "overmounts").
  • container workloads: these are automatically related to the underlying Linux namespaces.
    • lxkns now leverages (Siemens OSS) Turtlefinder technology to autodetect container engines even in hierarchical configurations, such as Kubernetes-in-Docker and Docker Desktop on WSL2. Also, (socket-activated) podman detection has finally landed in turtlefinder, and in turn also in lxkns.
Where? lsns lxkns Kernel
/proc/*/ns/* 4.11
/proc/*/task/*/ns/* 4.11
bind mounts A 4.11
➃a /proc/*/fd/* namespace fds 4.11
➃b /proc/*/fd/* socket fds 5.6
namespace hierarchy 4.11
owning user namespaces 4.11
  • A very recent versions of lsns have improved and are now reporting bind-mounted namespaces as of "util-linux 2.39.1". Maybe lxkns managed to put some pressure to innovate on lsns, maybe not; we would like to hear from people who are acquainted with the rationale.

lxkns finds mount points even in process-less mount namespaces (for instance, as utilized in "snap" technology). Our discovery engine even determines the visibility of mount points, taking different forms of "overmounting" into consideration.

Take a look at the comprehensive user (and developer) manual.

Note

Please check Important Changes, especially if you have been used the API in the past, and not only the service.

Intro Video

Or, watch the short overview video how to find your way around discovery web frontend:

lxkns web app

Detected/Supported Container Engines

The following container engine types are supported:

Deployment Options

The lxkns discovery engine can be operated as a stand-alone REST service with additional web UI. Alternatively, it can be embedded/integrated into other system diagnosis tools. A prominent example of embedding lxkns is @siemens/ghostwire.

DevContainer

Caution

Do not use VSCode's "Dev Containers: Clone Repository in Container Volume" command, as it is utterly broken by design, ignoring .devcontainer/devcontainer.json.

  1. git clone https://github.com/thediveo/lxkns
  2. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
  3. select lxkns.code-workspace and off you go...

Supported Go Versions

lxkns supports versions of Go that are noted by the Go release policy, that is, major versions N and N-1 (where N is the current major version).

Contributing

Please see CONTRIBUTING.md.

Copyright and License

lxkns is Copyright 2020‒26 Harald Albrecht, and licensed under the Apache License, Version 2.0.

About

Discover Linux kernel namespaces in Go. Almost everywhere. Aware of various OCI container engines, even engines in containers.

Resources

License

Contributing

Stars

Watchers

Forks

Packages