all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs cannot write file in a Virtual Box shared folder
@ 2019-10-21  9:22 Bernardo
  2019-10-22 14:35 ` Robert Pluim
  2019-10-22 14:43 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Bernardo @ 2019-10-21  9:22 UTC (permalink / raw)
  To: help-gnu-emacs


Greetings,

Running GNU Emacs in Debian (9.11) VM guest under VirtualBox host (6.0.14) running on Windows 10 box.
(hope all this makes sense)

Am having problems editing files located in a Virtual Box shared
directory. The directory is owned by root but members of 'vboxsf'
group have read/write/execute rights.  Emacs user is a member of
'vboxsf' group.

 $ groups
  some_user cdrom sudo audio <snip> bluetooth vboxsf

The (old) version of Emacs that comes with Debian reads/writes files ok;
  GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian

The version of Emacs that's built from Git repos cannot write
file. Also by default it opens the file in read-only mode.
  GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-10-21

Debugger entered--Lisp error: (file-error "Unlocking file" "Operation not permitted" "/media/sf_Home/zz_stuff")
  write-region(nil nil "/media/sf_Home/zz_stuff" nil t "/media/sf_Home/zz_stuff")
  basic-save-buffer-2()
  basic-save-buffer-1()
  basic-save-buffer(t)
  save-buffer(1)
  funcall-interactively(save-buffer 1)
  call-interactively(save-buffer nil nil)
  command-execute(save-buffer)

Other editors (GNU nano) within the VM read/write the same files correctly.
Sounds like a bug?

--
cheers






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs cannot write file in a Virtual Box shared folder
  2019-10-21  9:22 Emacs cannot write file in a Virtual Box shared folder Bernardo
@ 2019-10-22 14:35 ` Robert Pluim
  2019-10-23 10:07   ` Bernardo
  2019-10-22 14:43 ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2019-10-22 14:35 UTC (permalink / raw)
  To: Bernardo; +Cc: help-gnu-emacs

>>>>> On Mon, 21 Oct 2019 20:22:04 +1100, Bernardo <bernardo.bacic@pobox.com> said:

    Bernardo> Greetings,

    Bernardo> Running GNU Emacs in Debian (9.11) VM guest under VirtualBox host (6.0.14) running on Windows 10 box.
    Bernardo> (hope all this makes sense)

    Bernardo> Am having problems editing files located in a Virtual Box shared
    Bernardo> directory. The directory is owned by root but members of 'vboxsf'
    Bernardo> group have read/write/execute rights.  Emacs user is a member of
    Bernardo> 'vboxsf' group.

    Bernardo>  $ groups
    Bernardo>   some_user cdrom sudo audio <snip> bluetooth vboxsf

    Bernardo> The (old) version of Emacs that comes with Debian reads/writes files ok;
    Bernardo>   GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian

    Bernardo> The version of Emacs that's built from Git repos cannot write
    Bernardo> file. Also by default it opens the file in read-only mode.
    Bernardo>   GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-10-21

    Bernardo> Debugger entered--Lisp error: (file-error "Unlocking file" "Operation not permitted" "/media/sf_Home/zz_stuff")
    Bernardo>   write-region(nil nil "/media/sf_Home/zz_stuff" nil t "/media/sf_Home/zz_stuff")
    Bernardo>   basic-save-buffer-2()
    Bernardo>   basic-save-buffer-1()
    Bernardo>   basic-save-buffer(t)
    Bernardo>   save-buffer(1)
    Bernardo>   funcall-interactively(save-buffer 1)
    Bernardo>   call-interactively(save-buffer nil nil)
    Bernardo>   command-execute(save-buffer)

Looks like emacs is trying to create/delete a lockfile, and
failing. Does /media/sf_Home support symlinks?

You can work around this temporarily by customizing 'create-lockfiles'
to nil, but then emacs won't detect if youʼre editing the same file
from a different emacs session.

Robert



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs cannot write file in a Virtual Box shared folder
  2019-10-21  9:22 Emacs cannot write file in a Virtual Box shared folder Bernardo
  2019-10-22 14:35 ` Robert Pluim
