While I was asleep, my Windows host rebooted for some unknown reason (not a Windows update - apparently something crashed). Now I can’t restart my CentOS7 VM running on VirtualBox and Vagrant (originally built with a tool called PHPpet that creates puppet manifests with an online interface, but I haven’t provisioned it in years). I know it’s an old box and configuration - I am building a modern Debian replacement in my spare time, but it’s a big learning curve and I haven’t had much time to work on it (I need some specialized structure for my webserver). But this VM has been working fine until now, so either something got corrupted or I’m not restarting it correctly. I’m a programmer, not a sysadmin, so please bear with me if I say dumb things.
I didn’t really know what state the machine was in, so I first tried vagrant up
, hoping that if resume
was really what was needed, Vagrant would be smart and just do that. It failed to mount /sbin/mount.vboxsf
and mentioned VirtualBox Guest Additions. So I looked at VirtualBox, which said the box was “Saved”, whatever that means. I then tried vagrant resume
- it ended with exit code 0 but gave weird output along the way (mojibake characters at the beginning and end of path names, causing it to not find folders it was looking for) and of course didn’t function as a webserver. So I ran vagrant halt
, rebooted to make sure VirtualBox was clean, then tried vagrant up
again. Same result as the first time except that now VirtualBox says it’s running. Here’s the error portion of the vagrant up
output:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
In SSH, I looked for what it said was the problem. /sbin/mount.vboxsf
is a symbolic link to /usr/lib64/VBoxGuestAdditions/mount.vboxsf
, which appears to exist:
[root@7and7](02:32:55)[~]$ ls -l /usr/lib64/VBoxGuestAdditions/mount.vboxsf
-rwxr-xr-x. 1 root root 19152 Sep 13 2016 /usr/lib64/VBoxGuestAdditions/mount.vboxsf*
The bit about possibly being a “faulty Vagrant box” scares me, because the server is no longer what the ancient puppet manifests would build - when I customized the server for my needs, I tried to figure out how to edit the puppet files to match, but the labyrinth of files PHPpet created was too much to decipher, so I gave up and just made sure I never typed vagrant destroy
. If I can’t fix this, I’ll need to do all my code testing on the production server until I can get time to finish building the new VM, fixing all the deprecated code to run on that VM, and building a matching production server (involving not just a webserver but mail and other stuff I don’t yet know how to set up).
I do have backups of all files on my PC, but I don’t know if restoring something would work or not, or what I should do in VirtualBox to coordinate with such a bruteforce action. The 7and7.dev
folder contains:
- Logs (folder, 882 kB)
- Snapshots (folder, empty)
- centos72-disk1.vmdk (8.81 GB; the filename is misleading - it’s actually 7.9 now)
- 7and7.dev.vbox (7.55 kB)
- 7and7.dev.vbox.prev (7.55 kb)
All the files have current timestamps since the crash, and all except one log file are within a few minutes of when I last tried a Vagrant command. If you think I should restore some or all of this from before the crash, let me know how to do it gracefully (e.g. what state to have VirtualBox in when I do it) and any other tips.