Advertisement
Guest User

Vagrantfile

a guest
Apr 26th, 2023
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. ### Change here for more memory/cores ###
  2. VM_MEMORY=4096
  3. VM_CORES=4
  4.  
  5. Vagrant.configure('2') do |config|
  6. config.vm.box = 'ubuntu/bionic64'
  7. config.vm.network "forwarded_port", guest: 8080, host: 8080
  8.  
  9. config.vm.provider :vmware_fusion do |v, override|
  10. v.vmx['memsize'] = VM_MEMORY
  11. v.vmx['numvcpus'] = VM_CORES
  12. end
  13.  
  14. config.vm.provider :virtualbox do |v, override|
  15. v.memory = VM_MEMORY
  16. v.cpus = VM_CORES
  17.  
  18. required_plugins = %w( vagrant-vbguest )
  19. required_plugins.each do |plugin|
  20. system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
  21. end
  22. end
  23.  
  24. config.vm.provision 'shell' do |s|
  25. s.inline = 'echo Setting up machine name'
  26.  
  27. config.vm.provider :vmware_fusion do |v, override|
  28. v.vmx['displayname'] = "VM Name"
  29. end
  30.  
  31. config.vm.provider :virtualbox do |v, override|
  32. v.name = "VM Name"
  33. end
  34. end
  35.  
  36. config.vm.provision 'shell', privileged: true, inline:
  37. "apt-get -q update
  38. apt-get -q install nodejs -y
  39. apt-get -q -y autoremove
  40. apt-get -q -y clean
  41. update-locale LC_ALL=C"
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement