Montecarlo is a system utility designed for the management of Linux kernel modules and system services. It provides a unified interface to probe, load, and unload device drivers, incorporating safety protocols to prevent system instability.
The tool focuses on stability and transparency, helping users detect driverless devices and manage system resources without the risk of accidental module unloading or dependency bloat.
Montecarlo enforces stability through a multi-layer safety engine:
- Dependency Protection: Prevents the unloading of modules that are dependencies for other active drivers.
- Hardware Locking: active hardware detection prevents the accidental unloading of drivers currently in use by peripheral devices.
The dashboard eliminates kernel noise to focus on relevant system components:
- Root Module Isolation: Automatically filters internal kernel dependencies, displaying only user-relevant "Root Modules".
- Status Indicators: Real-time status flags distinguish between
(In Use)and(Idle)drivers, verified against hardware bindings.
Integrated systemd management allows for seamless control of background services directly from the driver dashboard:
- Privileged Control: Authenticated Start, Stop, Enable, and Disable operations via PolicyKit.
- State Awareness: Instant visual feedback on service health and runtime status.
Complete operational transparency is maintained through real-time auditing:
- Decision Logging: Every decision made by the daemon—from device detection to driver verification—is logged.
- Event Tracing: Trace the complete lifecycle of device events and driver interactions.
Montecarlo maintains a session-based history of all administrative actions:
- Driver Reloading: Quickly restore accidentally unloaded modules.
- Service Recovery: Restart services that were stopped during the current session.
Your command center. View all loaded USB drivers in real-time. The list is filtered to remove kernel noise, focusing on the drivers that matter.
Active drivers are verified against hardware bindings.
Don't know which driver to use? Browse your kernel's native module repository. You can search, filter, and load drivers dynamically to test compatibility.
Search and load drivers specific to your kernel version.
Manage your standard linux services transparently. Montecarlo integrates with Systemd to show you what's running, failed, or inactive.
- Privileged Control: Start, Stop, Enable, or Disable services using strict PolicyKit authentication.
- State Awareness: Color-coded states to quickly identify failed or running services.
Secure service management via PolicyKit.
Transparency is key. Watch Montecarlo's decision-making process in real-time. See exactly what the daemon is doing, which devices are detected, and why a driver is allowed or blocked.
Detailed audit log of all actions.
Made a mistake? The Restore tab keeps a history of all modules unloaded during the session, allowing you to quickly reload them with a single click.
Undo capabilities for driver management.
The system consists of modular components: a C Daemon, a Python UI, a Shared Library, and a Privileged Helper.
graph TD
subgraph Kernel Space
UD["UDev Events"] --> Daemon
Drivers["Kernel Drivers"]
Systemd["Systemd Manager"]
end
subgraph User Space
Daemon["Daemon Service<br>(montecarlo-daemon)"]
Socket(("Unix Socket<br>/tmp/montecarlo.sock"))
UI["User Interface<br>(desktop/ui.py)"]
Lib["Core Library<br>(libmontecarlo.so)"]
Helper["Privileged Helper<br>(montecarlo-helper)"]
LibSD["Systemd Wrapper<br>(systemd/libsystemdctl.so)"]
end
Daemon -->|Listens| UD
Daemon -->|Launches on Match| UI
Daemon -->|Sends Target Syspath| Socket
UI -->|Connects| Socket
UI -->|Read Info| Lib
UI -->|List Services| LibSD
UI -.->|"Pkexec (Root)"| Helper
Helper -->|Links| LibSD
LibSD -->|D-Bus| Systemd
Lib -->|modprobe / rmmod| Drivers
gcc,makelibudev-dev,libsystemd-devpython3,python3-gi,policykit-1(GTK3)
# Clone the repository
git clone https://github.com/IRodriguez13/Montecarlo.git
cd Montecarlo
# Build All Components (Daemon, Libraries, Helper, CLI)
makeTo test the UI without installing the system service:
# Rebuild for development (sets RPATH)
make dev(The UI will launch automatically)
This project is licensed under the GNU General Public License v3.0 (GPLv3).