@ 2019-10-22 14:43 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2019-10-22 14:43 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Bernardo <bernardo.bacic@pobox.com>
> Date: Mon, 21 Oct 2019 20:22:04 +1100
> 
> The version of Emacs that's built from Git repos cannot write
> file. Also by default it opens the file in read-only mode.
>   GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-10-21
> 
> Debugger entered--Lisp error: (file-error "Unlocking file" "Operation not permitted" "/media/sf_Home/zz_stuff")
>   write-region(nil nil "/media/sf_Home/zz_stuff" nil t "/media/sf_Home/zz_stuff")
>   basic-save-buffer-2()
>   basic-save-buffer-1()
>   basic-save-buffer(t)
>   save-buffer(1)
>   funcall-interactively(save-buffer 1)
>   call-interactively(save-buffer nil nil)
>   command-execute(save-buffer)
> 
> Other editors (GNU nano) within the VM read/write the same files correctly.
> Sounds like a bug?

Could be, it's hard to say.

Suggest to report this using report-emacs-bug, and if you can, include
strace information that shows which file operation involved in this
fails.  My guess is that Virtual Box has problems supporting symlinks
or something, but that's just a guess.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs cannot write file in a Virtual Box shared folder
  2019-10-22 14:35 ` Robert Pluim
@ 2019-10-23 10:07   ` Bernardo
  0 siblings, 0 replies; 4+ messages in thread
From: Bernardo @ 2019-10-23 10:07 UTC (permalink / raw)
  To: help-gnu-emacs

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Mon, 21 Oct 2019 20:22:04 +1100, Bernardo <bernardo.bacic@pobox.com> said:
>
>     Bernardo> Greetings,
>
>     Bernardo> Running GNU Emacs in Debian (9.11) VM guest under VirtualBox host (6.0.14) running on Windows 10 box.
>     Bernardo> (hope all this makes sense)
>
>     Bernardo> Am having problems editing files located in a Virtual Box shared
>     Bernardo> directory. The directory is owned by root but members of 'vboxsf'
>     Bernardo> group have read/write/execute rights.  Emacs user is a member of
>     Bernardo> 'vboxsf' group.
>
>     Bernardo>  $ groups
>     Bernardo>   some_user cdrom sudo audio <snip> bluetooth vboxsf
>
>     Bernardo> The (old) version of Emacs that comes with Debian reads/writes files ok;
>     Bernardo>   GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian
>
>     Bernardo> The version of Emacs that's built from Git repos cannot write
>     Bernardo> file. Also by default it opens the file in read-only mode.
>     Bernardo>   GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-10-21
>
>     Bernardo> Debugger entered--Lisp error: (file-error "Unlocking file" "Operation not permitted" "/media/sf_Home/zz_stuff")
>     Bernardo>   write-region(nil nil "/media/sf_Home/zz_stuff" nil t "/media/sf_Home/zz_stuff")
>     Bernardo>   basic-save-buffer-2()
>     Bernardo>   basic-save-buffer-1()
>     Bernardo>   basic-save-buffer(t)
>     Bernardo>   save-buffer(1)
>     Bernardo>   funcall-interactively(save-buffer 1)
>     Bernardo>   call-interactively(save-buffer nil nil)
>     Bernardo>   command-execute(save-buffer)
>
> Looks like emacs is trying to create/delete a lockfile, and
> failing. Does /media/sf_Home support symlinks?
>
> You can work around this temporarily by customizing 'create-lockfiles'
> to nil, but then emacs won't detect if youʼre editing the same file
> from a different emacs session.
>
> Robert
>

Thanks Robert and Eli.

You were spot on, the symlinks cannot be created on this file system,
vboxsf, which seems to be a layer on top of NTFS.

  $ mount | grep sf_Home
  Home on /media/sf_Home type vboxsf (rw,nodev,relatime,<snip>

  $ ln -s zz_stuff my_link
  ln: failed to create symbolic link 'my_link': Operation not permitted

Will be reporting this as a bug, the manual says:
   (1) If your file system does not support symbolic links, a regular
       file is used.
       
 M-: (info "(emacs) Interlocking") RET

It looks like the old version of Emacs (24.5.1) was creating lock files
elsewhere and not in the directory where the edited file is located.


--
cheers



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-23 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21  9:22 Emacs cannot write file in a Virtual Box shared folder Bernardo
2019-10-22 14:35 ` Robert Pluim
2019-10-23 10:07   ` Bernardo
2019-10-22 14:43 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.