Page 1 of 1

VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 5. Apr 2017, 21:17
by UltraLuminous
Hey all,

I am trying to create a Windows 10 VM but I get the following error while trying to make a virtual hard disk. I have verified that there is enough space for the file and that the directory is correct, but the error won't go away:

Failed to create the hard disk storage /home/user/VirtualBox VMs/Windows 10/Windows 10.vhd.

Could not create the medium storage unit '/home/hubert/VirtualBox VMs/Windows 10/Windows 10.vhd'.
VHD: cannot set the file size for '/home/hubert/VirtualBox VMs/Windows 10/Windows 10.vhd' (VERR_INVALID_PARAMETER).


Result Code:
VBOX_E_FILE_ERROR (0x80BB0004)
Component:
MediumWrap
Interface:
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

Please tell me how I can fix this, it's very frustrating...

Thank you,
Matthew

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 5. Apr 2017, 22:06
by socratis
UltraLuminous wrote:VHD: cannot set the file size
What's the size that you're using for the disk? And why a VHD?

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 5. Apr 2017, 22:26
by UltraLuminous
Using 20GB. Tried other formats, same thing.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 5. Apr 2017, 23:42
by socratis
First of all, unless you have a specific reason not to, stick with VDI.

Second, try for a change to NOT disturb the defaults. Create another VM which you can later delete along with its files. Does it still complain?

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 11:49
by UltraLuminous
Yes, it still says the same error no matter what size or format I choose.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 12:19
by mpack
Stick to VDI. Otherwise this looks like you don't have write permission for that VM folder. That's a host OS problem.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 12:44
by UltraLuminous
I have tried VDI and set the permissions to read and write on that folder. Still doesn't work... I'll try re-installing VirtualBox.

UPDATE: That din't help. Perhaps I have the wrong VBox version?

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 13:10
by socratis
I will repeat this once more, just to be clear, because last time I asked you to NOT touch the defaults and your answer was "no matter what size or format I choose". That doesn't go well with "do NOT touch the defaults".

So, create a new VM using the wizard. Do NOT change anything. Do NOT modify the size. Do NOT modify the type.

Type only a VM name: "Win10", no spaces and press "Continue", twice. Press "Create". Press "Continue", twice. Press "Create.

What your host, what's your VirtualBox version? Where did you get VirtualBox from? From the command line post the output of the following:
  • uname -a
    VBoxManage -v

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 13:37
by UltraLuminous
By the "no matter what I choose" I meant that I did also try the defaults and still had the same result. I have done exactly what you said and still got the same error.

My "uname -a" is:
Linux mint-pc 4.8.0-45-generic #48~16.04.1-Ubuntu SMP Fri Mar 24 12:46:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

My "vboxmanage -v" is:
5.1.18r114002
(a.k.a virtualbox-5.1_5.1.18-114002~Ubuntu~xenial_i386.deb from official downloads page)

I hope I have cleared up any confusion, and that we can now come to a solution to this.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 6. Apr 2017, 17:19
by mpack
Try copying any file into the VM folder. Do you have write permission?

Please confirm that you are not creating a fixed size drive.

Oh, and just for fun it would be nice to see the free space reported by the host for the target folder, i.e. "'/home/hubert/VirtualBox VMs/Windows 10/".

Also of interest would be free RAM on the host.

I would like you to report the error message you get when VDI is used. As far as I can see that error string only exists in the VHD code, meaning you couldn't possibly get it for other disk container types.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 11. Apr 2017, 21:35
by sierrahotel
I've had a similar problem. In summary, details later.

Creating a fixed disk using vboxmanager or GUI tools on linux fails (host 32 bit manjaro, an Arch variant so doubly unsupported, I know, I know!, version 5.1.18r114002, 64 bit hardware architecture, running Windows 8.1 32 bit guest).

An error of some sort is always given no matter what the size parameter, details are given of which section of code finds the size parameter objectionable when run from the command line, I'll try to provide examples later.

Using dynamic disks with the same parameters works fine. Applies to vdi and vhd. Also applies to other vboxmanage commands that manipulate disks that have a fixed disk parameter, as well as just fixed disk creation.

However, dual booting into Windows 10 32 bit on the same machine and calling VBoxManage.exe will create a fixed disk just fine. That can then be used by the linux VMs.

Bye for now,
Simon

edit: added .exe file extension, clarity

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 11. Apr 2017, 22:24
by sierrahotel
OK, here's something to start with...

Linux (as above) cli and result:

Code: Select all

[simon@dell-t3400-manjaro ~]$ vboxmanage createmedium disk --filename page.vdi --size 1540 --format vdi --variant fixed
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to create medium
VBoxManage: error: Could not create the medium storage unit '/home/simon/page.vdi'.
VBoxManage: error: VDI: setting image size failed for '/home/simon/page.vdi' (VERR_INVALID_PARAMETER)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 450 of file VBoxManageDisk.cpp
Linux GUI trying to copy an existing fixed disk to a partition with room and permissions gives a popup containing:

Failed to create the hard disk storage /run/media/simon/Slow Store/Windows 8_copy.vdi.
Could not create the clone medium '/run/media/simon/Slow Store/Windows 8_copy.vdi'.
VDI: setting image size failed for '/run/media/simon/Slow Store/Windows 8_copy.vdi' (VERR_INVALID_PARAMETER).
Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}


The filesystems were mounted as follows (partitions containing home directory for cli attempt, and 'Slow Store' for GUI attempt):

Code: Select all

/dev/sda4 on / type ext4 (rw,noatime,discard,data=ordered)
/dev/sdb9 on /run/media/simon/Slow Store type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
edit: mount output

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 13. Apr 2017, 21:16
by sierrahotel
Anyone been able to reproduce this?

Worth filing a bug report?

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 14. Apr 2017, 19:32
by socratis
sierrahotel wrote:Creating a fixed disk using vboxmanager or GUI tools on linux fails (host 32 bit manjaro, an Arch variant so doubly unsupported, I know, I know!
sierrahotel wrote:Worth filing a bug report?
With the Arch port, most probably. I would ask for verification in their support site first.

Re: VHD: cannot set the file size for 'path' (VERR_INVALID_PARAMETER)

Posted: 28. Sep 2017, 00:16
by k_w_a
Exactly the same errors on Xubuntu 16.04 32-bit & Ubuntu 14.04 32-bit , VirtualBox 5.1.22