VirtualBox

Opened 8 years ago

Last modified 8 years ago

#15893 new defect

Differencing disk for shared immutable disk saved to wrong VM settings file

Reported by: Joshua Rehm Owned by:
Component: virtual disk Version: VirtualBox 5.1.4
Keywords: Cc:
Guest type: Windows Host type: Windows

Description

Sharing an immutable drive across two VMs causes VirtualBox to save the differencing disk configuration in the wrong VM's configuration file. This is causing my scripts to fail when they search for the differencing disk UUID in the configuration.

After creating both VM's, the following appears in VM1's configuration file:

    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{c1487c8e-ab83-41ca-8efa-92e14b36c4dc}" location="E:/Golden Images/W2K12.vhd" format="VHD" type="Immutable">
          <HardDisk uuid="{a721fb7e-9bae-4347-9e32-f6e73fab310e}" location="Snapshots/{a721fb7e-9bae-4347-9e32-f6e73fab310e}.vhd" format="VHD"/>
          <HardDisk uuid="{ac2da970-c422-4c48-9b7d-9b7ce9d8c5d1}" location="E:/Machines/VM2/Snapshots/{ac2da970-c422-4c48-9b7d-9b7ce9d8c5d1}.vhd" format="VHD" autoReset="true"/>
        </HardDisk>
      </HardDisks>
    </MediaRegistry>

No MediaRegistry exists in VM2's configuration file. I expected to see a MediaRegistry in both configuration files, each containing only their specific VM's differencing disk.

I can reproduce the issue with the following commands. To create VM1:

VBoxManage.exe createvm --name VM1 --ostype Windows2012_64 --register
VBoxManage.exe modifyvm VM1 --memory 4096 --vram 128 --vrde off --accelerate3d on --accelerate2dvideo on --usb on
VBoxManage.exe storagectl VM1 --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage.exe storagectl VM1 --name "IDE Controller" --add ide
VBoxManage.exe storageattach VM1 --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium emptydrive
VBoxManage.exe modifyhd "E:\Golden Images\W2K12.vhd" --type immutable
VBoxManage.exe storageattach VM1 --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "E:\Golden Images\W2K12.vhd"
VBoxManage.exe modifyhd "E:\Golden Images\Snapshots/{a721fb7e-9bae-4347-9e32-f6e73fab310e}.vhd" --autoreset off
VBoxManage.exe modifyvm VM1 --nic1 hostonly --hostonlyadapter1 "VirtualBox Host-Only Ethernet Adapter"

To create VM 2:

VBoxManage.exe createvm --name VM2 --ostype Windows2012_64 --register
VBoxManage.exe modifyvm VM2 --memory 4096 --vram 128 --vrde off --accelerate3d on --accelerate2dvideo on --usb on
VBoxManage.exe storagectl VM2 --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage.exe storagectl VM2 --name "IDE Controller" --add ide
VBoxManage.exe storageattach VM2 --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium emptydrive
# This line is redundant, but executed by my scripts to ensure the shared disk is immutable.
VBoxManage.exe modifyhd "E:\Golden Images\W2K12.vhd" --type immutable
VBoxManage.exe storageattach VM2 --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "E:\Golden Images\W2K12.vhd"

I apologize if this is simply because I'm not using the command line interface correctly.

Attachments (6)

VM1.vbox (3.0 KB ) - added by Joshua Rehm 8 years ago.
VM1 configuration file (Before second VM)
VM2.vbox (2.3 KB ) - added by Joshua Rehm 8 years ago.
VM2 Configuration File
VM1-Changed.vbox (3.2 KB ) - added by Joshua Rehm 8 years ago.
VM1 Configuration File (After VM2 Created)
VBoxSVC.log (11.3 KB ) - added by Joshua Rehm 8 years ago.
Log after creating VM2
VBoxSVC.log.1 (10.6 KB ) - added by Joshua Rehm 8 years ago.
Log after creating VM1 (I assume?)
VirtualBox.xml (5.8 KB ) - added by Joshua Rehm 8 years ago.
VirtualBox user configuration file

Download all attachments as: .zip

Change History (7)

by Joshua Rehm, 8 years ago

Attachment: VM1.vbox added

VM1 configuration file (Before second VM)

by Joshua Rehm, 8 years ago

Attachment: VM2.vbox added

VM2 Configuration File

by Joshua Rehm, 8 years ago

Attachment: VM1-Changed.vbox added

VM1 Configuration File (After VM2 Created)

by Joshua Rehm, 8 years ago

Attachment: VBoxSVC.log added

Log after creating VM2

by Joshua Rehm, 8 years ago

Attachment: VBoxSVC.log.1 added

Log after creating VM1 (I assume?)

by Joshua Rehm, 8 years ago

Attachment: VirtualBox.xml added

VirtualBox user configuration file

comment:1 by Joshua Rehm, 8 years ago

I forgot to mention that VM1 and VM2 seem to operate as expected when started.

It's just that the configuration for VM2 is saved in VM1 for some reason.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use