Linux – Gedit won’t save a file on a VirtualBox share: Text file busy

filesgeditlinuxlockvirtualbox

I have a text file that I can change using other applications (for example openoffice). But when I try to change and save it using gedit, I am getting error from gedit:

Could not save the file /media/sf_Ubuntu/BuildNotes.txt.
Unexpected error: Error renaming temporary file: Text file busy

the permission of BuildNotes.txt is as follow:

-rwxrwx--- 1 root vboxsf  839 2012-10-26 12:08 BuildNotes.txt

and user id is:

m@m-Linux:/media/sf_Ubuntu$ id
uid=1000(m) gid=1000(m) groups=4(adm),20(dialout),24(cdrom),46(plugdev),105(lpadmin),119(admin),122(sambashare),1000(m),1001(vboxsf)

What is the problem and how I can fix it?

Best Answer

This problem has been reported since 2009 (example [archived]). It is awful that there's no fix for it yet. Neither VirtualBox nor Gedit developers are willing to take responsibility for it, and instead are content to point fingers at one another for over three years.

You can set your editor preferences to 'Create a backup' then save twice. Incredibly painful, but it works.

Some other editors won't report the problem. However, when I tested Kate and nano, for example, those just silently deleted the file on every other save. That's even worse than the gedit situation...

Related Question