Increasing VirtualBox VDI storage capacity on Mac OS X
Tags: virtualbox, virtualization, storage, oracle
Published: 2018-03-21 15:57:49

---
title: Increasing VirtualBox VDI storage capacity on Mac OS X
published: true
description: 
tags: virtualbox, virtualization, storage, oracle
---

_Originally published on [Medium](https://medium.com/@akshay.g174_68301/increasing-virtualbox-vdi-capacity-on-mac-os-x-ac4d52b63f0c)_

![Resizing you Virtual Box storage is as simple as resizing this image, not really
](https://cdn-images-1.medium.com/max/1600/1*bn4isgq4L6kLoIBEn0kqkg.png "Resizing you Virtual Box storage is as simple as resizing this image, not really")


I use a VirtualBox setup on my Mac for running Ubuntu as a Guest OS. This setup helps me mock the production environment on my local dev machine. VirtualBox is a pretty handy software for anyone trying to run a guest OS. Though there is an initial learning curve while setting it up, but it’s fun. I have been using this setup for over a year now and it has served my well. Well, well until today…

Today, while working on a legendary(read as legacy) piece of software which was no cakewalk navigating through, required me to download the latest DB dumps. So, like any good programmer I tried to download the dumps, only to realise that I couldn’t do so because… my VM was out of space. I suddenly remembered the time when I allocated 20Gigs of space to the VDI, thinking that I’d never need more space than that. Haha.. was I wrong!!. Following the lazy dev protocol, I tried quickest solution; cleared up the logs and removed most unwanted files, but to no avail. Finally the time had come for me to get my hands dirty. A few search results later…

## Steps to follow
* Take backup of your VDI
(https://forums.virtualbox.org/viewtopic.php?f=2&t=58803)

* Fetch path to VDI
_Save this path, we’ll use it in the next steps_
Right click on VM -> Click Settings-> Storage -> Select your VDI on the Storage Tree on the left -> Location would have the path to your .vdi

![Path to the VDI is highlighted
](https://cdn-images-1.medium.com/max/1600/1*igq15rMNn2aI61R5B903CA.png "Path to the VDI is highlighted")


* Shutdown the VM and quit VirtualBox
* Navigate to VBoxManage utility folder
Open the Terminal app and type the following command

```
cd /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/
```

* Modify the size allocated to the VDI
Use the VDI path from above and use it in the below command

```
VBoxManage modifyhd — resize [new size in MB] [/path/to/vdi]
```

![Is it over yet?](https://cdn-images-1.medium.com/max/1600/1*OfT1MxmR0MwJE9oYKufVZQ.png "Is it over yet?")

**Tip:** Notice the ‘\’ before the space. This is used to escape the space character in path.

* Verify if the desired changes were successful

```
VBoxManage showhdinfo [/path/to/vdi]
```

![Yay!!](https://cdn-images-1.medium.com/max/1600/1*9hcwL4UFmM4FensdSyG7gw.png "Yay!!") 

* Launch the VirtualBox and VM

**Tip:** You may need to reallocate the partition to use the new space.

**Note:** I am using VirtualBox version 5.1.14. You may want to use modifymedium instead of modifyhd if you are on a newer version, though modifyhd is still supported.

*A few search results later…*

… I was happily downloading the DB dump on my VM and completing this blog post in the meanwhile. :)

If you like this post, feel free to follow me on [Twitter](https://twitter.com/akshaygoyal174). You can also visit my [Github](https://www.github.com/ninetyone) page to checkout some interesting projects, and contribute to them.

## Resources

* [https://www.virtualbox.org/manual/ch08.html]
* [http://osxdaily.com/2015/04/07/how-to-resize-a-virtualbox-vdi-or-vhd-file-on-mac-os-x/]