Create new Vagrant

First install

        
            
cd ~ && mkdir Sites
mkdir Vagrant && cd Vagrant && mkdir debian9-php7.2 && cd debian9-php7.2

cat > Vagrantfile << EOL
Vagrant.configure("2") do |config|
  config.vm.box = "generic/debian10"

  config.vm.network :forwarded_port, guest: 80, host: 80
  config.vm.network :forwarded_port, guest: 3306, host: 3306
  config.vm.network :forwarded_port, guest: 9200, host: 9200
  config.vm.network :forwarded_port, guest: 9001, host: 9001
  config.vm.network :forwarded_port, guest: 6081, host: 6081
  config.vm.network :forwarded_port, guest: 4000, host: 4000
  config.vm.network :forwarded_port, guest: 443, host: 443
  config.vm.network :forwarded_port, guest: 8000, host: 8000

  config.vm.network :private_network, ip: "192.168.33.10"

  config.vm.synced_folder "/System/Volumes/Data" + Dir.pwd + "/../../Sites", "/var/www", :nfs => true

  config.vm.provider "vmware_fusion" do |v|
    v.vmx["memsize"] = "8192"
    v.vmx["numvcpus"] = "4"
  end
end
EOL
vagrant up --provider=vmware_fusion
    
        
    

Copy an existing Vagrant

        
            
        cd Vagrant/
        mkdir newvm && cp debian9-php7.2/Vagrantfile newvm/.
        cd newvm && vagrant up --provider=vmware_fusion
    
        
    

Nginx: redirect not configured domains to reminder

        
            
        server {
            listen 80 default_server;
            server_name _ ;
            root /var/www/default;
            index index.html;
        }
    
        
    
        
            
<!-- /var/www/default/index.html -->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Default page</title>
        <link href="http://fonts.googleapis.com/css?family=Lato:300" rel="stylesheet" type="text/css">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style>
            * {
                font-size: 24px;
                font-family: Lato, sans-serif;
                font-weight: 300;
            }
            p {
                max-width: 400px;
                margin: 70px auto;
                text-align: center;
            }
        </style>
    </head>

    <body>
        <p>Don't forget to configure your virtual host on nginx.</p>
    </body>
</html>
    
        
    

Lock/unlock /etc/resolv.conf (may not be needed)

To lock the file:

        
            sudo chattr +i /etc/resolv.conf
        
    

To unlock the file:

        
            sudo chattr -i /etc/resolv.conf