VirtualBox increase guest OS Storage size

Posted: November 14, 2012 in VirtualBox
Tags: , ,

Steps to increase the storage size for guest OS in VirtualBox. After going through several posts and understanding the hard way that VirtualBox dynamically allocated storage option does not increase the size automatically, steps which worked for me.

System Details:
VirtualBox: 4.2.4 r81684
Host: Windows 7
Guest: Ubuntu 11.04

Initial storage Settings for Guest OS: Dynamically Allocated, 8GB

Steps:
1. Clone the existing system:
a. Open Virtual Box.
b. Right click on the VM and click clone.
c. close VirtualBox

2. Goto command prompt and run -┬áVBoxManage modifyhd C:\{location}\Ubuntu11.04.vdi –resize 51200
- VBoxManage might not be in your PATH settings. From command prompt goto directory VirtualBox was installed ‘C:\Program Files\Oracle\VirtualBox’
- {location} can be found in VM settings > storage click on vdi and copy location
- 51200 is for 50GB. Any other size do 1024*size GB

3. After the command is run. Open VirtualBox goto VM settings > storage click on vdi the virtual size should be showing 50GB

4. Download GParted from http://gparted.sourceforge.net/download.php and burn the ISO file on the CD/DVD.

5. Open VirtualBox goto VM settings and make following changes:
a. settings > system boot order uncheck floppy checkbox
b. settings > storage under controller, Attributes > CD/DVD Drive select Host Drive ‘D:’
note the original setting for later use.

6. Put GParted CD in CD drive

7. Start VM

8. Select option to run live CD

9. GParted on linux is loaded and GParted in open

10. You would see:
/dev/sda1 ext4
/dev/sda2 extended
/dev/sda5 linux-swap
You should also see large unallocated space. What we need to do is move extended and linux swap to the right end and increase size of sda1.

11. Select /dev/sda2 goto Partition > Resize/Move
increase the size by dragging the right side arrow till the end.

12. Select /dev/sda5 goto Partition > Resize/Move
move the block by dragging to the right most end.

13. Select /dev/sda2 goto Partition > Resize/Move
decrease size by dragging the left arrow to right hand side

14. Select /dev/sda1 goto Partition > Resize/Move
increase size by dragging the right arrow to the right hand side

15. Say yes to all the alert messages

16. Finally goto Edit > Apply all changes

17 All changes will get applied.

18. Shutdown

19. Open VirtualBox goto VM settings and make following changes:
a. settings > storage under controller, Attributes > CD/DVD Drive select original setting

Note: These steps worked for me. There are no screen shots as I have already done the changes :). Do it on your own risk, if you are not sure and creating a new VM is not a hassle, create a new VM with fresh install with larger storage size allocated.

About these ads

Comments are closed.