Create an Arch Linux based Vagrant base box

Here is my simple tutorial to create an Arch Linux based Vagrant base box.

 

First, download the Arch Linux iso on this page.

Now, create a new virtual machine:

  • Click „New“
  • Name „Vagrant Arch Linux“
  • Set „Memory size“ to 1024MB
  • Select „Create a virtual hard disk now“
  • Click „Create“
  • Set „File size“ to 100GB
  • Click „Create“

After creating the virtual machine, change the settings:

  • Select the virtual machine and click „Settings“
  • Select „Storage“, select the „empty“ under „Controller: IDE“
  • Click on the upper right corner on the DVD icon an select „Choose Virtual Optical Disk File…“
  • Select the downloaded Arch Linux iso and click „Open“
  • Click „OK“

Finally, you can run the virtual machine by clicking „Start“. You will prompted with several boot options, choose the first (or the second, if you have an x86 system).

For the installation, I’m using the following commands to create a real minimalistic Arch Linux installation:

Now you can create and add a base box by the following command:

Done!

Mastering Symfony 2 – Part 1 – Installation

I’ve switched to a new employer and so the used framework. So I’m writing about my experience with Symfony 2.

So first, ensure you have a current version of composer, if not, download it:

Now, you can use composer to create a new Symfony 2 based project:

It will load the latest stable version since the syntax of ~2 is the same like >= 2.0, < 3.0.  You can check here for the release notes. After the download process you will be polled for some decisions:

The  Acme demo bundle  will install some classes to demonstrate some features of Symfony 2. It’s up to you to install this bundle. I will not use this bundle in future posts, but it’s maybe helpful to you.

All other decisions you can leave unattended as we will change them later:

Finally you did it, you installed Symfony 2 successfully….

Install Vagrant on Arch Linux

For development, Vagrant is the best way to provide a development environment. On Arch Linux some preconditions are needed to be satisfied.

Preconditions

VirtualBox

First, you have to install VirtualBox and the host modules

If you use an custom kernel, you should use virtualbox-host-dkms instead. You can find more information in the official wiki.

Now the VirtualBox kernel modules have to be loaded. For auto loading on every start create the following file:

Also, you have load these modules with modprobe MODULNAME .

NFS

Many Vagrant boxes are configured to use NFS for sharing the data between host and guest system.  It’s a lot faster than the shared folder from VirtualBox. So install the following packages:

After that, you have to edit some files. First set the  Domain  in (i’ve choosed lan):

If you have a firewall, you have to set static ports, even if not it’s recommended. Modify the following files and add/modify options:

 

Enable and start rpcbind

Finally we have to start the services

(If you get some errors… try to restart the whole system)

rsync

Another option getting popular is rsync. Simply install it via:

 

Vagrant

Now we can install Vagrant:

 

Install Redis on Arch Linux

Installing a Redis server is really simple on Arch. First, you have to install the package via package manager

The package comes without an systemd service so you have to create one for your own. Create a new file

and add the following content

Now you’re able to enable and run the Redis server with

Really simple, isn’t it?