Change virtual size of VHD

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Daroarster
Posts: 2
Joined: 15. Jan 2013, 16:33

Change virtual size of VHD

Post by Daroarster »

I've have a VHD of a hard drive partition that was 100GB. When trying to use it to run in Virtual Box, the virtual size of the VHD shows as 149.1GB

Is there any way to reduce this to 100GB to bring it in line with the actual size?
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Change virtual size of VHD

Post by stefan.becker »

Try converting with CloneVDI to a vdi file.
jorgensen
Posts: 589
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Change virtual size of VHD

Post by jorgensen »

First you need to clean up everything as for a normal installation - what is the actual space use for files.
Then you can use CloneVDI to compact the virtual disk to a new image.
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: Change virtual size of VHD

Post by mpack »

I don't see the problem. You captured an image of a 150GB drive containing a 100GB partition. What makes you think something needs fixing?
Daroarster
Posts: 2
Joined: 15. Jan 2013, 16:33

Re: Change virtual size of VHD

Post by Daroarster »

I read somewhere that you cannot have a virtual hard drive over 127.5 GB. Basically I have taken a VHD of a colleagues old machine as she has recently switched to a new one. I want to be able to fire up the old VHD in VB in case she needs something from it but I cannot get it to work in either Virtual Box or Windows Virtual PC yet the actual machine/hard drive boots fine.
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: Change virtual size of VHD

Post by mpack »

Daroarster wrote:I read somewhere that you cannot have a virtual hard drive over 127.5 GB
Windows refuses to create them, which isn't the same thing. They have marketing reasons for doing that, there is nothing in the VHD format itself which requires that limitation.

Perhaps you should provide details of the real problem - failure to boot.
Post Reply