After I did steps shown here I've noticed in VM's settings that I only increased virtual size but actual size remain the same. How to increase it also?
Ubuntu – How to increase actual size of hard disk in VirtualBox
hard driveUbuntuvirtualbox
Related Solutions
I still do not know why GParted could not see the whole device. As snapshoe suggested it might because the VM had snapshots.
Trying to remove snapshots after running modifyhd
did not succeed.
Here is how it was solved:
I had to create a new virtual disk from within VirtualBox, then clone the old one to the new one:
VBoxManage clonehd Mint.vdi NewMind.vdi --existing
Then I had to disconnect the old disk from the VM, and run GParted to expend the existing guest partition to the whole of the device.
Increasing the memory of the VM is trivial: go to System -> Motherboard. You see Base Memory, you can set it to whatever you wish either by entering the explicit number, or by working on the graphical cursor. Now start your VM and you are done.
Increasing the disk size is just a bit trickier: issue the command
VBoxManage modifyhd /path/toYourVM/disk.vdi --resize 50000
You must know where your VM's disk is (generally /home/yourName/VirtualBox\ VMs/YourVMName/YourVMName.vdi); the above command sets the new disk size to 50GB (default units, in the command, are MB).
Now comes the tricky part: the newly increased disk must have its partitions resized, so as to take advantage of the new size. Otherwise, the newly allocated space will simply appear as empty, i.e., not belonging to any partition.
But, as you know, an intervention of this kind cannot be done from the same machine which is using the disk. This is true for real pcs, but also for VMs. So now you take an iso image of a Linux distribution (Ubuntu?), put it into the virtual CD/DVD drive, and boot the VM from this, not from the HDD. This way the newly enlarged HDD is available for the operation to follow. You start GParted (by typing
sudo gparted
in a terminal, if it is not already installed you will have to install, for instance by means of
sudo apt-get install gparted
in Debian-like systems), and resize the partitions by taking advantage of the newly added space, as it best suits you.
When you are done resizing the partitions, bring the VM don, extract the Linux iso from the CD/DVD virtual driver, start from HDD, and you are done.
EDIT:
You are perfectly right, the error message means you have a fixed disk, rather than a dynamic one. For a fixed disk, the resize operation is not supported, but...
we can first convert the fixed disk to a dynamic one,
VBoxManage clonehd OldDisk.vdi NewDisk.vdi --variant Standard
where --variant Standard is the keyword that transforms a fixed to a dynamic disk.Notice also that cloning means that your original disk will remain intact, and thus you will not lose data, a certainty that we do not enjoy with physical (as opposed to virtual) disks.
Now you can apply the operations previously discussed to the NewDisk.vdi, making sure that you are not loading the the OldDisk.vdi at all. This is like unplugging the old sik, leaving it in the drawer, while all operations are applied to the new one.
When you are done with the resizing, and you have persuadedyourself that everyything is in order, you may (if you wish) transform back new, expanded NewDisk into a fixed disk:
VBoxManage clonehd NewDisk.vdi NewDiskFixed.vdi --variant Fixed
This is not necessary, just do it if you think the larger speeds are what you are after.
Best Answer
When you increase the virtual disk size, you typically have to increase some partition size within the OS's actual file system in order to make use of the added space. However, because you've set it to "dynamically allocated", it will grow as used. See http://www.virtualbox.org/manual/ch05.html which says:
"For more flexible storage management, use a dynamically allocated image. This will initially be very small and not occupy any space for unused virtual disk sectors, but will grow every time a disk sector is written to for the first time, until the drive reaches the maximum capacity chosen when the drive was created. While this format takes less space initially, the fact that VirtualBox needs to expand the image file consumes additional computing resources, so until the disk file size has stabilized, write operations may be slower than with fixed size disks. However, after a time the rate of growth will slow and the average penalty for write operations will be negligible."