| name | virtualbox |
| description | Control and manage VirtualBox virtual machines directly from openclaw. Start, stop, snapshot, clone, configure and monitor VMs using VBoxManage CLI. Supports full lifecycle management including VM creation, network configuration, shared folders, and performance monitoring. |
| homepage | https://www.virtualbox.org/manual/ch08.html |
| metadata | {"openclaw":{"emoji":"🖥️","requires":{"bins":["VBoxManage"]}}} |
VirtualBox Skill
Control and manage VirtualBox virtual machines directly from openclaw using the VBoxManage command-line interface. This skill provides comprehensive VM lifecycle management, configuration, and monitoring capabilities.
Setup
Prerequisites
- VirtualBox must be installed on the host system
- VBoxManage CLI must be accessible (usually in PATH after VirtualBox installation)
- User must have appropriate permissions to control VMs
Verify Installation
VBoxManage --version
Common Paths
- Linux:
/usr/bin/VBoxManage or /usr/local/bin/VBoxManage
- macOS:
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
- Windows:
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
Core Capabilities
VM Lifecycle Management
- Create, start, stop, pause, and delete VMs
- Manage VM states (running, paused, saved, powered off)
- Force stop and ACPI shutdown options
- Reset and restart VMs
Configuration Management
- Modify VM settings (CPU, RAM, storage)
- Configure network adapters and modes
- Set up shared folders
- Manage USB device passthrough
Snapshot & Cloning
- Create and restore snapshots
- Clone existing VMs
- Export/Import appliances
Monitoring & Information
- List all VMs and their states
- Get detailed VM information
- Monitor VM metrics and performance
- View logs and debugging info
Usage
List All VMs
VBoxManage list vms
VBoxManage list runningvms
VBoxManage list vms --long
VM Information
VBoxManage showvminfo "VM_NAME"
VBoxManage showvminfo "VM_NAME" --machinereadable
Start a VM
VBoxManage startvm "VM_NAME"
VBoxManage startvm "VM_NAME" --type headless
VBoxManage startvm "VM_NAME" --type separate
Stop a VM
VBoxManage controlvm "VM_NAME" acpipowerbutton
VBoxManage controlvm "VM_NAME" poweroff
VBoxManage controlvm "VM_NAME" savestate
VBoxManage controlvm "VM_NAME" pause
VBoxManage controlvm "VM_NAME" resume
VBoxManage controlvm "VM_NAME" reset
Create a New VM
VBoxManage createvm --name "NewVM" --register
VBoxManage modifyvm "NewVM" --ostype "Ubuntu_64"
VBoxManage modifyvm "NewVM" --memory 4096
VBoxManage modifyvm "NewVM" --cpus 2
VBoxManage createhd --filename "/path/to/NewVM.vdi" --size 50000
VBoxManage storagectl "NewVM" --name "SATA Controller" --add sata
VBoxManage storageattach "NewVM" --storagectl "SATA Controller" \
--port 0 --device 0 --type hdd --medium "/path/to/NewVM.vdi"
VBoxManage storageattach "NewVM" --storagectl "SATA Controller" \
--port 1 --device 0 --type dvddrive --medium "/path/to/install.iso"
Clone a VM
VBoxManage clonevm "SourceVM" --name "ClonedVM" --register
VBoxManage clonevm "SourceVM" --name "LinkedVM" --options link --register
VBoxManage clonevm "SourceVM" --name "FromSnapshotVM" \
--snapshot "SnapshotName" --register
Delete a VM
VBoxManage unregistervm "VM_NAME"
VBoxManage unregistervm "VM_NAME" --delete
Snapshots
VBoxManage snapshot "VM_NAME" list
VBoxManage snapshot "VM_NAME" take "SnapshotName" --description "Description here"
VBoxManage snapshot "VM_NAME" restore "SnapshotName"
VBoxManage snapshot "VM_NAME" delete "SnapshotName"
VBoxManage snapshot "VM_NAME" restorecurrent
Network Configuration
VBoxManage showvminfo "VM_NAME" | grep -A 5 "NIC"
VBoxManage modifyvm "VM_NAME" --nic1 nat
VBoxManage modifyvm "VM_NAME" --nic1 bridged --bridgeadapter1 eth0
VBoxManage modifyvm "VM_NAME" --nic1 hostonly --hostonlyadapter1 vboxnet0
VBoxManage modifyvm "VM_NAME" --natpf1 "ssh,tcp,,2222,,22"
VBoxManage modifyvm "VM_NAME" --natpf1 delete "ssh"
VBoxManage list hostonlyifs
VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0
Shared Folders
VBoxManage sharedfolder add "VM_NAME" --name "share" --hostpath "/path/on/host"
VBoxManage sharedfolder add "VM_NAME" --name "share" --hostpath "/path/on/host" --readonly
VBoxManage sharedfolder add "VM_NAME" --name "share" --hostpath "/path/on/host" --automount
VBoxManage sharedfolder remove "VM_NAME" --name "share"
VBoxManage showvminfo "VM_NAME" | grep -A 5 "Shared Folder"
Modify VM Settings
VBoxManage modifyvm "VM_NAME" --memory 8192
VBoxManage modifyvm "VM_NAME" --cpus 4
VBoxManage modifyvm "VM_NAME" --vram 128
VBoxManage modifyvm "VM_NAME" --accelerate3d on
VBoxManage modifyvm "VM_NAME" --nested-hw-virt on
VBoxManage modifyvm "VM_NAME" --vrde on --vrdeport 3389
VBoxManage modifyvm "VM_NAME" --name "NewName"
VBoxManage modifyvm "VM_NAME" --description "Production server VM"
USB Device Passthrough
VBoxManage list usbhost
VBoxManage controlvm "VM_NAME" usbattach "UUID_OR_ADDRESS"
VBoxManage controlvm "VM_NAME" usbdetach "UUID_OR_ADDRESS"
VBoxManage usbfilter add 0 --target "VM_NAME" --name "FilterName" \
--vendorid "XXXX" --productid "XXXX"
Export/Import Appliances
VBoxManage export "VM_NAME" --output "/path/to/export.ova"
VBoxManage export "VM1" "VM2" --output "/path/to/export.ova"
VBoxManage import "/path/to/export.ova"
VBoxManage import "/path/to/export.ova" --vsys 0 --vmname "ImportedVM"
Monitoring & Metrics
VBoxManage metrics list
VBoxManage metrics setup --period 10 --samples 5 "VM_NAME"
VBoxManage metrics collect "VM_NAME"
VBoxManage metrics query "VM_NAME" "CPU/Load"
VBoxManage metrics query "VM_NAME" "RAM/Usage"
VBoxManage metrics query "VM_NAME" "Net/Rate"
VBoxManage metrics list "VM_NAME"
Medium (Disk) Management
VBoxManage list hdds
VBoxManage showhdinfo "/path/to/disk.vdi"
VBoxManage modifyhd "/path/to/disk.vdi" --resize 100000
VBoxManage clonemedium "/path/to/source.vdi" "/path/to/clone.vdi"
VBoxManage modifymedium "/path/to/disk.vdi" --compact
VBoxManage modifymedium "/path/to/disk.vdi" --type normal
VBoxManage modifymedium "/path/to/disk.vdi" --type immutable
VBoxManage modifymedium "/path/to/disk.vdi" --type writethrough
Guest Control (Guest Additions Required)
VBoxManage guestcontrol "VM_NAME" run --exe "/bin/ls" \
--username user --password pass -- -la /home
VBoxManage guestcontrol "VM_NAME" copyto \
--username user --password pass \
"/host/path/file.txt" "/guest/path/file.txt"
VBoxManage guestcontrol "VM_NAME" copyfrom \
--username user --password pass \
"/guest/path/file.txt" "/host/path/file.txt"
VBoxManage guestcontrol "VM_NAME" mkdir \
--username user --password pass \
"/home/user/newdir"
VBoxManage guestcontrol "VM_NAME" rm \
--username user --password pass \
"/home/user/file.txt"
VBoxManage guestcontrol "VM_NAME" process list \
--username user --password pass
Debugging & Logs
VBoxManage showvminfo "VM_NAME" | grep -i log
VBoxManage debugvm "VM_NAME" info item
VBoxManage debugvm "VM_NAME" statistics
Practical Examples
Quick VM Status Check
VBoxManage list runningvms | grep "VM_NAME"
VBoxManage list vms --long | grep -E "Name:|State:"
Automated VM Startup Script
#!/bin/bash
for vm in "WebServer" "Database" "Cache"; do
echo "Starting $vm..."
VBoxManage startvm "$vm" --type headless
sleep 10
done
echo "All VMs started"
Backup Script with Snapshots
#!/bin/bash
VM_NAME="ProductionVM"
DATE=$(date +%Y%m%d_%H%M%S)
SNAPSHOT_NAME="Backup_$DATE"
VBoxManage snapshot "$VM_NAME" take "$SNAPSHOT_NAME" \
--description "Automated backup $DATE"
SNAPSHOTS=$(VBoxManage snapshot "$VM_NAME" list --machinereadable | grep SnapshotName | wc -l)
if [ $SNAPSHOTS -gt 5 ]; then
OLDEST=$(VBoxManage snapshot "$VM_NAME" list --machinereadable | grep SnapshotName | head -1 | cut -d'"' -f4)
VBoxManage snapshot "$VM_NAME" delete "$OLDEST"
fi
Complete VM Cloning Workflow
#!/bin/bash
SOURCE_VM="TemplateVM"
NEW_VM="DevVM_$(date +%s)"
VBoxManage controlvm "$SOURCE_VM" poweroff 2>/dev/null
VBoxManage snapshot "$SOURCE_VM" take "PreClone"
VBoxManage clonevm "$SOURCE_VM" --name "$NEW_VM" --register
VBoxManage modifyvm "$NEW_VM" --memory 2048 --cpus 2
VBoxManage startvm "$NEW_VM" --type headless
echo "Cloned VM '$NEW_VM' is now running"
Network Port Forwarding Setup
#!/bin/bash
VM_NAME="WebServer"
VBoxManage modifyvm "$VM_NAME" --natpf1 "ssh,tcp,,2222,,22"
VBoxManage modifyvm "$VM_NAME" --natpf1 "http,tcp,,8080,,80"
VBoxManage modifyvm "$VM_NAME" --natpf1 "https,tcp,,8443,,443"
VBoxManage showvminfo "$VM_NAME" | grep "NIC 1 Rule"
Monitor Resource Usage
#!/bin/bash
VM_NAME="ProductionVM"
VBoxManage metrics setup --period 5 --samples 12 "$VM_NAME"
sleep 60
VBoxManage metrics query "$VM_NAME" "CPU/Load:RAM/Usage:Net/Rate"
Common Issues & Solutions
VM Won't Start
VBoxManage showvminfo "VM_NAME" | grep State
VBoxManage showvminfo "VM_NAME" | grep -i lock
VBoxManage startvm "VM_NAME" --type headless 2>&1
Cannot Delete VM
VBoxManage controlvm "VM_NAME" poweroff
VBoxManage showvminfo "VM_NAME" | grep -E "Storage|Medium"
VBoxManage unregistervm "VM_NAME" --delete
Network Issues
VBoxManage showvminfo "VM_NAME" | grep -A 10 "NIC 1"
VBoxManage modifyvm "VM_NAME" --nic1 none
VBoxManage modifyvm "VM_NAME" --nic1 nat
VBoxManage list hostonlyifs
Performance Issues
VBoxManage showvminfo "VM_NAME" | grep -E "Memory|CPU"
VBoxManage modifyvm "VM_NAME" --memory 8192 --cpus 4
VBoxManage modifyvm "VM_NAME" --hwvirtex on --nestedpaging on
Important Notes
-
VM Names with Spaces: Always quote VM names containing spaces
VBoxManage startvm "My Production VM"
-
UUIDs vs Names: Both VM names and UUIDs work interchangeably
VBoxManage startvm "VM_NAME"
VBoxManage startvm "12345678-1234-1234-1234-123456789abc"
-
Running vs Stopped Operations:
controlvm - operates on running VMs
modifyvm - operates on stopped VMs (mostly)
-
Headless Mode: Always use --type headless for server environments without GUI
-
Permissions: Some operations require elevated permissions or membership in specific groups (e.g., vboxusers on Linux)
-
Guest Additions: Required for:
- Shared clipboard
- Drag and drop
- Shared folders auto-mount
- Guest control commands
- Seamless mode
OS Types Reference
Common OS types for --ostype parameter:
Windows11_64 - Windows 11 (64-bit)
Windows10_64 - Windows 10 (64-bit)
Ubuntu_64 - Ubuntu Linux (64-bit)
Debian_64 - Debian Linux (64-bit)
Fedora_64 - Fedora Linux (64-bit)
ArchLinux_64 - Arch Linux (64-bit)
macOS_ARM64 - macOS on Apple Silicon
macOS_128 - macOS on Intel (64-bit)
FreeBSD_64 - FreeBSD (64-bit)
Other_64 - Other OS (64-bit)
Get full list with:
VBoxManage list ostypes
Quick Reference Card
| Operation | Command |
|---|
| List VMs | VBoxManage list vms |
| Start VM | VBoxManage startvm "NAME" --type headless |
| Stop VM | VBoxManage controlvm "NAME" acpipowerbutton |
| Force Stop | VBoxManage controlvm "NAME" poweroff |
| VM Info | VBoxManage showvminfo "NAME" |
| Snapshot | VBoxManage snapshot "NAME" take "SnapName" |
| Restore | VBoxManage snapshot "NAME" restore "SnapName" |
| Clone | VBoxManage clonevm "SRC" --name "NEW" --register |
| Delete | VBoxManage unregistervm "NAME" --delete |
| Modify RAM | VBoxManage modifyvm "NAME" --memory 4096 |
| Modify CPU | VBoxManage modifyvm "NAME" --cpus 2 |
| Port Forward | VBoxManage modifyvm "NAME" --natpf1 "rule,tcp,,host,,guest" |
Requirements
- Required Binary:
VBoxManage (part of VirtualBox installation)
- Permissions: User must have VM management permissions
- Guest Additions: Required for guest control and enhanced features