3

Virtual Box 6.0 here. I have a Windows 10 VM that is taking up enormous disk space on my host machine (Mac OS) and I would like to save the entire VM and all its associated files off to a flash drive until I can find a different host to run this VM on. That way I can have it backed up but can also delete it from my Mac.

So basically, I'm looking for a Save to disk or Clone to disk feature, where I can save off an exact copy of the VM to another location.

I can't find any options that are obvious here. I see Machine >> Clone which looks very promising. However I know that there are lots of different files involved with making a Virtual Box VM, and I'm worried that the clone won't be as complete as I'm looking for it to be.

Can someone with Virtual Box experience confirm that Machine >> Clone will produce a 2nd identical copy of my Windows 10 VM, and that it will allow me to save that clone to a flash drive? Thanks in advance!

8
  • 1
    Another approach (assuming you have updated the Windows 10 machine) is to do a Disk Cleanup, and Cleanup System Files. When the cleanup dialogue comes up, select ALL items for cleanup including old Windows installs (windows.old). Let that finish. You could save up to 30 GB. Then shrink the VBOX guest. howtogeek.com/312883/…
    – John
    Feb 8, 2021 at 23:00
  • Thanks @John (+1) thats an interesting idea. Do you have any experience with Machine >> Clone, and if so, would that do what I need it to do? Or does it not actually clone the entire machine? The idea is I could clone it to a flash drive, copy it from the flash to another PC, and then start it up on that PC and be staring at the exact same VM, with the exact same file system, etc. Feb 9, 2021 at 20:15
  • 1
    Cloning or copying the machine will only reduce space if you reduce space in the machine first. Otherwise it will not reduce space. Otherwise you may need to offload data to a USB drive. I prefer to keep the machines small if I can.
    – John
    Feb 9, 2021 at 20:17
  • Thanks @John sorry if I didnt make this clear in the question: I don't care about the disk space. It can be as big as it wants. I just want it off my Mac laptop, but I will need to be able to use it again on another host machine in the future. So, space considerations aside, whats your confidence level that Machine >> Clone to a flash drive will truly copy the entire VM and its disk to the flash drive? Feb 9, 2021 at 20:35
  • My own Virtual Machines stay within the Fixed Disk size I allotted for them. Generally 100 GB allowed (only use what it needed) for a modern 64-bit machine.
    – John
    Feb 9, 2021 at 20:37

2 Answers 2

2
+100

You may read about cloning in the article How To Clone Virtual Machine in VirtualBox, but that doesn't help to export a VM to another computer, as it only creates a copy on the local computer.

Instead, you should export the VM as an appliance, move the appliance to the new host, and then import it. The method to use is described below.

On the source host

  • Power down the VM.
  • In the VirtualBox main window, click File > Export Appliance.
  • In the resulting window, locate and select the VM to be exported and click Next.
  • In the next window, select the location to hold the exported appliance file and its format. The default of .ova will save the appliance as a single file and is to be preferred. The default format usually works fine.
  • After you name the appliance and select the format, click Next.
  • In the final screen, review the settings and click Export
  • Wait patiently for the export to terminate.

On the target host

  • Make available the exported .ova file.
  • In VirtualBox use menu File > Import Appliance.
  • Browse to the .ova file.
  • Click Next.
  • Review the Appliance settings.
  • Click Import.
  • When the import completes the VM is ready to use.

For more information and screenshots see the article
How to export VirtualBox virtual machines as appliances.

4
  • Thanks @harrymc! Another user (eventHandler) is warning against potential changes to the virtual hardware's UUID which could deactivate the Windows guest. With your suggested method, exporting it as an appliance, would this changed UUID/deactivated guest problem be an issue for me? Thanks again! Feb 11, 2021 at 10:26
  • I believe this will export the VM as-is without changes and Windows should remain activated. However, avoid running two VMs with the same license at the same time. I don't know if Microsoft can detect this, but it might be a risk.
    – harrymc
    Feb 11, 2021 at 10:54
  • 1
    It's illegal and impossible to hand-off an activated Windows VM. You need to sysprep it first, so as to return it to inactivated status Otherwise you risk Microsoft blacklisting your license.
    – harrymc
    Feb 11, 2021 at 11:08
  • 1
    If you give away an activated VM, then you have also given away your Windows license.
    – harrymc
    Feb 16, 2021 at 7:18
2

Cloning a VM generally involves changing virtual hardware's UUID. Therefore, despite of getting an exact copy of your data, your Windows guest will get deactivated. It is possible to revert UUID changes simply modifying some files, though.

Copying the VM files will keep its virtual hardware intact, so Windows won't lose its activation.

1- locate the VM folder in your Mac.

2- copy the folder to the new host.

3- open Virtualbox in the new host and go to machine -> add.

4- select the vbox file in the VM folder.

4
  • Thanks again @eventHandler! Would exporting my VM as an appliance cause this "changed UUID/deactivated guest" problem for me as well? Feb 11, 2021 at 10:27
  • Afaik, it is the same as copying the files directly, except that copying files can be quicker. You can send them over the network directly, without using more disk space for the export. You don't waste time in the export/import steps. Feb 11, 2021 at 10:34
  • Also, additionally to this answer, which is correct and it is the solution, VirtualBox has option to compact virtual media, which it is advised to use on virtual drive to minimize time of copying process.
    – pbies
    Feb 12, 2021 at 18:01
  • It is legally correct to do this, as it is considered a manual migration from one host to another. However, you must not keep the VM folder in the old host or turn it on. You may keep it as a backup, but not for using it. Feb 12, 2021 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .