vbman is a lightweight command-line tool for managing VirtualBox virtual machines (VMs) on Linux and macOS. It provides an interactive menu to list, start, and stop VMs with both graceful and force shutdown options. This script simplifies VM management without the need for the VirtualBox GUI.
✅ List all available VMs with their status (Running/Stopped)
✅ Start VMs in Headed (GUI) or Headless (background) mode
✅ Gracefully shut down VMs using ACPI Power Button
✅ Force shutdown VMs when necessary
✅ Bulk shutdown options for all running VMs
✅ Interactive menu for easy management
🔥 Run this command to instantly download & run vbman! 🔥
bash <(curl -sSL https://raw.githubusercontent.com/michaelbolanos/vbman/main/vbman.sh)
💡 No need to manually clone the repository! Just copy, paste, and go!
Ensure that VirtualBox and VBoxManage
are installed on your system:
# Install VirtualBox (Linux)
sudo apt install virtualbox # Debian-based
sudo dnf install virtualbox # Fedora-based
# Install VirtualBox (macOS, via Homebrew)
brew install --cask virtualbox
Clone the repository and make the script executable:
git clone https://github.com/michaelbolanos/vbman.git
cd vbman
chmod +x vbman.sh
Run the script to open the interactive menu:
./vbman.sh
Alternatively, run specific commands directly:
# List all VMs
./vbman.sh list
# Start a specific VM (by name or UUID)
./vbman.sh start <vm_name_or_uuid>
# Gracefully shut down a VM
./vbman.sh shutdown <vm_name_or_uuid>
# Force shut down a VM
./vbman.sh force-shutdown <vm_name_or_uuid>
======================================
🎛️ VirtualBox VM Management Script 🎛️
======================================
1) List all VMs (Show Status)
2) Start a VM
3) Shut down a VM
4) Force shut down a VM
5) Shut down ALL running VMs
6) Force shut down ALL running VMs
7) Exit
======================================
Enter your choice:
Initially, vbman was designed to be executed via a direct curl
pipe:
curl -sSL https://raw.githubusercontent.com/michaelbolanos/vbman/main/vbman.sh | bash
However, this method caused input issues where the script could not properly capture user choices in the interactive menu. This was due to bash
reading input directly from the pipe instead of allowing keyboard interaction.
- Direct Pipe Execution (
curl | bash
) → Caused input issues. - Writing to a Temporary File First → Allowed execution but cluttered the system.
- Process Substitution (
bash <(curl ...)
) → Fixed interactive input while keeping the one-liner simple.
The final iteration settled on:
bash <(curl -sSL https://raw.githubusercontent.com/michaelbolanos/vbman/main/vbman.sh)
✅ Ensures full script execution before user input.
✅ Maintains simplicity—no need to manually download the script.
✅ Works consistently across macOS and Linux environments.
Feel free to contribute by submitting a pull request or opening an issue!
This project is licensed under the MIT License.
Created by Michael Bolanos