Resizing Virtual Appliances (Debian) in VirtualBox for Windows Shutdown your Virtual Box Machin before you start the following steps STEP1: Open the command terminal and Go to VB dir executables to clone the Debian Machine: cd C:\Program Files\Oracle\VirtualBox C:\Program Files\Oracle\VirtualBox> C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "C:\Users\Name\VirtualBox VMs\Debian\Debian-disk1.vmdk" "C:\Users\Name\VirtualBox VMs\Debian\Debian-disk1.vdi" --format vdi 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone medium created in format 'vdi'. UUID: 2909034f-e794-4c02-97fbbcc3c6a717cb Now you have in this dir C:\Users\bas627\VirtualBox VMs\Debian>: two different Debian-disk1 (Debian-disk1.vdi and Debian-disk1.vmdk) STEP2: In the command terminal, Resize Debian-disk1.vdi to 200GB C:\Program Files\Oracle\VirtualBox>VBoxManage modifyhd "C:\Users\Name\VirtualBox VMs\Debian\Debian-disk1.vdi" --resize 204800 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% STEP3: Delete old vmdk source (either through the command terminal or by using your mouse) Navigate to "C:\Users\Name and delete.vitualbox folder Then procced to "C:\Users\Name\VirtualBox VMs\Debian and delete the old Debian-disk1.vmdk STEP4: In the command terminal, Clone the resized Debian-disk1.vdi back to vmdk format: C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "C:\Users\bas627\VirtualBox VMs\Debian\ Debian-disk1.vdi" "C:\Users\bas627\VirtualBox VMs\Debian\ Debian-disk1.vmdk " --format vmdk 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone medium created in format 'vmdk'. UUID: 0f23884b-22f1-43ce-9e8d- 173378ed9426 (YOUR DEBIAN MACHINE HAS BEEN SUCCESSFULLY RESIZED)
After resizing Debian disk as described above you need to resize the virtual box pertition (depending on which version of virtual box you are using or which way it was installed you might need to uninstall your VirtualBox and reinstall the newest version) By now, your virtual box would be empty because we deleted the.virtualbox folder. You would need to add the Machine again on VM by going to Machine -> Add -> (locate the disk) Debian.vmi You might also need to right-click on the machine and go to settings -> Storage, add a controller:sata and locate back the existing disk, as below.
STEP5: download the GParted live CD s ISO file from here (download gparted-live-0.23.0-1- i586 version, and now this one should work: Download gparted-live-0.27.0-1-i686.iso) STEP6: Click settings and storage in VB and browse to CD GParted software in download by clicking CD icons as shown: STEP7: Load the ISO file into your virtual machine by selecting your virtual CD drive, and browsing to the ISO file on your computer as shown above click OK. Next click start and see instructions.
STEP8: Press Enter key to start GParted Live. Please stand by while Linux does its magic detecting all hardware. You may see several lines ending with "(Warning)", this is normal. STEP9: A keymap selection dialog appears. This defines the layout of keyboard; US English is the default one. As you do not really need keyboard during running GParted, press Enter to accept the Don't touch keymap option.
STEP10: Press Enter key again to accept the default language (US English) for GParted. As you can see, the default selection is in square brackets - "[]". And then press Enter again to run GParted in a graphical environment called X-Window. X will start and open GParted automatically. Please note that sometimes it might take several minutes for disks and partitions to appear in the program.
This is a copy from our laptop rerun: After heating returns as described above we get:
There are three partitions (/dev/sda1, /dev/sda2 and the unallocated partition) present in the virtual box. We need to delete the second partitions before we can expand the first partition to use the unallocated space. STEP11: Delete the /dev/sda2 (extended) by first deleting /dev/sda5 (linux-swap) NOTE: You have to create the /dev/sda2 (extended) and /dev/sda5 (linux-swap) partition again after you are done expanding the /dev/sda1 partition, so note the memory of the partition.
STEP12: After deleting the /dev/sda2 (extended) and /dev/sda5 (linux-swap) Click Resize/Move and resize /dev/sda1 after which you have to After the resize operation completes, create the /dev/sda2 (extended) and /dev/sda5 (linux-swap) again, restart your virtual machine and remove the GParted ISO file. Windows will check the file system in your virtual machine to ensure it s working properly don t interrupt this check. STEP13: Remove the attachment iso as shown:
Click plus sign close to controller IDE to create new empty optical cd drive for future use as shown: The virtual machine s partition will now take up the entire virtual hard disk, so you ll have access to the additional space. Reboot VB and check that after resizing, roots partition is 29GB user@nipy:~$ df -h