Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐧 Lxc4Dev - Advanced LXC Container Management Suite

License: MIT Arch Linux CachyOS Shell Script

A comprehensive, user-friendly LXC (Linux Containers) management suite with automated installation, interactive container management, and advanced features. Designed for both beginners and advanced users.

🚀 Quick Start

# Clone the repository
git clone https://github.com/0xamirreza/lxc4dev.git
cd lxc4dev

# Make scripts executable
chmod +x lxc-install.sh 0xlxc.sh

# Run the installation
./lxc-install.sh

# Choose option 1 to install LXC + Network
# After installation, press Enter to launch 0xlxc manager
# OR
# For Access the LXC manager from anywhere just type
0xlxc

📋 Project Structure

File Description
lxc-install.sh 🔧 One-click LXC installation with network configuration
0xlxc.sh 🎛️ Advanced interactive container management interface
VERSION 📌 Version control file (current: v1.0.0)
README.md 📚 This comprehensive guide

✨ Key Features

🔧 Installation & Setup

  • One-click installation with automated network configuration
  • Auto-launch interface - seamlessly transition from install to management
  • Global command access - use 0xlxc from anywhere
  • Complete uninstallation with dependency cleanup

🎛️ Container Management

  • Interactive container selection - no manual typing required
  • 18 management functions covering all container operations
  • Beautiful table interfaces with status indicators
  • Resource monitoring - real-time CPU, memory, disk usage
  • Container cloning with interactive source selection

💾 Backup & Recovery

  • Smart backup system with automatic file discovery
  • Interactive restore with backup file browser
  • Snapshot management - create, restore, delete snapshots
  • Data integrity - containers stopped during backup for consistency

🌐 Network Management

  • Automatic bridge setup (lxcbr0 with DHCP)
  • Network diagnostics and connectivity testing
  • IP address management with real-time display
  • Network troubleshooting tools built-in

🗺️ Roadmap

🔥 High Priority

  • Multi-distro Support - Add support for apt, dnf, zypper package managers
  • Enhanced Resource Editor - Improve container resource editing functionality
  • Installation Wizard - GUI-based installation option

🚀 Planned Features

  • Container Templates - Pre-configured container templates
  • Logging System - Persistent logging with rotation
  • Web Interface - Browser-based management dashboard
  • Auto-scaling - Dynamic resource adjustment
  • Health Monitoring - Container health checks and alerts
  • Custom Networks - Support for custom bridge configurations
  • Container Migration - Move containers between hosts
  • Backup Scheduling - Automated backup scheduling
  • Performance Analytics - Historical performance data
  • Container Orchestration - Multi-container deployment management

🔧 Technical Improvements

  • Configuration Files - YAML/JSON configuration support
  • Container Registry - Private container image registry
  • Security Hardening - Enhanced security profiles

📋 Complete Function Reference

# Function Description Features
1 Create Container Interactive OS selection Resource limits, template selection
2 Container Info Detailed system information Resource usage, network details
3 List All Containers Overview dashboard Status, IP addresses, resource usage
4 Start Container Boot containers Interactive selection, status monitoring
5 Stop Container Graceful shutdown Safe stopping with confirmation
6 Restart Container Reboot containers Graceful restart with status updates
7 Delete Container Remove containers Safe deletion with data confirmation
8 Enter Container Access container shell Multiple methods (attach/console)
9 Execute Command Run remote commands Execute in any container remotely
10 Clone Container Duplicate containers Interactive source selection
11 Snapshot Management Container snapshots Create, restore, delete, list
12 Resource Usage Real-time monitoring CPU, memory, disk, network stats
13 Network Configuration Network management Interface config, connectivity tests
14 Backup Container Full container backup Smart directory selection
15 Restore Container Restore from backup Interactive backup file browser
16 Exit Quit application Clean exit with goodbye message
17 Edit Resources Modify limits Dynamic CPU, memory, disk adjustment
18 Uninstall LXC Complete removal Clean uninstall with dependency cleanup

🛠️ Technical Features

  • Cgroup v1/v2 Support - Automatic detection and compatibility
  • Resource Validation - Input validation for all settings
  • Error Handling - Comprehensive error checking and user feedback
  • Color-coded Interface - Beautiful, intuitive user experience
  • Table Formatting - Professional data presentation
  • Smart Defaults - Sensible default values for quick setup

🎯 Usage Guide

Basic Usage

# Access the LXC manager from anywhere
0xlxc

Command Reference

# Installation
./lxc-install.sh              # Install LXC with network setup

# Management Interface
0xlxc                         # Open interactive manager

# Direct LXC Commands (after installation)
lxc-ls -f                     # List all containers with details
lxc-start -n CONTAINER_NAME   # Start a specific container
lxc-stop -n CONTAINER_NAME    # Stop a specific container
lxc-attach -n CONTAINER_NAME  # Attach to container shell
lxc-console -n CONTAINER_NAME # Access container console
lxc-info -n CONTAINER_NAME    # Show container information

# Network Troubleshooting
sudo lxc-fix-network          # Fix network issues (auto-installed)

Example Workflow

# 1. Install the system
./lxc-install.sh
# Choose option 1, press Enter when done

# 2. Create your first container
# Select option 1 in 0xlxc interface
# Choose Ubuntu 22.04, set resources

# 3. Start and enter the container
# Use options 4 and 8 in the interface

# 4. Backup your configured container
# Use option 14 for backup

🖥️ Distribution Support

Fully Tested & Supported

  • Arch Linux - Fully tested and working perfectly
  • CachyOS - Fully tested and working perfectly

📦 Package Manager Support

The installation script currently supports pacman (Arch-based distributions). Support for other package managers is planned:

Package Manager Distributions Status
pacman Arch Linux, Manjaro, EndeavourOS, CachyOS Supported
apt Debian, Ubuntu, Linux Mint, Pop!_OS 🔄 Planned
dnf Fedora, RHEL 8+, CentOS Stream 🔄 Planned
yum RHEL, CentOS 7 🔄 Planned
zypper openSUSE, SUSE Linux Enterprise 🔄 Planned
apk Alpine Linux 🔄 Planned
xbps Void Linux 🔄 Planned
emerge Gentoo (Portage) 🔄 Planned

Note: While the core 0xlxc management interface should work on any Linux distribution with LXC installed, the automated installer currently only supports Arch-based systems.

📋 Requirements

System Requirements

  • Linux system with systemd
  • Root/sudo privileges
  • Internet connection for package downloads
  • Minimum 2GB RAM (4GB+ recommended)
  • 10GB+ free disk space

Dependencies (Auto-installed)

  • LXC (Linux Containers)
  • iptables-nft
  • dnsmasq
  • systemd-networkd

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Areas where help is needed:

  • Support for additional package managers (apt, dnf, zypper, etc.)
  • Testing on different distributions
  • Documentation improvements
  • Bug fixes and feature enhancements

📄 License

This project is licensed under the MIT License - see the MIT License for details.

🐛 Issues & Support

⭐ Show Your Support

If this project helped you, please consider giving it a ⭐ on GitHub!


Made with ❤️ for the Linux community

About

⚙️ A comprehensive, user-friendly LXC (Linux Containers) management suite with automated installation, interactive container management, and advanced features. Designed for both beginners and advanced users.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages