[solved] disk not attached

Discussions related to using VirtualBox on Windows hosts.
Post Reply
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

[solved] disk not attached

Post by harald123 »

Hi,

as in the screenshot below, two differencing and base, are shown as 'not attached' in storage controller. I assume this is the reason why the machine is not shown in the GUI as having snapshots.

Is it possible to run a vboxmanage command or change a setting in the UI - storage panel of the vm to have the disks as 'attached' ?

I have searched in the vboxmanage documentation and found it should work with this command:

Code: Select all

VBoxManage storageattach LMint19 --storagectl "PIIX4" --port 0 --device 0 --type hdd --medium "C:\Daten\LMint19\Snapshots\{b1d88967-d281-4516-af1e-b44394f0bc77}.vdi"
Can you confirm this would work , considering the disks are actually attached to the controller (the VM works fine) and that the specified UUID is from the 2nd differencing disk?
Or should I first remove them from the storage controller and add them with this command?

Thank you.

If it helps, here is the output of this command:

Code: Select all

C:\Program Files\Oracle\VirtualBox
λ VBoxManage snapshot LMint19 list
This machine does not have any snapshots
Attachments
notattached.PNG
notattached.PNG (16.97 KiB) Viewed 5118 times
Last edited by harald123 on 25. Nov 2020, 19:41, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: disk not attached

Post by scottgus1 »

Snapshots use differencing disks, but differencing disks can exist outside snapshots. I don't think there is an official command to successfully attach a series of base and differencing disks to a VM and have them show up as official snapshots in the main Virtualbox window. (Hacking together a .vbox file manually is the only way I am aware of to use these files and make 'snapshots' out of them. Snapshots also include hardware listings. This has to be done very carefully. It's beyond my expertise, but it could be figured out.)

You can use Mpack's CloneVDI to clone the final disk in the chain to get the contents of the whole chain boiled down into a single disk file, then attach the single clone disk file to an existing VM. This will give you the final state of the disk chain's data. (You can also clone earlier files in the chain to get earlier states. Read the CloneVDI instructions for how.)
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

Re: disk not attached

Post by harald123 »

Hi and thanks for the quick reply.

Yes, I tried to use the tool, it says it cannot do differencing disks. - yet I used version 4.0.1 .

The disks have been differencing disks of a snapshot before, see below. After some issues and doing some repair work the vm works fine with the disks, but since then it says 'not attached' and no snapshot.
Attachments
Storagedevices.PNG
Storagedevices.PNG (28.95 KiB) Viewed 5090 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: disk not attached

Post by scottgus1 »

harald123 wrote:it says it cannot do differencing disks
From the CloneVDI instructions:
If you still receive an error message that "differencing images are not supported", then it
means that a valid VDI snapshot chain couldn't be created from the files you provided.
Thus it appears that your files are not from a complete chain.

Use the command:
vboxmanage showmediuminfo "path/to/drive/file.dvi"
on each drive file to plot out the parent and child UUIDs of each drive file. Then you can tell if your chain is complete.
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

Re: disk not attached

Post by harald123 »

Good morning, thank you for the answer.

Here is the output of showmediuminfo of all 3 disks. To me it looks fine.. if I am not missing something.

Code: Select all

vboxmanage showmediuminfo 50216244-b8a1-4fb9-9ca1-8d279c0f4fbe
UUID:           50216244-b8a1-4fb9-9ca1-8d279c0f4fbe
Parent UUID:    base
State:          locked read
Type:           normal (base)
Location:       C:\Daten\Linux Mint\Linux Mint.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       19163 MBytes
Size on disk:   18856 MBytes
Encryption:     disabled
Property:       AllocationBlockSize=1048576
Child UUIDs:    68d6ba78-c330-44c5-8118-ac721d339d89



vboxmanage showmediuminfo 68d6ba78-c330-44c5-8118-ac721d339d89
UUID:           68d6ba78-c330-44c5-8118-ac721d339d89
Parent UUID:    50216244-b8a1-4fb9-9ca1-8d279c0f4fbe
State:          locked read
Type:           normal (differencing)
Auto-Reset:     off
Location:       C:\Daten\LMint19\Snapshots/{68d6ba78-c330-44c5-8118-ac721d339d89}.vdi
Storage format: VDI
Format variant: differencing default
Capacity:       19163 MBytes
Size on disk:   4117 MBytes
Encryption:     disabled
Property:       AllocationBlockSize=1048576
Child UUIDs:    b1d88967-d281-4516-af1e-b44394f0bc77



vboxmanage showmediuminfo  b1d88967-d281-4516-af1e-b44394f0bc77
UUID:           b1d88967-d281-4516-af1e-b44394f0bc77
Parent UUID:    68d6ba78-c330-44c5-8118-ac721d339d89
State:          locked write
Type:           normal (differencing)
Auto-Reset:     off
Location:       C:\Daten\LMint19\Snapshots/{b1d88967-d281-4516-af1e-b44394f0bc77}.vdi
Storage format: VDI
Format variant: differencing default
Capacity:       19163 MBytes
Size on disk:   5901 MBytes
Encryption:     disabled
Property:       AllocationBlockSize=1048576
In use by VMs:  LMint19 (UUID: 8ee08a56-e6ee-480e-b4b6-0a791a9b8f94)

Here is how it looks when I try to use clonevdi:
Attachments
image_2020-11-23_082935.png
image_2020-11-23_082935.png (70.7 KiB) Viewed 5066 times
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: disk not attached

Post by fth0 »

Just a guess: Put the three files in the same folder first.
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

Re: disk not attached

Post by harald123 »

I just looked into the vbox file, the storage controller looks like this:

Code: Select all

      <StorageControllers>
        <StorageController name="PIIX4" type="ICH6" PortCount="2" useHostIOCache="true" Bootable="true">
          <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
            <Image uuid="{0b1a269e-faa0-4378-bd7c-fb6910f18032}"/>
          </AttachedDevice>
          <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
            <Image uuid="{b1d88967-d281-4516-af1e-b44394f0bc77}"/>
          </AttachedDevice>
        </StorageController>
      </StorageControllers>

Should all three disks be here, or is it fine with the last differencing disk? Thank you!
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: disk not attached

Post by fth0 »

harald123 wrote:Should all three disks be here, or is it fine with the last differencing disk? Thank you!
No and yes/no depending on the rest of the .vbox file.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: disk not attached

Post by scottgus1 »

The showmediuminfo's look correct. Did you try fth0's suggestion to put the files all in one folder, as the CloneVDI instructions state?
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

Re: disk not attached

Post by harald123 »

yes, I did now.
it says:
Attachments
image_2020-11-23_175020.png
image_2020-11-23_175020.png (66.82 KiB) Viewed 5046 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: disk not attached

Post by scottgus1 »

Good, we've got past the first "differencing" error. The way forward seems clear.
harald123
Posts: 64
Joined: 30. Oct 2020, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Linux Mint 19 Tara

Re: disk not attached

Post by harald123 »

After messing around with external hard drive and bitlocker, I was able to create a single file from the three disks with Clone VDI.

Would be nice though if there is a solution to get disks from 'not attache'd' to ''attached'.

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

Re: [solved] disk not attached

Post by scottgus1 »

Disks that are attached to the disk controller get 'attached'. It's just that Virtualbox does not have a method that I know of to attach an orphaned series of base and differencing disks. It is better to get the disks cloned into one disk, then attach the clone.
Post Reply