Increase disk size on the server for VirtualBox

  • Run command line with administrator rights (cmd), go to the folder C:\Program Files\Oracle\VirtualBox
cd C:\Program files\Oracle\VirtualBox
../_images/faq_extend_harddisk_1.png
  • Run command:
VBoxManage modifyhd «C:\Users\NameUser\VirtualBox VMs\Staffcop\Staffcop.vdi» --resize X

Where X - the number of MB to which you want to increase the disk space

Note

The path to the drive can be seen in VirtualBox in the machine Setup -> Media by selecting the full drive path .vdi. Disk size is set in MB

../_images/faq_extend_harddisk_2.png
  • Download Gparted, see the footnote on Gparted at the end of the article.
  • Shut down the virtual machine with the server and disconnect the disk in Settings -> Media
  • Create a new virtual machine
  • In the new virtual machine, go to Settings -> Media -> Controller: IDE, then click Add optical disc drive, then connect the downloaded Gparted image and, clicking on it, select Primary IDE wizard
  • Connect a virtual disk from the server’s virtual machine directory in Settings -> Storage -> Controller: SATA
../_images/faq_extend_harddisk_3.png
  • Start a new virtual machine and log in to the operating environment with Gparted
  • Select the server virtual machine disk in Gparted, (for example: /dev/sdb1)
../_images/faq_extend_harddisk_4.png
  • Delete linux-swap and expected partitions
  • Increase ext4 to maximum and click Apply.
../_images/faq_extend_harddisk_5.png
  • Resize ext4, taking about 2000 MB of space from it
../_images/faq_extend_harddisk_6.png
  • Create from free 2000 MB partition through the context menu Extended/Advanced
../_images/faq_extend_harddisk_7.png
  • And create a partition with the file system/: linux-swap
../_images/faq_extend_harddisk_8.png
  • Click Apply and exit the virtual machine with Gparted
  • Disconnect the server disk from the virtual machine and connect to the server virtual machine
  • Start the staffcop virtual machine and make sure that the disk size is increased by the command: df –h
  • Check the integrity of all data and network settings.

Note

For Hyper-V and VMware virtual machines, the disk size is increased by configuring programs settings, and the logical partition size is increased similar to that in Gparted

Note

All rights to the Gparted product belong to the gparted community, the link to the ISO image is local, because the sourceforge resource is very often unavailable.