Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Discussions about using Windows guests in VirtualBox.
Post Reply
jayakumar
Posts: 2
Joined: 17. Apr 2011, 08:59
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: xp

Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Post by jayakumar »

Hi,

I had a 160GB dual-boot Windows XP/Ubuntu system (laptop) which I wanted to convert into a single WinXP VDI for use with VirtualBox. The windows partition in this was 80GB in size and has a bunch of crappy software that I often need to use. So I dd-ed 100GB of the laptop's hard disk on to my host as a raw image. I then successfully converted this raw image into a VDI. So, I now have a 100GB VDI that contains an 80GB Windows partition and 20GB ext3 partition that just has the grub menu and start files. This works fine in virtualbox, I see it boot, go to the grub menu, and then chainload XP and all is good. The only issue is that the VDI is 100GB in size. So, I then defrag-ed and cleaned up the Windows partition so that it now has 50GB free. So, in theory, I should be able to resize my ntfs to 40GB (giving me still 10GB free in windows) and delete/shrink the other partitions to the minimum needed to hold the grub menu to chainload XP, lets call it a single 3GB partition. So my plan is:
- running guest
- boot from ubuntu CD in guest
- repartition the 100gb using ubuntu live CD into 40GB ntfs, 3GB grub/ubuntu, and leave the remainder (3rd partition) unallocated (so 57GB of unused partition)
Now, on the host, how do I clonevdi such that I can get the new vdi size to be 43GB instead of 100GB? That is, can I tell clonevdi that I don't want it to clone the unused partition on the original vdi? Thanks in advance for any advice or suggestions.

Thanks,
jaya
jayakumar
Posts: 2
Joined: 17. Apr 2011, 08:59
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: xp

Re: Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Post by jayakumar »

Ah, I underestimated the smartness of clonevdi. Once I deleted the guest 3rd partition in the guest itself, then clonevdi --existing was smart enough to ignore the unwanted data.

Thanks virtualbox developers! You have done an awesome job.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Post by Sasquatch »

To get rid of the Grub bootloader, run the recovery mode of the XP install disc and run fixmbr and fixboot. That will rewrite the MBR of the 'disk' to point to the Windows bootloader, instead of Grub. You can then remove the ext3 partition that holds the grub bootloader.

As for the partition size, you will still be able to let it grow up to 100 GB, but the file itself, the VDI, won't grow beyond the limit set as partitioned space. The RAW state will be ignored until you allocate it.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply