Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
November 4, 2013
Chris
Linux, Local Development, Vagrant, Virtual Machine / VM
Comments Off on How to copy Vagrant boxes (or duplicate them)

How to copy Vagrant boxes (or duplicate them)

PreviousNext
vagrant

Copy vagrant box & compress it

Making a real 1:1 copy of a Vagrant box is really easy ! Simply turn off the box (if she is currently running – yes, for me a Vagrant box is female!) with

vagrant halt

and create a package.box file (default name) in the same folder with

vagrant package

That’s it. The package.box contains the full virtual machine, compressed. You can put this file whereever you want now.

 

Create a new VM from the new box file (quick method)

Now create a new folder somewhere (for your new project that uses the box) and initialize a new default Vagrantfile via

vagrant init

Open the file, and edit this: Rename the default boxname (which might be precise64) to something new, like “my-zend-framework-box“.

config.vm.box = "my-zend-framework-box"

Uncomment and edit the default box location from

# config.vm.box_url = "http://domain.com/path/to/above.box"

to the filepath of your package.box. Windows users need to write the path this way:

config.vm.box_url = "file:///d:/folder/package.box"

Then uncomment and change the default IP to something you want, I recommend increasing the last number of the IP.

config.vm.network :private_network, ip: "192.168.33.101"

Run your Vagrant box with:

vagrant up

 

Create a new VM from the new box file (long method)

If you want to add the box to your vagrant box list (to use the box by it’s name, not by giving the file location) do it like this:

vagrant package

Add the box to Virtualbox (chose a box name for name-of-this-box):

vagrant box add name-of-this-box package.box virtualbox

Now you can create virtual machines from this box by simply giving the name of the box in the Vagrantfile, like

config.vm.box = "name-of-my-box"

A config.vm.box_url is not necessary anymore.

 

Be aware of synced folder issues !

There’s a weird issue going on with the synced folder: When packing a box and creating a new virtual machine from it, you might loose the content of the synced folder in the guest system. Obviously the fresh and empty synced folder on the host deletes the synced folder’s content in the guest. I haven’t tried yet, but maybe turning off the synced folder before packing is a solution.

 

vagrantvirtual machinevm
Share this
shadow dom

Crossbrowser-safe HTML5 video (IE6+) with a few lines of code and just one .mp4 video file

No time to read the full article ? Get the code directly here on GitHub: panique/html5-video. Publishing a video on

github-logo-octocat

GitHub buys Easel.io, a code-free full website creator worth a look

GitHub has just aquired Easel.io (which is NOT easel.ly who offer something similar for infographics / powerpoint !), a powerful

Perfect HTML email templates for perfect HTML emails (outlook!) with INK

The people behind FOUNDATION, the excellent responsive frontend framework, have just released a set of highly professional, perfectly compatible HTML

Google I/O 2014 – HTTPS Everywhere (video)

Excellent, essential and game-changing talk by Ilya Grigorik and Pierre Far (both of Google), explaining why you should always use

php

New GitHub repo: simple php-long-polling for creating real-time apps

Mornin’ ! I’ve just pushed a sweet little new project into GitHub: A very simple and totally reduced PHP long-polling

Redesigning Windows 8 – fantastic and clever drafts by Jay Machalani

The interface of Windows 8 has been the topic of heated discussions for a long time now, and everybody who’s

php-phalcon-logo

Which PHP-framework to learn in 2014 ? PHALCON, by far the fastest ever!

Hey guys, just a short little article between the years: If you have the possibility to learn and use a

How to setup a config-free WordPress, PHP and MySQL (for local development) in Windows 7 / 8 in under 3 minutes

If you need to setup WordPress for local development and don’t have time and nerve to go through the installation

the-php-login-project

How to install php-login-minimal on Ubuntu 12.04 LTS

In this article I’ll show you how to install the minimal version of the php-login.net‘s login script (see the GitHub

microsoft-windows-azure-cloud-hosting

Microsoft’s Azure platform gives away high money prizes for “testing out” their cloud services

Disclaimer: DEV METAL does not get any money etc. for saying this, there is no affiliate link, no deal with

1/4

Categories

Search

css4
Angelina Fabbro talks about “CSS4” in this excellent conference video
This picture shows the icon of blindness
How blind people use websites (video with Sina Bahram, blind accessibility researcher)
sass laravel
SASSmeister is a real-time JSfiddle for SASS / CSS. Awesome!
php
How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)
windows-xp-eol
Windows XP is officially dead from today. Do you know people still using it ? Punch them.
hack-php
Wow! Facebook devs have rewritten and fixed PHP, releasing it as new language called “Hack” today
twig
A 6min video introduction into Twig, the PHP templating engine
Rare Steve Jobs AND Bill Gates video interview from 2007’s D5 conference (90min)
New project: Building a naked PHP skeleton / boilerplate application from scratch
MINI, an extremely simple barebone PHP application
composer
How to install Composer on Windows 7 / 8 or Ubuntu
steam sale coupon voucher
-30% to -90% on Steam and Origin
github-logo-octocat
GitHub rolls out .PSD diff and viewing
Dangerous Performance Myths in the Web (video talk by Thomas Lohner, PHPUG Latvia)
phpstorm-github-code-color-syntax-theme
Get Github’s code colors in PHPStorm (2014 style)

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy