Controlling VirtualBox from the command line

My virtual machine is called centos.

List virtual machines

$ vboxmanage list vms

Start a virtual machine

$ vboxmanage startvm centos --type headless

List snapshots of a virtual machine

$ vboxmanage snapshot centos list

Restore a snapshot

Stop the machine if it's running, then restore a snapshot identified either by its name or its ID. You can get both from issuing vboxmanage snapshot centos list:

$ vboxmanage controlvm centos poweroff
$ vboxmanage snapshot centos restore a927529c-60fd-47c2-af98-4a0d38eea642

~ /home 🏠 ~ talks 💬 ~ bash ~ craftsmanship ~ db ~ dongxi ~ emacs ~ escenic ~ iam ~ java ~ js ~ language ~ latex ~ ldap ~ life ~ linux ~ llm ~ mac-os-x ~ mt-foo ~ network ~ norsk ~ python ~ quotes ~ running ~ security ~ travel ~ unix ~ various ~ vcs ~ webdesign ~ windows ~ discoveries ~ cv 🧙 ~

Licensed under CC BY Creative Commons License ~ 📡 RSS feed ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert