help me destroy my VM

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Aki
Posts: 6
Joined: 5. May 2009, 06:15
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xubuntu-CentOS-Windoze

help me destroy my VM

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: help me destroy my VM

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: help me destroy my VM

Post 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 ;)
Aki
Posts: 6
Joined: 5. May 2009, 06:15
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xubuntu-CentOS-Windoze

Re: help me destroy my VM

Post 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 !
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: help me destroy my VM

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Aki
Posts: 6
Joined: 5. May 2009, 06:15
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xubuntu-CentOS-Windoze

Re: help me destroy my VM

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: help me destroy my VM

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Aki
Posts: 6
Joined: 5. May 2009, 06:15
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xubuntu-CentOS-Windoze

Re: help me destroy my VM

Post by Aki »

Wow, nice tip...

Very interesting info. Thanks!
Post Reply