vmware / open-vm-tools

Official repository of VMware open-vm-tools project
http://sourceforge.net/projects/open-vm-tools/
2.26k stars 427 forks source link

Drag and drop fails when cancelling drop and blockFd locks (+ workaround) #445

Open atorrescogollo opened 4 years ago

atorrescogollo commented 4 years ago

Behaviour

I've installed and enabled open-vm-tools-desktop package in Debian. And, something fails very often when dragging and cancelling drop. This failure causes blockFd flag to lock file descriptor for other drag/drop actions.

The following processes are running at the beginning:

root@debian:~# ps aux | grep vm
root        178  0.0  0.0      0     0 ?        S    00:00   0:00 [irq/16-vmwgfx]
root        328  0.0  0.0 186768   548 ?        Ssl  00:00   0:00 vmware-vmblock-fuse /run/vmblock-fuse -o rw,subtype=vmware-vmblock,default_permissions,allow_other,dev,suid                                                      
root        476  0.3  0.5  48652 11804 ?        Ss   00:00   0:00 /usr/bin/vmtoolsd
root        702  1.0  1.8 331388 36620 ?        Sl   00:00   0:00 /usr/bin/vmtoolsd -n vmusr --blockFd 3
root        756  0.0  0.0   6076   820 pts/1    R+   00:01   0:00 grep vm

Note that vmtoolsd is executed with --blockFd 3 parameter.

When I drag but don't drop, something weird happens: the file appears to be locked and its icon moves to the top right of the screen as shown in the picture. LockedIcon

The locked icon does not dissapear until the process with the blockFd flag is killed. In my case: kill -9 702

Now, drag and drop is locked in the file manager and systemctl restart open-vm-tools.service doesn't do anything useful: it only relaunchs the process with pid=476 (/usr/bin/vmtoolsd).

Also, executing vmware-user-suid-wrapper relaunchs the killed process (/usr/bin/vmtoolsd -n vmusr --blockFd 3), but the problem persists.

Workaround ( Not clean at all )

root@debian:~# ps aux | grep vm
root        178  0.0  0.0      0     0 ?        S    00:00   0:00 [irq/16-vmwgfx]
root        328  0.0  0.0 260636   548 ?        Ssl  00:00   0:00 vmware-vmblock-fuse /run/vmblock-fuse -o rw,subtype=vmware-vmblock,default_permissions,allow_other,dev,suid                
root       1545  0.1  0.5  48652 11168 ?        Ss   00:33   0:00 /usr/bin/vmtoolsd
root       1653  7.0  1.7 257780 36288 pts/1    Sl   00:37   0:00 /usr/bin/vmtoolsd -n vmusr --blockFd 3
root       1658  0.0  0.0   6076   884 pts/1    S+   00:38   0:00 grep vm
  1. Kill /usr/bin/vmtoolsd -n vmusr --blockFd 3 and vmware-vmblock-fuse:
    root@debian:~# kill -9 1653 328
    root@debian:~# ps aux | grep vm
    root        178  0.0  0.0      0     0 ?        S    00:00   0:00 [irq/16-vmwgfx]            
    root       1545  0.1  0.5  48652 11168 ?        Ss   00:33   0:00 /usr/bin/vmtoolsd
    root       1944  0.0  0.0   6076   880 pts/1    S+   00:51   0:00 grep vm
  2. Run vmware-user-suid-wrapper without vmblock process (Note "could not open" message):
    
    root@debian:~# vmware-user-suid-wrapper 
    vmware-user: could not open /proc/fs/vmblock/dev
    (vmware-user:2041): Gtk-WARNING **: 00:56:03.485: gtk_disable_setlocale() must be called before gtk_init()

root@debian:~# ps aux | grep vm root 178 0.0 0.0 0 0 ? S 00:00 0:00 [irq/16-vmwgfx] root 1545 0.1 0.5 48652 11860 ? Ss 00:33 0:01 /usr/bin/vmtoolsd root 2041 2.4 1.8 331348 36664 pts/1 Sl 00:56 0:00 /usr/bin/vmtoolsd -n vmusr root 2050 0.0 0.0 6076 884 pts/1 S+ 00:56 0:00 grep vm

   **Note that `--blockFd 3` parameter is no longer used for `/usr/bin/vmtoolsd -n vmusr`**

3. Relaunch vmblock process:

root@debian:~# systemctl list-unit-files | fgrep vmblock run-vmblock\x2dfuse.mount enabled

root@debian:~# systemctl restart 'run-vmblock\x2dfuse.mount'


4. `usr/bin/vmtoolsd -n vmusr` is running without `blockFd` flag, so that file descriptor will not be locked on failure:

root@debian:~# ps aux | grep vm root 178 0.0 0.0 0 0 ? S 00:00 0:00 [irq/16-vmwgfx] root 1545 0.1 0.5 48652 11860 ? Ss 00:33 0:02 /usr/bin/vmtoolsd root 2041 0.2 1.8 331348 36664 pts/1 Sl 00:56 0:01 /usr/bin/vmtoolsd -n vmusr root 2226 0.0 0.0 195100 572 ? Ssl 01:03 0:00 vmware-vmblock-fuse /run/vmblock-fuse -o rw,subtype=vmware-vmblock,default_permissions,allow_other,dev,suid root 2234 0.0 0.0 6076 888 pts/2 R+ 01:03 0:00 grep vm

vmwzhangv commented 4 years ago

Without the blockFd, I doubt the DND still works though...

atorrescogollo commented 4 years ago

It is working for me although the file keeps visually blocked (icon on top of the screen). The difference I have noticed is that the file is not blocking the file descriptor for future drag and drop motions. Anyway, I think this issue is more related with cancelling the drop action. I mean: drag the file from the host, move it over guest file manager and drop it on the host instead of on the guest.

shrout1 commented 4 years ago

I have the same exact problem in Ubuntu 20.04 running VMWare Player 15.5.6 build 16341506. Annoying.

ravindravmw commented 4 years ago

Thanks for reporting this issue. I have filed an internal bug to track this issue.

Could you please provide the details of open-vm-tools version (vmtoolsd -v) along with the hypervisor product version details? It helps isolate issues that have been fixed already vs a new issue.

Hope someone will get back if more details are required.

atorrescogollo commented 4 years ago

open-vm-tools version:

$ vmtoolsd -v
VMware Tools daemon, version 10.3.10.10540 (build-12406962)

VMware version:

Product: VMware® Workstation 16 Pro
Version: 16.0.0 build-16894299
atorrescogollo commented 3 years ago

open-vm-tools version:

$ vmtoolsd -v
VMware Tools daemon, version 10.3.10.10540 (build-12406962)

VMware version:

Product: VMware® Workstation 16 Pro
Version: 16.0.0 build-16894299

It seems there was some extra issues with my machine. It is working in a new installation so those versions do not break DnD.

However, the icon still appears in the top-left corner when drop is cancelled

CheariX commented 3 years ago

I'm experiencing the same problem. Any news on that?