virtualbox 4.1.12 vdi expansion failed

Discussions related to using VirtualBox on Mac OS X hosts.

virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 29. Jan 2013, 22:55

I resized my VDI file per this link:

1) I listed the drives;
VBoxManage list hdds

2) I cloned it to make a copy
$ sudo VboxManage clonehd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi /Volumes/Data/VBOX/backups/Win7-clone.vdi

3) I extended the drive
$ sudo VBoxManage modifyhd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi --resize 22528

4) I powered on my windows 7 VM and get this error:
FATAL: No bootable medium found! System halted.

What do I do now?
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby noteirak » 29. Jan 2013, 23:11

Try without the sudo part
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5192
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 29. Jan 2013, 23:16

It did not work without the sudo the first time.

$ VBoxManage modifyhd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi --resize 25000
VBoxManage: error: Failed to lock media when compacting '/Users/homedir/VirtualBox VMs/Win7/Win7.vdi'
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee nsISupports
Context: "Resize(cbResize, progress.asOutParam())" at line 522 of file VBoxManageDisk.cpp
VBoxManage: error: Code VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) - Current object state prohibits operation (extended info not available)


$ sudo VBoxManage modifyhd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi --resize 25000
Password:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

The sudo was needed as you can see above.

However, when it completed I tried booting up my windows VM, and that is when I get the error i listed.
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 30. Jan 2013, 11:28

Did the original VM use snapshots?
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 30. Jan 2013, 18:07

No snapshots - but I cloned the VM before making the change.

$ sudo VboxManage clonehd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi /Volumes/Data/VBOX/backups/Win7-clone.vdi

At this point, I have a windows VM that is not usable. I have tried to use the clone, but it will not work either.
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 30. Jan 2013, 18:09

Did you actually clone the VM, or did you just clone the base VDI in a VM which used snapshots?

The error message is actually quite simple: there is no bootable disk mounted in the VM. You need to believe the error message and ask yourself why it says that. One thing it isn't: cloning did not corrupt the disk.
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 30. Jan 2013, 18:21

Basically, I just followed the instructions: "how-to-resize-a-virtualbox-vdi-fixed-size-virtual-drive-on-mac/" from the gubatron blog web site.

I cloned the VDI as a way to backup the VM.

Right now, after the VDI file was increased, I rebooted the VM and I got the error message it listed. So at this point it looks like increasing the VDI file created the issue. How do I resolve that issue? I tried removing and adding the disk back. But I am not sure what else to do and all my windows stuff is there?
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 30. Jan 2013, 19:08

Well, you made a number of basic mistakes which make it difficult to retrieve the situation. First, you cloned the hard disk (which changed the header UUIDs) when what you actually needed was a simple copy of the file (which doesn't). Having done that you then modified your original instead of the clone. Then... it's somewhat vague what you did after that.

You haven't given me a clear answer to my question of whether the starting point was a VM which used snapshots. Your earlier response was indirect. For me to know if the situation is fixable I need to know exactly what you started with, and exactly what you did, step by step.
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 30. Jan 2013, 19:27

Here are the steps I took:

$ VBoxManage list hdds | grep -E "Location|UUID|State"
UUID: 0c9e4e50-4e77-47ac-80b2-11d69deb0aad
Location: /Users/homedir/VirtualBox VMs/Win7/Win7.vdi
State: locked write

Then

$ VboxManage clonehd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi /Volumes/Data/VBOX/backups/
VBoxManage: error: Failed to lock source media '/Users/homedir/VirtualBox VMs/Win7/Win7.vdi'
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee nsISupports
Context: "CloneTo(dstDisk, DiskVariant, NULL, progress.asOutParam())" at line 665 of file VBoxManageDisk.cpp

Since it failed, I added the sudo

$ sudo VboxManage clonehd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi /Volumes/Data/VBOX/backups/Win7-clone.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 0164f3ee-1a47-4c0b-8de5-1590a4f613e6

After I created a clone (a backup) of the original file, I did the following (note i added the sudo to ensure it would work):
$ sudo VBoxManage modifyhd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi --resize 22528
Password:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Then I listed the hdds again:

$ VBoxManage list hdds | grep -E "UUID|Location|State"
UUID: 0c9e4e50-4e77-47ac-80b2-11d69deb0aad
Parent UUID: base
Location: /Users/homedir/VirtualBox VMs/Win7/Win7.vdi
State: locked write

I added more space - so I went ahead and reran the command:

$ sudo VBoxManage modifyhd /Users/homedir/VirtualBox\ VMs/Win7/Win7.vdi --resize 25000
Password:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Then I listed the hdds again:

$ VBoxManage list hdds | grep -E "UUID|Location|State|Type|Usage"
UUID: 0c9e4e50-4e77-47ac-80b2-11d69deb0aad
Location: /Users/homedir/VirtualBox VMs/Win7/Win7.vdi
State: created
Type: normal
Usage: Win7 (UUID: c7b9e762-3e15-48ec-a9fc-cc43fd596193)

Started virtualbox, checked windows 7 VM settings and it still shows the disk is 20G

Then I powered on the VM

Then the VM started to boot and then the error:
"Fatal: No bootable medium found! System halted

Then I powered off the VM

Then I went to the settings->storage, then clicked on the controller and removed the disk.

Then I went to the settings->storage and added the disk back.

Right now: these settings are:
SATA Controller; Type AHCI; Port count 1
Virtual Size 20G; actual size 19.92 GB; Detail: dynamically allocated

I think this covers all...
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 31. Jan 2013, 13:22

I still need a clear answer to my snapshots question.
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 31. Jan 2013, 16:38

Ok, then I am not sure what you are asking. Are you asking if I took a snapshot before I made the changes? In an earlier post i stated no snapshots.

I clicked on the snapshots button, and all I see is "Current State"

I appreciate the help.
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 31. Jan 2013, 19:09

elchap1n wrote:Ok, then I am not sure what you are asking. Are you asking if I took a snapshot before I made the changes? In an earlier post i stated no snapshots.

I clicked on the snapshots button, and all I see is "Current State"

In the earlier post you said no snapshots and then immediately started talking about a clone VM - it wasn't clear if your statement applied to the original or the clone. Your most recent comments incline me to believe you have not used snapshots.

Ok, lets review the evidence.

First sign of trouble was that you got a "locked write" status for the VDI. That's disturbing since with the VM shut down there should be nothing asserting a lock on the file. It's possible that you only hibernated the VM instead of properly shutting it down?

You cloned the hard disk. As I've mentioned before, in fact a simple copy would have been better as it would have been identical.

You then used sudo to override the protections and modify your original disk. I'm surprised that a Mac OS X host allows that.

Your command syntax looks odd to me, though I'm not a Mac user... You have a space in the path string "VirtualBox\ VMs". Does the '\' character act as a space escape on a Mac shell? If so that is still a puzzle since I thought the folder was called "VirtualBoxVMs" (no space) on a Mac. And is "/Users/homedir/" the standard path?

"No bootable medium found" means what it says. Either the hdd mounted in the VM is not bootable, or you don't have an hdd mounted (also no CD etc). Are you absolutely sure this VM was working on this host before you started messing?


Please provide the following additional data (please be careful to provide everything):
A zip file containing the most recent VM log (The VM log file is called "VBox.log" and can be found in the "Logs" subfolder of the VM folder).
In the same zip, a copy of the .vbox file for the VM.
A directory listing of the VM folder, and the VM/Snapshots subfolder.
Post the zip file as a message attachment here.
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 2. Feb 2013, 01:37

A couple of things:

-- By the way i followed this URL:
http://www.gubatron.com/blog/2011/08/29 ... ve-on-mac/

1) I know that it was powered off since shutdown the OS. How can i confirm next time the VM was fully powered off?

2) You mentioned a copy would have been better. How would I accomplish that?

3) I used sudo since i thought that command needed elevated privs

4) Spaces not an issue, but I used tab completion to get to the VDI file :)

5) Yes, this VM was working. My primary VM to do all my work tasks. I had another VM on another host that i'm using, but this windows 7 VM was my primary and there was lots of data that at this point not sure if i can get it back.

Here is what you requested:
$ ls Snapshots/
$
$ ls
Logs Snapshots Win7.vbox Win7.vbox-prev Win7.vdi
$
Attachments
vbox.zip
This file contains the two files you requested
(16.14 KiB) Downloaded 8 times
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Re: virtualbox 4.1.12 vdi expansion failed

Postby mpack » 2. Feb 2013, 10:54

Well, I still don't know what you've done to that disk, but it looks like its time to try recovering from it.

  • First, make a backup of the .vbox file (in fact the .zip you uploaded here contains a copy).
  • Next, you need to copy that clone VDI you created into the VM folder, alongside the existing VDI.
  • Use File|Virtual Media Manager to Release and then Remove the existing VDI.
  • Use the VM settings Storage section to mount the clone vdi in the VM (this should be safe now that we have established that you haven't used snapshots).
  • Start the VM and see what happens.
mpack
Site Moderator
 
Posts: 29186
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: virtualbox 4.1.12 vdi expansion failed

Postby elchap1n » 2. Feb 2013, 17:23

>> where you able to see the link I sent as those are the instructions I used - were those incorrect?

First, make a backup of the .vbox file (in fact the .zip you uploaded here contains a copy).
>> what method do I use to backup since they way I clone (per the link) you mentioned was not good. How do you recommend I backup?

Next, you need to copy that clone VDI you created into the VM folder, alongside the existing VDI.
>> Do I just do a the simple linux command 'cp' or 'mv'?

Use File|Virtual Media Manager to Release and then Remove the existing VDI.
>> Do I do this by going to settings->storage-> then in the storage tree, under sata controller, select the VDI file, and click the '-' to remove?

Use the VM settings Storage section to mount the clone vdi in the VM (this should be safe now that we have established that you haven't used snapshots).
>> >> Do I do this by going to settings->storage-> then in the storage tree, under sata controller, select the clone file and click the '+' to add?

Start the VM and see what happens.


Also, any luck from seeing the logs to find out if I can recover the original VM?
elchap1n
 
Posts: 21
Joined: 29. Jan 2013, 22:50

Next

Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: netsrak and 12 guests