Ubuntu: How do I increase the hard disk size of the virtual machine?

Published: 12 June 2019
on channel: Roel Van de Paar
44
0

Ubuntu: How do I increase the hard disk size of the virtual machine?


Question: [enter image description here]
I have run out of space on my WinXP virtual machine, which I only gave 10 GB
space for when I created it. Is there an easy way to increase it to, say, 20
GB? I can't see any obvious option in VirtualBox settings.
----
The suggestion below gives this error
wim@wim-ubuntu:/media/data/winxp_vm$ VBoxManage modifyhd wim.vdi --resize 20000
VBoxManage: error: Cannot register the hard disk '/media/data/winxp_vm/wim.vdi'
{46284957-2c09-4e70-8a49-bfbe0f7f681d} because a hard disk '/home/wim/
VirtualBox VMs/winxp_vm/wim.vdi' with UUID {46284957-2c09-4e70-8a49-
bfbe0f7f681d} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component
VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType,
AccessMode_ReadWrite, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 210
of file VBoxManageDisk.cpp
----
Removing the .vdi from VirtualBox before calling VBoxManage command, then
adding it back in, was successful. But now I can't boot the virtual machine, I
get this worrying screen:
[enter image description here]
By the way, it says FATAL: Could not read from the boot medium! System halted.
----
The vdi must be reattached to the VM after VBoxManage command. Further, the
partition will need to be resized from WITHIN windows, because you will have
this empty space:
[enter image description here]
I was able to resize the partition easily using a bit of freeware called http:/
/download.cnet.com/EaseUS-Partition-Master-Home-Edition/3000-2248_4-
10863346.html.

Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):

== This solution helped 17 people ==
Wim, I think you'll need to unregister it from Vbox first. File, Media Manager,
Click on you hdd, and unregister it. Then try it again.

== This solution helped 1 person ==
A sure-proof way is to do it the same as moving to a larger hard drive that's
not running in a VM. First use ccleaner or similiar program in XP to clean up
all junk files that it can. Then create a secondary virtual HDD of the size you
want. Boot with the clonezilla ISO in your virtual ODD drive and clone over
along with the 'resize to new partition size' option selected. Then set the new
Virtual HDD as primary, and don't delete the old one until you know it worked.

== This solution helped 1 person ==
I received the same error until I used sudo to run the command, then worked
perfect, still need to have partition grown from within the guest to use
additional space.

== This solution helped 1 person ==
Make sure you are logged in as user with write permissions to the disk image
file. Then run
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
Worked for me at first time of asking

== This solution helped 1 person ==
As a matter of fact, it seems that modifyhd alone doesn't do you any good in
some cases. I actually expanded my WinXP vdi by cloning the image after
expansion.
Here's the complete step-by-step guide that worked for me a couple of weeks
ago: http://libtronics.com/2011/07/resize-...

With thanks & praise to God! With thanks to all the many who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music & music license: https://www.bensound.com/royalty-free... | Images & images license: https://stocksnap.io/license and others | With thanks to user xyzzyman (https://askubuntu.com/users/26046), user wim (https://askubuntu.com/users/21350), user Tom Brossman (https://askubuntu.com/users/12864), user tindase (https://askubuntu.com/users/52207), user tiempjuuh (https://askubuntu.com/users/37625), user stolsvik (https://askubuntu.com/users/23634), user Richard Povinelli (https://askubuntu.com/users/33497), user Philippe Gachoud (https://askubuntu.com/users/108063), user Matt (https://askubuntu.com/users/683695), user lenooh (https://askubuntu.com/users/40495), user Judex (https://askubuntu.com/users/626858), user Jorge Castro (https://askubuntu.com/users/235), user JJinCO (https://askubuntu.com/users/44514), user guntbert (https://askubuntu.com/users/134729), user 0x61696f (https://askubuntu.com/users/49774), and the Stack Exchange Network (http://stackoverflow.com/questions/88.... Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything should be amiss at Roel D.OT VandePaar A.T gmail.com.


Watch video Ubuntu: How do I increase the hard disk size of the virtual machine? online without registration, duration hours minute second in high quality. This video was added by user Roel Van de Paar 12 June 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 44 once and liked it 0 people.