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

Stressed and unrelaxed while coding ? Try some ultra-deeply-relaxing ASMR audio clips. It will change your life. Seriously.

Do you remember your first professional massage – and that weird, extremely soft and relaxing feeling you had, this strange

php

How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)

Disclaimer: Currently 5.5 is the very latest version of PHP, but the common way to install PHP 5.5 has a

times-new-roman

The Times talks about Times New Roman (3min video)

A sweet little video, made by The Times, about Times New Roman. No real information here, but nice to look.

hiphop php

Vote for “Hack” for HipHop/HHMV support (future style PHP) in PHPStorm 8

“Hack” will come. And “Hack” will change PHP, definitly. In case you never heard of it, have a look into

-45% (or even 50%) off on DesignWall today

Get 45% off on DesignWall.com with this coupon code: AMTHUNTER45 It’s also possible to get off 50% by taking part

anti block adblock

Show ads to ad-blockering visitors – with PageFair.com

Interesting news on the dramatically decreasing web ad market: There’s a new service called PageFair that does basically exactly what

php

PHP 5.7 gets refactored core, is 10%-30% faster than PHP 5.5! Wow!

What an announcement! The awesome PHP core guys have refactored the Zend Engine (which drives PHP) and could successfully speed

phpstorm-8

When PHPStorm’s cache eats up your harddisk space

I recently stumbled over this: By default PHPStorm (obviously in all versions since 1.0) creates a local history of all

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

Soundcloud’s “VP of Engineering” about using SSDs

Excellent [german] statement from Alexander Grosse (Soundcloud’s Vice President of Engineering) about using SSDs for the main application (music data

1/4

Categories

Search

shadow dom
A quick video introduction into Shadow-DOM, the game-changing DOM-subtree-technology
the-php-login-project
How to install php-login-one-file on Ubuntu 12.04 LTS
A quick history of Comic Sans, the most wrongly used font ever
php
How to install PHP 7.0 on Ubuntu 14.04 LTS
Bézier Curves – Under the Hood (4min video)
october cms
October CMS, built on top of Laravel, is beautiful, clever and on the way to be the new #1 CMS
How to show memory usage (Ubuntu)
php-legacy-code
Interesting talk on modernizing a legacy PHP codebase
phpstorm-github-code-color-syntax-theme
Get Github’s syntax highlighting colors in PHPStorm
Useful basic linux stuff: Show kernel version, distribution name and distribution version on Ubuntu systems
This picture shows the icon of blindness
How blind people use websites (video with Sina Bahram, blind accessibility researcher)
zend framework 3
First view on Zend Framework 3 by Matthew O’Phinney
Install Laravel 4 on Ubuntu 12.04 LTS (a how-to tutorial)
Quick fix for 404 error in WordPress category / tag page
composer
[Link] How to require versions of PHP, HHVM / HipHop, GD, curl, openssl etc. with Composer

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