Registry / networking / unshare

unshare

JSON →
library0.7.0rscratesunverified

The low-level interface for linux namespaces (containers).

# Cargo.toml [dependencies] unshare = "0.7.0"
INSTALL
IMPORT
SIG · UNSHARE
U
unshare
networkingrustv0.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Command
use unshare::Command;

Run a command in a new Linux namespace.

use unshare::Command; fn main() { let mut cmd = Command::new("echo"); cmd.arg("Hello from namespace"); let status = cmd.status().expect("Failed to run command"); println!("Exit status: {}", status); }
Debug
Known issues
gotchaOnly works on Linux; requires appropriate privileges (e.g., CAP_SYS_ADMIN).
fix
Run as root or with CAP_SYS_ADMIN capability.
affects: *
Upgrade
Version history
0.7.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
unshare — cargo add unshare · libregistry