Skip to content

Latest commit

 

History

History
256 lines (156 loc) · 4.87 KB

File metadata and controls

256 lines (156 loc) · 4.87 KB

Alt Text

VirtualBox Management & Commands

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.


Table of Contents


Overview

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.


Commands

List Virtual Machines

  • Command:

    VBoxManage list vms

    Lists all registered VMs.


Start a Virtual Machine

  • 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

Power Off a Virtual Machine

  • Command:

    VBoxManage controlvm [vmname] poweroff

    Powers off the specified VM.


Pause and Resume a Virtual Machine

  • Pause a VM:

    VBoxManage controlvm [vmname] pause
  • Resume a paused VM:

    VBoxManage controlvm [vmname] resume

Create a Virtual Machine

  • Command:

    VBoxManage createvm --name [vmname] --register

    Creates a new VM with the specified name.


Modify VM Settings

  • 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

Attach an ISO to VM

  • Command:

    VBoxManage storageattach [vmname] --storagectl [controllername] --port 0 --device 0 --type dvddrive --medium [path/to/iso]

    Attaches an ISO file to the specified VM.


Create a Virtual Hard Disk

  • Command:

    VBoxManage createmedium disk --filename [path/to/vdi] --size [size in MB]

    Creates a new virtual hard disk file.


Take and Restore Snapshots

  • Take a snapshot:

    VBoxManage snapshot [vmname] take [snapshotname]
  • Restore a snapshot:

    VBoxManage snapshot [vmname] restore [snapshotname]

Delete a Virtual Machine

  • Command:

    VBoxManage unregistervm [vmname] --delete

    Deletes the VM and all its associated files.


Configure Network Settings

  • Set the first network adapter to use NAT:

    VBoxManage modifyvm [vmname] --nic1 nat

Show VM Information

  • Command:

    VBoxManage showvminfo [vmname]

    Displays detailed information about the specified VM.


Resources


Contribution

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.


Author

Date of Latest Revision

  • 12/09/2024

License

  • 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.