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
ubuntu-14-04-lts lamp

How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 12.04 or Debian 7.0/7.1

This little tutorial shows how to setup Apache, MySQL and PHP on a Linux server, in this case Ubuntu 12.04

php

PHP 5.6 announced, statically typed (!) “new” PHP announced by Facebook devs

PHP 5.6 goes alpha PHP 5.6 has been announced for a while now, and these days things get serious (code-freeze,

mod-rewrite-ubuntu-14-04-lts

How to enable mod_rewrite in Ubuntu 14.04 LTS

A little note first: This is the most basic way to enable mod_rewrite. However, it’s not the best way. The

angularjs

Two excellent introductions into AngularJS by Todd Motto

If you are familiar with PHP frameworks and have a basic understanding of what a model, a controller and a

GitHub introduces revert button / rollback for merged pull requests

Once again GitHub delivers an excellent feature: Clean one-click rollbacks / reverts / undos of pull requests, very very useful,

Disappointed by Watch Dogs’s graphics ? See how it looks with unlocked, hidden settings. Awesome!

When you are interested in 3D and game graphics in general, you probably stumbled upon these excellent and extremely good-looking

php

Must-read PHP blog: PHPweekly.com

Probably one of the best ressources for your weekly doze of news from the PHP scene: phpweekly.com simply publishes a

pdo-debug

Debug PDO with this one-line function. Yeah!

Update: This article is a little bit older, the tool has changed gently. Everthing this article still works exactly like

php

PHP 5.6.0 RC1 is available

The first Release Candidate of PHP 5.6 is available here on php.net, as usual also for Windows systems. The RC

frontend-workflow

[german] Modernes Frontend-Development mit Bower, Grunt, Yeoman (45min Video, Thorsten Rinne auf der IPC2013)

Der Titel sagt ja wohl alles! :) Absoluter Pflichtvortrag für jeden Frontendler der NICHT mit Bower etc. arbeitet. Thorsten Rinne

1/4

Categories

Search

sass
[german video] Modernizing and minimalizing frontend markup code at AutoScout24
php
[Link] Excellent PHP best practices, 2014 style
composer
A short & simple Composer tutorial
vagrant
A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 13.10 (Saucy Salamander)
Create a fast, perfect and bootable 1:1 Windows backup (full clone of HDD) for SSD migration
github-logo-octocat
GitHub rolls out .PSD diff and viewing
Experimenting with HHVM at Etsy (Link)
Awesome next-gen PS4 graphics in “The Order: 1886”
What’s new in PHPStorm 10 (Official promo video)
php
How to install PHP curl extension (in 5 seconds)
vagrant
How to setup a local server (in a virtual machine) with Vagrant in PHPStorm
Material Design – How Google designed Android L (7min video)
mod-rewrite-ubuntu-14-04-lts
Which server OS version to choose ? Some EOL lists of Debian, Ubuntu and CentOS
laracon-2014-eu-amsterdam
Laracon 2013 – Jordi Boggiano: In Depth Composer (47min video)
This is an experimental advertisement

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