Error: invalid arch independent ELF magic, while loading a VirtualBox machine with Ubuntu Tinyos

8,826

This happens when the GRUB core image (the boot loader's first stage) is built for a different CPU architecture than the modules that it tries to load from /boot/grub. (Here's the check you're running into, modulo slight typographical changes that have been made since then; it's called from here.) This suggests a serious error when installing the OS. It doesn't directly relate to 64-bit support in the VM or anything like that, although it's of course possible that that kind of thing might have confused the OS installer into doing the wrong thing somehow.

Since you asked this several years ago, it's possible that you've solved it by now, that you've given up, or that simply reinstalling with a newer version of Ubuntu will help. But if none of those things are true:

  • Ensure that the disk image was clean before you installed the virtual machine guest. This sort of thing might happen if you have bits of GRUB left over from a previous installation.
  • Make sure you aren't doing anything funny like trying to boot the guest using a boot loader that wasn't installed by the guest OS installation.
  • Make sure the process of installing the guest was as simple as possible. There usually isn't much reason to have something like a complicated partitioning setup in a VM guest, and that sort of thing just introduces ways that things can go wrong.
Share:
8,826

Related videos on Youtube

Hassan Samii
Author by

Hassan Samii

student (computer network engineering)

Updated on September 18, 2022

Comments

  • Hassan Samii
    Hassan Samii over 1 year

    I've created a virtual machine with Ubuntu (having TinyOS). The problem arises when I start the machine. I immediately get a black screen with written:

    GRUB loading.
    error: invalid arch independent ELF magic
    grub rescue>
    

    What kind of a problem is it, and more importantly how can I solve it? I tried it on my laptop which has Windows 7 64 bit, and so I also tried it on my Ubuntu partition and also with Ubuntu, once I launch the virtual machine I get the same error!

    • Jeff Hewitt
      Jeff Hewitt about 11 years
      What architecture(s) do your host and guest have? This may simply be a case of 64-bit support not being enabled for virtual machines.
    • Jeff Hewitt
      Jeff Hewitt about 11 years
      Then you may be looking at the opposite case. Check the processor settings of the virtual machine. Are you trying to install 32-bit TinyOS on a 64-bit VM? It doesn't seem that the installation should fail though...