VBoxManage commands are used for managing VirtualBox VMs via the command line. These commands cover a wide range of functionalities, from creating and controlling VMs to adjusting network settings and managing disk images. This guide provides an overview of the most commonly used VBoxManage commands.
VBoxManage is a command-line interface for VirtualBox that provides powerful options for creating, managing, and configuring virtual machines. It is especially useful for automation and scripting purposes.
-
Command:
VBoxManage list vms
Lists all registered VMs.
-
Start a VM in headless mode (without a GUI):
VBoxManage startvm [vmname] --type headless
-
Start a VM with a GUI:
VBoxManage startvm [vmname] --type gui
-
Command:
VBoxManage controlvm [vmname] poweroff
Powers off the specified VM.
-
Pause a VM:
VBoxManage controlvm [vmname] pause
-
Resume a paused VM:
VBoxManage controlvm [vmname] resume
-
Command:
VBoxManage createvm --name [vmname] --register
Creates a new VM with the specified name.
-
Set the memory size:
VBoxManage modifyvm [vmname] --memory [memorysize in MB] -
Set the number of CPUs:
VBoxManage modifyvm [vmname] --cpus [number]
-
Enable the VirtualBox Remote Desktop Extension:
VBoxManage modifyvm [vmname] --vrde on
-
Command:
VBoxManage storageattach [vmname] --storagectl [controllername] --port 0 --device 0 --type dvddrive --medium [path/to/iso]
Attaches an ISO file to the specified VM.
-
Command:
VBoxManage createmedium disk --filename [path/to/vdi] --size [size in MB]Creates a new virtual hard disk file.
-
Take a snapshot:
VBoxManage snapshot [vmname] take [snapshotname]
-
Restore a snapshot:
VBoxManage snapshot [vmname] restore [snapshotname]
-
Command:
VBoxManage unregistervm [vmname] --delete
Deletes the VM and all its associated files.
-
Set the first network adapter to use NAT:
VBoxManage modifyvm [vmname] --nic1 nat
-
Command:
VBoxManage showvminfo [vmname]
Displays detailed information about the specified VM.
Your contributions can make these scripts even better:
-
Fork the repository.
-
Create a new branch:
git checkout -b my-awesome-feature
-
Make your invaluable changes.
-
Commit your changes:
git commit -am 'Added some amazing features' -
Push to the branch:
git push origin my-awesome-feature
-
Create a new Pull Request targeting the Notes directory.
Contributions are welcome! Feel free to open issues, suggest enhancements, or submit pull requests to improve the script.
- Raphael Chookagian | GitHub Profile
- 12/09/2024
-
This script is provided as-is without any warranties. Users are advised to review and understand the script before executing it.
-
This project is licensed under the MIT License. See the LICENSE file for details.
