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)
Change History (7)
by , 8 years ago
comment:1 by , 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.
VM1 configuration file (Before second VM)