author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 15 Nov 2020 16:55:51 +0200 | |
changeset 2458 | 28c248a41a85 |
parent 2452 | f2450d4f1adc |
permissions | -rw-r--r-- |
2197
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
========= |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
Vagrant |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
========= |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
Changing Vagrant home directory |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
=============================== |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
Set ``VAGRANT_HOME`` env var, like:: |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
VAGRANT_HOME=d:\srv\vagrant |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
Default is ``~/.vagrant.d`` for Linux and ``%USERPROFILE%\.vagrant.d`` for Windows. |
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
14 |
|
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
https://www.vagrantup.com/docs/other/environmental-variables.html |
2271 | 16 |
Environmental Variables. ``VAGRANT_HOME``. |
17 |
https://www.vagrantup.com/docs/vagrantfile/ |
|
18 |
Load Order and Merging. |
|
2197
5ee52f8d25b5
Changing Vagrant home directory.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
19 |
|
2306
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
20 |
Pointing to VirtualBox location |
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
21 |
=============================== |
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
22 |
|
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
23 |
Set ``VBOX_MSI_INSTALL_PATH`` variable:: |
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
24 |
|
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
25 |
VBOX_MSI_INSTALL_PATH=c:\opt\VirtualBox |
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
26 |
|
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
27 |
It is set/updated by VirtualBox installer and was ``VBOX_INSTALL_PATH`` before 4.3.12 (2014). |
5892d69ad3ed
Pointing to VirtualBox location.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2302
diff
changeset
|
28 |
|
2452
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
29 |
Selecting Vagrantfile |
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
30 |
===================== |
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
31 |
|
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
32 |
Use env var ``VAGRANT_VAGRANTFILE`` to control which ``Vagrantfile`` is to use:: |
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
33 |
|
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
34 |
VAGRANT_VAGRANTFILE=Vagrantfile-alpine vagrant status |
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
35 |
VAGRANT_VAGRANTFILE=Vagrantfile-debian vagrant status |
f2450d4f1adc
Selecting Vagrantfile.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2372
diff
changeset
|
36 |
|
2307
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
37 |
Updating Vagrant |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
38 |
================ |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
39 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
40 |
Plugins are required to reconfigures when Vagrant version was updated:: |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
41 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
42 |
vagrant plugin expunge --reinstall |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
43 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
44 |
and possibly:: |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
45 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
46 |
vagrant plugin update |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
47 |
|
2272 | 48 |
Managing names |
49 |
============== |
|
50 |
||
51 |
Vagrant VM name:: |
|
52 |
||
53 |
config.vm.define "NAME" |
|
54 |
||
55 |
VirtualBox name:: |
|
56 |
||
57 |
config.vm.provider :virtualbox do |vb| |
|
58 |
vb.name = "NAME" |
|
59 |
end |
|
60 |
||
61 |
Host name:: |
|
62 |
||
63 |
config.vm.hostname = "NAME" |
|
64 |
||
2291
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
65 |
Managing resources |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
66 |
================== |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
67 |
|
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
68 |
https://unix.stackexchange.com/questions/176687/set-storage-size-on-creation-of-vm-virtualbox |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
69 |
https://askubuntu.com/questions/317338/how-can-i-increase-disk-size-on-a-vagrant-vm |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
70 |
https://stackoverflow.com/questions/49822594/vagrant-how-to-specify-the-disk-size |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
71 |
https://github.com/sprotheroe/vagrant-disksize |
a49f3423eb55
Managing resources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2272
diff
changeset
|
72 |
|
2237 | 73 |
Managing boxes |
74 |
============== |
|
75 |
||
2301 | 76 |
Store new box from catalog locally:: |
2237 | 77 |
|
78 |
$ vagrant box add ubuntu/trusty64 |
|
2301 | 79 |
$ vagrant box add --provider virtualbox hashicorp/precise64 |
2237 | 80 |
|
2301 | 81 |
Check for box updates:: |
2237 | 82 |
|
83 |
$ cd $BOXDIR |
|
84 |
$ vagrant box outdated |
|
85 |
||
2238 | 86 |
or:: |
87 |
||
88 |
$ vagrant box outdated --global |
|
89 |
||
2237 | 90 |
Disable checking for update each time you call ``vagrant`` command:: |
91 |
||
92 |
Vagrant.configure("2") do |config| |
|
93 |
config.vm.box_check_update = false |
|
94 |
end |
|
95 |
||
96 |
Download box update:: |
|
97 |
||
98 |
$ vagrant box update |
|
99 |
||
100 |
.. note:: |
|
101 |
``vagrant box update`` does not magicall updates your existing boxes. In just download |
|
102 |
updated versions. To install new versio you need to destroy and install new boxes:: |
|
103 |
||
104 |
$ vagrant destroy |
|
105 |
$ vagrant up |
|
106 |
||
107 |
To remove box at specific version:: |
|
108 |
||
109 |
$ vagrant box remove laravel/homestead --box-version 1.1.0 |
|
110 |
||
2259 | 111 |
To get list of boxes with corresponding versions:: |
112 |
||
113 |
$ vagrant box list |
|
114 |
$ vagrant global-status |
|
115 |
||
2237 | 116 |
https://www.vagrantup.com/docs/cli/box.html |
117 |
Command: ``vagrant box``. |
|
118 |
https://www.vagrantup.com/docs/boxes/versioning.html |
|
119 |
Box Versioning. |
|
120 |
||
2301 | 121 |
Exporting boxes |
122 |
=============== |
|
123 |
||
124 |
Any VirtualBox VM can be packages as Vagrant box. Find VM name or UUID with:: |
|
125 |
||
126 |
$ VBoxManage list vms |
|
127 |
||
128 |
Pass it to one of:: |
|
129 |
||
130 |
$ vagrant package --base $VM_NAME |
|
131 |
$ vagrant package --base $VM_UUID |
|
132 |
$ vagrant package --base $VM_NAME --output my.box |
|
133 |
$ vagrant package --base $VM_UUID --output my.box |
|
134 |
||
135 |
If you are in Vagrant managed directory (with ``.vagrant`` subdirectory) it is as simple as:: |
|
136 |
||
137 |
$ vagrant package |
|
138 |
||
139 |
.. note:: Only one VM is packages even if Vagrant file defines several VMs. |
|
140 |
||
141 |
Import packages box:: |
|
142 |
||
143 |
$ vagrant box add --name $NAME /path/to/new.box |
|
144 |
... |
|
145 |
$ vagrant init $NAME |
|
146 |
... |
|
147 |
$ vagrant up |
|
148 |
||
2302
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
149 |
To export box from local catalog:: |
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
150 |
|
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
151 |
$ vagrant box list |
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
152 |
$ vagrant box repackage NAME PROVIDER VERSION |
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
153 |
|
2301 | 154 |
https://www.vagrantup.com/docs/boxes/base.html |
155 |
Create own vagrant image. |
|
156 |
https://www.vagrantup.com/docs/cli/package.html |
|
157 |
``package`` command. |
|
2302
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
158 |
https://www.vagrantup.com/docs/cli/box.html#box-repackage |
f47dd29b4e06
To export box from local catalog
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2301
diff
changeset
|
159 |
``box repackage`` command. |
2301 | 160 |
|
2238 | 161 |
Managing plugins |
162 |
================ |
|
163 |
||
164 |
https://www.vagrantup.com/docs/cli/plugin.html |
|
165 |
Command: ``vagrant plugin``. |
|
166 |
https://github.com/hashicorp/vagrant/wiki/Available-Vagrant-Plugins |
|
167 |
List of vagrant plugins. |
|
168 |
||
2259 | 169 |
Debugging Vagrant |
170 |
================= |
|
171 |
||
2307
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
172 |
Add environment variable:: |
2259 | 173 |
|
174 |
VAGRANT_LOG=warn vagrant ssh |
|
175 |
VAGRANT_LOG=info vagrant ssh |
|
176 |
VAGRANT_LOG=debug vagrant ssh |
|
177 |
||
2307
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
178 |
or option:: |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
179 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
180 |
vagrant up --debug |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
181 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
182 |
To add timestamps use one of:: |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
183 |
|
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
184 |
VAGRANT_LOG_TIMESTAMP=1 vagrant up |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
185 |
vagrant up --timestamp |
08aa10b9c7ff
Add timestamp to Vagrant log.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2306
diff
changeset
|
186 |
|
2308
caadfc329ea2
Vagrant's --debug-timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2307
diff
changeset
|
187 |
To add both as option:: |
caadfc329ea2
Vagrant's --debug-timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2307
diff
changeset
|
188 |
|
caadfc329ea2
Vagrant's --debug-timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2307
diff
changeset
|
189 |
vagrant up --debug-timestamp |
caadfc329ea2
Vagrant's --debug-timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2307
diff
changeset
|
190 |
|
2309 | 191 |
https://www.vagrantup.com/docs/other/debugging.html |
192 |
Debugging Vagrant. |
|
2271 | 193 |
https://www.vagrantup.com/docs/other/environmental-variables.html |
194 |
Environmental Variables. ``VAGRANT_LOG``. |
|
195 |
||
2201
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
196 |
Running individual provisioning scripts |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
197 |
======================================= |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
198 |
|
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
199 |
You may give name to provisioning script:: |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
200 |
|
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
201 |
Vagrant.configure("2") do |config| |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
202 |
config.vm.provision 'user_ssh', type: :shell, privileged: false do |s| |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
203 |
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
204 |
s.inline = "echo #{ssh_pub_key} >> /home/$USER/.ssh/authorized_keys" |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
205 |
end |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
206 |
config.vm.provision 'root_ssh', type: :shell, privileged: true do |s| |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
207 |
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
208 |
s.inline = "mkdir /root/.ssh/; echo #{ssh_pub_key} >> /root/.ssh/authorized_keys" |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
209 |
end |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
210 |
... |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
211 |
end |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
212 |
|
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
213 |
and apply them individually:: |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
214 |
|
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
215 |
vagrant provision --provision-with user_ssh |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
216 |
vagrant provision --provision-with root_ssh |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
217 |
vagrant provision --provision-with user_ssh,root_ssh |
af2d2e117b4e
Running individual provisioning scripts.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2197
diff
changeset
|
218 |
|
2372 | 219 |
Copying files |
220 |
============= |
|
221 |
||
222 |
To copy files recursively to running box:: |
|
223 |
||
224 |
vagrant upload $SRC $DST |
|
225 |
vagrant upload $SRC $DST $BOXID |
|
226 |
||
227 |
To copy to ``/home/vagrant``:: |
|
228 |
||
229 |
vagrant upload $SRC . |
|
230 |
vagrant upload $SRC . $BOXID |
|
231 |
||
232 |
To copy to ``/home/vagrant/$DIR``:: |
|
233 |
||
234 |
vagrant upload $SRC $DIR |
|
235 |
vagrant upload $SRC $DIR $BOXID |
|
236 |
||
237 |
https://www.vagrantup.com/docs/cli/upload.html |
|
238 |
Uploads files and directories from the host to the guest machine. |
|
239 |
||
240 |
There is 3rd patry option with:: |
|
241 |
||
242 |
vagrant plugin install vagrant-scp |
|
243 |
vagrant scp $SRC :$DST |
|
244 |
vagrant scp $SRC $BOXID:$DST |
|
245 |
||
2236
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
246 |
Working with Alpine Linux |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
247 |
========================= |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
248 |
|
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
249 |
Install plugin:: |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
250 |
|
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
251 |
$ vagrant plugin install vagrant-alpine |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
252 |
Installing the 'vagrant-alpine' plugin. This can take a few minutes... |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
253 |
Installed the plugin 'vagrant-alpine (0.3.0)'! |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
254 |
|
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
255 |
Create Vagrantfile:: |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
256 |
|
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
257 |
$ vagrant init maier/alpine-3.6-x86_64 |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
258 |
|
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
259 |
https://app.vagrantup.com/maier/boxes/alpine-3.6-x86_64 |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
260 |
AlpineLinux v3.6.2 with VirtualBoxGuestAdditions |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
261 |
https://app.vagrantup.com/maier |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
262 |
maier boxes. |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
263 |
https://github.com/maier/vagrant-alpine |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
264 |
Home page of ``vagrant-alpine`` plugin. |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
265 |
https://app.vagrantup.com/generic/boxes/alpine36 |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
266 |
Generic box. |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
267 |
https://app.vagrantup.com/generic/boxes |
15e9cc9e054f
Working with Alpine Linux.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2201
diff
changeset
|
268 |
Generic boxes. |