Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.