Home  >  Article  >  Computer Tutorials  >  How to increase disk size in VirtualBox [Guide]

How to increase disk size in VirtualBox [Guide]

WBOY
WBOYforward
2024-03-17 10:10:181227browse

We often encounter situations where the predefined disk size has no space to accommodate more data? If you need more virtual machine hard disk space at a later stage, you must expand the virtual hard disk and partitions. In this post, we will see how to increase disk size in VirtualBox.

Increase disk size in VirtualBox

It is important to note that you may want to back up your virtual hard disk files before performing these operations, as there is always the possibility of something going wrong. It is always a good practice to have backups. However, the process usually works fine, just make sure to shut down your machine before continuing.

There are two ways to increase the disk size in VirtualBox.

  • Expand the disk size of VirtualBox using the graphical user interface
  • Expand the disk size of VirtualBox using the CLI
  • Let’s talk about it in detail.

    1]Expand the disk size of VirtualBox using the GUI

    How to increase disk size in VirtualBox [Guide]

    Oracle provides a tool called Virtual Media Manager in VirtualBox that allows us to edit your computer. Follow the steps mentioned below to expand the disk size.

  • To open it, you can use the keyboard shortcut Ctrl D or go to File Tools Virtual Media Manager (in some cases, 'Tools' is not available, so, just go to File Virtual Media Manager). >>>
  • Now, select the machine where you want to turn off the disk, right-click on it and select Properties.
  • It will give you various options, just go to Size and use the slider to edit the actual size of your device.
  • Now, click Apply to confirm your action and you will be good to go.
  • Even if the disk size increases, the partition size will not change automatically. You need to extend the partition on the disk to use the extra space. To do this, you need to log into the virtual machine and use the disk management tool to extend the partition.

    Read: How to install macOS in VirtualBox on Windows?

    2]Extend VirtualBox disk size using CLI

    First, proceed to shut down the virtual machine. At the same time, make sure to turn off the device and set it to PowerOff, not Saved. Now, in order to change the disk size, we need to use the VBoxManage command.

    Before modifying the virtual disk file, if you use the snapshot feature in VirtualBox, be sure to delete all associated snapshots. This ensures that you are modifying the correct virtual disk file and everything will run normally afterwards.

    Open Run, type "delete" and press Enter. This will open the command prompt for you, next, you need to switch to VirtualBox’s program files directory using the command mentioned below.

    cd "C:Program FilesOracleVirtualBox"

    Now, we need to find out your folder, to do this, open File Explorer and go to the following path.

    C: USERS username VirtualBox VM

    Note: Please make sure to replace username with the username of the virtual machine host.

    After navigating to this location, open the VM's folder and look for files with the .jobs extension. Now, note the name and location of the file. Finally, run the following command to increase the disk size to 50 GB or 51200 MB.

    VBoxManage modifyhd "C:UsersyusufVirtualBox VMFedora. vdi"——resize 51200

    If this command does not work, please run the following command because VirtualBox 6.0 launched in 2019 does not support the above command.

    VBoxManage modifymedia disk "C:UsersyusufVirtualBox VMFedora.vdi"——resize 51200

    This will do the job for you. However, if you get an error saying VBOX_E_NOT_REMORTED, check to make sure you didn't shrink the drive because the --resize command takes the final size as input. So if your disk is currently 16GB in size and you are trying to resize it to 8GB, it won't work.

    You will also need to extend the partition to use this extra space. There are many ways to do the same thing, try using Paragon Partition Manager, it's a free tool.

    that's all!

    Read: How to install VirtualBox Guest Additions on Windows?

    How to increase disk size in VirtualBox?

    There are two ways to increase the disk size, you can use Virtual Media Manager or Command Prompt to perform the same operation. We have mentioned these two steps earlier in this article and you can easily increase the disk size and partitions by just checking it carefully.

    Read: How to speed up a virtual machine and make it run faster

    What is the maximum disk size in Virtual Box?

    Graphical User Interface (GUI) allows you to create hard drives up to 2TB. For larger disks, you can use the VBoxManage command line tool. Just open a command prompt, go to the VirtualBox location, and use the VBoxManage command as shown earlier.

    Also Read: Fix VirtualBox not showing 64-bit Operating System.

    The above is the detailed content of How to increase disk size in VirtualBox [Guide]. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete