Difference between revisions of "Resizing you Virtual Disk"

From Klaus' wiki
Jump to: navigation, search
(Created page with 'This is a short description of how you can resize your haddisk to the virtual PC. First shut down the guest operating system - the Centos. The free and open version of VIrtualB…')
 
Line 20: Line 20:
  
 
Finally one could think that we now need to clone the disk back to the vmdk-format. But that is not necessary. Just delete the present disk in the VirtualBox Manager - click Settings for the particular machine and move down to '''Storage'''. Delete the attached disk, e.g. Centos.vmdk and insert the "clone.vdi" instead.
 
Finally one could think that we now need to clone the disk back to the vmdk-format. But that is not necessary. Just delete the present disk in the VirtualBox Manager - click Settings for the particular machine and move down to '''Storage'''. Delete the attached disk, e.g. Centos.vmdk and insert the "clone.vdi" instead.
 +
 +
The last step is to resize the partition within the virtual machine. This can only be done, when the Linux is not running. Therefore you have to boot the virtual machine using a LiveCD. I downloaded from [https://wiki.centos.org/Download a LiveKDE CD]. In the VirtualBox manager attach the LiveKDE CD to the Optical disk controller using the CD button to the right.
 +
 +
Eventually take a look at this [https://www.youtube.com/watch?v=b5mdnzQ0nuw video].
  
 
Boot the PC and see that everything works.
 
Boot the PC and see that everything works.
  
 
As root start '''gparted''' and resize the main partition to t he new size.
 
As root start '''gparted''' and resize the main partition to t he new size.

Revision as of 08:25, 9 January 2017

This is a short description of how you can resize your haddisk to the virtual PC.

First shut down the guest operating system - the Centos.

The free and open version of VIrtualBox does not - yet - have the capability to resize the .vmdk disk's. Therefore you have to convert the present harddisk to another format, vdi.

$ vboxmanage clonehd "d03428v1-disk1.vmdk" "clone.vdi" --format vdi

here put in your diskname, eg. "Centos.vmdk"

Now, after a while waiting time, we are ready to perform the actual resizing.

$ vboxmanage modifyhd "clone.vdi" --resize 80000

Here the disk is resized to 80 GB ~ 80000MB

Finally one could think that we now need to clone the disk back to the vmdk-format. But that is not necessary. Just delete the present disk in the VirtualBox Manager - click Settings for the particular machine and move down to Storage. Delete the attached disk, e.g. Centos.vmdk and insert the "clone.vdi" instead.

The last step is to resize the partition within the virtual machine. This can only be done, when the Linux is not running. Therefore you have to boot the virtual machine using a LiveCD. I downloaded from a LiveKDE CD. In the VirtualBox manager attach the LiveKDE CD to the Optical disk controller using the CD button to the right.

Eventually take a look at this video.

Boot the PC and see that everything works.

As root start gparted and resize the main partition to t he new size.