Oops. Deleted .vmdk file. What can I do?

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
vmsys
Posts: 2
Joined: 21. Jul 2017, 12:02

Oops. Deleted .vmdk file. What can I do?

Post by vmsys »

Hey guys,

Hope someone can help me here. Really need to get back to work.

This morning my 120gb macbook air was filling up and I was prompted to remove some files. I had been playing around with Kali this week on another vm so decided to remove that to continue working on my Laravel apps. Unfortunately in a morning haze I deleted the wrong file :D

I am using virtual box + vagrant to run a Laravel development environment with Homestead
laravel [.] com/docs/5.4/homestead

Thankfully all my files are saved locally and mirrored on the vm so everything should be okay right?

When I try to 'vagrant up' and power on the vm I get error VERR_FILE_NOT_FOUND opening image file '/Users/user/VirtualBox VMs/homestead-7/box-disk1.vmdk' (VERR_FILE_NOT_FOUND) - the one I stupidly deleted. Lesson learned.

Inside the Virtual Box GUI -> homestead-7 (name of the machine) -> settings -> storage -> Controller SATA controller. Should I remove the reference to the deleted file and create a new one? Or should I delete this vm entirely and make a new one?

Can anyone tell me what to do? Would really appreciate some help here.

Thanks so much
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Oops. Deleted .vmdk file. What can I do?

Post by mpack »

First, we don't support Vagrant installations here.

I'll briefly confirm that if you remove the reference to the deleted vmdk then this will certainly stop VirtualBox complaining about missing media. However, if the VM needed that media to boot then the missing media error will be replaced by a boot error of some kind, probably "NO BOOTABLE MEDIUM FOUND". In that case your options are (a) restore the missing VMDK from your last backup, or (b) delete the VM and start again with a new one.
vmsys
Posts: 2
Joined: 21. Jul 2017, 12:02

Re: Oops. Deleted .vmdk file. What can I do?

Post by vmsys »

mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Oops. Deleted .vmdk file. What can I do?

Post by mpack »

Thanks for reporting back, however I don't see any VirtualBox "solution" there. The top answer only deals with Vagrant (which we don't care about), and the "solution" is to delete the VM and start again, which is the same answer and I gave above (option b).

I'll round off the discussion by mentioning that if anyone was expecting to see option (c) undelete the vmdk using a file undelete tool then the reason that option was not given was because in my experience it never works. Undelete sometimes works for very small files (a few K up to a few meg). IME it never works for files in the hundreds of megs, and certainly not for typical VMDKs/VDI/VHD which you can expect to be in the GBs.
Post Reply