Cannot boot after vhd hard drive is resized in VirtualBox

In Windows 7, I set up another Windows 7 VM in VirtualBox. It worked great. Then, I needed to increase the vhd HD size. So, I used VBoxManage utility to do that with the following comment:

VBoxManage modifyhd "c:\VMs\Win7.vhd" --resize 30000

Then, I tried to run the VM again but it cannot be booted and gives me the following error:

FATAL: No bootable medium found! System halted.

Then, I tried to see what is going on inside the VHD and try to attach it inside Device Management and it says It cannot be attached because The file or directory is corrupted and unreadable.

Any idea what went wrong here and how can I save my VM inside that VHD file?

Answer

Unfortunately the VirtualBox documentation for the VBoxManage –resize option is misleading. You cannot just increase the size of the disk image and have everything work properly. The disk partition information within the image has to be adjusted so that the guest operating system knows the layout of the “drive” the disk image is simulating. You accomplish this adjustment by downloading a bootable CD image that has a partition editor on it and booting the VM onto that CD. You then use the partition editor to adjust the disk image’s partitions to use the added space.

There’s a nice writeup of the procedure here; just skip to step 4.

Attribution
Source : Link , Question Author : tugberk , Answer Author : Kyle Jones

Leave a Comment