Page 1 of 1
help me destroy my VM
Posted: 13. May 2009, 06:08
by Aki
I'm testing a product that runs over a corrupted file system in centos linux, which is the guest in a jaunty host.
I need to somehow corrupt the guest image to force the linux boot process to stop when requesting to run fsck or enter root password.
Up to now, I've tried abruptely shuting down the guest but seems not to be enough. Ideally I would need to create a 'bad sector' in the guest so that linux cannot finish booting.
So any suggestions on how this can be done are very welcome. Thanks.
Re: help me destroy my VM
Posted: 13. May 2009, 14:27
by Sasquatch
Your question isn't really in the scope of this forum. You can get the same situation on a bare metal install.
There is a small thing that you could try. If you install a new kernel on the system, e.g. 2.6.29 from
http://kernel.ubuntu.com/~kernel-ppa/mainline and abort the VM (pull the plug, so to speak) during installation, you might get a half installed kernel that won't boot properly.
Re: help me destroy my VM
Posted: 13. May 2009, 14:45
by fixedwheel
Aki wrote:I need to somehow corrupt the guest image to force the linux boot process to stop when requesting to run fsck or enter root password.
boot the virtual machine with a live-CD .iso e.g. Ubuntu desktop installation CD and from there use dd on the virtual disk partition(s). See the filesystem documentation for which places to treat (superblock?)
and consider that RHEL/Centos default is to allocate the ext3 partitions under LVM, so choose your target right

Re: help me destroy my VM
Posted: 15. May 2009, 18:40
by Aki
Thanks. I'll try both and see.
I don't quite understand why this question wouldn't be in the scope of this forum.
All I need is the boot secuence to stop at some point past the bootloader to test. Seems a fair use to me.
Thanks anyway !
Re: help me destroy my VM
Posted: 15. May 2009, 20:35
by Sasquatch
It may seem fair use, but as I said before, this can be done without the use of VB. Just go to a random linux forum and ask or search there for how to trash the boot process. No VM needed or anything like that. You can do the same on a normal PC.
Good luck in your quest for corruption.
Re: help me destroy my VM
Posted: 17. May 2009, 13:20
by Aki
I think I understand you point now, my question appearing to be more of a Linux/CentOS question than a VBox one.
Perhaps if I'd asked more specifically the background issue that brought me here would help: How can I emulate/create a "physical" bad block in a virtual hd in virtualbox?
Thanks to all for your previous answers. I'll try them.
Re: help me destroy my VM
Posted: 17. May 2009, 22:12
by Sasquatch
If you really want to mess it up, you could open the VDI in a hex editor and change a bit. But keep in mind, that by doing that, you might actually break the file itself and VB won't be able to use it. Please read the
Tutorial: All about VDIs for some more information on the VDI file.
If you're able to, read the source code which might help you understand how the file is actually build.
Re: help me destroy my VM
Posted: 21. May 2009, 13:45
by Aki
Wow, nice tip...
Very interesting info. Thanks!