How do I increase the hard disk size of the virtual machine?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
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:
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:
I was able to resize the partition easily using a bit of freeware called EASEUS Partition Master 9.1.0 Home Edition.
virtualbox hard-drive windows-xp
add a comment |
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:
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:
I was able to resize the partition easily using a bit of freeware called EASEUS Partition Master 9.1.0 Home Edition.
virtualbox hard-drive windows-xp
3
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
1
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25
add a comment |
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:
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:
I was able to resize the partition easily using a bit of freeware called EASEUS Partition Master 9.1.0 Home Edition.
virtualbox hard-drive windows-xp
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:
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:
I was able to resize the partition easily using a bit of freeware called EASEUS Partition Master 9.1.0 Home Edition.
virtualbox hard-drive windows-xp
virtualbox hard-drive windows-xp
edited Apr 23 '12 at 22:32
Jorge Castro
37.4k107423618
37.4k107423618
asked Dec 18 '11 at 11:51
wimwim
5,463246695
5,463246695
3
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
1
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25
add a comment |
3
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
1
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25
3
3
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
1
1
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25
add a comment |
14 Answers
14
active
oldest
votes
Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
replacing YOUR_HARD_DISK
and SIZE_IN_MB
with your image name and desired size. sudo
might be necessary in some machines or you might encounter an error. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.
After resizing, the extra virtual hard drive space needs to be partitioned and formatted for the guest to use it. This can be done with gparted by booting the guest from a live ISO. We can also resize the existing partition using gparted. For this we may need to disable /swap
and create a new swap partition.
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.
– Jonik
Dec 22 '11 at 10:05
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
I think in recent versions of VirtualBox it is.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now.modifyhd
is also works though — there is a backward compatibility with older commands.
– TranslucentCloud
Sep 6 '17 at 19:04
|
show 12 more comments
The following worked for me:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
However, I understand how mileage can vary :-) As far as resizing the partition, in Windows 7, I was able to resize at the screen you showed by right clicking on the
C: drive in the bottom panel and selecting extend volume.
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to usesudo
for virtualbox which is a bad idea.
– Lekensteyn
Apr 15 '12 at 12:01
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
add a comment |
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.
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
add a comment |
After resizing and not being able to view the resizing on my windows XP guest machine, I had to
- clone it
- resize it with
"VBoxManage modifyhd winxppro Clone.vdi --resize 30720"
and everything worked
I saw in other forums that snapshots can interfere for resizing and not being able to remove all snapshots for different errors I got, the only found solution for me was to clone it to remove the snapshots and then resize it, and everything worked. For resizing outside windows, a gparted boot cd that can be found here can help
add a comment |
You can also do it using the VirtualBox menu:
Select File
-> Virtual Media Manager ...
A window will open:
Select your disk, and select Properties
. Now just move the slider at the bottom.
After you start the virtual machine, windows will not recognize the new space.
In windows, open Computer Management
(search for it in the start menu), select Storage
-> Disk Management
in the left menu. Select your partition (probably C:), right click on it and select Extend Volume ...
. Now just click through the wizard and you're done.
Do you need to doRelease
before that? As currently the slider is grayed. Or did you chose dynamic partition?
– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
add a comment |
I had the same problem where I had moved a disk, and replaced the original with a symlink. This works OK afterwards, but you run into problems with the 'modifyhd' command, as that apparently canonicalizes the path to the vdi-file when working with it. This makes it looks like you're trying to add a new disk with the same UUID but on a different path - or something like that.
There was two problems:
The disk had to be removed from the VM that used it, but then also "from the VirtualBox list of hdds". This was fixed with 'closemedium' command, which removes it from that list.
The disk to be resized was a "fixed disk" instead of "dynamic", and only dynamic disks can be resized. That was fixed with a 'clone' command (the clone is dynamic), and then resize the resulting disk.
This is my log for how it was done. Do notice that I am not at any point running as root, except when I afterwards do the resize of the partition and filesystem.
REMOVE THE ASSOCIATION TO THE DISK FROM VM.
PROBLEM STILL PERSISTS:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
VBoxManage: error: Cannot register the hard disk '/datadisk/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' {6cd99209-e4db-4178-a6c2-53f9581b1fad} because a hard disk '/home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' with UUID {6cd99209-e4db-4178-a6c2-53f9581b1fad} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
Ah, the disk is still "in the system":
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
UUID: 6cd99209-e4db-4178-a6c2-53f9581b1fad
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi
State: created
Type: normal
Remove/delete the disk from the VirtualBox disk list ("closemedium"):
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage closemedium disk 6cd99209-e4db-4178-a6c2-53f9581b1fad
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
Try the resize again:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
DAMN, "fixed-size" DOESN'T WORK! 'clonehd' to the rescue, as that leaves a 'dynamically allocated' cloned disk:
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage clonehd TestInception 64 bit.vdi TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 8e237500-173b-401a-9e63-9e64da110da9
NOW DO THE RESIZE (instantanious):
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd --resize 8192 TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
THEN ATTACH TO SOME VM, FOR RESIZING. This is done as root. Assumes that you only have one partition and possibly swap.
# fdisk /dev/sdb # <- The extra disk, just attached to be resized
// The procedure looks like this:
// m - print help
// p - print table
// d ... - delete partition (delete both if you have root and swap)
// n - new partition (create root/first partition starting on exact same sector as before, typically 2048, but ends on last, or last minus swap)
// ... n.. (.. then add the swap partition. Calculate how many sectors using original table)
// t - change type of partition (swap partition, if any, to 82 - not 83 which is "normal Linux").
// w - write partition table (write out, with the resized partition)
# e2fsck -f /dev/sdb1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 99918/122160 files (0.3% non-contiguous), 471032/487936 blocks
# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sdb1 to 1965824 (4k) blocks.
The filesystem on /dev/sdb1 is now 1965824 blocks long.
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
add a comment |
This worked for me with Virtualbox 5.2.6 installed on Ubuntu 16.04 Host Machine and Windows 10 Guest:
open Virtualbox Manager, click on Global Tools (upper right corner) and choose Virtual Media Manager.
Click on the Hard Disk Tab and select your Guest OS. At the bottom of the box click on the Attributes Tab. At the bottom you can see the size of the Virtual Disk, and with the slider you can increase the size to your liking. (You can only increase, not decrease the size with this method). Click on Apply.
Start your Windows Guest OS, open Computer Management, right click on the C: Drive, and select Extend Volume to extend the file system with the unallocated part.
That’s all I had to do, works perfectly for me.
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
add a comment |
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.
add a comment |
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.
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
add a comment |
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
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
add a comment |
If your host machine is windows, then you can run the following command to increase or decrease the vdi disk size in virtual box:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:Usersyour_user_nameVirtualBox VMsUbuntu18LTSUbuntu18LTS.vdi" --resize 20000
In the above command replace your_user_name with the real windows user and 20000 is MB size of disk.
add a comment |
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-virtualbox-disk-for-winxp-guest/
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
add a comment |
Here's a way to resize your VirtualBox disk, regardless of whether it is a fixed format or dynamic format disk. Specifically, it prevents this error:
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
⚠️ Backup the virtual disk. You never know what might go wrong.
On your host:
Open a terminal window.
On Windows: Open the command prompt
cmd
.
Go to the directory with the virtual disk you want to resize. For example:
cd "My VMs"
Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either
Standard
(dynamic) orFixed
). For example, to create a 50 GB fixed-format disk calledMyNewDisk.vdi
:
VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed
If
VBoxManage
is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" createmedium
--filename "MyNewDisk.vdi" --size 50000 --variant Fixed
Copy the original disk to the new disk.
VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing
The resize is done! You can check the properties of the new disk if you want:
VBoxManage showmediuminfo "MyNewDisk.vdi"
Change the virtual machine to use the new disk instead.
Next, on your guest OS you need to resize the partitions to use the newly available space.
add a comment |
For those who have Windows on a VHD, like I did, first convert to VDI by cloning with the following Linux command. (Note, Windows VM powered off.)
VBoxManage clonehd Windows10.vhd Windows10.vdi --format vdi
This will duplicate the vhd.
Then the VDI can be resized with the following. Note the VDI won't actually grow until it is used.
VBoxManage modifyhd Windows10.vdi --resize 80000
After fixing up the storage mounting in the VM host software, and powering on the VM, Windows boots, but the partition will still be the same size. Google for a Windows tool that can resize the C drive partition. I used EaseUs Partition Master to grow the C drive partition to my new size.
Finally, the VHD can be deleted.
add a comment |
protected by Community♦ Apr 10 '12 at 10:27
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
14 Answers
14
active
oldest
votes
14 Answers
14
active
oldest
votes
active
oldest
votes
active
oldest
votes
Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
replacing YOUR_HARD_DISK
and SIZE_IN_MB
with your image name and desired size. sudo
might be necessary in some machines or you might encounter an error. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.
After resizing, the extra virtual hard drive space needs to be partitioned and formatted for the guest to use it. This can be done with gparted by booting the guest from a live ISO. We can also resize the existing partition using gparted. For this we may need to disable /swap
and create a new swap partition.
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.
– Jonik
Dec 22 '11 at 10:05
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
I think in recent versions of VirtualBox it is.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now.modifyhd
is also works though — there is a backward compatibility with older commands.
– TranslucentCloud
Sep 6 '17 at 19:04
|
show 12 more comments
Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
replacing YOUR_HARD_DISK
and SIZE_IN_MB
with your image name and desired size. sudo
might be necessary in some machines or you might encounter an error. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.
After resizing, the extra virtual hard drive space needs to be partitioned and formatted for the guest to use it. This can be done with gparted by booting the guest from a live ISO. We can also resize the existing partition using gparted. For this we may need to disable /swap
and create a new swap partition.
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.
– Jonik
Dec 22 '11 at 10:05
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
I think in recent versions of VirtualBox it is.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now.modifyhd
is also works though — there is a backward compatibility with older commands.
– TranslucentCloud
Sep 6 '17 at 19:04
|
show 12 more comments
Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
replacing YOUR_HARD_DISK
and SIZE_IN_MB
with your image name and desired size. sudo
might be necessary in some machines or you might encounter an error. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.
After resizing, the extra virtual hard drive space needs to be partitioned and formatted for the guest to use it. This can be done with gparted by booting the guest from a live ISO. We can also resize the existing partition using gparted. For this we may need to disable /swap
and create a new swap partition.
Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
replacing YOUR_HARD_DISK
and SIZE_IN_MB
with your image name and desired size. sudo
might be necessary in some machines or you might encounter an error. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.
After resizing, the extra virtual hard drive space needs to be partitioned and formatted for the guest to use it. This can be done with gparted by booting the guest from a live ISO. We can also resize the existing partition using gparted. For this we may need to disable /swap
and create a new swap partition.
edited Apr 13 '17 at 12:23
Community♦
1
1
answered Dec 18 '11 at 12:07
Tom BrossmanTom Brossman
8,9931151115
8,9931151115
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.
– Jonik
Dec 22 '11 at 10:05
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
I think in recent versions of VirtualBox it is.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now.modifyhd
is also works though — there is a backward compatibility with older commands.
– TranslucentCloud
Sep 6 '17 at 19:04
|
show 12 more comments
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.
– Jonik
Dec 22 '11 at 10:05
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
I think in recent versions of VirtualBox it is.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now.modifyhd
is also works though — there is a backward compatibility with older commands.
– TranslucentCloud
Sep 6 '17 at 19:04
19
19
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).
$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.– Jonik
Dec 22 '11 at 10:05
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed).
$ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition.– Jonik
Dec 22 '11 at 10:05
3
3
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
+1, This is certainly the cleanest way to do it.
– Starx
May 3 '12 at 15:08
19
19
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
@asd Changing the disk size isn't enough, you also need to resize the partition.
– Bruno
Nov 7 '12 at 18:44
1
1
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
THIS WILL WORK! However, you need to increase the partition after so windows can register the new space. Best and quickest / easiest method: howtogeek.com/howto/windows-vista/…
– Travis van der Font
Dec 9 '16 at 14:46
5
5
I think in recent versions of VirtualBox it is
.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now. modifyhd
is also works though — there is a backward compatibility with older commands.– TranslucentCloud
Sep 6 '17 at 19:04
I think in recent versions of VirtualBox it is
.VBoxManage.exe modifymedium disk 4d30d154-f8c2-4a3b-bd8b-ddcfbfe64aaf --resize 30720
now. modifyhd
is also works though — there is a backward compatibility with older commands.– TranslucentCloud
Sep 6 '17 at 19:04
|
show 12 more comments
The following worked for me:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
However, I understand how mileage can vary :-) As far as resizing the partition, in Windows 7, I was able to resize at the screen you showed by right clicking on the
C: drive in the bottom panel and selecting extend volume.
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to usesudo
for virtualbox which is a bad idea.
– Lekensteyn
Apr 15 '12 at 12:01
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
add a comment |
The following worked for me:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
However, I understand how mileage can vary :-) As far as resizing the partition, in Windows 7, I was able to resize at the screen you showed by right clicking on the
C: drive in the bottom panel and selecting extend volume.
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to usesudo
for virtualbox which is a bad idea.
– Lekensteyn
Apr 15 '12 at 12:01
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
add a comment |
The following worked for me:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
However, I understand how mileage can vary :-) As far as resizing the partition, in Windows 7, I was able to resize at the screen you showed by right clicking on the
C: drive in the bottom panel and selecting extend volume.
The following worked for me:
VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
However, I understand how mileage can vary :-) As far as resizing the partition, in Windows 7, I was able to resize at the screen you showed by right clicking on the
C: drive in the bottom panel and selecting extend volume.
edited Sep 29 '12 at 16:47
answered Apr 15 '12 at 11:53
Richard PovinelliRichard Povinelli
1,085917
1,085917
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to usesudo
for virtualbox which is a bad idea.
– Lekensteyn
Apr 15 '12 at 12:01
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
add a comment |
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to usesudo
for virtualbox which is a bad idea.
– Lekensteyn
Apr 15 '12 at 12:01
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
12
12
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to use sudo
for virtualbox which is a bad idea.– Lekensteyn
Apr 15 '12 at 12:01
sudo
is not necessary. It may corrupt permissions in your home directory, requiring you to use sudo
for virtualbox which is a bad idea.– Lekensteyn
Apr 15 '12 at 12:01
1
1
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: Good to know that it is not necessary. I used it because others had said it didn't work without being root. As far as permission corruptions go, chmod works well to fix such mistakes.
– Richard Povinelli
Apr 15 '12 at 12:05
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
@Lekensteyn: chown will fix ownership mistakes. I mention chmod and chown, because I have had to fix the problem you are referencing many times :-)
– Richard Povinelli
Apr 15 '12 at 12:19
2
2
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
This is great for Windows, but if you have a Linux guest OS this link can help with re-sizing the partitions: forums.virtualbox.org/viewtopic.php?f=35&t=50661
– Jon
Mar 29 '14 at 21:35
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
If you are running windows inside linux you need to follow this options , and extend the disk, otherwise windows wont add the additional space we added
– Ajith R Nair
Aug 17 '16 at 13:52
add a comment |
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.
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
add a comment |
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.
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
add a comment |
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.
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.
answered Dec 19 '11 at 11:40
tiempjuuhtiempjuuh
40327
40327
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
add a comment |
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
1
1
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
Not required on Linux in VirtualBox. Just had to shut down the guest OS completely first.
– Underverse
Feb 4 '17 at 9:23
add a comment |
After resizing and not being able to view the resizing on my windows XP guest machine, I had to
- clone it
- resize it with
"VBoxManage modifyhd winxppro Clone.vdi --resize 30720"
and everything worked
I saw in other forums that snapshots can interfere for resizing and not being able to remove all snapshots for different errors I got, the only found solution for me was to clone it to remove the snapshots and then resize it, and everything worked. For resizing outside windows, a gparted boot cd that can be found here can help
add a comment |
After resizing and not being able to view the resizing on my windows XP guest machine, I had to
- clone it
- resize it with
"VBoxManage modifyhd winxppro Clone.vdi --resize 30720"
and everything worked
I saw in other forums that snapshots can interfere for resizing and not being able to remove all snapshots for different errors I got, the only found solution for me was to clone it to remove the snapshots and then resize it, and everything worked. For resizing outside windows, a gparted boot cd that can be found here can help
add a comment |
After resizing and not being able to view the resizing on my windows XP guest machine, I had to
- clone it
- resize it with
"VBoxManage modifyhd winxppro Clone.vdi --resize 30720"
and everything worked
I saw in other forums that snapshots can interfere for resizing and not being able to remove all snapshots for different errors I got, the only found solution for me was to clone it to remove the snapshots and then resize it, and everything worked. For resizing outside windows, a gparted boot cd that can be found here can help
After resizing and not being able to view the resizing on my windows XP guest machine, I had to
- clone it
- resize it with
"VBoxManage modifyhd winxppro Clone.vdi --resize 30720"
and everything worked
I saw in other forums that snapshots can interfere for resizing and not being able to remove all snapshots for different errors I got, the only found solution for me was to clone it to remove the snapshots and then resize it, and everything worked. For resizing outside windows, a gparted boot cd that can be found here can help
answered May 28 '13 at 11:11
Philippe GachoudPhilippe Gachoud
3,4022538
3,4022538
add a comment |
add a comment |
You can also do it using the VirtualBox menu:
Select File
-> Virtual Media Manager ...
A window will open:
Select your disk, and select Properties
. Now just move the slider at the bottom.
After you start the virtual machine, windows will not recognize the new space.
In windows, open Computer Management
(search for it in the start menu), select Storage
-> Disk Management
in the left menu. Select your partition (probably C:), right click on it and select Extend Volume ...
. Now just click through the wizard and you're done.
Do you need to doRelease
before that? As currently the slider is grayed. Or did you chose dynamic partition?
– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
add a comment |
You can also do it using the VirtualBox menu:
Select File
-> Virtual Media Manager ...
A window will open:
Select your disk, and select Properties
. Now just move the slider at the bottom.
After you start the virtual machine, windows will not recognize the new space.
In windows, open Computer Management
(search for it in the start menu), select Storage
-> Disk Management
in the left menu. Select your partition (probably C:), right click on it and select Extend Volume ...
. Now just click through the wizard and you're done.
Do you need to doRelease
before that? As currently the slider is grayed. Or did you chose dynamic partition?
– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
add a comment |
You can also do it using the VirtualBox menu:
Select File
-> Virtual Media Manager ...
A window will open:
Select your disk, and select Properties
. Now just move the slider at the bottom.
After you start the virtual machine, windows will not recognize the new space.
In windows, open Computer Management
(search for it in the start menu), select Storage
-> Disk Management
in the left menu. Select your partition (probably C:), right click on it and select Extend Volume ...
. Now just click through the wizard and you're done.
You can also do it using the VirtualBox menu:
Select File
-> Virtual Media Manager ...
A window will open:
Select your disk, and select Properties
. Now just move the slider at the bottom.
After you start the virtual machine, windows will not recognize the new space.
In windows, open Computer Management
(search for it in the start menu), select Storage
-> Disk Management
in the left menu. Select your partition (probably C:), right click on it and select Extend Volume ...
. Now just click through the wizard and you're done.
edited Apr 7 at 11:59
answered Jul 6 '18 at 12:36
lenoohlenooh
397310
397310
Do you need to doRelease
before that? As currently the slider is grayed. Or did you chose dynamic partition?
– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
add a comment |
Do you need to doRelease
before that? As currently the slider is grayed. Or did you chose dynamic partition?
– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
Do you need to do
Release
before that? As currently the slider is grayed. Or did you chose dynamic partition?– Royi
Apr 17 at 10:38
Do you need to do
Release
before that? As currently the slider is grayed. Or did you chose dynamic partition?– Royi
Apr 17 at 10:38
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
Royi: when you make the virtual disk, make sure it has a dynamic size.
– lenooh
Apr 17 at 19:14
add a comment |
I had the same problem where I had moved a disk, and replaced the original with a symlink. This works OK afterwards, but you run into problems with the 'modifyhd' command, as that apparently canonicalizes the path to the vdi-file when working with it. This makes it looks like you're trying to add a new disk with the same UUID but on a different path - or something like that.
There was two problems:
The disk had to be removed from the VM that used it, but then also "from the VirtualBox list of hdds". This was fixed with 'closemedium' command, which removes it from that list.
The disk to be resized was a "fixed disk" instead of "dynamic", and only dynamic disks can be resized. That was fixed with a 'clone' command (the clone is dynamic), and then resize the resulting disk.
This is my log for how it was done. Do notice that I am not at any point running as root, except when I afterwards do the resize of the partition and filesystem.
REMOVE THE ASSOCIATION TO THE DISK FROM VM.
PROBLEM STILL PERSISTS:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
VBoxManage: error: Cannot register the hard disk '/datadisk/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' {6cd99209-e4db-4178-a6c2-53f9581b1fad} because a hard disk '/home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' with UUID {6cd99209-e4db-4178-a6c2-53f9581b1fad} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
Ah, the disk is still "in the system":
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
UUID: 6cd99209-e4db-4178-a6c2-53f9581b1fad
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi
State: created
Type: normal
Remove/delete the disk from the VirtualBox disk list ("closemedium"):
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage closemedium disk 6cd99209-e4db-4178-a6c2-53f9581b1fad
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
Try the resize again:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
DAMN, "fixed-size" DOESN'T WORK! 'clonehd' to the rescue, as that leaves a 'dynamically allocated' cloned disk:
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage clonehd TestInception 64 bit.vdi TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 8e237500-173b-401a-9e63-9e64da110da9
NOW DO THE RESIZE (instantanious):
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd --resize 8192 TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
THEN ATTACH TO SOME VM, FOR RESIZING. This is done as root. Assumes that you only have one partition and possibly swap.
# fdisk /dev/sdb # <- The extra disk, just attached to be resized
// The procedure looks like this:
// m - print help
// p - print table
// d ... - delete partition (delete both if you have root and swap)
// n - new partition (create root/first partition starting on exact same sector as before, typically 2048, but ends on last, or last minus swap)
// ... n.. (.. then add the swap partition. Calculate how many sectors using original table)
// t - change type of partition (swap partition, if any, to 82 - not 83 which is "normal Linux").
// w - write partition table (write out, with the resized partition)
# e2fsck -f /dev/sdb1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 99918/122160 files (0.3% non-contiguous), 471032/487936 blocks
# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sdb1 to 1965824 (4k) blocks.
The filesystem on /dev/sdb1 is now 1965824 blocks long.
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
add a comment |
I had the same problem where I had moved a disk, and replaced the original with a symlink. This works OK afterwards, but you run into problems with the 'modifyhd' command, as that apparently canonicalizes the path to the vdi-file when working with it. This makes it looks like you're trying to add a new disk with the same UUID but on a different path - or something like that.
There was two problems:
The disk had to be removed from the VM that used it, but then also "from the VirtualBox list of hdds". This was fixed with 'closemedium' command, which removes it from that list.
The disk to be resized was a "fixed disk" instead of "dynamic", and only dynamic disks can be resized. That was fixed with a 'clone' command (the clone is dynamic), and then resize the resulting disk.
This is my log for how it was done. Do notice that I am not at any point running as root, except when I afterwards do the resize of the partition and filesystem.
REMOVE THE ASSOCIATION TO THE DISK FROM VM.
PROBLEM STILL PERSISTS:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
VBoxManage: error: Cannot register the hard disk '/datadisk/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' {6cd99209-e4db-4178-a6c2-53f9581b1fad} because a hard disk '/home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' with UUID {6cd99209-e4db-4178-a6c2-53f9581b1fad} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
Ah, the disk is still "in the system":
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
UUID: 6cd99209-e4db-4178-a6c2-53f9581b1fad
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi
State: created
Type: normal
Remove/delete the disk from the VirtualBox disk list ("closemedium"):
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage closemedium disk 6cd99209-e4db-4178-a6c2-53f9581b1fad
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
Try the resize again:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
DAMN, "fixed-size" DOESN'T WORK! 'clonehd' to the rescue, as that leaves a 'dynamically allocated' cloned disk:
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage clonehd TestInception 64 bit.vdi TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 8e237500-173b-401a-9e63-9e64da110da9
NOW DO THE RESIZE (instantanious):
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd --resize 8192 TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
THEN ATTACH TO SOME VM, FOR RESIZING. This is done as root. Assumes that you only have one partition and possibly swap.
# fdisk /dev/sdb # <- The extra disk, just attached to be resized
// The procedure looks like this:
// m - print help
// p - print table
// d ... - delete partition (delete both if you have root and swap)
// n - new partition (create root/first partition starting on exact same sector as before, typically 2048, but ends on last, or last minus swap)
// ... n.. (.. then add the swap partition. Calculate how many sectors using original table)
// t - change type of partition (swap partition, if any, to 82 - not 83 which is "normal Linux").
// w - write partition table (write out, with the resized partition)
# e2fsck -f /dev/sdb1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 99918/122160 files (0.3% non-contiguous), 471032/487936 blocks
# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sdb1 to 1965824 (4k) blocks.
The filesystem on /dev/sdb1 is now 1965824 blocks long.
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
add a comment |
I had the same problem where I had moved a disk, and replaced the original with a symlink. This works OK afterwards, but you run into problems with the 'modifyhd' command, as that apparently canonicalizes the path to the vdi-file when working with it. This makes it looks like you're trying to add a new disk with the same UUID but on a different path - or something like that.
There was two problems:
The disk had to be removed from the VM that used it, but then also "from the VirtualBox list of hdds". This was fixed with 'closemedium' command, which removes it from that list.
The disk to be resized was a "fixed disk" instead of "dynamic", and only dynamic disks can be resized. That was fixed with a 'clone' command (the clone is dynamic), and then resize the resulting disk.
This is my log for how it was done. Do notice that I am not at any point running as root, except when I afterwards do the resize of the partition and filesystem.
REMOVE THE ASSOCIATION TO THE DISK FROM VM.
PROBLEM STILL PERSISTS:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
VBoxManage: error: Cannot register the hard disk '/datadisk/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' {6cd99209-e4db-4178-a6c2-53f9581b1fad} because a hard disk '/home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' with UUID {6cd99209-e4db-4178-a6c2-53f9581b1fad} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
Ah, the disk is still "in the system":
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
UUID: 6cd99209-e4db-4178-a6c2-53f9581b1fad
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi
State: created
Type: normal
Remove/delete the disk from the VirtualBox disk list ("closemedium"):
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage closemedium disk 6cd99209-e4db-4178-a6c2-53f9581b1fad
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
Try the resize again:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
DAMN, "fixed-size" DOESN'T WORK! 'clonehd' to the rescue, as that leaves a 'dynamically allocated' cloned disk:
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage clonehd TestInception 64 bit.vdi TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 8e237500-173b-401a-9e63-9e64da110da9
NOW DO THE RESIZE (instantanious):
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd --resize 8192 TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
THEN ATTACH TO SOME VM, FOR RESIZING. This is done as root. Assumes that you only have one partition and possibly swap.
# fdisk /dev/sdb # <- The extra disk, just attached to be resized
// The procedure looks like this:
// m - print help
// p - print table
// d ... - delete partition (delete both if you have root and swap)
// n - new partition (create root/first partition starting on exact same sector as before, typically 2048, but ends on last, or last minus swap)
// ... n.. (.. then add the swap partition. Calculate how many sectors using original table)
// t - change type of partition (swap partition, if any, to 82 - not 83 which is "normal Linux").
// w - write partition table (write out, with the resized partition)
# e2fsck -f /dev/sdb1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 99918/122160 files (0.3% non-contiguous), 471032/487936 blocks
# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sdb1 to 1965824 (4k) blocks.
The filesystem on /dev/sdb1 is now 1965824 blocks long.
I had the same problem where I had moved a disk, and replaced the original with a symlink. This works OK afterwards, but you run into problems with the 'modifyhd' command, as that apparently canonicalizes the path to the vdi-file when working with it. This makes it looks like you're trying to add a new disk with the same UUID but on a different path - or something like that.
There was two problems:
The disk had to be removed from the VM that used it, but then also "from the VirtualBox list of hdds". This was fixed with 'closemedium' command, which removes it from that list.
The disk to be resized was a "fixed disk" instead of "dynamic", and only dynamic disks can be resized. That was fixed with a 'clone' command (the clone is dynamic), and then resize the resulting disk.
This is my log for how it was done. Do notice that I am not at any point running as root, except when I afterwards do the resize of the partition and filesystem.
REMOVE THE ASSOCIATION TO THE DISK FROM VM.
PROBLEM STILL PERSISTS:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
VBoxManage: error: Cannot register the hard disk '/datadisk/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' {6cd99209-e4db-4178-a6c2-53f9581b1fad} because a hard disk '/home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi' with UUID {6cd99209-e4db-4178-a6c2-53f9581b1fad} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
Ah, the disk is still "in the system":
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
UUID: 6cd99209-e4db-4178-a6c2-53f9581b1fad
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 64 bit/TestInception 64 bit.vdi
State: created
Type: normal
Remove/delete the disk from the VirtualBox disk list ("closemedium"):
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage closemedium disk 6cd99209-e4db-4178-a6c2-53f9581b1fad
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage list hdds
UUID: ba58276a-bbe1-4354-8ae5-246bdac390c8
Parent UUID: base
Format: VDI
Location: /home/virt_box/VirtualBox VMs/TestInception 32 bit/TestInception.vdi
State: locked write
Type: normal
Usage: TestInception 32 bit (UUID: a693ac62-7caa-4f11-9d00-51d3a149f5f7)
Try the resize again:
virt_box@TestBox:~/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd TestInception 64 bit.vdi --resize 8192
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
DAMN, "fixed-size" DOESN'T WORK! 'clonehd' to the rescue, as that leaves a 'dynamically allocated' cloned disk:
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage clonehd TestInception 64 bit.vdi TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 8e237500-173b-401a-9e63-9e64da110da9
NOW DO THE RESIZE (instantanious):
virt_box@TestBox:/datadisk/VirtualBox VMs/TestInception 64 bit$ VBoxManage modifyhd --resize 8192 TestInception 64 bit-cloned.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
THEN ATTACH TO SOME VM, FOR RESIZING. This is done as root. Assumes that you only have one partition and possibly swap.
# fdisk /dev/sdb # <- The extra disk, just attached to be resized
// The procedure looks like this:
// m - print help
// p - print table
// d ... - delete partition (delete both if you have root and swap)
// n - new partition (create root/first partition starting on exact same sector as before, typically 2048, but ends on last, or last minus swap)
// ... n.. (.. then add the swap partition. Calculate how many sectors using original table)
// t - change type of partition (swap partition, if any, to 82 - not 83 which is "normal Linux").
// w - write partition table (write out, with the resized partition)
# e2fsck -f /dev/sdb1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 99918/122160 files (0.3% non-contiguous), 471032/487936 blocks
# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sdb1 to 1965824 (4k) blocks.
The filesystem on /dev/sdb1 is now 1965824 blocks long.
edited Feb 22 '18 at 22:36
Matt
1054
1054
answered Apr 9 '13 at 12:01
stolsvikstolsvik
2581410
2581410
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
add a comment |
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
This worked for me, followed the guide here: yinfor.com/2015/05/…
– marijnz0r
Jun 21 '17 at 15:00
add a comment |
This worked for me with Virtualbox 5.2.6 installed on Ubuntu 16.04 Host Machine and Windows 10 Guest:
open Virtualbox Manager, click on Global Tools (upper right corner) and choose Virtual Media Manager.
Click on the Hard Disk Tab and select your Guest OS. At the bottom of the box click on the Attributes Tab. At the bottom you can see the size of the Virtual Disk, and with the slider you can increase the size to your liking. (You can only increase, not decrease the size with this method). Click on Apply.
Start your Windows Guest OS, open Computer Management, right click on the C: Drive, and select Extend Volume to extend the file system with the unallocated part.
That’s all I had to do, works perfectly for me.
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
add a comment |
This worked for me with Virtualbox 5.2.6 installed on Ubuntu 16.04 Host Machine and Windows 10 Guest:
open Virtualbox Manager, click on Global Tools (upper right corner) and choose Virtual Media Manager.
Click on the Hard Disk Tab and select your Guest OS. At the bottom of the box click on the Attributes Tab. At the bottom you can see the size of the Virtual Disk, and with the slider you can increase the size to your liking. (You can only increase, not decrease the size with this method). Click on Apply.
Start your Windows Guest OS, open Computer Management, right click on the C: Drive, and select Extend Volume to extend the file system with the unallocated part.
That’s all I had to do, works perfectly for me.
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
add a comment |
This worked for me with Virtualbox 5.2.6 installed on Ubuntu 16.04 Host Machine and Windows 10 Guest:
open Virtualbox Manager, click on Global Tools (upper right corner) and choose Virtual Media Manager.
Click on the Hard Disk Tab and select your Guest OS. At the bottom of the box click on the Attributes Tab. At the bottom you can see the size of the Virtual Disk, and with the slider you can increase the size to your liking. (You can only increase, not decrease the size with this method). Click on Apply.
Start your Windows Guest OS, open Computer Management, right click on the C: Drive, and select Extend Volume to extend the file system with the unallocated part.
That’s all I had to do, works perfectly for me.
This worked for me with Virtualbox 5.2.6 installed on Ubuntu 16.04 Host Machine and Windows 10 Guest:
open Virtualbox Manager, click on Global Tools (upper right corner) and choose Virtual Media Manager.
Click on the Hard Disk Tab and select your Guest OS. At the bottom of the box click on the Attributes Tab. At the bottom you can see the size of the Virtual Disk, and with the slider you can increase the size to your liking. (You can only increase, not decrease the size with this method). Click on Apply.
Start your Windows Guest OS, open Computer Management, right click on the C: Drive, and select Extend Volume to extend the file system with the unallocated part.
That’s all I had to do, works perfectly for me.
answered Jan 24 '18 at 17:55
JudexJudex
413
413
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
add a comment |
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
Worked great. Shouldn't this be the accepted answer, at least for the recent versions of VirtualBox?
– AlwaysLearning
Apr 29 '18 at 12:38
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Dec 19 '11 at 14:03
xyzzymanxyzzyman
85674
85674
add a comment |
add a comment |
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.
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
add a comment |
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.
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
add a comment |
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.
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.
answered Feb 1 '12 at 9:34
JJinCOJJinCO
111
111
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
add a comment |
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
Some people reported this causes the home dir to have bad permissions
– Jonathan
Sep 1 '16 at 0:02
add a comment |
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
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
add a comment |
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
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
add a comment |
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
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
edited Sep 17 '13 at 19:16
guntbert
9,526133170
9,526133170
answered Mar 26 '12 at 22:53
tindasetindase
191
191
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
add a comment |
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
1
1
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
Did you have to reinstall / reformat / repartition? or did it just boot right back up?
– Jonathan
Sep 1 '16 at 0:01
add a comment |
If your host machine is windows, then you can run the following command to increase or decrease the vdi disk size in virtual box:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:Usersyour_user_nameVirtualBox VMsUbuntu18LTSUbuntu18LTS.vdi" --resize 20000
In the above command replace your_user_name with the real windows user and 20000 is MB size of disk.
add a comment |
If your host machine is windows, then you can run the following command to increase or decrease the vdi disk size in virtual box:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:Usersyour_user_nameVirtualBox VMsUbuntu18LTSUbuntu18LTS.vdi" --resize 20000
In the above command replace your_user_name with the real windows user and 20000 is MB size of disk.
add a comment |
If your host machine is windows, then you can run the following command to increase or decrease the vdi disk size in virtual box:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:Usersyour_user_nameVirtualBox VMsUbuntu18LTSUbuntu18LTS.vdi" --resize 20000
In the above command replace your_user_name with the real windows user and 20000 is MB size of disk.
If your host machine is windows, then you can run the following command to increase or decrease the vdi disk size in virtual box:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:Usersyour_user_nameVirtualBox VMsUbuntu18LTSUbuntu18LTS.vdi" --resize 20000
In the above command replace your_user_name with the real windows user and 20000 is MB size of disk.
answered Aug 3 '18 at 7:50
Manish JangirManish Jangir
34123
34123
add a comment |
add a comment |
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-virtualbox-disk-for-winxp-guest/
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
add a comment |
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-virtualbox-disk-for-winxp-guest/
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
add a comment |
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-virtualbox-disk-for-winxp-guest/
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-virtualbox-disk-for-winxp-guest/
answered May 1 '12 at 19:25
0x61696f0x61696f
197112
197112
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
add a comment |
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
Can you please explain the steps here? Answers with little more than a link to another site are generally frowned up here, and may be deleted.
– Tom Brossman
Sep 29 '12 at 17:10
1
1
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
Well, you need to understand what modifyhd does, which isn't much more than expanding the underlying virtual disk, that's all. You still need to expand the filesystem that's on it.
– Marcin Kaminski
Nov 21 '12 at 0:41
add a comment |
Here's a way to resize your VirtualBox disk, regardless of whether it is a fixed format or dynamic format disk. Specifically, it prevents this error:
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
⚠️ Backup the virtual disk. You never know what might go wrong.
On your host:
Open a terminal window.
On Windows: Open the command prompt
cmd
.
Go to the directory with the virtual disk you want to resize. For example:
cd "My VMs"
Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either
Standard
(dynamic) orFixed
). For example, to create a 50 GB fixed-format disk calledMyNewDisk.vdi
:
VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed
If
VBoxManage
is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" createmedium
--filename "MyNewDisk.vdi" --size 50000 --variant Fixed
Copy the original disk to the new disk.
VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing
The resize is done! You can check the properties of the new disk if you want:
VBoxManage showmediuminfo "MyNewDisk.vdi"
Change the virtual machine to use the new disk instead.
Next, on your guest OS you need to resize the partitions to use the newly available space.
add a comment |
Here's a way to resize your VirtualBox disk, regardless of whether it is a fixed format or dynamic format disk. Specifically, it prevents this error:
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
⚠️ Backup the virtual disk. You never know what might go wrong.
On your host:
Open a terminal window.
On Windows: Open the command prompt
cmd
.
Go to the directory with the virtual disk you want to resize. For example:
cd "My VMs"
Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either
Standard
(dynamic) orFixed
). For example, to create a 50 GB fixed-format disk calledMyNewDisk.vdi
:
VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed
If
VBoxManage
is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" createmedium
--filename "MyNewDisk.vdi" --size 50000 --variant Fixed
Copy the original disk to the new disk.
VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing
The resize is done! You can check the properties of the new disk if you want:
VBoxManage showmediuminfo "MyNewDisk.vdi"
Change the virtual machine to use the new disk instead.
Next, on your guest OS you need to resize the partitions to use the newly available space.
add a comment |
Here's a way to resize your VirtualBox disk, regardless of whether it is a fixed format or dynamic format disk. Specifically, it prevents this error:
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
⚠️ Backup the virtual disk. You never know what might go wrong.
On your host:
Open a terminal window.
On Windows: Open the command prompt
cmd
.
Go to the directory with the virtual disk you want to resize. For example:
cd "My VMs"
Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either
Standard
(dynamic) orFixed
). For example, to create a 50 GB fixed-format disk calledMyNewDisk.vdi
:
VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed
If
VBoxManage
is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" createmedium
--filename "MyNewDisk.vdi" --size 50000 --variant Fixed
Copy the original disk to the new disk.
VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing
The resize is done! You can check the properties of the new disk if you want:
VBoxManage showmediuminfo "MyNewDisk.vdi"
Change the virtual machine to use the new disk instead.
Next, on your guest OS you need to resize the partitions to use the newly available space.
Here's a way to resize your VirtualBox disk, regardless of whether it is a fixed format or dynamic format disk. Specifically, it prevents this error:
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
⚠️ Backup the virtual disk. You never know what might go wrong.
On your host:
Open a terminal window.
On Windows: Open the command prompt
cmd
.
Go to the directory with the virtual disk you want to resize. For example:
cd "My VMs"
Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either
Standard
(dynamic) orFixed
). For example, to create a 50 GB fixed-format disk calledMyNewDisk.vdi
:
VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed
If
VBoxManage
is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" createmedium
--filename "MyNewDisk.vdi" --size 50000 --variant Fixed
Copy the original disk to the new disk.
VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing
The resize is done! You can check the properties of the new disk if you want:
VBoxManage showmediuminfo "MyNewDisk.vdi"
Change the virtual machine to use the new disk instead.
Next, on your guest OS you need to resize the partitions to use the newly available space.
answered Aug 18 '17 at 13:53
Daniel PelsmaekerDaniel Pelsmaeker
21424
21424
add a comment |
add a comment |
For those who have Windows on a VHD, like I did, first convert to VDI by cloning with the following Linux command. (Note, Windows VM powered off.)
VBoxManage clonehd Windows10.vhd Windows10.vdi --format vdi
This will duplicate the vhd.
Then the VDI can be resized with the following. Note the VDI won't actually grow until it is used.
VBoxManage modifyhd Windows10.vdi --resize 80000
After fixing up the storage mounting in the VM host software, and powering on the VM, Windows boots, but the partition will still be the same size. Google for a Windows tool that can resize the C drive partition. I used EaseUs Partition Master to grow the C drive partition to my new size.
Finally, the VHD can be deleted.
add a comment |
For those who have Windows on a VHD, like I did, first convert to VDI by cloning with the following Linux command. (Note, Windows VM powered off.)
VBoxManage clonehd Windows10.vhd Windows10.vdi --format vdi
This will duplicate the vhd.
Then the VDI can be resized with the following. Note the VDI won't actually grow until it is used.
VBoxManage modifyhd Windows10.vdi --resize 80000
After fixing up the storage mounting in the VM host software, and powering on the VM, Windows boots, but the partition will still be the same size. Google for a Windows tool that can resize the C drive partition. I used EaseUs Partition Master to grow the C drive partition to my new size.
Finally, the VHD can be deleted.
add a comment |
For those who have Windows on a VHD, like I did, first convert to VDI by cloning with the following Linux command. (Note, Windows VM powered off.)
VBoxManage clonehd Windows10.vhd Windows10.vdi --format vdi
This will duplicate the vhd.
Then the VDI can be resized with the following. Note the VDI won't actually grow until it is used.
VBoxManage modifyhd Windows10.vdi --resize 80000
After fixing up the storage mounting in the VM host software, and powering on the VM, Windows boots, but the partition will still be the same size. Google for a Windows tool that can resize the C drive partition. I used EaseUs Partition Master to grow the C drive partition to my new size.
Finally, the VHD can be deleted.
For those who have Windows on a VHD, like I did, first convert to VDI by cloning with the following Linux command. (Note, Windows VM powered off.)
VBoxManage clonehd Windows10.vhd Windows10.vdi --format vdi
This will duplicate the vhd.
Then the VDI can be resized with the following. Note the VDI won't actually grow until it is used.
VBoxManage modifyhd Windows10.vdi --resize 80000
After fixing up the storage mounting in the VM host software, and powering on the VM, Windows boots, but the partition will still be the same size. Google for a Windows tool that can resize the C drive partition. I used EaseUs Partition Master to grow the C drive partition to my new size.
Finally, the VHD can be deleted.
answered Apr 2 at 20:24
jwsjws
1112
1112
add a comment |
add a comment |
protected by Community♦ Apr 10 '12 at 10:27
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
3
Your problem is that you've symlinked the disk to a '/media/data' location and that it doesn't reside on the original '/home/wim/VirtualBox VMs' location. I've answered with how I fixed this.
– stolsvik
Apr 9 '13 at 15:35
1
i have detailed my experience here: kmonsoor.wordpress.com/2012/05/26/virtualbox-increase-disk-size the "accepted" answer below is way far from being even right.
– kmonsoor
Oct 8 '14 at 16:25
There is another possibility of "copying the existing vdi" to a "new empty vdi, whose size is bigger than existing" (refer- justintung.com/2011/01/06/… )
– parasrish
Apr 11 '18 at 5:22
also, note that, just resizing might not help, as the "vdi" size would have increased, but based on the "vm-os-installation", your primary partition stays the same, and the newly allocated space is typically shown "unallocated". You need to hence do the "partition re-allocation" (Refer the link above).
– parasrish
Apr 11 '18 at 9:25