Guest system does not see the updated disk size in VirtualBox
Solution 1
I finally found the solution here:
View all of the drives associated with VirtualBox
$ "C:\Program Files\Oracle\VirtualBox\VBoxManage" list hdds
For each associated drive use modifyhd
:
$ "C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd "D:\Pat\to\VM\Snapshots\{b0e3f93f-49fe-49bc-9ae2-79e80da6cf01}.vdi" --resize 20480
Now GParted sees the added space.
NOTE: The curly braced snapshot entries require the last forward slash to be changed to a backslash. Meaning:
...\Snapshots\{...}.vdi
instead of
...\Snapshots/{...}.vdi
Solution 2
1) Open GParted tool
2) In the graphical interface you'll see existing partitions and an unallocated partition
3)Click the partition you would like to extend
4) In the top action bar you'll see an arrow directed right. Click it and you'll get option to extend the partition with the unallocated space
Solution 3
Try installing scsitools and re-scanning the devices
sudo apt-get install scsitools
sudo rescan-scsi-bus.sh
Then check the available space
sudo fdisk -l
Or use gparted if that's what you prefer. If you see the extra space extend the partition
And lastly extend the filesystem on the guest vm
resize2fs /dev/sda1
Solution 4
I had the same problem with a Ubuntu virtual machine. First, I powered off the machine. Then, I removed saved states, which are probably the reason why the virtual machine couldn't see the resized disk. Just to be sure, I updated the virtual space once more and started the virtual machine. Now, I can finally see the unallocated space.
Solution 5
Nearly had the same problem and were overall frustated. In my case it was nearly like @Ladislav Ondris.
I saved my Snapshots, but missed to log out and shut down the VM in the last Snapshot. So gparted ditn't showed anything free to resize.
After shutdown, and making new Snapshot. I could open gparted and he showed in the right corner the bigger disk space and i resized the old one.
... Happy over all.
Related videos on Youtube
automatix
Updated on September 18, 2022Comments
-
automatix over 1 year
In the last time on every start of my Ubuntu 14.04 VM I'm getting the message
Low Disk Space
This computer has only 314.8 MB disk space remaining. You may free up some space by emptying the trash.
Now I've increased the disk space from
10
to20 GB
as described on the VirtualBox forum (first step).M:\>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "M:\VM\Ubuntu VM\Ubuntu VM.vdi" --resize 20480 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
I see, that the disk space has been resized successfully:
But when I start the machine and open GParted, only
10 GB
are available.So somehow the Ubuntu guest system haven't got the updated information about the disk space.
How to solve it and complete the disk space increase?
-
automatix almost 8 yearsThank you for your answer! I've tried it, but it didn't help.
-
nick fox over 6 yearsI had to do this with both the main VDI and the Snapshot in Snapshots/ for this to work. I did just the snapshot first and fdisk showed the larger partition but pvcreate threw an error "Fatal error while trying to detect swap signature on /dev/sda3" I also only had one snapshot so you may need to either do it with the latest snapshot or all of them? ive not tested this but its working now
-
Timothy Swan over 6 yearsThere is nothing in my
Snapshots
folder. -
lsborg almost 6 years@Timoth use the virtual midia manager to locate the snapshots.
-
PerrierCitror over 5 yearsSpot on! My problem was that I didn't run the script for the Snapshots too.
-
Beezer almost 5 yearsThis does not do the trick with version 6.06 of VirtualBox unfortunately. Ubuntu does not see the increases.
-
rsmets over 3 yearsLikewise, I had to modifyhd in the /Snapshots dir as well and worked. Thanks guys!
-
David about 2 yearsHello. Answer is not clear.