When you create a virtual hard disk in VirtualBox or VMware, you specify the maximum disk size. If you want more space on your virtual machine’s hard disk later, you will need to enlarge the virtual hard disk and partition.
Note that you may want to back up your virtual hard disk file before performing these actions – there’s always a chance that something could go wrong, so it’s always good to have a backup. However, the process worked fine for us.
Update: Use Virtual Media Manager in VirtualBox
VirtualBox 6 added a graphical option to enlarge and resize virtual disks. To access it, click File > Virtual Media Manager in the main VirtualBox window.
Select the virtual hard disk in the list and use the “Size” slider at the bottom of the window to resize it. When you are done click “Apply”.
You still have to make the partition on the disk bigger to take advantage of the extra space. The partition remains the same size even as the size of the disk increases. See the instructions below for more information on enlarging a partition.
Enlarge Virtual Disk With Command Line in Virtualbox
To enlarge a virtual disk in VirtualBox, you must use the VBoxManage command from the Command Prompt window. First, shut down the virtual machine – make sure its status is set to Powered Off, not Saved.
Comment: Before continuing, you should remove any Snapshots You are associated with a virtual machine if you use the Snapshot feature in VirtualBox. This will ensure that you are modifying the correct virtual disk file and everything will work properly afterwards.
Second, open a Command Prompt window from your Start menu and change the directory to VirtualBox’s Program Files folder. run command:
cd "C:\Program Files\Oracle\VirtualBox"
The following command will work on a VirtualBox virtual disk located at “C:\Users\Equinox\VirtualBox VMs\Windows 10\Windows 10.vdi”. This will resize the virtual disk to 81920 MB (80 GB).
VBoxManage modifyhd "C:\Users\Chris\VirtualBox VMs\Windows 10\Windows 7.vdi" --resize 81920
Comment: use the first two dashes Shape in the above order.
In the command above replace the file path with the location of the VirtualBox disk you want to resize and the size with which you want to enlarge the image (in MB).
Comment: In VirtualBox 6.0+ released in 2019, you may need to use the following command instead:
VBoxManage modifymedium disk "C:\Users\Equinox\VirtualBox VMs\Windows 10\Windows 10.vdi" --resize 81920
Note that this procedure does not enlarge the partition on the virtual hard disk, so you will not have access to the new space yet – see the Enlarge Virtual Machine Partition section below for more information.
Enlarge Virtual Disk in VMware
To enlarge a virtual machine’s hard disk in VMware, shut down the virtual machine, right-click on it, and select Virtual Machine Settings.
Select the virtual hard disk device in the list, click the Utilities button, and click Expand to expand the hard disk.
Enter a larger maximum disk size and click the Expand button. VMware will increase the size of your virtual disk, although its partitions will remain the same size – see below for information on enlarging a partition.
Enlarge virtual machine partition
You now have a large virtual hard disk. However, the operating system partition on your virtual hard disk is the same size, so you won’t be able to access any of this space yet.
You will now need to extend the guest operating system’s partition as if you were enlarging a partition on the actual hard disk in a physical computer. You cannot enlarge the partition while the guest operating system is running, just as you cannot enlarge your C:\ partition while running Windows on your computer.
You can use a GParted Live CD to resize your virtual machine’s partitions – just boot the GParted ISO image into your virtual machine and you’ll be taken to the GParted Partition Editor in a live Linux environment. GParted will be able to enlarge the partition on the virtual hard disk.
Load the ISO file into your virtual machine by going to the virtual machine’s Settings window, selecting your virtual CD drive, and browsing to the ISO file on your computer.
Boot (or restart) your virtual machine after inserting the ISO image and the virtual machine will boot from the ISO image. GParted’s Live CD will ask you several questions while you boot—you can press Enter to leave them for the default options.
Once GParted is booted, see how the virtual drive is partitioned.
Warning: Not all operating systems will result in a drive partitioned in this way, although there’s a good chance you’ll see something similar. Make sure you pay attention to existing partitions when you are doing this – carelessly resizing, reformatting or deleting partitions can lead to an inactive virtual machine.
The arrangement of division is extremely important. There are three partitions on the drive, plus 30 gigabytes of unallocated space.
The first partition, sda1, is the boot sector or EFI system partition. The second partition, sda2, is the “primary partition”. This is the space allocated to the Windows operating system – this is the partition we want to extend. This is noted in the picture above with a red arrow and a red box.
tip: Typically, you can identify your primary partition by size—this will be closer to the total size of the original virtual drive you just created.
Be sure to note that there is a third partition, sda3, directly between the partition you want to resize and the free space we created earlier. The status of sda3 means that we cannot expand sda2 into unallocated space. The third partition is literally on the way, and we have to move it first.
Right-click on sda3, then click “Resize/Move”.
Comment: It may not be sda3 for you. Whatever partition you are seeing between the primary partition and the unallocated space.
A new window will appear that lets you move the partition.
Pay attention to what the screen says. There are 30,722 megabytes of space after the msftres partition. If you want sda3 out of the way, we need to move sda3 to the other side of the available space. Click the “Free Space Preceding” box, enter “30722” in the field, then click “Resize/Move.” It should look like this:
Now sda3 is queued to be moved to the end of the unallocated space, and we can set sda2 to resize as well. Right-click on sda2, then click “Resize/Move”.
Enter the number after “Maximum size” in the “New size” field, or drag the right side of the slider all the way to the right.
If you did this correctly, you should now have a value of “Max Size” in the “New Size” box. Click “Resize/Move” to finalize the change.
Click the green check mark button near the top to apply all the changes you made. It may take a few minutes for the changes to be applied, depending on how many move or resize operations you have queued, and how fast your computer is. If you have to wait a while, don’t panic.
After the resizing is complete, restart your virtual machine and delete the GParted ISO file. Windows will check the file system in your virtual machine to make sure it’s working properly—don’t interrupt this check.
The virtual machine partition will now occupy the entire virtual hard disk, so you will have access to additional space.
Note that there are easier ways to get more storage – you can add a second virtual hard disk from your virtual machine’s settings window. You can access the contents of the other hard disk on a separate partition – for example, if you are using a Windows virtual machine, the other virtual hard disk will be accessible on a different drive letter inside your virtual machine .
#Enlarge #Virtual #Machines #Disk #VirtualBox #VMware
Most Reliable Software Company in Kolkata , West Bengal , India