vdi file too big, cannot clone and use

Discussions related to using VirtualBox on Linux hosts.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

I have searched and tried many things, but I can't seem to find a problem close enough to mine to help me solve this. There are some that are almost close enough to help, but mine seems to be unique.

I have a separate partition for my virtual machine, which I run Windows 7 on. My host OS is opensuse Leap 42.1, and the desktop is Plasma 5.

My dedicated virtualbox partition size was 114G. My virtual hard drive is supposed to be only 80gb, and only about 50gb is being used on it. However, for some reason my vdi files with snapshots grew to fill the entire partition. Then the machine shut down while I was in the middle of an operation, and I could not get it to work again. It had corrupted something in the vdi file.

Fortunately, I had a backup saved on another drive, which is a mirror image drive for all my files. So, I removed the old machine, removed the configurations files (in the ~/.config/VirtualBox/ directory), and removed the old vdi files and snapshots. Then I copied the backup files back into the right places of the old machine, configurations, and also the old vdi files and snapshots. Voila. I was able to get my old Windows7 virtual machine back up and running again.

So then I thought, I need to shrink the size of the vdi file, and at the same time give it more room to grow. I used gparted to extend my 114G partition to 127G. That went fine, and I can still run Windows in VirtualBox.

Then I looked at all the different options to try and shrink the vdi file. I opened windows and ran defragment on the hard drive, and then ran sdelete to zero out unused blocks.

Then I closed the VM and back in linux I went to the directory where the vdi file is stored (with the snapshots) and ran the following:

Code: Select all

> vboxmanage modifyhd Win2015su.vdi --compact
VBoxManage: error: Cannot register the hard disk '/home/virt/VirtualBox VMs/Windows/Win2015su.vdi' {88c39387-e94e-4e89-8c97-a91c96bbf9e7} because a hard disk '/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Win2015su.vdi' with UUID {88c39387-e94e-4e89-8c97-a91c96bbf9e7} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
I could not figure out how to tell virtualbox that this file only exists in one location, where I am trying to shrink it. But I could not figure that out.

So I thought I would try and remove my snapshots, but I got this error when I tried to delete a snapshot:

Code: Select all

Failed to delete the snapshot afterTOS of the virtual machine Windows.

 Unable to merge storage '/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Win2015su.vdi' - not enough free storage space. .

Result Code: NS_ERROR_OUT_OF_MEMORY (0x8007000E)
Component: SessionMachine
Interface: IMachine {f30138d4-e5ea-4b3a-8858-a059de4c93fd}

I have plenty of room to expand in this partition now, as it is now 127gb, and the total of all the virtual machine files is only 114gb. But it won't let me do it.

So, next thing to try. I decided to use the clonevdi tool. It is a windows based tool, so I copied my vdi file to another directory, and opened up my virtual machine. From there I ran clonevdi, and was able to shrink the Win2015su.vdi file, and then try and create a new machine using that file as the hard disk. However, it won't open. It gives me a blue screen on startup, and it won't repair with the windows startup repair utility.

I tried the same thing, using clonevdi on the latest snapshot vdi file, that has the format {UUID}.vdi. It cloned and compacted it, but the same thing - wouldn't start up, and windows startup repair wouldn't make it work.

