我Vagrantfile的如下:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Set Vagrant Minimum Version
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.network :forwarded_port, guest: 80, host: 8000
config.vm.network :private_network, type: "dhcp"
config.vm.synced_folder ".", "/vagrant"
# Determine the available cores in host system.
cpu_count = 1
if RUBY_PLATFORM =~ /linux/
cpu_count = `nproc`.to_i
elsif RUBY_PLATFORM =~ /darwin/
cpu_count = `sysctl -n hw.ncpu`.to_i
end
config.vm.provider "vmware_fusion" do |v|
v.vmx['memsize'] = 4096
v.vmx['numvcpus'] = (cpu_count / 2).ceil
end
end
Run Code Online (Sandbox Code Playgroud)
我正在使用bento/ubuntu-18.04盒子,我可以成功地做一个 …