1

I have a Linux server on a virtual machine with virtualbox, but would like to copy to backup while in use, because I can not stop to be giving various services.

I have seen the snapshots, but I see I saved only serve as the particular state and not the entire hard drive.

any ideas?

  • you could copy the .vdi file but there is no telling if it will be useful and not corrupt later on , The only safe way to back up a VM is to shut it down (not suspend) and then copy the VM folder. – user257256 Jan 15 '16 at 12:08
  • 1
    You can not make a reliable copy of the entire drive while it is in use. I suggest you derive an alternate backup strategy or bring the server down while you make a backup. – Panther Jan 15 '16 at 12:20
  • If you use a copy-on-write system (LVM/btrfs) then you can create a snapshot and copy the snapshot. It violate the write sync guarantees required for atomic database operations but otherwise is reasonably safe for normal usage. btrfs actually supports incremental remote backups and there are similar tools for lvm. – bain Jan 16 '16 at 3:00
0

There is no safe way to backup a virtual hard drive attached to a running virtual machine in Virtual Box.

Adapted from this thread in the Virtual Box Forums we have the following backup options:

Recommended:

  • Shutdown the guest and backup all files
    Advantage: Safe and fully recoverable.
    Disadvantage: Downtime from shutdown/reboot.

Alternatives if data are not critical:

  • Backup files from within the guest.
    Advantage: Fairly safe, no downtime.
    Disadvantage: Needs external backup solution running on the guest. Not all applications can be backed up by this.
  • Save the machine's state, backup all files, restart the guest
    Advantage: Fairly safe, downtime may be much shorter than a reboot.
    Disadvantage: needs similar hardware to recover. Some application data may become inconsistent.

Not recommended

  • Take a snapshot then copy files
    Advantage: Very fast, no downtime
    Disadvantage: Not safe, may lead to inconsistencies. Backup copies may not be recoverable on another host machine. Application data may get lost.
  • Just backup the files of a running manchine
    Advantages: none
    Disadvantages: disk image corruption may lead to unusable backups.
  • An option I'm missing here is: 1) Take the guest down. 2) Take a VM snapshot. 3) Back up the snapshot and control files. 4) Bring the guest up. 5) Back up the virtual disk(s). 6) Once you won't need to restore from this backup: delete the snapshot. Won't this be safe? It substantially reduces downtime. – Reinier Post Jun 16 '17 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.