2

I am trying to resize (from 20 to 270 GB) the hard disk of a Ubuntu OS running inside a VM (Virtualbox) that runs on Windows 10.

By following the instructions in this thread , I have with powered off my VM and run on my Windows 10 Powershell:

C:\Users\Bob> C:\"Program Files"\Oracle\VirtualBox\VBoxManage.exe modifyhd C:\Users\Bob\"VirtualBox VMs"\Tommaso_Ubuntu01\Tommaso_Ubuntu01.vdi --resize 270000

and I sussessfully get

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

so that when I check the settings of my VM on my Virtualbox panel I see:

Virtualbox screenshot

then I go on following the steps in the thread: I start my VM, go to

Applications (square of 9 points in the bottom bar) > Disks > Hard Disk (left side bar)

then

select Partition 3 (the partition that I previously sized to 21) > gears button > resize > set partition to 270 GB

but I get:

Error resizing partition

error resizing partition /dev/sda3: Failed to partition size on device '/-dev/sda/' (Unable to satisfy all constraints on the partition.) (udisk-error-quark,0)

What's the problem? How can I solve it?

error screenshot

Tms91
  • 595

2 Answers2

7

SOLVED

By following this thread, I installed GParted,

sudo apt-get install gparted

a pop-up opened up asking if I wanted to fix the unallocated free space (that I gof from the operation on powershell) > answered don't fix

selected the partition3 (that I previously allocated to 20GB)

resize the selected partition:

  • set new size to 260 GB, set Align to None.

  • clicked apply all operations

the same pop-up of before popped up, and this time I answered with fix.

The operation finished and I verified this time the VM got the change:

by tiping

df -h

the resized partition is returned among the others.

Tms91
  • 595
-1

In the host System you need to give full permission to the VM files. In windows you can do this by right clicking on the VM files -> Click on Properties option (last option in menu) -> Click on Security -> Edit -> Select Users -> Check-mark on Full Control -> Press OK and close the box.

Now try again the resizing the Partition in the Guest OS.

For example for Ubuntu VM -> Ubuntu.vmi, Ubuntu.vbox You can find the above files by right clicking on Guest OS in virtual box then click on the Show in Explorer option as following picture. enter image description here

Parth Patel
  • 19
  • 1
  • 4