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 broke my /etc/fstab file on my guest system in VirtualBox. How can I correct it? I tried virt-edit, but I can't get it working.

Guest OS: Debian

Host: Ubuntu

share|improve this question

migrated from stackoverflow.com Jan 15 '12 at 19:38

This question came from our site for professional and enthusiast programmers.

10  
You could try booting the VM from a recovery CD image (e.g. Ubuntu install disc), mounting the virtual drive, and fixing it through there. – Thomas Jan 15 '12 at 19:38

You have several options:

  1. Anything that would work on a real machine, would still work on a VM:

    • Use a rescue disk or live CD image to boot the system and correct your mistake.
    • Try booting into single-user mode - this should work, as long as your rootfs entry is correct and your distribution didn't mess up the filesystem hierarchy too badly.
    • Modify the kernel boot options to mount the proper rootfs and boot into /bin/sh directly.
  2. It is possible to view the VirtualBox drives as a disk and mount the filesystems on the host - I have described such a process in this old answer of mine.

share|improve this answer

You might also boot in single user mode and use vi or zile or emacs or nano (or some other terminal editor) to edit it

share|improve this answer

You must log in to answer this question.

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