3

I know you can use a shared folder, but is it possible in VirtualBox for all VMs to have a second hard disk, the same VirtualBox hard disk?

1
  • 1
    Why not use the same shared folder for all VMs?
    – hytromo
    Sep 20, 2015 at 8:57

2 Answers 2

2

It is absolutely possible to attach any virtual hard drive we had created to as many virtual machines we want.

Just open the VirtualBox Manager to attach the corresponding .VDI file (or other supported format) on "storage" settings.

All virtual drives attached to another VM will not be removed when deleting any given VM.

We need to make sure we do not change data needed for all VMs to be running as this may break other VMs. Therefore (even though possible) it is not recommended to share an OS-containing VDI, but you could put your HOME partition on such a VDI.

Note that you can not run virtual machines simultaneously when the same virtual drive is attached to both of them.

2
  • ...and you can run two VMs togheter with the same disk attached? That would be nice --- I admit I never tried.
    – Rmano
    Sep 20, 2015 at 14:00
  • 1
    @Rmano: no, this would lead to data corruption. Virtualbox does not allow to attach a disk to more than one running VM.
    – Takkat
    Sep 20, 2015 at 14:15
0

I suspect the correct answer is the one suggested by @hakermania in the comment.

Rationale: a "virtual disk" in VirtualBox is seen by the client as a SATA disk --- a piece of hardware connected to the SATA interface of the machine.

Now, physical SATA disks can't be shared between machines, so the OS is not prepared to do this --- controlling and managing conflicts and concurrency.

On the other hand, shared folders act as network shares under the point of view of the client OS, and they are commonly shared between machines --- all the needed technology is in.

What you probably can do is use a virtual machine to share (via virtual network) a virtual disk --- but I suspect that @hakermania idea is simpler and probably more efficient (never tried, YMMV). You can also probably use the same disk (as pointed by @Takkat) in several VMs... although I do not think they can do it together: https://forums.virtualbox.org/viewtopic.php?t=8573, although it seems that recent VBoxes can do that --- http://www.oracledistilled.com/virtualbox/creating-shared-drives-in-oracle-vm-virtualbox/ (not trivial though)

1
  • Ok. Thanks for the info! I guess I stock with folders as I can't use the same drive at the same time.
    – stepb
    Sep 26, 2015 at 6:31

You must log in to answer this question.

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