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

link|improve this question
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 at 19:38
feedback

migrated from stackoverflow.com Jan 15 at 19:38

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

2 Answers

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.

link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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