VM als Service starten aber für Backup manuell stoppen?

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Post Reply
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

VM als Service starten aber für Backup manuell stoppen?

Post by Rupat »

Hallo,
ich habe 3 als Dienst gestartete VMs von dennen ich am Wochende ein Backup mache.
Dafür stoppe ich den Dienst und kopiere die Dateien.
Die Vms laufen auf einen Linux System.

Jetzt möchte ich jede Nacht von einer von den dreien ein Backup machen.
Kann ich die Problemlos über vboxmanage steuern oder kommen dann die Dienste durcheinander?

Runterfahren sollte man die so?

Code: Select all

VBoxManage controlvm vm1 savestate
und wieder starten so?

Code: Select all

 vboxmanage startvm --type headless vm1
Gruß und Dank
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM als Service starten aber für Backup manuell stoppen?

Post by scottgus1 »

Rupat wrote:I have 3 VMs started as a service
The service probably has a scriptable command-line method to shut down the VMs. Once this command is run, the VM could be backed up using further script commands, then the VM could be started again. What service are you using?
Rupat wrote:VBoxManage controlvm vm1 savestate
It is not good to use 'savestate' to shut down VMs for backup purposes. A save-stated VM is tied to the host PC hardware and the version of Virtualbox that was running the VM. Change the hardware or the Virtualbox version and the save-state must be discarded, leaving the VM in the same situation as if the power had been cut off. Dirty file-systems, dirty databases, incomplete files, lost data.

It is better to fully shut down the VM using the shut-down method inside the VM's OS, or through 'VBoxManage controlvm vm1 acpipowerbutton', then back up all the files that make up the VM.
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

Re: VM als Service starten aber für Backup manuell stoppen?

Post by Rupat »

Hello,

someone wrote i should better use savestate...
I use vboxautostart-service which comes with centos.

i configure my VM with :

Code: Select all

VBoxManage modifyvm vm1 --autostart-enabled on

VBoxManage modifyvm vm1 --autostop-type savetate
and start the service as usual:

Code: Select all

systemctl start vboxautostart-service
is there a way to just stop one VM?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM als Service starten aber für Backup manuell stoppen?

Post by scottgus1 »

Save-state for running a VM as a service should be OK.

Save-state to back up a VM is bad, for the reasons stated above.
Rupat wrote:is there a way to just stop one VM?
I don't know about this. A 3rd-party auto-start service I have used before (VboxVMservice) has a command to stop a service-controlled VM. I have not tried the newer native auto-start service you are using. Try vboxmanage's 'acpipowerbutton' command on the desired VM?
Post Reply