Skip to content

Instantly share code, notes, and snippets.

@spirosrap
Last active November 29, 2020 04:08
Show Gist options
  • Save spirosrap/d2561df961da3294d28d83d444e17065 to your computer and use it in GitHub Desktop.
Save spirosrap/d2561df961da3294d28d83d444e17065 to your computer and use it in GitHub Desktop.
Vagrant VM with Virtual Box basic usage

Create a new VM

vagrant init ubuntu/focal64

add these to Vagrantfile to specify host name and name:

Vagrant.configure("2") do |config|
  config.vm.hostname = "ubuntu-focal"
  config.vm.define "ubuntu-focal"
vagrant up
vagrant ssh

Stop and Resume

vagrant suspend
vagrant resume

Delete machines

cd ./.vagrant/machines

Get rid of obsolete machines that still display as running but were deleted

vagrant global-status --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment