Skip to content

Fix shared folder mount on the VM reboot#391

Merged
legal90 merged 2 commits intoParallels:masterfrom
legal90:fix-shared-folder-fstab
Jun 23, 2021
Merged

Fix shared folder mount on the VM reboot#391
legal90 merged 2 commits intoParallels:masterfrom
legal90:fix-shared-folder-fstab

Conversation

@legal90
Copy link
Collaborator

@legal90 legal90 commented Jun 23, 2021

This PR fixes a critical bag introduced in vagrant-parallels v2.2.0 (Linux guests only): #389

Changes:

  1. Move shared folder setup from enable stage to prepare. In this case shared folders will be setup in the VM (via prlctl) before the VM is booted, so the filesystem will be available in the guest OS on early stage.
    In virtualbox provider it is done similarly: https://github.com/hashicorp/vagrant/blob/22795b161bf67a4c0ebbe32c9ce8777cb888c4a7/plugins/providers/virtualbox/synced_folder.rb#L17-L19

  2. Add _netdev mount option by default to all prl_fs filesystems. That will prevent VM from boot failure if the shared folder (filesystem) is not available.
    virtualbox provider does the same for vboxfs: https://github.com/hashicorp/vagrant/blob/5b501a3fb05ed0ab16cf10991b3df9d231edb5cf/plugins/providers/virtualbox/cap/mount_options.rb#L25

From man mount:

_netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).

legal90 added 2 commits June 23, 2021 07:43
In this case shared folders will be setup (via `prlctl`) before the VM is booted, so
the filesystem will be available in the guest OS on early stage
That will prevent VM from boot failure if the shared folder (filesystem) is not available.

From the `man mount`:
    _netdev The filesystem resides on a device that requires network access (used to prevent the system from
    attempting to mount these filesystems until the network has been enabled on the system).
@legal90
Copy link
Collaborator Author

legal90 commented Jun 23, 2021

Acceptance tests are passing successfully.

@romankulikov Could you please confirm if that's OK to use _netdev mount option for prl_fs filesystems on Linux guests?
Code snippets in this blog post describe how exactly this option works, and it looks fine to me: http://codingberg.com/linux/systemd_when_to_use_netdev_mount_option
So far it works good in my local tests.

@legal90 legal90 merged commit a89f816 into Parallels:master Jun 23, 2021
@romankulikov
Copy link
Collaborator

Sorry for being late here. Frankly speaking prl_fs has nothing to do with networking. So it doesn't look nice for me to bound prl_fs with _netdev mount option. nofail option looks saner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants