Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
50 views3 pages

Basic Vagrant Commands: 2. List All Boxes

This document provides an overview of some basic Vagrant commands, including: 1) vagrant version - Checks the Vagrant version 2) vagrant box list - Lists all boxes on the local system 3) vagrant box add - Adds a remote or local box 4) vagrant init - Initializes a new VM and creates a Vagrantfile 5) vagrant up - Starts an existing VM defined in the Vagrantfile 6) vagrant ssh - SSH's into a running VM 7) vagrant halt - Shuts down a running VM

Uploaded by

Urip Mainzar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

Basic Vagrant Commands: 2. List All Boxes

This document provides an overview of some basic Vagrant commands, including: 1) vagrant version - Checks the Vagrant version 2) vagrant box list - Lists all boxes on the local system 3) vagrant box add - Adds a remote or local box 4) vagrant init - Initializes a new VM and creates a Vagrantfile 5) vagrant up - Starts an existing VM defined in the Vagrantfile 6) vagrant ssh - SSH's into a running VM 7) vagrant halt - Shuts down a running VM

Uploaded by

Urip Mainzar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

8/15/2016

Basic Vagrant Commands

BasicVagrantCommands
BelowaresomebasicVagrantcommandsthatoftenbeusedwhenweworkwithVagrant.

or
Theoutputshouldbesimilartobelow:
1
2
3
Vagrant1.8.1
ThesecommandsalsocanbetocheckwhetherVagrantisreadytoworkonourenvironmentornot.

2.Listallboxes
WemayneedtolistalltheboxesonourPCs,evenjusttoknowthenames.
1
2
3
Theoutputonmyconsole:
1
2
3
4
1
2
3

3.2.AddaremoteboxspecifiedbyURL
1
2
3

3.3.Addalocalbox

http://howtoprogram.xyz/2016/07/11/basic-vagrant-commands/

1/3

8/15/2016

Basic Vagrant Commands

vagrant box add


CentOS7.1
file:///D:/Work/Vagr

4.InitializeanewVM
1
2
3
vagrantinitubuntu/trusty64juju
ThiscommandwillcreateaconfigurationfilenamedVagrantfileinthecurrentdirectory.Thecontentissimilar
asbelow:
1
2
3
4
5
Vagrant.configure(2)do|config|
config.vm.box="ubuntu/trusty64juju"
end
WhenwestartVagrantinthisdirectory,Vagrantwilldownloadthebox:ubuntu/trusty64jujufromtheinternetto
localanduseitastheimageoftheVM.
Ifyouwanttosearchfortheboxes,youcangotoHashicorpwebsite
vagrantup
IfwewanttostartanyVM,simplygotothefolderwhichtheVagrantfileexist.ThecommandwillstarttheVM
andtheoutputconsoleisasbelow:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Bringingmachine'default'upwith'virtualbox'provider...
==>default:Box'ubuntu/trusty64juju'couldnotbefound.Attemptingtofinda
http://howtoprogram.xyz/2016/07/11/basic-vagrant-commands/

2/3

8/15/2016

Basic Vagrant Commands

ndinstall...
default:BoxProvider:virtualbox
default:BoxVersion:>=0
==>default:Loadingmetadataforbox'ubuntu/trusty64juju'
default:URL:https://atlas.hashicorp.com/ubuntu/trusty64juju
==>default:Addingbox'ubuntu/trusty64juju'(v20160707.0.1)forprovider:vir
tualbox
default:Downloading:https://atlas.hashicorp.com/ubuntu/boxes/trusty64juju
/versions/20160707.0.1/providers/virtualbox.box
==>default:Waitingforcleanupbeforeexiting...
default:Progress:0%(Rate:0/s,Estimatedtimeremaining:::):)

6.SSHtotheVM
1
2
3
vagrantssh
IfyouwanttosshtotheVM,simplygotothefolderhastheVagrantfileandissueabovecommand.Notethat
youneedtohavesshclientinstalledonyourPC.

7.ShutdowntheVM
implygotothefolderhastheVagrantfileandissuebelowcommand
1
2
3

http://howtoprogram.xyz/2016/07/11/basic-vagrant-commands/

3/3

You might also like