VirtualBox VM Disk Resizing on MacOS

    
    

VirtualBox VM Memory Resize
When using VM’s inside VirtualBox, memory reallocation is sometimes necessary, particularly on minimal VM’s whose requirements change. 

This post describes the steps necessary to resize an existing VM. In our case, we are going to resize for a 150g virtual disk.

1. First, lets navigate to the enclosing folder for the VM’s:
kevins-MBP:~ admin$ cd VirtualBox\ VMs/

2. Now navigate to the specific VM you want to modify. In our case, we are going to modify a 64bit Kali Linux VM:
kevins-MBP:VirtualBox VMs admin$ cd Kali-Linux-2017.3-vbox-amd64

3. Now lets clone the installation and format for vdi. 
kevins-MBP:Kali-Linux-2017.3-vbox-amd64 admin$ vboxmanage clonehd “Kali-Linux-2017.3-vbox-amd64-disk002.vmdk” “clonekalidisk.vdi” –format vdi
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone medium created in format ‘vdi’. UUID: b3afb127-3eb2-408f-bd90-0c99b32c288d

4. Next, modify the cloned vdi for a 150gb size.
kevins-MBP:Kali-Linux-2017.3-vbox-amd64 admin$ vboxmanage modifyhd “clonekalidisk.vdi” –resize 150000
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%

5. Next, clone the newly created vdi to vdml format
kevins-MBP:Kali-Linux-2017.3-vbox-amd64 admin$ vboxmanage clonehd “clonekalidisk.vdi” “resizedkalidisk.vmdk” –format vmdk
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone medium created in format ‘vmdk’. UUID: b6e107aa-69df-433d-9a18-3d51131b8cce
kevins-MBP:Kali-Linux-2017.3-vbox-amd64 admin$

6. Now switch to the new vmdk file in vbox manager

7. Update and restart the VM
sudo apt-get update && sudo apt-get upgrade
reboot

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.