[ VirtualBox ] How to save the state of a virtual machine and stop it without GUI.
Have you ever want to save the state of a virtual machines and stop them with CUI? I'll illustrate how to save the state of the VM to disk and then stop it.
It takes 2 steps. First, checking which virtual machine is running. To do it, use VBoxManage command with list runningvms options. For example:
VirtualBox list runningvms
Then you'll get the information which virtual machine is running like following:
"ubuntu10_04" {57e88170-bb7e-4728-ba05-4724cdfe6cdb}
"squeeze_x64" {0d584575-84f6-4800-b74c-ef6b22cfbe9a}
Each line consists of two elements: VM name on the front and UUID on the back. At the previous, "ubuntu10_04" and "squeese_x64" are VM name (note, double quotes are enclosed). {57e88170-bb7e-4728-ba05-4724cdfe6cdb} and {0d584575-84f6-4800-b74c-ef6b22cfbe9a} are UUID.
UUID is the internal unique identifier that VirtualBox uses to refer to the virtual machine.
Second, Saving the sate of VM and then stopping it. To do it, use VBoxManage command with cntrolvm <VM> savestate options(*1). Note, when you execute command, please replace <VM> to a VM name or an UUID. For example, you want to operate to "squeeze_x64", input following:
VBoxManage controlvm "squeeze_x64" savestate
or
VBoxManage controlvm {0d584575-84f6-4800-b74c-ef6b22cfbe9a} savestate
done.
- WARNING
- An another option "controlvm <VM> poweroff" also can stop a virtual machine. But the state is NOT saved! Data may be LOST and system may be BROKEN.
- Reference
- VirtualBox Manual Chapter8. VBoxManage
| 固定リンク | コメント (0) | トラックバック (0)