[Solved] How change differencing disk

This is for discussing general topics about how to use VirtualBox.
Post Reply
Geppux
Posts: 9
Joined: 9. Jul 2016, 14:24

[Solved] How change differencing disk

Post by Geppux »

VirtualBox Versione 5.1.18 r114002 (Qt5.6.2)
Hi everybody,
I have a computer with W10 host machine with a 128 gb ssd disk so I decided to put my VM disk on a partition (D:) in a bigger HD. When I created a snaphot I didn't know he was creating a differencing disk on the c: disk and this differencing disk filled completeli the c:. So I moved the differencing disk on the d: partition but the virtual installation of linux wasn't starting anymore. I don't know what I did but I was able to start the linux machine but I lost all my data of the last period because it was created a new differencing disk.... so my question is: How can I assign the old differencing machine to the actual vdi disk?
I hope I was clear in my explanation, thank you.
Giuseppe
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How change differencing disk

Post by mpack »

You should throw that VM away and start again, as your tampering has made it hard to know where to begin to help you.

Your main error was right up front. If you were concerned about space on your SSD then you should have moved the entire VM, not scatter bits of it all over the shop. Howto: Move a VM. If you wanted to ensure that all new VMs are created on the secondary drive then you should set that preference before creating or cloning any VMs. The preference is in File|Preferences|General|Default Machine Folder.
Geppux
Posts: 9
Joined: 9. Jul 2016, 14:24

Re: How change differencing disk

Post by Geppux »

Thank you mpack next time I'll do as you suggest... I didnt know that this was the correct way...
Actually I solved modifying the file of the virtualbox machine definition changing the name of the snapshot re-created with the one of the correct one and now I recovered all the files and it seems working properly. Now what are the correct steps to have again a single file for the hard disk without differencing disk?
Thank you, bye.
Giuseppe
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How change differencing disk

Post by mpack »

If you have managed to get a working VM then I would :-
  1. Set the global location preference as I previously described (File|Preferences|General|Default Machine Folder).
  2. Clone your repaired VM: full clone, clone current state only (not the entire snapshop tree), but don't reset the MAC address.
The clone VM will be created in your preferred location. After testing the new VM the old VM can be deleted.

Please note that Linux guests often use grub to boot - and grub sometimes identifies the boot disk by its UUID, which changes when you clone the VM. You fix this by editing the grub boot script to match the new UUID, or even better: get grub to refer to the disk by device name rather than UUID.
Geppux
Posts: 9
Joined: 9. Jul 2016, 14:24

Re: How change differencing disk

Post by Geppux »

Thank you mpack; I cloned the VM and seems working fine. no problems with grub. Thanks for your help.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How change differencing disk

Post by mpack »

Thanks for reporting back.
Post Reply