Hi all,

I'm using Vagrant 2.2.4 with VirtualBox 6.0.8 on macOS Mojave 10.14.5.

I'm running into trouble with a NetBSD 8 box while setting up the shared 
folder.

This is my Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "NetBSD/NetBSD-8.0"
  config.vm.box_version = "1.0.0"

  PATH = 
"/bin:/sbin:/usr/bin:/usr/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin"
  
  config.vm.synced_folder ".", "/vagrant", type: "rsync", group: "users" 
rsync__chown: false
  config.ssh.shell = "sh"

  config.vm.provision "shell", inline: <<-SHELL    
PATH=$PATH:/sbin:/usr/sbin:/usr/pkg/sbin    export PATH    
PKG_PATH=ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All    
export PKG_PATH    pkg_add gmake  SHELLend


When I start the machine (*vagrant up*), I get this error:

==> default: Rsyncing folder: /Users/vikman/Projects/Vagrant/NetBSD/ => /vagrant
There was an error while attempting to run the post rsync
command for a synced folder. Please inspect the error message
below for more info.

Host path: /Users/vikman/Projects/Vagrant/NetBSD/
Guest path: /vagrant
Error: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

find /vagrant '!' -type l -a '(' ! -user vagrant -or ! -group users ')' -exec 
chown vagrant:users '{}' +

Stdout from the command:



Stderr from the command:

find: chown: No such file or directory


I found that the current *PATH* was:

/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin


In fact, *chown* is at */sbin*.

However, when I get into the machine (*vagrant ssh*), I get this value of 
*PATH*:

/home/vagrant/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin


I found this workaround: disable *rsync_chown* and run the command that 
failed in the provision script.

Vagrant.configure("2") do |config|
  config.vm.box = "NetBSD/NetBSD-8.0"
  config.vm.box_version = "1.0.0"

  config.vm.synced_folder ".", "/vagrant", type: "rsync", group: "users" 
rsync__chown: false
  config.ssh.shell = "sh"

  config.vm.provision "shell", inline: <<-SHELL    
PATH=$PATH:/sbin:/usr/sbin:/usr/pkg/sbin    export PATH    find /vagrant '!' 
-type l -a '(' ! -user vagrant -or ! -group users ')' -exec chown vagrant:users 
'{}' +    
PKG_PATH=ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All    
export PKG_PATH    pkg_add gmake  SHELLend


My question is: can I override the *PATH* variable prior to setting up the 
synced folder, or can I fix this issue in another way?

Thank you in advance!

Cheers,

Victor

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/96635791-f7ed-4d89-9419-b1a3663bd23e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to