DEV Community

Cover image for Introducing rust-lxc: Manage Linux Containers with Rust 🦀
Ozgur Kara
Ozgur Kara

Posted on

Introducing rust-lxc: Manage Linux Containers with Rust 🦀

LXC (Linux Containers) is a powerful tool for OS-level virtualization but there hasn't been a native Rust tool to manage it, until now!

Meet rust-lxc

rust-lxc is a fully open-source Rust crate CLI that allows you to manage LXC containers using native Rust code.

No more shell scripts, no more wrappers, just pure Rust and full control :-)

Features

  • ✅ Native FFI bindings to liblxc
  • ✅ Rust-based CLI (via clap)
  • ✅ Easily run commands like:
cargo run -- create --name mycontainer --template download
cargo run -- start --name mycontainer
cargo run -- stop --name mycontainer
cargo run -- delete --name mycontainer
Enter fullscreen mode Exit fullscreen mode

📦 Getting Started

  1. Clone the repo:
git clone https://github.com/ta2ozg/rust-lxc
cd rust-lxc
Enter fullscreen mode Exit fullscreen mode
  1. Build and run:
cargo run -- ls
Enter fullscreen mode Exit fullscreen mode
  1. Or use it as a library:
# Cargo.toml
[dependencies]
rust-lxc = "0.1"
Enter fullscreen mode Exit fullscreen mode

Why we built this

LXC deserves a fast, safe and modern Rust interface, rust-lxc fills that gap. As the Linux kernel begins embracing Rust, it's time our tooling does too.

This project aims to offer both a command-line interface and a reusable library for other Rust-based container tools.

Contributions welcome

This project is open to the community, if you have any ideas, feedback PRs are welcome!

If you like this project, please add ⭐ star it, test it and help grow the ecosystem!


🦀 Let's build the future of container tooling in Rust.

Top comments (0)