Command creating a virtual machine in vagrant

#Introduction

In this tutorial, I have written The commands when creating a virtual machine in VirtualBox using Vagrant.

Prerequisites

  • VirtualBox Installed
  • Vagrant Installed

The first, command at the time of creating

The box is searched from Vagrant Cloud.

Create a directory for the virtual machine you want to create and change to it.

mkdir vagrant_test
cd vagrant_test

Initialize the directory and create a Vagrantfile.

vagrant init ubuntu/trusty64

The contents should be as follows. If the box name is different, rewrite it.

cat Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
end

Start the virtual machine. A box has been added at this time.

vagrant up

ssh connection

vagrant ssh

Other used commands Vagrant

Add box

vagrant box add your-box-name

Added box list

vagrant box list

Delete box

vagrant box remove your-box-name

Virtual machine shutdown

vagrant halt

Delete virtual machine

vagrant destroy

Check virtual machine status

vagrant status

Conclusion

You have to use Command creating a virtual machine in vagrant. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

1 thought on “Command creating a virtual machine in vagrant

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.