Gixx-web.com presents:
Setting up a LAMP on a Virtual Box
An almost step-by-step tutorial

Preparations

Requirements

Before get started be sure you have all of these requirements:

  • Windows XP, Vista, 7, any of the desktop Linux systems that can run VirtualBox (check the http://www.virtualbox.org/wiki/Linux_Downloads page for supported Linux distributions), Solaris or Mac OSX operating system. This is the HOST system.
  • At least 1GB of RAM.
  • VGA card with at least 64 MB RAM.
  • At least 10GB of free disk space.

Get VirtualBox

Go to the VirtualBox website and grab the latest stable release that suits for your HOST operating system: http://www.virtualbox.org/wiki/Downloads

Depending your HOST operating system install the application. The only thing you have to be careful with is the VirtualBox Networking. I had trouble with it in the past so I always disable it, although it doesn't seem to be an important feature anyway.

Disable the VirtualBox Networking upon install

Get Linux

There are many Linux distributors on the market. We are looking for a free, user-friendly, widely supported, fast and small OS. So Ubuntu seems to be fine. Download the CD ISO file from http://www.ubuntu.com/download.

You can freely choose from the latest and the LTS releases. LTS seems to be a better choice since you don’t want a fancy desktop media center but an easy-to-use developer environment.

Create a VirtualBox Machine (VM)

Start VirtualBox, click „New” and follow the instructions.

Name your machine and choose Linux from the dropdown list

Creating the Virtual Hard Disk

During the process the wizard will ask you to define the Virtual Hard Disk. If you choose to create a new one, it is recommended to choose the dynamically expanding storage because you can save a large amount of disk space in the first times.

choose the `Dynamically expanding storage` option

In the next step choose the location or leave it default. If you want the use you virtual machine on different computers then it is recommended to define the .vdi location manually to an USB stick or portable hard drive. In this case you need to create the same VM on the other computer too and add this virtual hard disk instead of create a new one.

Configure the VM

Edit the VM’s properties and do the following modifications on the defaults:

  • add RAM (1024 MB is fine for development, but maximum the 50% of the physical RAM is recommended)

    Set RAM to optimum
  • enable PAE/NX and leave on one CPU (we don’t need to kill the HOST)

    Enable PAE/NX
  • enable VT-x/AMD-v and Nested Paging

    Enable virtualization
  • add video memory (128 MB is fine)

  • leave on one monitor

  • enable 3D acceleration (2D acceleration is available only for Windows GUESTs)

    Enable 3D acceleration

Attach the Ubuntu iso to the VM as a CD. Start the VM.

Attach the .iso file

Install Ubuntu

After the VM boots up the Ubuntu installer will start. Follow the instructions.

Answer some questions and press 'Next'.

When the installation process is about to finish, it will ask you for the credentials.

In the tutorial I will use developer for both username and password. You may choose your own.

Comments: