Hello,
I am new to VirtualBox. I have a working Virtual Machine but notice that the size of the actual virtual disk file on the Host is different (smaller by one third) than the size reported in the Guest O/S.
I would like to have the virtual disk file on the Host be as small as practicable and to better understand what the Guest O/S is reporting.
I would also like to understand which virtual disk file type would be best for my situation.
First some details:
Host: Windows 7 Pro 64-bit SP1
8GB Ram
VirtualBox: 4.2.16 r86992
Guest O/S: Windows 7 Pro 32-bit
I arrived at a working VM by creating a virtual disk in the VMDK format by recovering an Acronis Backup and Recover v11.5 backup file of my source, working, stand-alone Windows 7 32-bit system. It may be worth noting the source Windows system used a 150GB SATA SDD drive. I had to use the VMDK file type because Acronis did not have an option to recover to a VDI type of virtual disk file.
It was easy enough to create the VM I called "Win7-32bit" in VirtualBox. However, the VM would always crash with a BSOD "STOP: 0x0000007B ...".
It took a very long time to resolve this which, after spinning my wheels with various useless efforts, in the end was really quite simple thanks to a tip I found buried in this forum. I just had to move the virtual disk file from the SATA controller, where it went by default or my error, to the IDE controller. The result was a working VM, albeit I had to play with a few Domain issues, but otherwise the VM functions just as expected/hoped and just like the source system did, though a bit sluggish.
The VMDK file on the host started out at about 108GB but grew to about 110GB after I removed quite a number of programs. (I would have expected it to shrink, but perhaps that's another discussion.)
In the "Win7-32bit" Guest O/S the various disk utilities show the size as about 150GB, just as it was on the original source system.
I thought that it might be wise to convert the VMDK file to the native VirtualBox VDI file type thinking, mistakenly, that this might also shrink the file size on the Host. There was no significant difference. Nevertheless, I reconfigured the VM to use the VDI file rather than the original VMDK file.
Then, with Windows Disk Management, I tried to shrink the size of that but the only effect was to increase the size of the "Unallocated" partition on the drive (as seen from the Guest O/S) with no change size of virtual disk file on the Host. I tried the normally wonderful MiniTool Partition Wizard v8 but it could not complete the process.
It may be relevant here to note that the Win7-32bit Guest O/S shows the disk to have 3 partitions, one System Reserved, one for the System (Drive C:) and one unallocated. That's just like the source system. (As an aside, I have Parallels on a Mac, the virtual disk in the Windows 7 64bit Guest O/S shows one partition of 65GB and the virtual disk file, PVM file type, is 44GB. However, this virtual disk was built by installing the Guest O/S into Parallels rather than the method I describe above).
Now some questions:
Q1: Is it preferable to use the VDI virtual disk file type with VirtualBox versus the VDMK file type? (Unless there's a good reason to use the VMDK file type I'll elect to stay with VDI if only for the reason it is native to VirtualBox).
Q2: Is it "normal" to see the Guest O/S reporting the original physical drive size as was on the source system, and the reported size to be much larger than the actual virtual disk file size on the Host?
Once I finish removing programs from the Virtual Machine I'd like to shrink the size of the VDI file as much as can be acheived.
Q3: Is it possible to shrink the size of the VDI file on the Host?
Q4: Is it possible to to adjust the partitions as seen in the Guest O/S so that there is one partition using the full extent of the virtual disk?
Q5: Is it expected that the size of the VDI file on the Host will be significantly different (in this case smaller) that the size as seen by the Guest O/S.
Thanks in advance for tips, tricks and pointers.
Virtual disk file types, size on host, size in guest
-
HBadorties
- Posts: 6
- Joined: 10. Jul 2013, 17:46
-
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: Virtual disk file types, size on host, size in guest
Have you read chapter 5 of the user manual ("Virtual Storage")? If not then it would be a good place to start. That way you can, e.g., learn about dynamically allocated VDIs. After that, you can read "All About AVIs" in the Howto section of the site. After that... well come back if you have questions which the docs don't answer.
Incidentally, you won't find anything in the docs about disk partitions. Partitions are software data structures relevant to the guest OS and nothing else, whereas VirtualBox is hardware - albeit simulated.
Incidentally, you won't find anything in the docs about disk partitions. Partitions are software data structures relevant to the guest OS and nothing else, whereas VirtualBox is hardware - albeit simulated.
-
HBadorties
- Posts: 6
- Joined: 10. Jul 2013, 17:46
Re: Virtual disk file types, size on host, size in guest
OK. I've read the material in Chapter 5 Virtual Storage. Call me thick-headed but I cannot see anything in the HowTo section titled "All About AVIs".
Let me frame another related question.
As noted in my original post my Win7-32bit Guest O/S shows the disk to have 3 partitions, one System Reserved, one for the System (Drive C:) and one unallocated.
I should be able to create a new VDI of an appropriate size and then clone the "System (Drive C:)" partition from the active VDI to this newly created one using standard tools inside the Guest OS. I am expecting the result to be a single VDI with one partition that I can then use as the VDI to boot from.
Any thoughts/recommendations?
Let me frame another related question.
As noted in my original post my Win7-32bit Guest O/S shows the disk to have 3 partitions, one System Reserved, one for the System (Drive C:) and one unallocated.
I should be able to create a new VDI of an appropriate size and then clone the "System (Drive C:)" partition from the active VDI to this newly created one using standard tools inside the Guest OS. I am expecting the result to be a single VDI with one partition that I can then use as the VDI to boot from.
Any thoughts/recommendations?
-
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: Virtual disk file types, size on host, size in guest
My thought is: not possible. The "system reserved" partition contains the Win7 boot manager, which is responsible for selecting another partition (the C partition in your case) for the final boot stages. I'm not sure why you would even want to get rid of that partition, as 100MB is nothing compared to the overall size of a Win7 disk. "Unallocated" is not a partition, it refers to unpartitioned space. If this space is substantial in size then you can use the Windows DiskPart tool to enlarge the C partition to encompass it. Usually however the unallocated space is just a small residue left after Windows has allocated a partition with optimum alignment and granularity.
I would recommend that you really not mess with this stuff until you have more experience with it.
ps. The "All About AVIs" tutorial is in the Howto | Generic forum.
I would recommend that you really not mess with this stuff until you have more experience with it.
ps. The "All About AVIs" tutorial is in the Howto | Generic forum.
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Virtual disk file types, size on host, size in guest
I believe mpack means All about VDIs Just a typo
-
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: Virtual disk file types, size on host, size in guest
Ouch! Not only a typo, but one I did twice and still didn't see the mistake even after it had been pointed out. I must be getting old!
In partial explanation: I use AVIs a lot in my day job (as test data), and I'm so used to writing about them...
In partial explanation: I use AVIs a lot in my day job (as test data), and I'm so used to writing about them...
-
HBadorties
- Posts: 6
- Joined: 10. Jul 2013, 17:46
SOLVED: Virtual disk file types, size on host, size in guest
Well, in spite of mpack's caution I blasted away at this with success.mpack wrote:My thought is: not possible. The "system reserved" partition contains the Win7 boot manager, which is responsible for selecting another partition (the C partition in your case) for the final boot stages. I'm not sure why you would even want to get rid of that partition, as 100MB is nothing compared to the overall size of a Win7 disk. "Unallocated" is not a partition, it refers to unpartitioned space. If this space is substantial in size then you can use the Windows DiskPart tool to enlarge the C partition to encompass it. Usually however the unallocated space is just a small residue left after Windows has allocated a partition with optimum alignment and granularity.
I would recommend that you really not mess with this stuff until you have more experience with it.
Originally I had a VMDK virtual disk of 110GB on the Host and which mimicked the size and layout of the original system from which the virtual disk was created - that being 150GB layed out in 3 partitions, of which only about 52GB was being used.
I was able to reduce the size on the Host system by using VBoxManage to a) convert to VDI format and then b) compact (see: Reducing file size of VirtualBox HDD image). This reduced the virtual disk size on the Host from 110GB to about 52GB. Good.
To answer mpack's remark/question about why I would want to get rid of the other partitions and reduce it to one, well, it just bugged me to no end be left with the size and partition layout which was true to the source Windows 7 system when, had I built the VM from scratch with a fresh windows install, I would have had just one partition of a size created in VirtualBox. I figured I could indeed end up with one partition.
I created and added a new VDI of 60GB (enough to hold the files used by the Guest O/S on partition "System VM-1 (F:)" as seen in the screenshot below). Then, booting the VM with MiniTool Partition Wizard 8 Bootable CD I copied this partition to the newly created VDI.
After that was done, and the VM shut down, I changed the storage settings to remove the original virtual disk and then set this new virtual disk Attributes: to "IDE Primary Master" from Slave.
Then I started the VM with the Windows 7 Pro distribution and got into repair and the command prompt to fix the bootloader following "Option 2 – The Nuclear Option" as described in How To Fix The Windows Bootloader;
bootsect /nt60 c: /force /mbr bcdboot c:\windows /s c:Reboot the VM and Voila! A working VM with a single-partition virtual disk.

Thanks for this Perryg;
PS: I wanted to add that while it may appear from the above descriptions that I had the described steps all mapped out in advance of implementing each step that's not the case. There was some trial and error along the way and I have distilled here the logical steps to follow in hopes that someone else wanting to do something similar will not have to travel such a great distance and can get results more directly. Hope this indeed does help someone out a bit.Perryg wrote:I believe mpack means All about VDIs Just a typo
-
Jiger
- Posts: 100
- Joined: 11. Jan 2017, 17:33
- Primary OS: MS Windows 10
- VBox Version: OSE other
- Guest OSses: MS Windows XP, Linux Mint
- Location: Stockholm
Re: Virtual disk file types, size on host, size in guest
I followed your instructions with satisfaction but when coming to reboot (I have Windows XP under Windows 10 Home), I got the following respons:
FATAL NO BOOTABLE MEDIUM FOUND! SYSTEM HALTED
and when trying to repair with the Windows XP installation CD, I got the following respons:
FATAL: INT18: BOOT FAILURE
During the repair (fixmbr) process under Windows XP, only the small Windows XP-disk002.vmdk file (IDE Primary Slave Disk) seemed to be investigated...
What could be done here to make the NewVirtualDisk bootable?
FATAL NO BOOTABLE MEDIUM FOUND! SYSTEM HALTED
and when trying to repair with the Windows XP installation CD, I got the following respons:
FATAL: INT18: BOOT FAILURE
During the repair (fixmbr) process under Windows XP, only the small Windows XP-disk002.vmdk file (IDE Primary Slave Disk) seemed to be investigated...
What could be done here to make the NewVirtualDisk bootable?