So I need help. Can someone please help me to do one of the following 2 things:
a) tell virtualbox that it is mistaken to believe that there is another vdi file with the same UUID, so that I can compact the original vdi file and then make things work more effectively.
-OR-
b) use clonevdi to compact the current state vdi file, along with all the snapshots, into one file with a separate UUID (I already can make the separate UUID, but I can't figure out how to get them all together into one), so that I can try running that machine.

Option A is preferable, because my windows vm seems to run just fine as long as I don't add a bunch of stuff to the OS.

Any help is appreciated - thanks in advance.
G.O.

PS - I am running VirtualBox 5.0.16.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

For a start:
  1. Do you have one VM and one VM only? If not, follow the steps below for each and every VM.
  2. This is going to give us the "recipe" of the VM, the ".vbox" file:
    1. Right-click on the VM in the VirtualBox Manager.
    2. Select "Show in Finder/Explorer/Whatever".
    3. ZIP the selected ".vbox" file and attach it in your response.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

Thank you. Yes, I have only 1 VM - here are the 2 ".vbox" files associated with it zipped together. That would be the "Windows.vbox" and the "Windows.vbox-prev" files.
Attachments
Windows.zip
(10.86 KiB) Downloaded 9 times
jvanek
Posts: 7
Joined: 12. May 2016, 12:01

Re: vdi file too big, cannot clone and use

Post by jvanek »

Hello!

My virtual drive+snapshots had the same issue. Helped:
cat /dev/zero >'/zero.file' || true
sleep 10
sync
rm -f '/zero.file'

on VM

and afterwards with VM:
....
find "$VMDIR" -name '*.vdi' -exec echo -n "{}: " ';' -exec VBoxManage modifymedium {} --compact ';'
VBoxManage snapshot "$VM" take "$SNAPSHOT"
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

@jvanek
I prefer the official way (as the one that's in the manual) that talks about using the zerofree utility (Chapter 8.23), mainly because I run it from SystemRescueCD by attaching it temporarily to the VM and booting from it, if it is not available on the guest OS already.

@SChinaSeaTribe
I didn't find any reference to any file at '/home/george/VirtualBox VMs/VirtualBox VMs/'. Which means that something is rotten in Denmark. Please find and attach your VirtualBox.xml file, usually located in '/home/george/.config/VirtualBox.xml'.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

Ok, thanks so much. Here is the xml file.
Attachments
VirtualBox.xml
(2.3 KiB) Downloaded 11 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

OK, it is not in the "RecentListHD" list as I thought it would be, but I noticed something funny. The default machine folder points to: "/home/george/VirtualBox VMs" and there is only one VM (as you said): "/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Windows.vbox".

On that VM recipe (the .vbox file), the attached HD is listed at location="Win2015su.vdi", which uses a relative path. Coupled with the location of the .vbox file that means that VirtualBox is looking at "/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Win2015su.vdi" for its hard drive. Are you absolutely sure that there is no such file? Along with the snapshots?

The other thing is that there is no reference whatsoever to "/home/virt/...". None. Zilch. Nada.

I'm really at a loss here as to what might be going on. Please post the output of the commands:
   VBoxManage list hdds
   ls -alR /home/george/VirtualBox VMs/
   ls -alR /home/virt/VirtualBox VMs/Windows/
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

socratis wrote:OK, it is not in the "RecentListHD" list as I thought it would be, but I noticed something funny. The default machine folder points to: "/home/george/VirtualBox VMs" and there is only one VM (as you said): "/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Windows.vbox".

On that VM recipe (the .vbox file), the attached HD is listed at location="Win2015su.vdi", which uses a relative path. Coupled with the location of the .vbox file that means that VirtualBox is looking at "/home/george/VirtualBox VMs/VirtualBox VMs/Windows/Win2015su.vdi" for its hard drive. Are you absolutely sure that there is no such file? Along with the snapshots?

The other thing is that there is no reference whatsoever to "/home/virt/...". None. Zilch. Nada.
Sorry for the confusion. I put my system together about 3 years ago and have done updates ever since, and then upgraded to new distributions, while copying the vm files, , changing partition arrangements, etc., and the result is the convoluted mess that we are trying to sort out now. I really do appreciate the help.

Ok, the Win2015su.vdi file does exist - it is the file that I am currently using when I run virtualbox. The snapshots do exist also. They are in this directory:

Code: Select all

# ls -l /home/virt/VirtualBox\ VMs/Windows/
total 40511572
-rw------- 1 george users          60 May 12 09:40 .directory
drwxr-xr-x 2 george users        4096 May 14 23:24 Logs
drwxr-xr-x 2 george users        4096 May 12 09:40 Snapshots
-rw------- 1 george users 42163240960 May 13 04:01 Win2015su.vdi
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox-prev
-rw-r--r-- 1 george users       11117 May 13 19:56 Windows.zip
But they are also in this directory:

Code: Select all

# ls -l /home/george/VirtualBox\ VMs/VirtualBox\ VMs/Windows/
total 40511572
-rw------- 1 george users          60 May 12 09:40 .directory
drwxr-xr-x 2 george users        4096 May 14 23:24 Logs
drwxr-xr-x 2 george users        4096 May 12 09:40 Snapshots
-rw------- 1 george users 42163240960 May 13 04:01 Win2015su.vdi
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox-prev
-rw-r--r-- 1 george users       11117 May 13 19:56 Windows.zip
The reason for that is that /home/george/VirtualBox\ VMs/ is a symlink to /home/virt/VirtualBox\ VMs/ as follows:

Code: Select all

# ls -l /home/george/VirtualBox\ VMs/
total 16
-rw------- 1 george users   60 May 12 08:50 .directory
-rw-r--r-- 1 george users  790 Jun 27  2015 readme
lrwxrwxrwx 1 george users   26 Feb 13  2015 VirtualBox VMs -> ../../virt/VirtualBox VMs/
drwxr-xr-x 3 george users 4096 May 14 23:24 Windows
drwxr-xr-x 3 george users 4096 May 13 03:47 Windows7_May2016
It is also confusing that the same directory as the symlink is another directory called "Windows" which is not being used, as you can see above. But I don't think that is part of the problem. Can I delete that? The 3rd one, Windows7_May2016 was created when I tried to make a new virtual machine on the cloned drive, but it didn't work, and somehow I managed to delete the vdi file without removing the whole directory. I guess I should delete that as well. But I am hesitant to delete anything right now while we are in the middle of troubleshooting.

The VirtualBox.xml seems to have reference to some other vdi files that I created also and tried to create a machine with, all of which failed. But when I removed those creations and their data, virtualbox didn't remove their references from the xml file.
socratis wrote: I'm really at a loss here as to what might be going on. Please post the output of the commands:
   VBoxManage list hdds
   ls -alR /home/george/VirtualBox VMs/
   ls -alR /home/virt/VirtualBox VMs/Windows/
Here are the outputs:

Code: Select all

> vboxmanage list hdds
UUID:           88c39387-e94e-4e89-8c97-a91c96bbf9e7
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /home/george/VirtualBox VMs/VirtualBox VMs/Windows/Win2015su.vdi
Storage format: VDI
Capacity:       81920 MBytes
Encryption:     disabled

UUID:           0ca9ea90-92be-480a-8726-c1fb36f86712
Parent UUID:    88c39387-e94e-4e89-8c97-a91c96bbf9e7
State:          created
Type:           normal (differencing)
Location:       /home/george/VirtualBox VMs/VirtualBox VMs/Windows/Snapshots/{0ca9ea90-92be-480a-8726-c1fb36f86712}.vdi
Storage format: VDI
Capacity:       81920 MBytes
Encryption:     disabled

UUID:           83e9aae6-46ae-4d36-916c-361bd1f89a32
Parent UUID:    0ca9ea90-92be-480a-8726-c1fb36f86712
State:          created
Type:           normal (differencing)
Location:       /home/george/VirtualBox VMs/VirtualBox VMs/Windows/Snapshots/{83e9aae6-46ae-4d36-916c-361bd1f89a32}.vdi
Storage format: VDI
Capacity:       81920 MBytes
Encryption:     disabled

UUID:           a1a28943-4545-484c-97fb-3b36e8eaedde
Parent UUID:    83e9aae6-46ae-4d36-916c-361bd1f89a32
State:          created
Type:           normal (differencing)
Location:       /home/george/VirtualBox VMs/VirtualBox VMs/Windows/Snapshots/{a1a28943-4545-484c-97fb-3b36e8eaedde}.vdi
Storage format: VDI
Capacity:       81920 MBytes
Encryption:     disabled
For the parent directory before the symlink:

Code: Select all

 ls -alR /home/george/VirtualBox\ VMs/
/home/george/VirtualBox VMs/:
total 24
drwxr-xr-x  4 george users 4096 May 13 05:09 .
drwxr-xr-x 93 george users 4096 May 14 23:23 ..
-rw-------  1 george users   60 May 12 08:50 .directory
-rw-r--r--  1 george users  790 Jun 27  2015 readme
lrwxrwxrwx  1 george users   26 Feb 13  2015 VirtualBox VMs -> ../../virt/VirtualBox VMs/
drwxr-xr-x  3 george users 4096 May 14 23:24 Windows
drwxr-xr-x  3 george users 4096 May 13 03:47 Windows7_May2016

/home/george/VirtualBox VMs/Windows:
total 32
drwxr-xr-x 3 george users 4096 May 14 23:24 .
drwxr-xr-x 4 george users 4096 May 13 05:09 ..
-rw------- 1 george users   60 May 14 23:24 .directory
drwx------ 2 george users 4096 Jan  3 13:31 Logs
-rw------- 1 george users 7762 Jan  3 13:41 Windows.vbox
-rw------- 1 george users 7679 Jan  3 13:41 Windows.vbox-prev

/home/george/VirtualBox VMs/Windows/Logs:
total 124
drwx------ 2 george users   4096 Jan  3 13:31 .
drwxr-xr-x 3 george users   4096 May 14 23:24 ..
-rw------- 1 george users 117373 Jan  3 13:41 VBox.log

/home/george/VirtualBox VMs/Windows7_May2016:
total 28
drwxr-xr-x 3 george users 4096 May 13 03:47 .
drwxr-xr-x 4 george users 4096 May 13 05:09 ..
drwx------ 2 george users 4096 May 12 10:08 Logs
-rw------- 1 george users 7258 May 12 10:08 Windows7_May2016.vbox
-rw------- 1 george users 7174 May 12 10:08 Windows7_May2016.vbox-prev

/home/george/VirtualBox VMs/Windows7_May2016/Logs:
total 124
drwx------ 2 george users   4096 May 12 10:08 .
drwxr-xr-x 3 george users   4096 May 13 03:47 ..
-rw------- 1 george users 114879 May 12 10:08 VBox.log
For the directory after the symlink:

Code: Select all

> ls -alR /home/george/VirtualBox\ VMs/VirtualBox\ VMs
lrwxrwxrwx 1 george users 26 Feb 13  2015 /home/george/VirtualBox VMs/VirtualBox VMs -> ../../virt/VirtualBox VMs/
> ls -alR /home/virt/VirtualBox\ VMs/
/home/virt/VirtualBox VMs/:
total 28
drwxr-xr-x 6 george users 4096 May 13 02:50 .
drwxr-xr-x 4 george users 4096 May 12 08:48 ..
-rw------- 1 george users   59 Jan  3 13:25 .directory
drwxr-xr-x 4 george users 4096 May 14 23:24 Windows
drwxr-xr-x 2 george users 4096 May 13 02:50 Windows7_2016
drwx------ 2 george users 4096 Jul 23  2013 Windows XP Raid Clone
drwxr-xr-x 3 george users 4096 Feb 12  2015 WinXPNew

/home/virt/VirtualBox VMs/Windows:
total 40511580
drwxr-xr-x 4 george users        4096 May 14 23:24 .
drwxr-xr-x 6 george users        4096 May 13 02:50 ..
-rw------- 1 george users          60 May 12 09:40 .directory
drwxr-xr-x 2 george users        4096 May 14 23:24 Logs
drwxr-xr-x 2 george users        4096 May 12 09:40 Snapshots
-rw------- 1 george users 42163240960 May 13 04:01 Win2015su.vdi
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox
-rw------- 1 george users       49931 May 14 23:24 Windows.vbox-prev
-rw-r--r-- 1 george users       11117 May 13 19:56 Windows.zip

/home/virt/VirtualBox VMs/Windows/Logs:
total 380
drwxr-xr-x 2 george users   4096 May 14 23:24 .
drwxr-xr-x 4 george users   4096 May 14 23:24 ..
-rw------- 1 george users     59 Jun 27  2015 .directory
-rw------- 1 george users   2814 May 14 23:24 VBox.log
-rw------- 1 george users 119459 May 13 05:11 VBox.log.1
-rw------- 1 george users 123464 May 13 02:52 VBox.log.2
-rw------- 1 george users 121792 May 12 11:58 VBox.log.3

/home/virt/VirtualBox VMs/Windows/Snapshots:
total 78242260
drwxr-xr-x 2 george users        4096 May 12 09:40 .
drwxr-xr-x 4 george users        4096 May 14 23:24 ..
-rw------- 1 george users 17563648000 Jul  3  2015 {0ca9ea90-92be-480a-8726-c1fb36f86712}.vdi
-rw------- 1 george users  1307397273 Jun 11  2015 2015-06-11T13-46-17-283131000Z.sav
-rw------- 1 george users  1615849566 Jul  3  2015 2015-07-03T14-21-43-265774000Z.sav
-rw------- 1 george users  1545078438 Jan  3 13:48 2016-01-03T05-48-29-539865000Z.sav
-rw------- 1 george users 25208815616 Jan  3 13:48 {83e9aae6-46ae-4d36-916c-361bd1f89a32}.vdi
-rw------- 1 george users 33962328064 May 13 05:10 {a1a28943-4545-484c-97fb-3b36e8eaedde}.vdi
-rw------- 1 george users          60 May 12 09:40 .directory

/home/virt/VirtualBox VMs/Windows7_2016:
total 8
drwxr-xr-x 2 george users 4096 May 13 02:50 .
drwxr-xr-x 6 george users 4096 May 13 02:50 ..

/home/virt/VirtualBox VMs/Windows XP Raid Clone:
total 20
drwx------ 2 george users 4096 Jul 23  2013 .
drwxr-xr-x 6 george users 4096 May 13 02:50 ..
-rw------- 1 george users   59 Jul 23  2013 .directory
-rw------- 1 george users 7415 Jul 21  2013 Windows XP Raid Clone.vbox

/home/virt/VirtualBox VMs/WinXPNew:
total 12
drwxr-xr-x 3 george users 4096 Feb 12  2015 .
drwxr-xr-x 6 george users 4096 May 13 02:50 ..
drwx------ 2 george users 4096 Jul 16  2014 Snapshots

/home/virt/VirtualBox VMs/WinXPNew/Snapshots:
total 8
drwx------ 2 george users 4096 Jul 16  2014 .
drwxr-xr-x 3 george users 4096 Feb 12  2015 ..

socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

Geez Luise! You link one directory (A) to another (B), you try to operate on B, VirtualBox complains that the same file exists on A, and you blame VirtualBox!?! Are you @#!% kidding me!?!

Plus your posts, except the last one, kind of left out the fact that you were operating on a symlink and you had me going Hercules Poirot on this!?! Boy... OH, boy...</rant>

OK, let try and get you out of this huge hole that you've dug for yourself. BACKUP, BACKUP, BACKUP.Although to be fair, you do have a backup, you simply restored stuff in the wrong place ;)

I've tried to recreate the "structure" of your setup and actually tried the commands below in the sequence given. However, I'm not making any guarantees. It should work as advertised, but you never know if a minute difference in (e.g.) the shells might do something funky.

You can safely delete the following files and folders so that the picture is a little bit clearer. They are leftovers and of no need to you, except maybe to confuse you. You can copy-paste if you feel like it. I've adapted the commands to your case:
rm /home/virt/VirtualBox\ VMs/Windows/Snapshots/*.sav
rm -r /home/virt/VirtualBox\ VMs/Windows7_2016
rm -r /home/virt/VirtualBox\ VMs/Windows\ XP\ Raid\ Clone
rm -r /home/virt/VirtualBox\ VMs/WinXPNew
rm -r /home/george/VirtualBox\ VMs/Windows7_May2016
Delete the hard link.
rm /home/george/VirtualBox\ VMs/VirtualBox\ VMs
Delete the old (unused) VM.
rm -r /home/george/VirtualBox\ VMs/Windows
For that last one, do not worry. The contents of this folder show that it has not been modified since 03/Jan/2016, which I guess was the day that you created the link. So, you can delete this specific Windows folder safely. You should be left with no directories at all in '/home/george/VirtualBox\ VMs'.

Move all of your files from the 'virt' directory to your home directory (where they should be).
mv /home/virt/VirtualBox\ VMs/Windows/ /home/george/VirtualBox\ VMs/
Open VirtualBox. You should be all set. You have cleaned up the mess and your VirtualBox is in the state it should be.

Optionally, delete the VirtualVM folder from your 'virt' user so you don't get mixed up again.
rm -r /home/virt/VirtualBox\ VMs/
Let me know how it went...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

ok, thanks for your patience and help ;)

I followed all your instructions, and here is what happened. Once I moved the vdi file and the snapshots into the /home/george/Virtual VMs/Windows/ folder, I tried to start up virtual box again, and it said that the machine was inaccessible because it couldn't find the hard drive.

So I made another subfolder inside the Virtual VMs folder, so it just looks like it is double stacked as before, and then it was able to start up.

So my new folder structure has everything in /home/george/Virtual VMs/Virtual VMs/Windows/

After that I was able to successfully delete all my snapshots (except the latest of course), which was one of my original goals in the first place. So that is good - a big step.

But now I want to compact my hard drive. Here are my directories:

Code: Select all

> ls -l /home/george/VirtualBox\ VMs/VirtualBox\ VMs/Windows/
total 45654088
drwxr-xr-x 2 george users        4096 May 17 04:28 Logs
drwxr-xr-x 2 george users        4096 May 17 04:17 Snapshots
-rw------- 1 george users 46749712384 May 17 04:17 Win2015su.vdi
-rw------- 1 george users       24729 May 17 04:58 Windows.vbox
-rw------- 1 george users       24729 May 17 04:28 Windows.vbox-prev

Code: Select all

> ls -l /home/george/VirtualBox\ VMs/VirtualBox\ VMs/Windows/Snapshots/
total 27926860
-rw------- 1 george users  4432330752 May 17 04:58 {0181ed0f-dd26-4f01-be8d-38d2d3b97fb3}.vdi
-rw------- 1 george users 24166531072 May 17 04:17 {a1a28943-4545-484c-97fb-3b36e8eaedde}.vdi
So I have 3 vdi files - the Win2015su.vdi, and then in the snapshots subdirectory to the folder that contains that file, the 2 snapshot vdi files.

If I run vboxmanage {filename}.vdi --compact on any one of these files, will it be sufficient? Or do I have to run it on all 3 files separately? I am pretty confused about that.

Thanks again for your help. I will be travelling tomorrow, and will not be able to come back to this computer until the end of the week, so feel free to take your time.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

You should know the drill by now: new VBox.log and VirtualBox.xml. Both as fresh as possible.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

I'm sorry, I don't know what you mean by that. Could you explain a little more? Here is what I am planning to do:

In directory with the main vdi file:
vboxmanage modifyhd ./Win2015su.vdi --compact

In the directory with the snapshots:
vboxmanage modifyhd ./{0181ed0f-dd26-4f01-be8d-38d2d3b97fb3}.vdi --compact
vboxmanage modifyhd ./{a1a28943-4545-484c-97fb-3b36e8eaedde}.vdi --compact

That is the only way I can see to do this - to run the compact command 3 times, once for each file. Is that right?

What do I do afterwards with VBox.log and VirtualBox.xml? Do I create new blank files or something? I have no idea what the steps should be.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

I mean that you should attach the new VirtualBox.xml and the VBox.log.zip like you did previously.

Do not start modifying the VDIs until everything is in its proper place. Something didn't work the last time, not sure if it was bad instructions or PEBCAK.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
SChinaSeaTribe
Posts: 22
Joined: 12. May 2016, 21:34

Re: vdi file too big, cannot clone and use

Post by SChinaSeaTribe »

ah, ok, great. Here are my files :)
Attachments
VBox.log.zip
(88.75 KiB) Downloaded 7 times
VirtualBox.xml
(2.44 KiB) Downloaded 6 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vdi file too big, cannot clone and use

Post by socratis »

I should have also asked for the contents of the directories. Please post the output of the command below. Copy the purple text and paste to your Terminal:
   ls -alR /home/george/VirtualBox\ VMs/
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply