changes to macOS folder does not trigger inotify in Linux guest (parallels shared folder)

Discussion in 'Linux Virtual Machine' started by CharlB, Sep 1, 2017.

  1. CharlB

    CharlB Bit poster

    Messages:
    7
    My use case is this: I have source code on my macOS filesystem, which I edit there using an IDE. That same code is transpiled and executed in a Linux guest, via Parallels Shared Folders (PSF). In the Linux guest, tools like node are using inotify to know when to re-run the compilation.
    The problem: Changes on the macOS side are NOT triggering any inotify events in the Linux guest, so the watchers don't know when to recompile.
    I can also reproduce this issue using the Linux tool inotifywait. Creating a new file from macOS on the shared folder does not trigger any events.
    Interestingly, changes initiated from the Linux host on the macOS hosted PSF *do* trigger inotify events.
     
  2. rkulikov

    rkulikov Parallels Developers

    Messages:
    313
    Yep, Parallels Desktop doesn't support inotify in Linux Shared Folders now.
     
  3. CharlB

    CharlB Bit poster

    Messages:
    7
    Thanks for the info. Do you know if there are any plans to implement it?
     
  4. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    I just downloaded Parallels 14 and now my Centos 6 and Centos 7 VMs do not propagate local local Mac file changes to the VM. Is there no solution for this? Is Parallels a Windows only VM now?
     
  5. rkulikov

    rkulikov Parallels Developers

    Messages:
    313
    > ... and now my Centos 6 and Centos 7 VMs do not propagate local local Mac file changes to the VM.

    Do you mean that file being changed on host is not changed on the guest side? I.e. something like their hashes become different?
     
  6. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    Yes that is exactly what I mean. An edited file on the host Mac does not propagate to the Linux VM. So when developing and testing in the browser changes are not reflected. If I edit the file directly from the VM it works fine.

    I have an open ticket about this and will write up my findings here if it is resolved.
     
  7. rkulikov

    rkulikov Parallels Developers

    Messages:
    313
    @RyanO2, can you please provide here steps to reproduce this issue in as much details as possible.
     
  8. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    To replicate the issue is quite simple. E.g. From the VM open /media/psf/Home/Sites/my-file.php and make edits. The edits are saved and are reflected in the host machine.

    Then open the same file on the host machine e.g. /Sites/my-file.php and make edits. The edits are saved, but the changes are NOT made in the VM. This means that when developing, files changed on the host machine are not propagated to the VM unless the VM is re-booted. Not a great development workflow ;-)
     
  9. rkulikov

    rkulikov Parallels Developers

    Messages:
    313
    @RyanO2, it would be great to get a little bit more details from you to reproduce the problem. What applications do you use modify/view files, how do you save changes? For example, my steps which don't reproduce the issue:
    0. Create fresh CentOS 7 virtual machine, Parallels Tools for Linux installed.
    1. Log in into the guest graphical session.
    2. Open a file from Shared Folders (/media/psf/Home/test_dir/test_file.txt) with a default text editor (gedit).
    3. Add a line "test" at the edit of this file, press "Save" button and exit gedit.
    4. Make sure file is changed on the host:
    $ tail -n1 ~/test_dir/test_file.txt
    test

    5. Edit file on the host side:
    $ vim ~/test_dir/test_file.txt
    -- add a line "test2" at the end of the file, save and exit from editor :wq vim command).
    6. Check the file on host:
    $ tail -n2 ~/test_dir/test_file.txt
    test
    test2

    7. Open this file (/media/psf/Home/test_dir/test_file.txt) in the guest once again with gedit and see that there's "test2" at the end.
     
  10. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    I use gedit on the VM and VSCode on my Mac. It all worked fine on Parallels Desktop 11.
     
  11. rkulikov

    rkulikov Parallels Developers

    Messages:
    313
    I've tried VSCode on Mac - everything is still ok for me. Need to be sure that is still required to explicitly save file in VSCode (Cmd-S) to make modification go to file system.
     
  12. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    I'm glad it works for you. I have of course been saving my files.
     
    Last edited: Sep 19, 2018
  13. RyanO2

    RyanO2 Bit poster

    Messages:
    6
    Some further information. I tried all networking modes on Parallels Desktop 14. None of them worked. I then rolled back to Parallels Desktop 13 and re-installed Parallels Tools. Everything works as it should now. I have included the spec of my Mac below.
     

    Attached Files:

  14. SalvatoreC3

    SalvatoreC3 Bit poster

    Messages:
    1
    I've had the same problem of RynaO2 and the only way to fix the problem has been to rollack to Parallels Desktop 13.
    Here a few more info:
    1. create VM with Ubuntu
    2. install apache 2.4
    3. for apache, set root at /media/psf/Home/WebDev/www
    4. create file /media/psf/Home/WebDev/www/index.html
    5. write 'hello world' in index.html from VM;
    6. open index.html with text editor both in VM and Mac. I see all of che changes;
    7. set a new host edit-file.local on Mac and Ubuntu that is handled by apache on VM;
    8. open index.html with chrome under both OS. Up to here everything works perfectly;
    9. edit index.html from Mac with text-editor;
    10. run index.html with chrome under both OS. I cannot see the changes;
    11. open index.html with a text-editor under VM. I can see the changes;
    12. open index.html with a text-editor under Mac. I can see the changes;
    13. run again point 10. I cannot see the changes;
    14. run again point 11 and save (without doing any changes) and run point 10. I can see the changes.
    Rollback to Parallel Desktop 13 and everything works perfectly. No matter what I use to edit the file or from where, it just works.
     
  15. Giorgio2

    Giorgio2 Bit poster

    Messages:
    4
    Same as Salvatore C3. Only solution is to rollback to Parallels Desktop 13.
    Under Parallels 14 running Ubuntu 16.04, Apache serves old version of the files until you reboot the VM o restart Apache.
    My config is the same of SalvatoreC3 (php and html are on the Mac and are edited from there), Apache root is set to the (shared) folder (/media/psf/Home.. etc)
    I have tried latest build available at today (45387), same issue. Simply rollback to Parallels 13 and all work as aspected.
     
  16. NickK6

    NickK6 Bit poster

    Messages:
    3
    Just chiming in that I am also experiencing this with OSX Host and Ubuntu 18.04 guest. I'm running PHP-FPM and it looks like php-fpm is reading old / corrupt files. Code runs fine when copied directly onto the guests disk. Going to rollback to 13 - have a ticket in play.
     
  17. Guys, Parallels Desktop 14 update has been released. Please update your Parallels Desktop to the latest build (14.1.1-45476) and check the issue.
    You can download the update manually here.
    Let us know the results.
     
    Last edited by a moderator: Feb 6, 2019
  18. Giorgio2

    Giorgio2 Bit poster

    Messages:
    4
    Tried 1.4.2 and the problerm is gone. Thanks.
     
  19. NicolasW1

    NicolasW1 Bit poster

    Messages:
    1
    I have the same issue and its not gone :-(

    Host: macOS 10.14.3
    Parallels Desktop: 14.1.2 (45479)
    Guest: Ubuntu 18.04.2 LTS

    If I change files on the Mac my guest linux doesn't get the changes via inotify ...

    That's really bad, because all npm "watch" jobs don't trigger if I change any file via VSCode or other IDE.
     
    BobZ1 likes this.
  20. DevMarius

    DevMarius Bit poster

    Messages:
    1
    It seems that inotify still doesn't work with Ubuntu guests :(

    Host: macOS 11.0.1 (20B29)
    Parallels Desktop: 16.1.1 (49141)
    Guest: Ubuntu 20.04.1 LTS

    So my setup is that I use Rails 6 and webpack-dev-server for rails development with the source code files in a shared folder.

    If I run rails server and webpack-dev-server and edit the files in atom in the shared folder on macOS, no reloads are triggered and even if I refresh the browser manually the changes to the source files are not picked up. However, if I ssh into Ubuntu and use nano to edit the source files in the shared folder, the browser refreshes and the changes to the files are picked up.

    rkulikov - should this use case actually work? Do you expect inotify to work within shared folders in Parallels 16 / Ubuntu 20.04?
     

Share This Page