<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sanijag</id>
	<title>ICO wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sanijag"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php/Special:Contributions/Sanijag"/>
	<updated>2026-06-10T08:55:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=104499</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=104499"/>
		<updated>2016-06-06T18:57:49Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66;&lt;br /&gt;
Group C11;&lt;br /&gt;
Last edited 08.05.2016&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
Vagrant makes it easy to set up and launch multiple virtual machines at the same time using the same configuration file. With one command &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; the virtual machine(s) can be started, a box of users choice created so user can try out various operating systems and distributions. The learning curve is not very steep either and all in all using Vagrant is more comfortable, easier and saves time.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103371</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103371"/>
		<updated>2016-05-08T20:22:08Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66;&lt;br /&gt;
Group C11;&lt;br /&gt;
Last edited 08.05.2016&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103370</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103370"/>
		<updated>2016-05-08T20:21:43Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66;&lt;br /&gt;
Group C11;&lt;br /&gt;
Last edited 08.05.2016&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103369</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103369"/>
		<updated>2016-05-08T20:21:13Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66 &lt;br /&gt;
Group C11&lt;br /&gt;
Last edited 08.05.2016&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103368</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103368"/>
		<updated>2016-05-08T20:20:44Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66 &lt;br /&gt;
Group C11&lt;br /&gt;
Last edited 08.05.2016&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103367</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103367"/>
		<updated>2016-05-08T20:18:14Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|center|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt; By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|center|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|center|Accessing someones Vagrant environment]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103359</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103359"/>
		<updated>2016-05-08T20:08:31Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|thumb|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
 By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|thumb|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|thumb|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_connect_ssh.jpg&amp;diff=103358</id>
		<title>File:Running vagrant connect ssh.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_connect_ssh.jpg&amp;diff=103358"/>
		<updated>2016-05-08T20:07:24Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_share_ssh.jpg&amp;diff=103356</id>
		<title>File:Running vagrant share ssh.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_share_ssh.jpg&amp;diff=103356"/>
		<updated>2016-05-08T20:07:04Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103355</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103355"/>
		<updated>2016-05-08T20:06:24Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|thumb|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
 By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|thumb|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|thumb|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_share.jpg&amp;diff=103353</id>
		<title>File:Running vagrant share.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Running_vagrant_share.jpg&amp;diff=103353"/>
		<updated>2016-05-08T20:03:34Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103348</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103348"/>
		<updated>2016-05-08T20:00:19Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. &amp;lt;ref&amp;gt;Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&amp;lt;/ref&amp;gt; &amp;lt;ref&amp;gt;[http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt; that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&amp;lt;/ref&amp;gt; is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&amp;lt;/ref&amp;gt;, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&amp;lt;/ref&amp;gt; are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
 By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.&amp;lt;ref&amp;gt;[https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103336</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103336"/>
		<updated>2016-05-08T19:40:07Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] [http://docs.ansible.com/ansible/guide_vagrant.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes [https://www.vagrantup.com/docs/boxes.html] that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility[https://www.vagrantup.com/docs/installation/backwards-compatibility.html] is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. [https://www.vagrantup.com/docs/getting-started/project_setup.html]&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders [https://www.vagrantup.com/docs/synced-folders/], files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands[https://www.vagrantup.com/docs/cli/] are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. [https://www.vagrantup.com/docs/share/http.html]&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.[https://www.vagrantup.com/docs/share/ssh.html] By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.[https://www.vagrantup.com/docs/provisioning/]&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
* [http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
* [https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
# Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&lt;br /&gt;
# [http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&lt;br /&gt;
# [https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
# [https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
# [https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&lt;br /&gt;
# [https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&lt;br /&gt;
# [https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&lt;br /&gt;
# [https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&lt;br /&gt;
# [https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
# [https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&lt;br /&gt;
# [https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103334</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103334"/>
		<updated>2016-05-08T19:37:50Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] [http://docs.ansible.com/ansible/guide_vagrant.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes [https://www.vagrantup.com/docs/boxes.html] that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility[https://www.vagrantup.com/docs/installation/backwards-compatibility.html] is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. [https://www.vagrantup.com/docs/getting-started/project_setup.html]&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders [https://www.vagrantup.com/docs/synced-folders/], files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands[https://www.vagrantup.com/docs/cli/] are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. [https://www.vagrantup.com/docs/share/http.html]&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share.jpg|frame|Using HTTP sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.[https://www.vagrantup.com/docs/share/ssh.html] By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_share_ssh.jpg|frame|Using SSH sharing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:running_vagrant_connect_ssh.jpg|frame|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.[https://www.vagrantup.com/docs/provisioning/]&lt;br /&gt;
== See Also ==&lt;br /&gt;
[https://www.vagrantup.com/ Vagrant Homepage]&lt;br /&gt;
[http://docs.ansible.com/ansible/guide_vagrant.html Using Vagrant and Ansible]&lt;br /&gt;
[https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/ Starting with Vagrant on Ubuntu 14.10 - A Beginner&#039;s Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Mitchell Hashimoto (2014-05-06). [https://www.hashicorp.com/blog/vagrant-1-6.html &amp;quot;Vagrant 1.6&amp;quot;]. Retrieved 2016-04-29.&lt;br /&gt;
2. [http://www.linuxjournal.com/content/introducing-vagrant &amp;quot;Introducing Vagrant&amp;quot;]. Linux Journal. 14 November 2012. Retrieved 2016-05-06.&lt;br /&gt;
3. [https://www.vagrantup.com/docs/vagrantfile/ Vagrantfile]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
4. [https://www.vagrantup.com/docs/boxes.html Boxes]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
5. [https://www.vagrantup.com/docs/installation/backwards-compatibility.html Backwards Compatibility] Vagrant Documentation. Retrieved 2016-05-04.&lt;br /&gt;
6. [https://www.vagrantup.com/docs/getting-started/project_setup.html Project Setup]. Vagrant Documentation. Retrieved 2016-02-29.&lt;br /&gt;
7. [https://www.vagrantup.com/docs/synced-folders/ Synced Folders]. Vagrant Documentation. Retrieved 2016-04-27.&lt;br /&gt;
8. [https://www.vagrantup.com/docs/cli/ Command-line Interface]. Vagrant Documentation. Retrieved 2016-05-05.&lt;br /&gt;
9. [https://www.vagrantup.com/docs/share/http.html HTTP Sharing]. Vagrant Documentation. Retrieved 2016-05-06.&lt;br /&gt;
10. [https://www.vagrantup.com/docs/share/ssh.html SSH Sharing]. Vagrant Documentation. Retrieved 2016-05-08.&lt;br /&gt;
11. [https://www.vagrantup.com/docs/provisioning/ Provisioning]. Vagrant Documentation. Retrieved 2016-05-08.&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103333</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103333"/>
		<updated>2016-05-08T18:59:13Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] [http://docs.ansible.com/ansible/guide_vagrant.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes [https://www.vagrantup.com/docs/boxes.html] that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility[https://www.vagrantup.com/docs/installation/backwards-compatibility.html] is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. [https://www.vagrantup.com/docs/getting-started/project_setup.html]&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders[https://www.vagrantup.com/docs/synced-folders/], files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands[https://www.vagrantup.com/docs/cli/] are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. [https://www.vagrantup.com/docs/share/http.html]&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.[https://www.vagrantup.com/docs/share/ssh.html] By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:example1.jpg|frame|Running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:example2.jpg|frame|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.[https://www.vagrantup.com/docs/provisioning/]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
http://www.linuxjournal.com/content/introducing-vagrant&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103332</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103332"/>
		<updated>2016-05-08T18:48:43Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] [http://docs.ansible.com/ansible/guide_vagrant.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes [https://www.vagrantup.com/docs/boxes.html] that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility[https://www.vagrantup.com/docs/installation/backwards-compatibility.html] is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. [https://www.vagrantup.com/docs/getting-started/project_setup.html]&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with [https://en.wikipedia.org/wiki/Secure_Shell SSH] session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders[https://www.vagrantup.com/docs/synced-folders/], files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands[https://www.vagrantup.com/docs/cli/] are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage boxes with sub-commands:&amp;lt;code&amp;gt;add, list, remove, update, outdated, repackage&amp;lt;/code&amp;gt;.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the [https://www.vagrantup.com/docs/other/atlas.html HashiCorp’s Atlas server]. If user is not accessing protected boxes or using [https://www.vagrantup.com/docs/share/ Vagrant Share], no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the [https://www.vagrantup.com/docs/providers/ providers] implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands: &amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from [https://rubygems.org/ RubyGems]:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured [https://www.vagrantup.com/docs/provisioning/ provisioners] against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. [https://www.vagrantup.com/docs/share/http.html]&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side.[https://www.vagrantup.com/docs/share/ssh.html] By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
[[File:example1.jpg|frame|Running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
[[File:example2.jpg|frame|Accessing someones Vagrant envionment with SSH in terminal]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
== Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Provisioners in Vagrant are for automatical software install anf configuration altering. Each provisioner is configured within Vagrantfile using &amp;lt;code&amp;gt;config.vm.provision&amp;lt;/code&amp;gt; method call&lt;br /&gt;
&amp;lt;code&amp;gt;Vagrant.configure(&amp;quot;2&amp;quot;) do |config|&lt;br /&gt;
  # ... other configuration&lt;br /&gt;
&lt;br /&gt;
  config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;quot;echo hello&amp;quot;&lt;br /&gt;
end&amp;lt;/code&amp;gt;&lt;br /&gt;
Each provisioner has a type that is used as the first parameter, then follows basic key/value for configuring that specific provisioner. Instead Ruby block for a syntax can also be used.[https://www.vagrantup.com/docs/provisioning/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
http://www.linuxjournal.com/content/introducing-vagrant&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103331</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103331"/>
		<updated>2016-05-08T18:21:50Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] [http://docs.ansible.com/ansible/guide_vagrant.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is [http://www.ruby-lang.org/en/ Ruby]. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes [https://www.vagrantup.com/docs/boxes.html] that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility[https://www.vagrantup.com/docs/installation/backwards-compatibility.html] is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for [https://en.wikipedia.org/wiki/OS_X Mac OS X], [https://en.wikipedia.org/wiki/Microsoft_Windows Windows], [https://en.wikipedia.org/wiki/Debian Debian] and [https://en.wikipedia.org/wiki/CentOS Centos] can be installed by using installation package from their [https://www.vagrantup.com/downloads.html homepage]. There is also possibility to get older version from Vagrants [https://releases.hashicorp.com/vagrant/ releases services]. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. [https://www.vagrantup.com/docs/getting-started/project_setup.html]&lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running [http://releases.ubuntu.com/12.04/ Ubuntu 12.04 LTS 64-bit], following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from [https://atlas.hashicorp.com/boxes/search HashiCorp&#039;s Atlas box catalog] that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders[https://www.vagrantup.com/docs/synced-folders/], files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands[https://www.vagrantup.com/docs/cli/] are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Box&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Connect&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Destroy&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Global-status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Halt&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Init&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Package &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powershell&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provision&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RDP&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reload&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resume&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Share&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Snapshot&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH-config&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Suspend&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Up&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103330</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103330"/>
		<updated>2016-05-08T17:59:34Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile [https://www.vagrantup.com/docs/vagrantfile/] is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is Ruby. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for Mac OS X, Windows, Debian and Centos can be installed by using installation package from their homepage. There is also possibility to get older version from Vagrants releases service. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running Ubuntu 12.04 LTS 64-bit, following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from HashiCorp&#039;s Atlas box catalog that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== Destroy ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
=== Global-status ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
=== Halt ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
=== Init ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Login ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
=== Package ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
=== Plugin ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Port ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Powershell ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
=== Provision ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
=== RDP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
=== Reload ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
=== Resume ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
=== Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
=== SSH-config ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
=== Up ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Version ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103329</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103329"/>
		<updated>2016-05-08T17:56:47Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [https://en.wikipedia.org/wiki/HashiCorp HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, [https://en.wikipedia.org/wiki/Virtual_machine virtual machines] are provisioned on top of [https://en.wikipedia.org/wiki/VirtualBox VirtualBox], [https://en.wikipedia.org/wiki/VMware VMware], [https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine KVM], [https://en.wikipedia.org/wiki/Amazon_Web_Services AWS], [https://en.wikipedia.org/wiki/LXC LXC]. To automatically install and configure software on machines, provisioning tools like shell scripts, [https://en.wikipedia.org/wiki/Chef_(software) Chef], [https://en.wikipedia.org/wiki/Salt_(software) Salt], [https://en.wikipedia.org/wiki/Puppet_(software) Puppet] or [https://en.wikipedia.org/wiki/Ansible_(software) Ansible] can be used. From 1.6, Vagrant natively supports [https://en.wikipedia.org/wiki/Docker_(software) Docker] containers, which in some cases can serve as a substitute for a fully virtualized operating system. [https://www.hashicorp.com/blog/vagrant-1-6.html] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is Ruby. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for Mac OS X, Windows, Debian and Centos can be installed by using installation package from their homepage. There is also possibility to get older version from Vagrants releases service. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running Ubuntu 12.04 LTS 64-bit, following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from HashiCorp&#039;s Atlas box catalog that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== Destroy ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
=== Global-status ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
=== Halt ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
=== Init ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Login ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
=== Package ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
=== Plugin ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Port ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Powershell ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
=== Provision ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
=== RDP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
=== Reload ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
=== Resume ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
=== Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
=== SSH-config ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
=== Up ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Version ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103328</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103328"/>
		<updated>2016-05-08T17:51:35Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other [https://en.wikipedia.org/wiki/Ruby_(programming_language) programming languages] ([https://en.wikipedia.org/wiki/Java_(programming_language) Java], [https://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#], [https://en.wikipedia.org/wiki/Python_(programming_language) Python], [https://en.wikipedia.org/wiki/PHP PHP], [https://en.wikipedia.org/wiki/JavaScript JavaScript]). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded [HashiCorp] to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, virtual machines are provisioned on top of  VirtualBox, VMware, KVM, AWS, LXC. To automatically install and configure software on machines, provisioning tools like shell scripts, Chef, Salt, Puppet or Ansible can be used. From 1.6, Vagrant natively supports Docker containers, which in some cases can serve as a substitute for a fully virtualized operating system.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is Ruby. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for Mac OS X, Windows, Debian and Centos can be installed by using installation package from their homepage. There is also possibility to get older version from Vagrants releases service. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running Ubuntu 12.04 LTS 64-bit, following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from HashiCorp&#039;s Atlas box catalog that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== Destroy ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
=== Global-status ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
=== Halt ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
=== Init ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Login ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
=== Package ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
=== Plugin ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Port ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Powershell ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
=== Provision ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
=== RDP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
=== Reload ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
=== Resume ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
=== Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
=== SSH-config ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
=== Up ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Version ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103327</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103327"/>
		<updated>2016-05-08T17:47:11Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed [https://github.com/mitchellh/vagrant open source project] that is written in [https://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby] and can also be used with other programming languages (Java, C#, Python, PHP, JavaScript). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded HashiCorp to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, virtual machines are provisioned on top of  VirtualBox, VMware, KVM, AWS, LXC. To automatically install and configure software on machines, provisioning tools like shell scripts, Chef, Salt, Puppet or Ansible can be used. From 1.6, Vagrant natively supports Docker containers, which in some cases can serve as a substitute for a fully virtualized operating system.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is Ruby. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for Mac OS X, Windows, Debian and Centos can be installed by using installation package from their homepage. There is also possibility to get older version from Vagrants releases service. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running Ubuntu 12.04 LTS 64-bit, following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from HashiCorp&#039;s Atlas box catalog that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== Destroy ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
=== Global-status ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
=== Halt ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
=== Init ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Login ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
=== Package ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
=== Plugin ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Port ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Powershell ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
=== Provision ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
=== RDP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
=== Reload ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
=== Resume ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
=== Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
=== SSH-config ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
=== Up ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Version ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103326</id>
		<title>Vagrant</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Vagrant&amp;diff=103326"/>
		<updated>2016-05-08T17:41:26Z</updated>

		<summary type="html">&lt;p&gt;Sanijag: Created page with &amp;quot;Author Svea Anijago, TS 66, 08.05.2015  THIS IS A DRAFT  Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines li...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author Svea Anijago, TS 66, 08.05.2015&lt;br /&gt;
&lt;br /&gt;
THIS IS A DRAFT&lt;br /&gt;
&lt;br /&gt;
Vagrant is a command line utility that runs the virtual machine without a UI. It is used to manage virtual machines life cycle and to build complete development environments. It is a liberally licensed open source project that is written in Ruby and can also be used with other programming languages (Java, C#, Python, PHP, JavaScript). It was created in January 2010 by Mitchell Hasimoto, who in November 2012 founded HashiCorp to back up Vagrant development full time. &lt;br /&gt;
&lt;br /&gt;
In Vagrant, virtual machines are provisioned on top of  VirtualBox, VMware, KVM, AWS, LXC. To automatically install and configure software on machines, provisioning tools like shell scripts, Chef, Salt, Puppet or Ansible can be used. From 1.6, Vagrant natively supports Docker containers, which in some cases can serve as a substitute for a fully virtualized operating system.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vagrantfile is a very flexible configuration format. It marks the root directory of the project and describes the machine and resources needed to run the project and what software needs to be installed and how to access it. The syntax used in Vagrantfiles is Ruby. One Vagrantfile per project is used and it is supposed to be committed to version control to allow other developers involved in the project to check out the code. The package format for Vagrant environments are boxes that can be used on any platform that Vagrant supports. Vagrant uses these base images to clone a virtual machine. As a multi-machine environment, Vagrant is able to define and control multiple guest machines per Vagrantfile. The machines work together or are associated with each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Backwards compatibility ===&lt;br /&gt;
&lt;br /&gt;
Full backwards compatibility is provided by Vagrant 1.1+ for Vagrant 1.0.x Vagrantfiles that do not use plugins. Backwards compatibility for 1.x is not guaranteed and syntax stability is not certain before 2.0 which is to have stable backwards compatible Vagrantfile format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
Vagrants latest versions for Mac OS X, Windows, Debian and Centos can be installed by using installation package from their homepage. There is also possibility to get older version from Vagrants releases service. It will isolate dependencies and their configurations in a single consistent environment. Using single Vagrantfile the whole working environment is installed and configured. &lt;br /&gt;
&lt;br /&gt;
To have a fully functioning virtual machine in VirtualBox running Ubuntu 12.04 LTS 64-bit, following two commands need to be used to place a Vagrantfile to users directory and install virtual environment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init hashicorp/precise64&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt; downloads a box named &amp;quot;hashicorp/precise64&amp;quot; from HashiCorp&#039;s Atlas box catalog that stores all the host boxes. Boxes can be downloaded from HashiCorp&#039;s Atlas or added from a local file, custom URL or other. They are named using username e.g “hashicorp” and box name “precise64” that are separated with slash. Box names can be also specified with URL or local file paths.&lt;br /&gt;
&lt;br /&gt;
Accessing virtual machine is done with SSH session and user is located in &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Synced Folders ==&lt;br /&gt;
&lt;br /&gt;
Using synced folders, files are automatically synced with the guest machine. By default the project directory in Vagrantfile is shared to &amp;lt;code&amp;gt;/vagrant&amp;lt;/code&amp;gt; directory on guest machine, that is different than the &amp;lt;code&amp;gt;/home/vagrant&amp;lt;/code&amp;gt; where user is located when using &amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command-line interface ==&lt;br /&gt;
All available subcommands are displayed to user running &amp;lt;code&amp;gt;vagrant command&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box&amp;lt;/code&amp;gt; is used to manage(&amp;lt;code&amp;gt; add, list, remove, update, outdated, repackage &amp;lt;/code&amp;gt;)boxes.&lt;br /&gt;
So that multiple Vagrant environments could use a box, it needs to be added to Vagrant and then stored under specific name with command:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant box add&amp;lt;/code&amp;gt; &lt;br /&gt;
Current users boxes are stored globally and projects only use the box as an initial image to clone from but do not modify the actual base image, so that using same &amp;lt;code&amp;gt;hashicorp/precise64&amp;lt;/code&amp;gt;  box and adding files on one project does not affect others. &lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant connect&amp;lt;/code&amp;gt; is used to enable access to shared environments and complements the &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
=== Destroy ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant destroy&amp;lt;/code&amp;gt; command stops the running virtual machine and destroys all resources created during machine creation process.&lt;br /&gt;
&lt;br /&gt;
=== Global-status ===&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant global-status&amp;lt;/code&amp;gt; tells the state of all active Vagrant environments in the system for current logged in user.&lt;br /&gt;
&lt;br /&gt;
=== Halt ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; shuts down the currently running machine that is managed by Vagrant. At first it is attempted to shut the machine down by running guest OS shutdown mechanism, if this is not successful the &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; force flag is stated and the machine is shut off. &lt;br /&gt;
&lt;br /&gt;
=== Init ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant init [box-name] [box-url]&amp;lt;/code&amp;gt; initializes current directory to be a Vagrant environment by creating and initial Vagrantfile if it doesn’t already exist. The first argument will prepopulate the &amp;lt;code&amp;gt;config.vm.box&amp;lt;/code&amp;gt; and second argument &amp;lt;code&amp;gt;config.vm.box_url&amp;lt;/code&amp;gt; setting in the created Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Login ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant login&amp;lt;/code&amp;gt; command is used to authenticate with the HashiCorp’s Atlas server. If user is not accessing protected boxes or using Vagrant Share, no login is needed.&lt;br /&gt;
&lt;br /&gt;
=== Package ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant package&amp;lt;/code&amp;gt; command packages currently running VirtualBox environment into a re-usable box. This can be used with other providers based on the providers implementation and if they support it. &lt;br /&gt;
&lt;br /&gt;
=== Plugin ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin&amp;lt;/code&amp;gt; is used to manage plugins along with subcommands (&amp;lt;code&amp;gt;install, license, list, update, uninstall&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a known gem source with given name, usually from RubyGems:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install new-plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installing a plugin from a local file source:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant plugin install /path/to/new-plugin.gem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Port ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port&amp;lt;/code&amp;gt; displays full list of guest ports mapped to the host machine ports. If multi-machine Vagrantfile is used, name of the machine must be specified with &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant port my-machine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Powershell ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant powershell&amp;lt;/code&amp;gt; opens a PowerShell prompt into a running Vagrant machine and will only work if the machine supports PowerShell.&lt;br /&gt;
&lt;br /&gt;
=== Provision ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant provision&amp;lt;/code&amp;gt; runs configured provisioners against the running Vagrant managed machine. &lt;br /&gt;
&lt;br /&gt;
=== RDP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp&amp;lt;/code&amp;gt; starts RDP client for a remote desktop session with the guest. Typically only Windows Vagrant environments support remote desktop. Raw arguments are passed through to RDP client by appending it after a &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant rdp -- /span&amp;lt;/code&amp;gt; that on Windows will execute &amp;lt;code&amp;gt;mstsc.exe /span config.rdp&amp;lt;/code&amp;gt; allowing RDP to span on multiple desktops. &lt;br /&gt;
&lt;br /&gt;
=== Reload ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is the equivalent of running &amp;lt;code&amp;gt;vagrant halt&amp;lt;/code&amp;gt; followed by &amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; commands. This is usually required for the changes made in the Vagrantfile to take effect. &amp;lt;code&amp;gt;vagrant reload&amp;lt;/code&amp;gt; is needed after making modifications to the Vagrantfile. &lt;br /&gt;
&lt;br /&gt;
=== Resume ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant resume&amp;lt;/code&amp;gt; resumes a Vagrant machine that has been suspended with &amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share command&amp;lt;/code&amp;gt; loads the Vagrant Share session so that users Vagrant environment can be shared with anyone to enable collaboration directly in users Vagrant environment.&lt;br /&gt;
&lt;br /&gt;
=== Snapshot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant snapshot&amp;lt;/code&amp;gt; is used to manage snapshots with guest machine and are recorded a point-in-time state. This is not provided by every provider. Snapshot sub-commands include &amp;lt;code&amp;gt;push, pop, save, restore, list, delete&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh&amp;lt;/code&amp;gt; will SSH into a running Vagrant machine and give user access to a shell. An argument after &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; in command line is passed directly to ssh executable. That allows for example reverse tunneling down into the ssh program. If command runs in the background, it will be terminated almost immediately since when Vagrant executes the command, it is executed within the context of a shell. If shell is exited, all child processes also exit. To prevent this, process needs to be detached from shell. &lt;br /&gt;
&lt;br /&gt;
=== SSH-config ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant ssh-config&amp;lt;/code&amp;gt; will output valid configuration for an SSH config file to SSH into the running Vagrant machine from ssh directly.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant status&amp;lt;/code&amp;gt; will tell the state of the machines Vagrant is managing.&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant suspend&amp;lt;/code&amp;gt; suspends the guest machine rather than doing a full boot and saves the exact point-in-time state of the machine. This mostly requires extra disk space storing all the contents of RAM in guest machine not host machine or CPU cycles while it is in suspended.&lt;br /&gt;
&lt;br /&gt;
=== Up ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant up&amp;lt;/code&amp;gt; is the most important command in Vagrants since it creates and configures guest machine as specified in Vagrantfile.&lt;br /&gt;
&lt;br /&gt;
=== Version ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant version&amp;lt;/code&amp;gt; displays  the version of Vagrant that is installed and the latest version of Vagrant that is currently available,for this a network call must be made. &amp;lt;code&amp;gt;vagrant -- version&amp;lt;/code&amp;gt; is for checking only the latest version installed.&lt;br /&gt;
&lt;br /&gt;
== Vagrant share ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; has three primary modes or features that are not mutually exclusive: &lt;br /&gt;
* &#039;&#039;&#039;HTTP sharing&#039;&#039;&#039; creates a publicly accessible URL endpoint to access HTTP server running in Vagrant environment. It is enabled by default when &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt; is used. Accessing party does not need to have Vagrant installed in order to view. &lt;br /&gt;
&lt;br /&gt;
ADD Screenshot&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SSH sharing&#039;&#039;&#039; allows instant SSH access to used Vagrant environment by anyone by running &amp;lt;code&amp;gt;vagrant connect --ssh&amp;lt;/code&amp;gt; on the remote side. By default SSH sharing is disabled as a security measure. To enable SSH sharing, supply the &amp;lt;code&amp;gt;--ssh&amp;lt;/code&amp;gt; flag when calling &amp;lt;code&amp;gt;vagrant share&amp;lt;/code&amp;gt;. If SSH sharing is enabled, a brand new key pair for SSH access is generated. Public key portion is automatically inserted to Vagrant machine and private key portion is uploaded to server managing the Vagrant shares. Private key is encrypted using a password that user will be prompted for and that is never transmitted across the network by Vagrant. &lt;br /&gt;
When running &amp;lt;code&amp;gt;vagrant share --ssh&amp;lt;/code&amp;gt; it will output the name of the share:&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot1 https://www.vagrantup.com/docs/share/ssh.html&lt;br /&gt;
&lt;br /&gt;
After that, anyone can SSH directly to named Vagrant environment by running &amp;lt;code&amp;gt;vagrant connect --ssh NAME&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;NAME&amp;lt;/code&amp;gt; is the name of the previously share output.&lt;br /&gt;
&lt;br /&gt;
ADD Screenshot2&lt;br /&gt;
&lt;br /&gt;
The default behavior is that the private key is encrypted, the connecting person will be prompted for the password to decrypt the private key.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;General sharing&#039;&#039;&#039; allows anyone to access any exposed port of Vagrant environment by running vagrant connect on the remote side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
TBA &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Mitchell Hashimoto (2014-05-06). &amp;quot;Vagrant 1.6&amp;quot;. Retrieved 2014-06-14.&lt;br /&gt;
https://www.vagrantup.com/&lt;br /&gt;
https://www.howtoforge.com/tutorial/ubuntu-vagrant-install-and-getting-started/&lt;br /&gt;
http://docs.ansible.com/ansible/guide_vagrant.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Operatsioonisüsteemide administreerimine ja sidumine]]&lt;/div&gt;</summary>
		<author><name>Sanijag</name></author>
	</entry>
</feed>