Vagrant Snippets
# Create a new Vagrantfile with imagevagrant init hashicorp/bionic64
# Start the VM from stopped or suspend statevagrant up
# SSH into the VMvagrant ssh
# View SSH configuration related to VMvagrant ssh-config## Recreate the vagrant public key using the identify file listed in## the output of the ssh-config commandssh-keygen -y -f <identity-file-location> > key.pub## key.pub can be used to restore vagrant access to the VM## by appending the contents to the /home/vagrant/.ssh/authorized_keys file
# Reload the VM after changes to Vagrantfilevagrant reload --provision
# Temporarilty suspend the VM for start up latervagrant suspend
# Stop the VMvagrant halt
# Destroy the VMvagrant destroy# Destroy the VM without confirmationvagrant destroy -f
# Add box to local cachevagrant box add hashicorp/bionic64
# Update a specific boxvagrant box update --box archlinux/archlinux
# List all environments on the system for the logged in uservagrant global-status
# List all boxesvagrant box list
# Delete a vagrant boxvagrant box remove hashicorp/bionic64
# Enable proxy support using plugin# See instructions at https://github.com/tmatilai/vagrant-proxyconfvagrant plugin install vagrant-proxyconf
Vagrant.configure("2") do |config| if Vagrant.has_plugin?("vagrant-proxyconf") config.proxy.http = "http://192.168.0.2:3128/" config.proxy.https = "http://192.168.0.2:3128/" config.proxy.no_proxy = "localhost,127.0.0.1,.example.com" config.proxy.enabled = true end # ... other stuffend