Vvv: vmware Permissions Problems

Created on 17 Oct 2019  路  4Comments  路  Source: Varying-Vagrant-Vagrants/VVV

Expected Behavior

Core, Theme, Plugin updates and uploads all work as expected.

Current Behavior

No updates or uploads work without providing FTP/SSH creds.

Steps to Reproduce (for bugs)

  1. Change provider to vmware_desktop
  2. Provision
  3. Permissions are borked

As far as I can tell, this is caused by not being able to pass dir_mode and file_mode into vmware. The only thing I've seen that could be a possible solution is to use umask but I'm not sure it's possible to replicate the permissions used in the virtualbox environment. So far my attempts at implementing umask have been unsuccessful.

VMWare bug

Most helpful comment

Sure, I'll take a stab at it tomorrow. It looks like there's another part of the config that needs adjusted for vmware as well, so I'll try making one for that when I'm finished.

Honestly I'm kind of surprised it's not a more popular provider. I guess it is a bit pricey compared to the other options since you need both the app and a paid plugin from Vagrant. It's so much faster and less of a drain on the host system resources though...

All 4 comments

Well, I take back the part about not being able to get umask to work. I just needed to pass it as part of the mount_options parameter.

Not sure if this is worth a PR since my experience working with Vagrant is pretty limited, but this is how the vmware provider is configured on my machine now. The resulting file permissions aren't identical to virtualbox, but so far it seems to be liberal enough to not cause the issues mentioned above.

  # The VMware Provider does not understand "dmode"/"fmode" in the "mount_options" as
  # those are specific to Virtualbox. The folder is therefore overridden with one that
  # uses corresponding VMware mount options.
  config.vm.provider :vmware_desktop do |v, override|
    override.vm.synced_folder "www/", "/srv/www", owner: "vagrant", group: "www-data", :mount_options => [ "umask=002"  ]

    override.vm.synced_folder "log/memcached", "/var/log/memcached", owner: "root", create: true,  group: "syslog", mount_options: [ "umask=000" ]
    override.vm.synced_folder "log/nginx", "/var/log/nginx", owner: "root", create: true,  group: "syslog", mount_options: [ "umask=000" ]
    override.vm.synced_folder "log/php", "/var/log/php", create: true, owner: "root", group: "syslog", mount_options: [ "umask=000" ]
    override.vm.synced_folder "log/provisioners", "/var/log/provisioners", create: true, owner: "root", group: "syslog", mount_options: [ "umask=000" ]

    vvv_config['sites'].each do |site, args|
      if args['local_dir'] != File.join(vagrant_dir, 'www', site) then
        override.vm.synced_folder args['local_dir'], args['vm_dir'], owner: "vagrant", group: "www-data", :mount_options => [ "umask=002" ]
      end
    end
  end

Can you create a PR for this? VMWare is a bit of a wild west, I don't know anybody on the team who uses it, so we have no idea if it works or how to test/fix it, but everytime we try to deprecate or remove support people come out of the wood work

Sure, I'll take a stab at it tomorrow. It looks like there's another part of the config that needs adjusted for vmware as well, so I'll try making one for that when I'm finished.

Honestly I'm kind of surprised it's not a more popular provider. I guess it is a bit pricey compared to the other options since you need both the app and a paid plugin from Vagrant. It's so much faster and less of a drain on the host system resources though...

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings