Can't resize disk from CLI

Discussions about using Linux guests in VirtualBox.
Post Reply
Amaksoud
Posts: 3
Joined: 7. Sep 2019, 13:28

Can't resize disk from CLI

Post by Amaksoud »

Hello,

I have VB 6.0 installed on Mac OSX host and Kali Linux Guest OS.

I have trying to resize the only VHD file that I have for this guest from command line but I always get an error that might not be descriptive to me.

The VHD is located on an external disk drive.

I used the following command VBoxManage modifymedium disk 'path to disk' --resize 33000

I suspect that the path to file might be causing this issue as it contains spaces, that's why I tried using single or double quotes but still get the same error below
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Failed to resize medium
VBoxManage: error: Resizing to new size 34603008000 is not yet supported for medium '/Volumes/External BackUp Disk/Folder Name/FolderName/FolderName/Folder Name/Disk Name.vhd'
Any help would be much appreciated.
VBoxManage: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MediumWrap, interface IMedium
VBoxManage: error: Context: "RTEXITCODE handleModifyMedium(HandlerArg *)" at line 768 of file VBoxManageDisk.cpp
Amaksoud
Posts: 3
Joined: 7. Sep 2019, 13:28

Re: Can't resize disk from CLI

Post by Amaksoud »

Tried to move the disk to the laptop's disk to see if the spaces included in the old path are causing any issues but still get errors while trying to resize.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can't resize disk from CLI

Post by socratis »

The error doesn't say File_Not_Found, it says Not_Supported. From the appropriate chapter in the User Manual, VBoxManage modifymedium:
The --resize x option ... currently works only for VDI and VHD formats, and only for the dynamically allocated variants
Post the output of the following command:
  • 
    VBoxManage showmediuminfo "/Volumes/External BackUp Disk/Folder Name/FolderName/FolderName/Folder Name/Disk Name.vhd"
If you obfuscated your path, you'll need to adjust it appropriately. Please don't do it again.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Amaksoud
Posts: 3
Joined: 7. Sep 2019, 13:28

Re: Can't resize disk from CLI

Post by Amaksoud »

Hello,

The command output is as follows
UUID:           f98d7eec-4d26-4de2-88a3-1848b26a9a4f
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /tempkali/Kali Main.vhd
Storage format: VHD
Format variant: fixed default
Capacity:       16384 MBytes
Size on disk:   16384 MBytes
Encryption:     disabled
In use by VMs:  Kali Main (UUID: ac6b365a-e93f-4e54-a478-0af9735db528)
Last edited by socratis on 15. Sep 2019, 11:28, edited 1 time in total.
Reason: Enclosed the information in [quote][pre] tags for better readability
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can't resize disk from CLI

Post by socratis »

Amaksoud wrote:
Format variant: fixed default
You can't resize that specific virtual hard disk, it's Fixed size.

You could convert the VHD to a VDI and make it Dynamic at the same time, by using a command like:
  • 
    VBoxManage clonemedium "/tempkali/Kali Main.vhd" "/tempkali/Kali Main.vdi" --format VDI --variant Standard
    VBoxManage modifymedium disk "/tempkali/Kali Main.vdi" --resize 32768
For more information see the chapter "8.25. VBoxManage clonemedium". Then remove the VHD from your VM and attach your VDI. Make sure everything is working, delete the VHD.

PS. I lowered your HD size to something round in hexadecimal... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Cosmin
Posts: 3
Joined: 25. Jan 2019, 11:49

Re: Can't resize disk from CLI

Post by Cosmin »

socratis wrote:
Amaksoud wrote:
Format variant: fixed default
You can't resize that specific virtual hard disk, it's Fixed size.
Incorrect, still doesn't work for a dynamic VHD:

Code: Select all

vboxmanage --version
6.1.16_Ubuntur140961

VBoxManage showmediuminfo image.vhd
UUID:           4c3db192-1de5-3947-8832-b56fabb3109a
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /root/image.vhd
Storage format: VHD
Format variant: dynamic default
Capacity:       131072 MBytes
Size on disk:   2832 MBytes
Encryption:     disabled

vboxmanage modifymedium disk image.vhd --resize 3000
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Failed to resize medium
VBoxManage: error: Shrinking is not yet supported for medium '/root/image.vhd'
VBoxManage: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MediumWrap, interface IMedium
VBoxManage: error: Context: "RTEXITCODE handleModifyMedium(HandlerArg*)" at line 816 of file VBoxManageDisk.cpp
So yeah, broken
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Can't resize disk from CLI

Post by fth0 »

What you tried is deliberately not implemented and documented as such (in the VirtualBox User Manual and in this thread).
Post Reply