Next, click on the icon located at the right side of the Tools entry. Select Media from the pop-up menu to open the media view. The media view lists all the hard disks attached to your virtual machines. Once selected, you simply move the slider at the bottom of the screen to increase the disk size. Once you selected the new disk size, confirm it by clicking the Apply button. Keep in mind though that you can only increase the disk size and not decrease it.
Go ahead and start your virtual machine. Once ready, open the terminal if it has a desktop environment or log in via SSH if it is a server. List the information about the attached disks with command:. As expected, the command output reports 25 GB for the disk size. This proves that we successfully increased the disk size of our VirtualBox virtual machine.
All done, right? Run the following command to list the partitions:. After adding up the size of the individual partitions, we get to about 20 GB and not the desired 25 GB. So the virtual hard disk of our virtual machine was increased, but we still need to increase the partitions. The next section describes how to achieve this. The previous terminal screenshot tells us that the virtual machine has a primary partition sda1 that holds the root file system.
Furthermore, the virtual machine has an extended partition sda2 that holds the swap partition sda5. 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.
Unfortunately, you cannot change the partitions while the system is live. With the GParted program you can change your disk partitioning and format disks. Note that making a mistake in GParted tends to be permanent. To the point where you might loose data on your virtual machine. If you decided to skip the step where you back up your virtual machine, now would be a good time to reconsider this decision.
Visit the download section of the GParted website. Once there, download the latest bit stable release. At the time of this writing the latest stable release is 1. Make sure your virtual machine is powered off at this point. On the VirtualBox main screen, select your virtual machine and click the Settings button on the toolbar.
Once selected, click the blue disk icon button on the right side of the dialog. From the menu that dropped down, select the Choose a disk file… option. Complete the configuration by clicking the OK button on the Settings dialog. So go ahead and startup your virtual machine. A few prompts appear during the boot process. Just hit Enter every time to accept the defaults. In GParted you can see a 5 GB chunk that is unallocated.
Next, to expand the hard drive, click on the "Expand" button. Now, enter the required disk size for you and click the "Expand" button. Like the previous methods, VMware will increase the size of your virtual disk, although its partitions will remain the same size.
Now is the time to expand the virtual hard disk partition to access the increased disk space. Go to the virtual machine settings window and select the virtual CD drive and download the ISO file to your virtual machine. Restart your virtual machine after inserting the ISO image; Live CD GParted will ask you a few questions during boot - it is better to press Enter so that the selected options are the default.
Next, right-click on the section you want to enlarge and select "Resize". When you create a VM in VirtualBox, you are required to allocate disk size for the VM, as shown in the following picture:. However, with time passing, the virtual machine file become bigger and bigger, and you need to enlarge VirtualBox disk size.
As for how to make VirtualBox increase disk size under Windows host computer, please read the following content. You can enlarge the hard disk of virtual machine if you set the disk to be so small at the beginning of creating virtual machine, and here are detailed steps.
To make VirtualBox increase disk size, you just need to do two steps. Please refer to the following content:. Here are the commands:. Please note that you should replace the VDI path and the size according to your condition.
0コメント