Table of Contents
#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!
Ngon :))