0

Looking for help on what extra configuration I can set to allow my ubuntu virtualbox vm to write into the NFS synced project directory on my OSX host. I've set the explicit sudoers for vagrant in macOS so it shouldn't have any issues modifying the host if needed.

End goal is to be able to operate the app's build and dev runtime within ubuntu, while editing the files on the macOS host and the ubuntu box will detect changes and rebuild with gulp as appropriate.

Currently getting an error on npm install for bcrypt when it tries to preserve permissions, but I'm also not sure if this is the root cuase of the full fail.

Cross posted: https://groups.google.com/forum/#!topic/vagrant-up/LS_eFJhZAwQ

Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provider "virtualbox" do |v|
    v.memory = "3072"
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
  end

  config.vm.define "dev", primary: true do |dev|
    dev.vm.hostname = "proteus.dev"
    dev.vm.network "private_network", ip: "192.168.10.10"
    dev.vm.synced_folder '.', '/home/ubuntu/src/proteus', nfs: true, mount_options:['nolock,vers=3,udp,noatime,actimeo=1']
    # also tried 'rw' and other linux__mount_options
  end
end

Error output:

$ npm install bcrypt

> bcrypt@1.0.2 install /home/ubuntu/src/proteus/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@6.11.0 (node-v48 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/ubuntu/src/proteus/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
cp: preserving permissions for ‘Release/bcrypt_lib.node’: Operation not permitted
bcrypt_lib.target.mk:134: recipe for target 'Release/bcrypt_lib.node' failed
make: *** [Release/bcrypt_lib.node] Error 1
make: Leaving directory '/home/ubuntu/src/proteus/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-83-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /home/ubuntu/src/proteus/node_modules/bcrypt
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ubuntu/src/proteus/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:891:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-83-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/ubuntu/src/proteus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ubuntu/src/proteus/node_modules/bcrypt
node-pre-gyp ERR! node -v v6.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ubuntu/src/proteus/node_modules/bcrypt/lib/binding' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-83-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "bcrypt"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
notbrain
  • 209
  • 3
  • 16

1 Answers1

0

I had a simular problem once. Try to empty your /etc/exports in your MacOS. I don't have mount_options or setextradata.

I would first try to isolate the problem, first to see why cp didn't work (without npm stuff). It could be that it's macOS problem that I still have https://github.com/mitchellh/vagrant/issues/8061

Good luck!

confiq
  • 164
  • 10