[Solved] Failed to start virtual machine. please help me!

Discussions related to using VirtualBox on Windows hosts.
Post Reply
BVO
Posts: 5
Joined: 7. Sep 2015, 12:45

[Solved] Failed to start virtual machine. please help me!

Post by BVO »

please help me! :(
Failed to start the virtual machine Win 7 Ultimate SP1 x64.

Could not open the medium 'C:\Users\MyPC\VirtualBox VMs\Win 7 Ultimate SP1 x64\Window 7 Ultimate SP1 x64 Integrated April 2012.vdi'.

VDI: invalid pre-header in 'C:\Users\MyPC\VirtualBox VMs\Win 7 Ultimate SP1 x64\Window 7 Ultimate SP1 x64 Integrated April 2012.vdi' (VERR_VD_VDI_INVALID_HEADER).

VD: error VERR_VD_VDI_INVALID_HEADER opening image file 'C:\Users\MyPC\VirtualBox VMs\Win 7 Ultimate SP1 x64\Window 7 Ultimate SP1 x64 Integrated April 2012.vdi' (VERR_VD_VDI_INVALID_HEADER).

Result Code: E_FAIL (0x80004005)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Why? what's the solution? :?:
Screenshoot
Screenshoot
Failed VM.png (113.16 KiB) Viewed 13252 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

You have corrupted the VDI somehow - perhaps you tried to edit it in Word or something. No problem, just restore it from a backup.
BVO
Posts: 5
Joined: 7. Sep 2015, 12:45

Re: Failed to start the virtual machine. please help me!

Post by BVO »

I do not have a reserve. how do I restore it.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

If you don't have a backup then there is no guarantee that your data can be restored - otherwise people wouldn't need to make backups.

However, try this. Download the frHed hex editor. Use it to open the VDI (you'll need to use File|Open partially...), and save the first 2MB to a file. Zip the binary file and attach the zip here. I will take a look.

Also provide the following information:
  1. Confirm whether the VDI was dynamic or fixed size.
  2. The logical (maximum) size of the disk selected at creation time.
  3. The current exact size (in bytes) of the VDI file.
BVO
Posts: 5
Joined: 7. Sep 2015, 12:45

Re: Failed to start the virtual machine. please help me!

Post by BVO »

I do not know for sure how to use the tool frHed hex editor but I try.

1. dynamic
2. 20.00 GB
3. 20.1 GB (21,685,600,256 bytes)
Attachments
FileFrhedBin.zip
FileFrhed
(450 Bytes) Downloaded 158 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

You have only provided the first 52000 bytes, whereas I asked for the first 2MB (2*1024*1024 bytes).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

Happily, in your case it looks like it really is only the preheader which has been damaged, so I don't need to see the extra data. Repair is quite easy, discussed in my first post in this older topic :-

viewtopic.php?f=6&t=45192

Of course you should make a backup of the VDI before attempting a hack such as this.
BVO
Posts: 5
Joined: 7. Sep 2015, 12:45

Re: Failed to start the virtual machine. please help me!

Post by BVO »

I do not know, can fix or not, so what should I replace

please help find a solution and get it done. guide me step by step.
hopefully God repay goodness you.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

Is the instructions in the other post not quite simple?

You have corrupted the "pre header" which is 72 bytes of mostly human readable bytes at the beginning of a VDI file. This corruption is not serious because the preheader simply marks this file as a VDI, the contents of the preheader are the same for all VDIs - it contains no variable data.

I suggest that you view a known good VDI to see this header for yourself. Any VDI will do. If you have no other VDIs then create a dummy new VM.

To repair your header simply copy the first 72 bytes from the good VDI to the bad VDI. In detail :-
  1. In FrHed use "File|Open partially..." to open the first 4096 bytes of the GOOD VDI.
  2. In another FrHed instance use "File|Open partially..." to open the first 4096 bytes of the BAD VDI.
  3. In the "good" FrHed select the first 72 bytes and use Ctrl+C to copy it to the clipboard.
  4. In the "bad" FrHed paste the 72 bytes from the clipboard at position 0.
  5. Save the changes to the bad FrHed then close both FrHed instances.
  6. The VDI is now repaired.
Make a backup of the bad VDI before you start, so you can't make things worse.
BVO
Posts: 5
Joined: 7. Sep 2015, 12:45

Re: Failed to start the virtual machine. please help me!

Post by BVO »

SOLVED!
Ok Mpack! Thanks for your help!
your is the best.
hopefully God repay goodness you.
thank very much!

just share.
may exist that have the same problem.
Attachments
Solved.gif
Solved.gif (120.57 KiB) Viewed 13114 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Failed to start the virtual machine. please help me!

Post by mpack »

I'm glad you got it working, thanks for reporting back.

If I might suggest: the cause of the original corruption is still unexplained, so I would starting making regular backups of the VM folder. Also, if the VM contains any particularly vital files then these should be backed up outside the VM somewhere.
loveVB
Posts: 12
Joined: 28. Jul 2018, 09:27

Re: Failed to start the virtual machine. please help me!

Post by loveVB »

Hi mpack,

Could you please help me take a look at my thread which describes a very similar problem I have encountered? This really destroys my life. Please see below.

My thread: viewtopic.php?f=6&t=88891&p=426076#p426076

Thanks in advance.
Last edited by socratis on 29. Jul 2018, 16:40, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Post Reply