Running out of space on your virtual machine can be frustrating. One minute you’re installing updates, the next you’re staring at a “Disk full” warning. But don’t worry — adding more storage to your VirtualBox VM is easier than you think. Whether you’re a beginner or just in a rush, we’ve got you covered with a simple, step-by-step guide.
TL;DR
Need more space in Oracle VirtualBox? You can easily expand your VM storage by resizing the virtual disk and adjusting settings in VirtualBox. It just takes a few clicks and a little bit in the terminal. Follow this guide, and you’ll go from “No space left” to “Plenty of room” in no time.
Why You Might Need More Storage
Virtual machines are like digital containers. You assign them a fixed size, but over time things change. You install software, download files, and suddenly that cute little 15GB VM is begging for breathing room.
- Installing software eats up space
- System updates take more storage than expected
- Personal files and media build up quickly
Before you panic, grab a coffee or tea and get ready to expand.
Step 1: Shut Down Your VM
Make sure your virtual machine is completely shut down, not just saved or paused. The resize operation only works when the VM is not running. So go ahead — power it off like you’re giving it a break.
Step 2: Locate the VDI File
Next, find where your virtual disk is stored. This is usually a file ending in .vdi (if you’re using VirtualBox’s default format).
By default, files are stored in:
- On Windows: C:\Users\YourName\VirtualBox VMs\YourVM\
- On macOS/Linux: /Users/YourName/VirtualBox VMs/YourVM/
Tip: Make a copy of this file before editing it — just in case!
[h3]Step 3: Use the VBoxManage Command[/h3]
Time to roll up your sleeves and run a command.
Open your terminal (Command Prompt on Windows, Terminal on macOS/Linux), and type:
VBoxManage modifymedium disk "Path/To/YourVM.vdi" --resize size_in_MB
For example, if you want to resize to 50 GB, type:
VBoxManage modifymedium disk "C:\Users\Me\VirtualBox VMs\LinuxVM\LinuxVM.vdi" --resize 51200
Note: 1 GB = 1024 MB
Step 4: Resize the Partition in the Guest OS
Increasing the virtual disk size is just step one. You now need to tell the guest operating system (the one running inside VirtualBox) to recognize and use the extra space.
If You’re Using Ubuntu or Another Linux Distro
Boot into your VM, then open a terminal in the guest OS and run:
sudo parted
Type the following commands:
print– Shows current partitionsresizepart– Select the primary partition (usually 1)- Resize it to use all available space
Once you’ve resized the partition, use:
sudo resize2fs /dev/sda1
This will stretch your file system to fit the new space.
If You’re Using Windows as Guest
The Disk Management tool is your friend! Follow these steps:
- Start your Windows VM
- Go to Start Menu ➜ Type “disk management” ➜ Open it
- Right-click the main partition (usually C:)
- Select Extend Volume
- Follow the wizard and use all available space
Step 5: Verify the New Space
Now that you’ve done all the resizing, it’s time to enjoy your new, roomy VM. Open your file manager in your guest OS and check your disk space. You should see more gigabytes ready to use!
What If You’re Using a VHD or VMDK File?
No worry! VirtualBox can also work with VHD and VMDK file types. The command is the same, just replace the path and filename accordingly.
VBoxManage modifymedium disk "Path/To/YourDisk.vmdk" --resize 51200
Just make sure it’s not a “fixed size” disk. Fixed disks can’t be resized easily. You may need to clone it into a dynamic disk first.
Tips for the Future
Don’t want to go through this every few months? Here are a few tricks:
- Start with bigger disk sizes – 50GB or more is safer
- Use dynamic allocation – It grows as you use it
- Regularly delete junk – Clean out unnecessary files
Bonus: Add a New Virtual Disk Instead
If resizing feels scary, you can add a second virtual hard drive. Think of it as adding a second storage unit.
Here’s how:
- Open VirtualBox
- Select your VM ➜ Click Settings ➜ Storage
- Click the plus sign under “Storage Devices”
- Create a new virtual disk (choose a size and format)
- Boot your VM and format the new disk in the guest OS
Now you’ve got two drives — primary and bonus storage!
Still Having Trouble?
It happens to the best of us. If the above doesn’t work:
- Make sure the disk isn’t in use when you resize
- Check that the disk is not marked as read-only
- If using snapshots, delete or merge them first
Or try cloning the disk:
VBoxManage clonehd original.vdi cloned.vdi --resize 51200
Then use the cloned version in your VM settings.
Conclusion
That’s it — you’ve just upgraded your virtual machine’s closet space! By following these steps, you’ve saved yourself from pesky storage errors and cleared the way for a smoother, faster virtual experience.
VirtualBox might be virtual, but your storage struggles are real. Now you’re armed to handle them like a pro!
Final Check:
- VM powered off?
- Resized the virtual disk?
- Adjusted partitions inside the VM?
- Smiling at your new storage space?
Mission accomplished! 🎉