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
You can, in fact, hot-add storage to a running VirtualBox VM, using VBoxManage storageattach:
(Please note that on Windows you may have to remove the backslashes and line breaks.)
If you have a SATA controller, the device number is always 0 and the entire parameter is optional.
If the VM name has spaces, enclose them in quotes. Same goes for the storage controller name and image path.
There are important preconditions, (check with
VBoxManage showvminfo
):IIRC the GUI does not offer support for any of this.