Score:0

On VirtualBox, how to launch multiple instances of a VM that uses the .vmdk format?

ng flag

On VirtualBox, how to launch multiple instances of a VM that uses the .vmdk file format?

That mean, what are the alternates to do and run multiple copys or clones of the VM?

Possible small hint:

VirtualBox can run virtual hard disk files at minimum on follow modes:

  • changeable
  • carbon-less
  • shareable
  • multiple connectable...
FedKad avatar
cn flag
You question is not very clear, but obviously every VM instance must have exclusive read and write access to all related .VMDK's. So, you should create separate copies of each .VMDK's for each instance.
in flag
You’re asking how to run multiple instances from the same image simultaneously? Have you taken into account the challenge of each machine trying to write to the same files simultaneously? Or is that part of your question?
Alfred.37 avatar
ng flag
.vmdk files can run in 5 different modes at minimum... See: normal, not changeable, carbonless, shareable and multiple connectable....
FedKad avatar
cn flag
You should read section 5.4 on the VirtualBox documentation: https://www.virtualbox.org/manual/ch05.html
Score:0
cn flag

I understand that you have a single disk image that contains, say the root filesystem of a run-able Ubuntu instance and you want to create more than one virtual machine that will run this Ubuntu disk image.

One option would be to clone your VirtualBox instance.

But, if you want to do this by using the same disk image for multiple virtual machines then you can change the Type of this disk image to Multi-attach.

According to VirtualBox documentation (section 5.4) the disk format (VMDK, VDI, etc.) is irrelevant to this.

Multi-attach mode disk images can be attached to more than one virtual machines at the same time, even if these machines are running simultaneously. For each virtual machine to which such an image is attached, a "differencing" image is created (under the Snapshots directory of the VM's VirtualBox definition directory). As a result, any data that is written to such a virtual disk by one machine is not seen by the other machines to which the image is also attached. Each machine creates its own write history of the multi-attach image and the original disk image is never updated.

A multi-attach type disk is like an immutable disk image, except that the "differencing" image is not reset every time the machine starts. In other words, the changes made by each virtual machine are persistent between VM restarts and this means that the "differencing" image of a VM is going to grow as the VM makes updates on the "multi-attach"ed disk.

Note that according to the documentation,

This mode is useful for sharing files which are almost never written, for instance picture galleries, where every guest changes only a small amount of data and the majority of the disk content remains unchanged. The modified blocks are stored in differencing images which remain relatively small and the shared content is stored only once at the host.

IMHO a multi-attach type disk can be used for an operating system's root partition (I haven't tested though). However, I don't see any real advantage over creating clones.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.