Backup VirtualBox machine via copy and paste?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
keogh
Posts: 10
Joined: 27. Feb 2013, 17:31
Primary OS: MS Windows 8
VBox Version: OSE Debian
Guest OSses: Ubuntu all the way
Location: London, England
Contact:

Backup VirtualBox machine via copy and paste?

Post by keogh »

Howdy all,

Apologies if this has been discussed, I just want a definitive answer on this really.

I have a Ubuntu Server VB machine running on my Windows 7 x64 host, I just want to know if I wanted to make periodic backups (they never have to be up to date, so a base to use in future) can I simply do that by copy and pasting my VirtualBox folder to a backup folder on my NAS drive for example?

So if in future I lost my drive, I would at least have a basic backup of it that I could just drop in place? Or is it a bit more complex than that?

As I say, it don't need to be up to date backups, just backups I might manually make now and then?

Thanks
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Backup VirtualBox machine via copy and paste?

Post by mpack »

Yes, you can backup by copying and pasting a folder; except it's the VM folder you need to copy, not the "VirtualBox folder" (of which there are actually two, neither of which contain anything worth backing up).
keogh
Posts: 10
Joined: 27. Feb 2013, 17:31
Primary OS: MS Windows 8
VBox Version: OSE Debian
Guest OSses: Ubuntu all the way
Location: London, England
Contact:

Re: Backup VirtualBox machine via copy and paste?

Post by keogh »

Yep the C:\Users\[my_name]\VirtualBox VMs\[VB_name] folder is the folder I was intending to copy... that the correct one?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Backup VirtualBox machine via copy and paste?

Post by mpack »

Moved to "Windows Hosts" since you've introduced Windows specific paths.
keogh wrote:Yep the C:\Users\[my_name]\VirtualBox VMs\[VB_name] folder is the folder I was intending to copy... that the correct one?
Well, it's correct in the sense that it is intended to be the default folder for VMs. Personally however I would consider it better practice to think in terms of backing up each VM individually, not as one big anonymous lump. After all, that "VirtualBox VMs" folder is just a default: you are free to locate VMs elsewhere, and if you do you may fail to back them up.
keogh
Posts: 10
Joined: 27. Feb 2013, 17:31
Primary OS: MS Windows 8
VBox Version: OSE Debian
Guest OSses: Ubuntu all the way
Location: London, England
Contact:

Re: Backup VirtualBox machine via copy and paste?

Post by keogh »

Ok cool, as I said above though, I'm not bothered my backups are up to date at all, just when I install a new service (e.g. nginx) on Ubuntu I would make a backup of the VM to my NAS. So that if I lost my VM for whatever reason, I could simply get that backup and start from there.

It's basically so I wouldn't have to re-install Ubuntu and all its services again, but if files and stuff are out of date that don't matter at all, all important files are on a git repo anyway.

I have to store my VM on my local HDD and not a network/external drive cos its all on a mac mini that I take to and from work, so I need it all accessible in the office and at home.

I'll only EVER have this one Virtual Machine, so just copying that Ubuntu folder should be fine for me I'd say.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Backup VirtualBox machine via copy and paste?

Post by mpack »

Fine. While I'm here I'll answer the question that typically comes next: how to restore from the backup.

The answer to that depends on why you want to restore.
  • If you still have a working VM but you want to revert to the older (backed up) state, then simply shut down VirtualBox and overwrite the VM files from the backup. Start VBox again and you'll find the VM state is reverted. The VM was already registered so you didn't need to register it again.
  • If you lost the working VM for some reason: say your host hard disk was zapped by lightning, then you would reinstall VirtualBox, then copy the VM folder from the backup and into "VirtualBox VMs", then use Machine|Add to re-register the .vbox file, which is the VM. After that you'll be back up and running.
Oh - and avoid snapshots at all costs. It would complicate all this stuff.
keogh
Posts: 10
Joined: 27. Feb 2013, 17:31
Primary OS: MS Windows 8
VBox Version: OSE Debian
Guest OSses: Ubuntu all the way
Location: London, England
Contact:

Re: Backup VirtualBox machine via copy and paste?

Post by keogh »

I wasn't gonna ask that actually, but that is a great response cos I wasn't thinking bout restoring it and you answered that perfectly! Thanks for that, I'll keep that response in a safe place for when I have to revert!

Thanks for your help!
Post Reply