Clarification on Moving / Cloning VMachine

This is for discussing general topics about how to use VirtualBox.
Post Reply
CBergman
Posts: 3
Joined: 21. Mar 2023, 00:37

Clarification on Moving / Cloning VMachine

Post by CBergman »

Because the terms seem to be used differently and maybe not as intended I am confused on the correct way to use a Virtual Drive on more than ONE VM and Physical machine.

Here is what I wish to do.

I have several PCs and Macs.

I have ONE Important Business VHD. It is on a 2TB external USB C disk. It is encrypted the whole USB with VeraCrypt.

I insert the USB into a PC, Mount the Drive, and then launch the Virtual box VM. Then I run the machine and all is well.

I wish to take this portable VHD on the USB with me. And run it on many different actual physical machines both mac and PC.

So I have this ONE good VM on the USB.

So which of the many and confusing ways should I install, copy, clone, JUST the Virtual box Machine settings to get it to work fine on any machine in which I plug in the VHD on the USB?

I hope that is not confusing.

I also, wish to COPY just the VHD for back up purposes of course.

That seems perfectly straight forward. COPY it to another encrypted drive. Normal copy same name etc.

But it is running a single VDH from a single USB on many different machines that is confusing.

I do NOT want to COPY or CLONE the VHD, and end up with different copies. I wish to JUST clone or copy the virtual machine settings or recreate them so that they can see and use the SAME VHD when I move it back and forth, OFTEN.

Thanks
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Clarification on Moving / Cloning VMachine

Post by scottgus1 »

What you'll want to do is store the whole VM on the external drive, not just the disk file.

A VM consists of a folder containing the VM's .vbox file (the VM settings, essentially the 'motherboard' of the VM), typically the disk file (this can be in other places like yours is, but its best in the VM's folder with the .vbox file) and Logs and Snapshots subfolders.

When you store the whole VM folder on the external drive, everywhere you plug it in you have the same VM, including the UUIDs that affect software activation and licensing. Make a setting change, it stays with the VM on the external drive and appears on the next host you use the VM on, etc.

Make sure you have everything reliably backed up.

In the main Virtualbox window, while the VM is fully shut down not save-stated, right-click the VM in the list and choose Move. Browse to a desired folder on the external drive, and start the move. The VM folder will go to the external drive. Now, in the main Virtualbox window's Virtual Media Manager, select the VM's disk file and use the Move toolbar button to move the disk file into the VM folder, so the disk file and .vbox file are together in the same folder.

You can now take the external drive to any capable Virtualbox host and register the VM's .vbox file using the main Virtualbox window Machine menu Add command. You'll probably have to fully shut down all Virtualbox processes to eject the external disk.

One thought on the VHD: If it is truly a .vhd extension, and you are not using snapshots, then you'd do well to clone it to .vdi, see Mpack's CloneVDI. VHD has a design flaw that can kill the whole disk data if there is a host glitch while the vhd file is expanding.
Post Reply