I suggest you return to the shell provisioning strategy, I also skipped this hell, but it is definitely doable. After many searches, I found that for this you need two very vague documents:
The first and most important part is that you need to enable the creation of symbolic links in the VirtualBox instance with this line in your config.vm.provider block, without this, NVM just wonβt work (see here ):
config.vm.provider "virtualbox" do |vb| # (...) vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant","1"] end
Next, you will need to separate your provisioning script in two parts that will run the usual apt / git / any material with root privileges ... and the other, which will work as the default user "tramp"
$rootScript = <<SCRIPT
Finally, you need to say a tramp in order to run the second script only with user rights (as almost completely without documents here ):
config.vm.provision "shell", inline: $rootScript config.vm.provision "shell", inline: $userScript, privileged: false
That should do. Not really, but it works.
Look here for working sense and good luck!
source share