

For our virtual machine to reap the benefits of the larger disk size, we want to increase the partition with the root file system ( sda1) from 18 GB to 23 GB. Furthermore, the virtual machine has an extended partition sda2 that holds the swap partition sda5. The previous terminal screenshot tells us that the virtual machine has a primary partition sda1 that holds the root file system. Increase the size of your root file system partition
#Virtualmachine add more space how to#
The next section describes how to achieve this. So the virtual hard disk of our virtual machine was increased, but we still need to increase the partitions. Run the following command to list the partitions:Īfter adding up the size of the individual partitions, we get to about 20 GB and not the desired 25 GB. This proves that we successfully increased the disk size of our VirtualBox virtual machine. List the information about the attached disks with command:Īs expected, the command output reports 25 GB for the disk size. Once ready, open the terminal if it has a desktop environment or log in via SSH if it is a server. Let’s verify that the disk size of your VirtualBox virtual machine actually got increased. Keep in mind though that you can only increase the disk size and not decrease it. Once you selected the new disk size, confirm it by clicking the Apply button. In this example, I want to increase the disk size from 20 GB to 25 GB. Once selected, you simply move the slider at the bottom of the screen to increase the disk size. In my case it is Debian Server.vdi which currently has a size of 20 GB. On the VirtualBox media view, select the VDI disk that you want to increase in size. The media view lists all the hard disks attached to your virtual machines.

Select Media from the pop-up menu to open the media view. Next, click on the icon located at the right side of the Tools entry. In my case it is Debian Server.vdi and its current size equals 20 GB:įor increasing the size of your VDI disk, go to the VirtualBox main screen. You can then see the name of the VDI file in the “Storage” section.

To locate the name of your virtual machine’s VDI file, select your virtual machine on VirtualBox’s main screen. Think of this VDI file as the hard disk of your virtual machine. Upon creation of a virtual machine, VirtualBox creates a VDI file. Increase the size of your VDI virtual disk in VirtualBox You just have to swap the Debian Server and Debian Server Backup command parameters around. For restoring the backup, you can use a similar cp command as above. If something goes wrong while performing the steps outlined in this article, you can simply delete the Debian Server directory and restore the backup.

These directory names contains spaces and therefore I surrounded them with double quotes. The following two commands backup this virtual machine to a directory called Debian Server Backup:Ĭp -avr "Debian Server" "Debian Server Backup" home/pragmalin/VirtualBox VMs/Debian Server/ My Debian server virtual machine resides at this location in my user’s home directory: Therefore simply copying these files already creates a backup of the entire virtual machine. A virtual machine consists of plain files on you PC. For this reason we’d better make a backup copy of the virtual machine. Increasing the disk size of your VirtualBox virtual machine, including the partition resizing, is an invasive operation. This article takes the same Debian server virtual machine as a starting point. If you don’t yet have a virtual machine, you can follow this tutorial to create a minimal Debian server virtual machine in VirtualBox. Fear not, because this article provides you with step-by-step instructions on how to increase the disk size of your VirtualBox virtual machine. So to complete the disk size increase of your VirtualBox virtual machine, you still need to change the size of the disk partition(s). Your disk partitions still have the same size as before. However, that’s not the end of the story. Luckily, VirtualBox allows you to easily increase the size of your virtual disk. But how do you achieve this task for your VirtualBox virtual machine? But what do you do when your virtual machine runs out of disk space? On real hardware you would swap the hard disk for a larger version. Virtual machines provide a great playground for learning about and testing out all sorts of Linux related things. It provides you with step-by-step instructions on how to increase the disk size of your VirtualBox virtual machine. This article will help you along the way. Just keep in mind that afterwards you still need to increase the size of your partitions accordingly. Is your VirtualBox virtual machine starting to run out of disk space? No worries, because VirtualBox allows you to easily increase the disk size of your virtual machine.
