Original article, welcome to reprint. Reprint please specify: reprint from IT people story, thank you! How to Install a Virtual Machine on a MAC using Vagrant

Most of them are MAC or Windows and don’t have a Linux host. If you want to install Docker on Linux, the Linux machine can be virtualized. Generally, virtualization software is VirtualBox or VMware Workstation

  • This article recommends using:VirtualBoxBecause it works seamlessly with Vargrant if you have to use it
    VMware Workstation

    It is also possible to crack or buy charging products, the course is not introduced.

Install VirtualBox

  • Download: VirtualBox www.virtualbox.org open the official website



Open the website

  • Click: MAC version



MAC version

  • Start: Download



Start the download

  • File downloaded



File downloaded

  • Double-click to open it and start installation












  • Automatically open after installation



Install the Vagrant

Vagrant is a Ruby-based tool for creating and deploying virtualized development environments. Its main point is to let all developers use the same environment as the online server, essentially creating a new virtual machine with you.

  • Download: Vagrant www.vagrantup.com/



Open the website




Click to enter the download page

  • Download page: www.vagrantup.com/downloads.h… Now the general computer is 64 – bit, must use 64 – bit computer to avoid later in 32 – bit pit



A 64 – bit

  • Start to download, download a little slow, recommended to use the tool download



  • File downloaded



File downloaded

  • Double-click to open it and start installation












image.png

  • Start Install



  • In the installation



  • installed



The Vagrant’s official website https://www.vagrantup.com/













Install centos7’s mirror image of Vagrant

  • Once the reboot is complete, let’s see if Vagrant is available
# create directory Vagrant
mkdir vagrant
# enter directory
cd vagrant
Create directory centos
mkdir centos
# enter directory
cd centos
Create centos7's 'Vagrantfile' file
vagrant init centos/7
Copy the code



  • Check whether virtual machines exist in VirtualBox or are empty






  • Start to install the virtual machine, the download is really slow
vagrant up
Copy the code



  • View Centos7 running in virtualBox



  • Vagrant command
# to restart
vagrant reload [vm-name]
# to turn it off
vagrant halt [vm-name]
Destroy the VIRTUAL machine
vagrant destroy [vm-name]
# Log in to the VM over SSH
vagrant ssh [vm-name]
Copy the code
  • Shut down



  • Start the



  • delete



PS: Although docker can be directly installed under Windows and MAC to learn, for the actual environment, virtual machine can reduce the burden of the hard disk of the computer, and IT is easier to delete and control.

Past wonderful
  1. Docker Guide (1)
  2. Technical Overview of Containers (II)
  3. Docker’s charm first experience -5 minutes to install wordpress without taking a detour (3)
  4. Docker official website Introduction (4)
  5. How to install Docker on MAC
  6. How to install Docker on Windows



image