Skip to content

Instantly share code, notes, and snippets.

@nite
Last active January 27, 2022 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nite/4562aac25c704001d02c7113f28d8c49 to your computer and use it in GitHub Desktop.
Save nite/4562aac25c704001d02c7113f28d8c49 to your computer and use it in GitHub Desktop.

How to Spin up a VM on OSX via Command line

All you need to do is run the commands here in OSX terminal - the links are for reference.

Install these with the following few commands:

  • Homebrew, a command-line tool for installing apps on OSX
  • virtualbox, a free VM runner on OSX
  • vagrant, a command line VM runner for virtualbox

This will allow you to spin up a VM with a single command - you wont need to install virtualbox & vagrant again if you need another VM.

Just run this to install the above:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install virtualbox
brew install vagrant

Just run this to spin up the Kali VM:

cd ~
mkdir -p vagrant/kali
cd vagrant/kali
vagrant init kalilinux/rolling
vagrant up
  • Once this finishes it should fire up the VM.
  • Login with username & pasword both vagrant / vagrant
  • Open the VirtualBox app from Applications and you'll see your VM there too - you can stop it from there by right-clicking on it & closing it, then you can give it more resources (CPU/RAM) to make it faster etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment