This is how I run linux in my machine.
I'm using brew for the installation.
brew --version in the terminal to see if brew is installed already. If there is no brew installed, let’s just add it into our machine.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run this command to add VirtualBox in our machine
brew install cask virtual box
Then check the installation using this command
Next, we will need Vagrant to help us running and getting in to the linux machine.
brew install vagrant
Then check the installation using
These are the main things to run linux.
vagrant init <boxpath>
You can choose linux version that you want. go to this source here.
In case we want to use ubuntu1804, we can type
vagrant init ubuntu/bionic64 .
This command will generate a Vagrantfile for us.
This command will start our linux machine in virtualbox. We can see if our machine is up already by typing this command.
vagrant ssh <boxname>
In this case, we only use default Vagrantfile which is generated from
vagrant init <boxpath> instead of set the box name. We can simply run
vagrant ssh to get into out VM.
Welcome to linux machine !!
This will stop the VM. We can simply run
vagrant resume to start the VM again.
This command will delete the VM, and we need to run
vagrant up if we want to run the Linux machine again.