How to resize a disk in VirtualBox 4.1 (ubuntu host/windows XP guest)
In my previous post (https://myotragusbalearicus.wordpress.com/2011/04/28/how-to-resize-a-disk-in-virtualbox-ubuntu-hostwindows-xp-guest/) I discussed about resizing a virtual hard disk in VirtualBox 3.2.
Now, in the newer version of VirtualBox we have no “Create new virtual disk” option in the virtual device manager.
To resize a disk in VirtualBox is now much more easier… although you’ll have to use the command line.
First, list all of the virtual disks installed:
$ VBoxManage list hdds UUID: b8f8a160-d751-4a98-af16-5b6bd7174099 Parent UUID: base Format: VDI Location: /var/VirtualBox/HardDisks/WindowsXP.vdi State: created Type: normal Usage: WindowsXP (UUID: 6e027563-4bea-47e3-966e-067e3b563048)
That’s my 20GB hard disk drive.To resize it to 30GB:
$ VBoxManage modifyhd /var/VirtualBox/HardDisks/WindowsXP.vdi --resize 30720
And now, choose your application to extend the old partition to the new size.
It’s very easy with a LiveCD and GParted. Just choose Resize/Move and apply the changes.
An applause for VirtualBox, because in previous versions this was a little bit frustrating.
And don’t forget to read the documentation:
Ok, I need to repartiion, but I need something different
How to resize a disk in VirtualBox 4.1 (windows 8 host/Ubuntu 64bit 12.10 guest)
I used vboxmanage modifyhd to resize the VDI to a larger size. It works fine, I can boot into Ubuntu, no problems. But my HD partition in Ubuntu is still the 8gb I started with not the 15gb I resized it to. So how do I resize the partition in Ubuntu.
Thanks
LikeLike
You must login to Ubuntu and use GParted to resize the partition, but first make a backup!
LikeLike
Thanks for the help miquel, but I’m still having troubles, now with GParted. I installed it in Ubuntu, and then ran it, it shows me that I have 3 partitions, /dev/sda1, /dev/sda2 with /dev/sda5 that is the linux-swap. And then the unallocated partition. But there is no way I can figure how to add this unallocated space to /dev/sda1 (extend sda1 that is). Help would be appreciated.
LikeLike
If the free space is not adjacent it’s not trivial.
Look at this post, it’s similar to your question:
http://askubuntu.com/questions/120347/how-can-i-add-space-from-unallocated-to-extended
You have to start with a live CD and move /dev/sda2 and /dev/sda5 at the end of the free space, and then you can resize the /dev/sda1 to get the extra space.
Hope this helps!
LikeLike
GREAT! Hint for those resizing WIN partitions. After running the above, your new .vdi file can be resized by starting virtual win, then Control Panel | Administrative Tools | Computer Management |Disk Management. Then simply merge your existing partition with the newly created one. No need to mess with GPARTED.
LikeLike
Thanks Mark for your hint. I think it’s easier with Disk Management for those who use only windows.
LikeLike
It was nice to read your post. Thank you for posting this piece!
LikeLike