{"id":18451455,"url":"https://github.com/trasherdk/virtualbox-scripts","last_synced_at":"2026-01-30T07:06:34.173Z","repository":{"id":103287622,"uuid":"207712904","full_name":"trasherdk/virtualbox-scripts","owner":"trasherdk","description":"Bash scripts for managing Virtualbox from the command line","archived":false,"fork":false,"pushed_at":"2017-01-07T21:08:39.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T14:07:20.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trasherdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-11T03:14:03.000Z","updated_at":"2021-08-19T14:58:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"81e36197-f253-4497-bab7-646534eb54b2","html_url":"https://github.com/trasherdk/virtualbox-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fvirtualbox-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fvirtualbox-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fvirtualbox-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fvirtualbox-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trasherdk","download_url":"https://codeload.github.com/trasherdk/virtualbox-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249494354,"owners_count":21281661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T07:28:42.881Z","updated_at":"2026-01-30T07:06:34.106Z","avatar_url":"https://github.com/trasherdk.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Virtualbox-scripts\n========\n*This repo contains Bash scripts for managing Virtualbox from the command line*\n\nInstallation\n============\n*Clone or download the content of this repo to your computer*\n\n**[jf@Tzunami ~]$** cd ~    \n**[jf@Tzunami ~]$** git clone https://github.com/jensfredlund/virtualbox-scripts.git  \nCloning into 'virtualbox-scripts'...  \nremote: Counting objects: 29, done.  \nremote: Compressing objects: 100% (22/22), done.  \nremote: Total 29 (delta 4), reused 29 (delta 4), pack-reused 0  \nUnpacking objects: 100% (29/29), done.  \n  \n**[jf@Tzunami ~]$** ls virtualbox-scripts/  \nbashrc.txt  network  README.md  snapshot   storage  \nlist        ports    settings   startstop  vb_help.sh  \n\nBash aliases\n============  \n*Add the Bash aliases below to your to ~/.bashrc file. Don't forget to change the VB_SCRIPTPATH to the directory where the virtualbox-scripts is located.*\n\n```  \nVB_SCRIPTPATH=\"~/virtualbox-scripts\"  \n  \nfunction vb_stop() {  \n    echo \"Waiting for VM \\\"$1\\\" to shutdown...\"\n    vboxmanage controlvm $1 poweroff  \n}  \n  \nfunction vb_start() {  \n    vboxmanage startvm $1 --type headless  \n}  \n  \nalias vbhelp=\"$VB_SCRIPTPATH/vb_help.sh\"  \nalias vblist=\"$VB_SCRIPTPATH/list/vb_list_all_vms.sh\"  \nalias vbstart=vb_start  \nalias vbstartg=\"$VB_SCRIPTPATH/startstop/vb_group_start.sh \"$1\"\"  \nalias vbrunning=\"$VB_SCRIPTPATH/list/vb_list_running_vms.sh\"  \nalias vbstop=vb_stop  \nalias vbstopg=\"$VB_SCRIPTPATH/startstop/vb_group_stop.sh \"$1\"\"  \nalias vbports=\"$VB_SCRIPTPATH/ports/vb_list_port_forward_all.sh\"  \nalias vbgroups=\"$VB_SCRIPTPATH/list/vb_list_groups.sh\"  \nalias vbmac=\"$VB_SCRIPTPATH/network/vb_list_mac.sh $1\"  \nalias vbip=\"$VB_SCRIPTPATH/network/vb_list_ip.sh $1\"  \nalias vbsnaps=\"$VB_SCRIPTPATH/snapshot/vb_list_snapshot.sh $1\"  \nalias vbsnap=\"$VB_SCRIPTPATH/snapshot/vb_snapshot.sh $1\"  \nalias vbremovesnap=\"$VB_SCRIPTPATH/snapshot/vb_remove_snapshot.sh $1\"  \nalias vbrestoresnap=\"$VB_SCRIPTPATH/snapshot/vb_remove_snapshot.sh $1 $2\"  \nalias vbsettings=\"$VB_SCRIPTPATH/settings/vb_vm_settings.sh $1\"  \nalias vbstorage=\"$VB_SCRIPTPATH/storage/vb_list_all_disks.sh\"  \nalias vbstopall=\"$VB_SCRIPTPATH/startstop/vb_poweroff_all.sh\"\nalias vbstartall=\"$VB_SCRIPTPATH/startstop/vb_start_all.sh\"\n``` \nList available aliases in the console\n============\n*This example will list all available Virtualbox Bash aliases from the command line*\n\n```\njf@Tzunami:~/$ vbhelp\nUse the Bash aliases below to manage Virtualbox from the command line:\n\nStart/stop VM:\nvbstart server01 - Start VM server01\nvbstop server01  - Stop VM server01\n\nStart/stop all VMs:\nvbstartall       - Start all VMs\nvbstopall        - Stop all VMs\n\nGroup action:\nvbstartg puppet  - Start all VMs in group puppet\nvbstopg puppet   - Stop all server in grou puppet\n\nNetwork:\nvbports          - List port forwarding for all Virtualbox VMs\nvbmac server01   - List MAC for VM\nvbip             - List IP for all VMs\n\nSnapshot:\nvbsnaps sever01                        - List snapshots for server01\nvbsnap server01                        - Take snapshot of server01\nvbrestoresnap server01 snapshotUUID    - Restore snapshot on server01 with snapshotUUID\nvbremovesnap server01 snapshotUUID     - Remove snapshot from server01 with snapshotUUID\n\nMisc:\nvbhelp           - Show this output\nvblist           - List all Virutalbox VMs active \u0026 disabled\nvbrunning        - List all running VMs\n```\n\nList running VMs\n============\n*This example will list all running Virtualbox VMs from the command line*\n\n```\njf@Tzunami:~$ vbrunning\nThese VMs is currently running in Virtualbox:\nnginx1\nnginx2\nnginx3\nmysql1\n```\n\nShutdown Virtualbox VM\n============\n*This example will shutdown a Virtualbox VM from the command line*\n\n```\njf@Tzunami:~$ vbstop nginx3\nWaiting for VM \"nginx3\" to shutdown...\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n\n```\n\nStart Virtualbox VM\n============\n*This example will start a Virtualbox VM from the command line*\n\n```\njf@Tzunami:~$ vbstart nginx3\nWaiting for VM \"nginx3\" to power on...\nVM \"nginx3\" has been successfully started.\n```\n\nTake snapshot of Virtualbox VM\n============\n*This example will take a snapshot of a Virtualbox VM from the command line*\n\n```\njf@Tzunami:~/$ vbsnap nginx1\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nSnapshot taken. UUID: 947ad21d-2cad-4e64-80cc-2ff819d1be4e\n```\n\nList snapshots of Virtualbox VM\n============\n*This example will list all available snapshots for a Virtualbox VM from the command line*\n```\njf@Tzunami:~/$ vbsnaps nginx1\nSnapshotName=\"Snapshot taken by jf@Tzunami 2017-01-07 20:51:48\"\nSnapshotUUID=\"947ad21d-2cad-4e64-80cc-2ff819d1be4e\"\nCurrentSnapshotName=\"Snapshot taken by jf@Tzunami 2017-01-07 20:51:48\"\nCurrentSnapshotUUID=\"947ad21d-2cad-4e64-80cc-2ff819d1be4e\"\nCurrentSnapshotNode=\"SnapshotName\"\n```\n\nRestore snapshots of Virtualbox VM\n============\n*This example will restore a snapshot for a Virtualbox VM from the command line*\n\n```\njf@Tzunami:~/$ vbrestoresnap nginx1 947ad21d-2cad-4e64-80cc-2ff819d1be4e\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n```\n\nList portforwarding rules for VMs in Virtualbox\n============\n*This example will list all port forwarding rules for all Virtualbox VMs from the command line*\n\n```\njf@Tzunami:~/$ vbports\nVM: mysql1 Port Forward: 2202 =\u003e 22\nVM: nginx1 Port Forward: 2222 =\u003e 22\nVM: nginx2 Port Forward: 2200 =\u003e 22\nVM: nginx3 Port Forward: 2201 =\u003e 22\n```\n\nList MAC addresses for Virtualbox VM\n============\n*This example will list all MAC-addresses for a specific Virtualbox VM from the command line*\n\n```\njf@Tzunami:~/$ vbmac nginx1\nNIC1:MAC:025194FB32E8,NAT,\nNIC2:MAC:0800273D9CE8,Host-only\n```\n\nList IP addresses for Virtualbox VMs\n============\n*This example will list the IP addresses for all Virtualbox VMs from the command line*\n```\njf@Tzunami:~/$ vbip\nnginx1\n192.168.56.11\nnginx2\n192.168.56.12\nnginx3\n192.168.56.13\nmysql1\n192.168.56.21\n```\n\nList Virtualbox VM groups\n============\n*This example will list all available Virtual machine groups in Virtualbox from the command line*\n```\njf@Tzunami:~/$ vbgroups\nListing Virtualbox groups\n\"/MySQL servers\"\n\"/Nginx servers\"\n```\n\nStart a group of Virtualbox VMs\n============\n*This example will start a group of Virtualbox VMs from the command line*\n```\njf@Tzunami:~/$ vbstartg nginx servers\nBooting VM: nginx1\nWaiting for VM \"nginx1\" to power on...\nVM \"nginx1\" has been successfully started.\nBooting VM: nginx2\nWaiting for VM \"nginx2\" to power on...\nVM \"nginx2\" has been successfully started.\nBooting VM: nginx3\nWaiting for VM \"nginx3\" to power on...\nVM \"nginx3\" has been successfully started.\n```\n\nShutdown a group of Virtualbox VMs\n============\n*This example will stop a group of Virtualbox VMs from the command line*\n```\njf@Tzunami:~/$ vbstopg nginx servers\nShutting down VM: nginx1 Group: nginx\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nShutting down VM: nginx2 Group: nginx\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nShutting down VM: nginx3 Group: nginx\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n```\n\nStart all Virtualbox VMs\n============\n*This example will start all installed Virtualbox VMs from the command line*\n```\njf@Tzunami:~/$ vbstartall\n\nBooting nginx1\nWaiting for VM \"nginx1\" to power on...\nVM \"nginx1\" has been successfully started.\n\nBooting nginx2\nWaiting for VM \"nginx2\" to power on...\nVM \"nginx2\" has been successfully started.\n\nBooting nginx3\nWaiting for VM \"nginx3\" to power on...\nVM \"nginx3\" has been successfully started.\n\nBooting mysql1\nWaiting for VM \"mysql1\" to power on...\nVM \"mysql1\" has been successfully started.\n```\n\nStop all Virtualbox VMs\n============\n*This example will stop all installed Virtualbox VMs from the command line*\n```\njf@Tzunami:~/$ vbstopall\n\nPoweroff nginx1\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n\nPoweroff nginx2\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n\nPoweroff nginx3\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n\nPoweroff mysql1\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrasherdk%2Fvirtualbox-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrasherdk%2Fvirtualbox-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrasherdk%2Fvirtualbox-scripts/lists"}