--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/2da22943-7b14-4c43-8f56-8e766b69ac2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, I can.
The use case is:
A base windows VM, that I create as a box. This will be the starting point.
Then I can create a Vagrantfile like this:
Another one:
Now I have two linked clones sharing the same windows base VM.
Now the fun starts.
I want to use these VMs, and create linked clones to create different development environment for the projects I am working on.
The Visual Studio 2017 machine takes about 25Gb, so if this can be a base box for other VM’s I will save a lot of disk space.
I can achieve exactly that by using VirtualBox to create the linked clones and then put my dev stuff on those machines.
The thing is that I want to make use of the features that vagrant offers to provision and handle all the port collisions for me.
So instead of using a box as a starting point for a new VM, it would be great if Vagrant can use another VM as the starting point.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exiZNJOFw466__tnpBsGKmM7w-Z0%2BFvMJrOqxR2k75nqQ%40mail.gmail.com.
0 $ mkdir n1
0 $ cd n1
0 $ vagrant init -m alvaro/xenial64
0 $ vagrant up --provider virtualbox
2. do some work
< here is where you install SW, etc>
3. grab uuid and create a named snapshot.
0 $ cat .vagrant/machines/default/virtualbox/id
bf944f9e-cd87-43ba-8da6-21e51f0409e4
0 $ VBoxManage snapshot bf944f9e-cd87-43ba-8da6-21e51f0409e4 take forclone --live
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Snapshot taken. UUID: d6b5dcf4-4212-4456-896a-03b2d4e57613
0 $
4. create a new project directory
0 $ cd ..
0 $ cp -ap n1 n2
0 $ cd n2
0 $
5. create a clone from the snap and update the new project box.
0 $ VBoxManage clonevm bf944f9e-cd87-43ba-8da6-21e51f0409e4 --snapshot forclone --options link --name n2 --register
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Machine has been successfully cloned as "n2"
0 $ echo 35117e02-e226-43e7-b5b6-cfec1f0c8338 > .vagrant/machines/default/virtualbox/id
0 $
sizes that shows is a reduced size VM. and not a full copy
0 $ du -sh n1*/ n2/
2.7G n1_default_1540496025122_57328/
118M n2/
0 $
6. vagrant reload will work from here.
0 $ vagrant reload
==> default: This machine used to live in /Users/alvaro/Downloads/clone/n1 but it's now at /Users/alvaro/Downloads/clone/n2.
==> default: Depending on your current provider you may need to change the name of
==> default: the machine to run it as a different machine.
==> default: Discarding saved state of VM...
==> default: Checking if box 'alvaro/xenial64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/alvaro/Downloads/clone/n2
0 $
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/00bd01d46c94%2423027430%2469075c90%24%40van-veldhuizen.nl.
For more options, visit https://groups.google.com/d/optout.