1

Until this morning, my emacs setup (running on Arch Linux as a VirtualBox guest) was working absolutely fine. Then for no obvious reason I started experiencing the following issue:

If I opened an existing file for edit and immediately typed C-x C-s, I would receive the following message:

Wrote <filename>

and this would happen every time I typed C-x C-s, without actually editing the file. Whereas it should simply say

(No files need saving)

After wasting nearly the whole day trying to fix the problem, including upgrading VirtualBox related packages, I narrowed it down to the operation of the emacs function file-exists-p which is being called by save-buffer -> basic-save-buffer. The issue is that while file-exists-p works correctly in that it returns t for files which are on my Linux file system, it returns nil for files which are on my Windows 10 host which are shared through VirtualBox, mounted using VirtualBox's mount.vboxsf. This in turn is causing the following additional prompt to be displayed any time I actually modify a buffer of a file I have already opened:

<filename> has changed since visited or saved. Save anyway? (y or n)

which of course it hasn't, but the code believes it has since file-exists-p is returning nil.

My question is why is file-exists-p behaving in this way? Is it a problem with the function itself, or some other problem perhaps with the way the mounting is working? Is there some way to determine where the problem actually lies, and most important of all, how to fix it?

I am running:

Windows 10 (as host)

VirtualBox 5.2.18 (with Virtual Guest Additions installed on guest)

Arch Linux (as guest, Kernel 4.18.14)

Emacs 26.1

1

It turns out that there was a deeper issue involving VirtualBox and ArchLinux. For those who run across the same issue, I did the following to fix it:

  • Downloaded the latest VirtualBox host for Windows, version 5.2.20
  • Added the VBoxGuestAdditions.ISO that comes with it (on my system in c:\Program Files\Oracle\VirtualBox) as a Storage Device under Settings in the VBox GUI
  • Booted up my Arch Linux system, and mounted the CD ROM to a folder under /media
  • Uninstalled the locally installed virtualbox-guest-utils (via pacman -R virtualbox-guest-utils)
  • Ran (as root): sh VBoxLinuxAdditions.run

And that fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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