Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu Server VM on a Mac OS X host. Stupidly, I have no recent snapshot of this VM (let this be a grim reminder to me).

My host was running slowly and erratically- low on RAM. While trying to change files on the VM, I received a constant "file system is read-only" error (similar to this question Ubuntu VM "read only file system" fix?). I shutdown the VM and restarted the computer, then opened Virtual Machine with no other applications running. Now, when I attempt to load the VM, I get a number of these errors on the start-up screen and then it freezes:

comm init: bad extended attribute block (some numbers here)

I am able to get to Recovery mode but don't have any experience in repairing a Linux machine. Is there anything I could do in Recovery mode, or otherwise, to attempt to save my virtual machine?

share|improve this question
If you have the vmdk files in a Time Machine backup, I'd recommend that you restore the whole VM. Otherwise you need to boot in rescue mode from the Ubuntu ISO and do an fsck on the disk, see this: for more information. – jaume Jan 28 '13 at 19:14
Thanks for that response. Do you know of an article showing how to restore a .vdi from TimeMachine back-up? I have restored the previous .vdi file to my desktop no problem, but I can't then attach it to the machine as it has the same UUID. – Ali Jan 29 '13 at 12:51
To answer my own question, this worked:… – Ali Jan 29 '13 at 13:01
Great, could you please add an answer your own question with a short description of what you did (you can add the link too, but please add a description, links get broken) and mark the question as answered? – jaume Jan 29 '13 at 13:04
up vote 0 down vote accepted

To answer my own question, as suggested above:

First I attempted to restore the Ubuntu file system using fsck and the instructions contained in this helpful video below:

Summarised, they are:

  • Assuming you have file system problems that can't be fixed while the file system is mounted:

    1. Download a Ubuntu Desktop disk image
    2. Attach the disk image to the VM and set it as first in the boot order
    3. Boot into the CD and click "Try Ubuntu"
    4. Run file recovery commands (such as fsck) that need the file system un-mounted from the Terminal in the CD version

This fixed a bunch of file system problems, but the machine was still hanging on start-up and I was running out of time for Linux System Recovery 101. So I decided to see if restoring from Time Machine back-up would work.

Roughly, that process goes like this:

  1. Restore known good back-up of VM to desktop
  2. Run a command to change the UUID of the restored VM. On my Mac, that was

    VBoxManage internalcommands sethduuid /path/to/my/restored/disk/image.vdi
  3. In VirtualBox, open the Settings for the broken machine, go to Storage, detach existing disk image and attach restored disk image
  4. Start-up & hold your breath.

That worked, although many of the files that ought to have been there weren't. Fortunately I have separate back-ups of those files, so have been able to restore it all with only, er, 1.5 days downtime.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .