VBoxManage can't resize -- Lock error

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Wylbur_Wrong
Posts: 3
Joined: 9. Nov 2015, 04:50

VBoxManage can't resize -- Lock error

Post by Wylbur_Wrong »

I am running VBox 5.0.8 under SUSE Linux 13.2 64bit. The guest is W7 Home Premium 64bit. It has run out of "HD" space (20GB). So, I am attempting to resize the .vdi file (not static). However, W7 did not shutdown normally. I issued the following and that is followed by the response:

Code: Select all

VBoxManage modifyhd "W7 Home Premium.vdi" --resize 42950
VBoxManage: error: Failed to lock media when compacting '/home/ospjbt/VirtualBox VMs/W7 Home Premium/W7 Home Premium.vdi'
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "Resize(cbResize, pProgress.asOutParam())" at line 691 of file VBoxManageDisk.cpp
VBoxManage: error: Failed to resize medium!

How does one get the lock for VBoxManage modifyhd, or tell it to force the lock? I have not been able to find this searching the user PDF or the whole 'net with Google.

Baring this, is there a way that I can mount this file as a virtual file system from a different W7 image, and copy the data from it (I am assuming that Vbox will have the same problem) (almost all postings I've seen for this were not addressing Linux as a host, with Winderz as a guest, and so far all I've done is destroy a guest trying to do this).

If the only option is for me to build a new file at 40GB, OK, I can do that (I have enough room in my /home partition). But I would like to get the data from the one I'm trying to expand into this new dynamic vdi.

To avoid this problem, I had been trying to use the host's /home area where I have a folder that is shared with Linux so data and programs can be gotten to from either O/S (before you start, think Wine). However, Winderz absolutely goes nuts with programs on a "network drive", and some Micro$oft programs will ONLY install on the "C" drive (I have very good reasons for not doing it this way going back to NT 4.0 days where this was NOT a requirement). </rant>

Regards,
Wylbur Wrong
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage can't resize -- Lock error

Post by Perryg »

Failure to lock usually indicates that the guest is not shut down, IE saved state.
Wylbur_Wrong
Posts: 3
Joined: 9. Nov 2015, 04:50

Re: VBoxManage can't resize -- Lock error

Post by Wylbur_Wrong »

Sorry, but trying to answer this w/ an iPhone is painful.

As I said in my initial post, Windows 7 did NOT shutdown properly. This does not mean it is in "sleep state". It means that it can't write to the .vdi file info needed for it to be able to start normally. This probably means that the NTFS in use flag can't be turned off.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage can't resize -- Lock error

Post by Perryg »

The vdi file is just a container and really does not use any host flags per se but it might have a "<vbox>".pid file. I don't know where it is in a windows host but you should be able to search for pid. If found delete it and then try again. You can also try CloneVDI Tool
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage can't resize -- Lock error

Post by mpack »

If there is a saved state associated with the VM then you can simply discard it. But do check that it isn't part of a snapshot chain. Snapshot chains can be resized, but you need to know exactly what you're doing.
Wylbur_Wrong
Posts: 3
Joined: 9. Nov 2015, 04:50

Re: VBoxManage can't resize -- Lock error

Post by Wylbur_Wrong »

Well, after getting multiple syntax errors on the command to resize, I decided to restart VBox and start the guest because Dolphin was showing that the .vdi had changed sizes.

I do not understand or know when it worked, but I have effectively doubled the size of the Windows "NTFS" drive.

I did not delete any files. I looked at a few logs, but that is about it.

I have one last question, is it wise to compress (compact) the .vdi at intervals? I do not have snapshots enabled. Just a "vanilla" .vdi running W7.

Regards,
Wylbur Wrong

Take-off (pun intended) on Wylber Wright
jackfido
Posts: 2
Joined: 25. Nov 2015, 21:16

Re: VBoxManage can't resize -- Lock error

Post by jackfido »

I have the same problem, I have Virtual Box 5+, and Im trying to resize Hardisc for Windows 7 64 bits, my host is Ubuntu 15.10

Manage modifyhd "Windows 7.vdi" --resize 25000
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize medium operation for this format is not implemented yet!

Can onyone help me?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage can't resize -- Lock error

Post by mpack »

@Jackfido: that isn't even close to being the same problem. Where do you see VERR_UNSUPPORTED in the OP's post? I'll make a wild stab in the dark and guess that your problem is twofold: you haven't read the user manual properly, and your disk is already larger than the 25GB you're trying to "increase" it to.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: VBoxManage can't resize -- Lock error

Post by Martin »

"error: Resize medium operation for this format is not implemented yet!" looks more like the file is one of the not resizable formats and was just renamed to VDI.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage can't resize -- Lock error

Post by mpack »

Martin wrote:"error: Resize medium operation for this format is not implemented yet!" looks more like the file is one of the not resizable formats and was just renamed to VDI.
Yes, I considered mentioning that, but hopefully people wouldn't believe that (say) a VMDK can be made a VDI just by renaming the file, plus I know that you also get VERR_SUPPORTED when you try to shrink the drive, so that's what I went with.
Post Reply