1 Preface
Online articles about increasing the size of disk space for VirtualBox virtual machines are very, very many, and the reason why I am writing this is because when I refer to these articles, because of the VirtualBox version update and some other environmental issues, there are some problems encountered. After spending some time solving these problems, write them up for your reference.
2 problems you may encounter with references to previous articles
Commands to use
Vboxmanage MODIFYHD "C:\users\<username>\virtualbox vms\<vm_name>\<disk_name>.vdi" –resize < Size in mb>
2.1 Space Issues-if there are spaces in the virtual machine disk file path, using "" does not work.
2.2 VirtualBox Command Update issue-previous use of MODIFYHD, new command is Modifymedium
2.3 Problem with disk File path resolution
My VirtualBox installation path is C:\Program Files\oracle\virtualbox, in the Execute command vboxmanage MODIFYHD "c:\users\<username>\ VirtualBox Vms\<vm_name>\<disk_name>.vdi "–resize <size in Mb>, the path to the disk file is parsed into C:\Program files\oracle \virtualbox\ "C:\users\<username>\virtualbox Vms\<vm_name>\<disk_name>.vdi" and then prompt for this file format is incorrect
3 environment
Host: Win7
virtualbox:5.0.16
Virtual machine: Win10
VirtualBox Installation path C:\Program Files\oracle\virtualbox
Virtual machine Disk File path C:\users\<username>\virtualbox VMS\<VM_NAME>\<DISK_NAME>.VDI
Current virtual machine disk File size 32G, ready to be modified to 90G
4 Workarounds and procedures
4.1 Renaming a folder VirtualBox VMs for Virtualboxvms, back again-here is the main solution to the space problem
4.2 Under directory C:\Program files\oracle\virtualbox find VBoxManage.exe, VBoxDDU.dll, VBoxRT.dll, copy these three components to C:\users\<username >\virtualbox vms\<vm_name> here directory, with the disk file to be modified in the same directory-the purpose here is to resolve the disk file path parsing problem
4.3 Run cmd, open the Command Prompt window
4.4 Run
CD \
CD C:\users\<username>\virtualbox vms\<vm_name>
Enter the directory where the disk files are stored
4.5 Performing vboxmanage Modifymedium <disk_name>.vdi–-resize 90000
Note: We have previously copied the VBoxManage.exe to the directory where the disk files are stored, so the vboxmanage command can be executed directly
4.6 Booting the WIN10 virtual machine in VirtualBox
4.7 Access to WIN10 Disk Management
4.8 In WIN10 Disk Management, select the original disk, right-click, in the right-click menu, select Extend Volume, follow the wizard to increase the newly allocated space to the original disk
4.9 The disk size in the WIN10 virtual machine has been increased
Increase the disk space size of the VirtualBox virtual machine (host:win7 VirtualBox5.0.16 vm:win10)