Install WordPress on a Ubuntu Virtual Machine using VirtualBox

Web Design & Development
This entry is part 1 of 4 in the series WordPress Development Environment.

Installing VirtualBox

Installing VirtualBox is fairly straightforward. Once it is installed, we’ll create a VM and configure it for running Ubuntu.

  1. First, we need to download VirtualBox. Because my host OS is Windows 7, I’ll need the version for Windows hosts (it doesn’t matter what guest OS you plan on using for your VM, you just need the version of VirtualBox for your host OS).

    Download VirtualBox for Windows hosts
    Download the latest VirtualBox binary for Windows hosts if your host OS is Windows
  2. Once it’s downloaded, run the installer. You’ll get a chance to select which features will be installed. I left the features set at their defaults (install everything). Click Nextto continue.

    Select which VirtualBox features you want to install
    Select which VirtualBox features you want to install
  3. You’ll get a warning saying that the installation will reset your network connection, so you’ll briefly lose connection to the internet. This is normal (it’s necessary to install a network service that allows the VM within VirtualBox to have access to the internet).

    VirtualBox network warning
    VirtualBox will need to temporarily disconnect you from your network and the internet during installation
  4. Windows will prompt you with a security warning when VirtualBox installs the network service. Click Installto continue.

    VirtualBox network service security warning
    Windows will pop up a security warning to confirm that you want to install the network service for VirtualBox
  5. The installation should now run without any more prompts or warnings. Once it is complete, click the Finishbutton and launch VirtualBox.

    VirtualBox installation is complete
    If it isn't checked, select the checkbox to "Start Oracle VM VirtualBox...after installation" and click Finish
  6. Now we’re ready to set up our first virtual machine! On the VirtualBox main screen, click the New button.

    The main VirtualBox screen
    This is the main VirtualBox screen; click New to set up a new VM
  7. Click the Next button on the welcome screen of the Create New Virtual Machine wizard.

    Create New Virtual Machine wizard
    The Create New Virtual Machine wizard will walk you through the process of setting up a VM
  8. On the VM Name and OS Type screen, type something into the Name field (I used “WPLinux“), select “Linux” as the Operating System and “Ubuntu” as the Version.

    Create a name and select the OS for the VM
    On this screen you must give your VM a name and select which operating system you will be installing
  9. The next screen determines how much RAM the VM will be able to access. I have 4GB on my PC, so I chose to give the VM 1.5GB (1,536KB).

    Choose the amount of RAM to provide to the VM
    You can select anywhere between 4MB and the maximum amount of RAM on your system; to maintain adequate performance, you should not go below the minimum requirement for your guest OS or above half of your total system RAM
  10. Now we need to set up a virtual hard disk for the VM. Choose “Create a new hard disk” and click Next.

    Create a virtual hard disk
    Choose to create a new hard disk for your virtual OS
  11. The Create New Virtual Hard Disk wizard will launch. Click Nextto continue.

    Virtual hard disk wizard
    The Virtual Hard Disk wizard walks you through the creation of a virtual hard disk for your VM
  12. Choose “Dynamically exapnding storage” on the next screen. This will ensure your VM always has enough hard disk space without getting any larger than necessary.

    Virtual hard disk storage type
    Select "Dynamically expanding storage" for the Storage Type
  13. On the next screen you can choose a location for the virtual hard disk to reside on your host OS. By default in Windows 7 it will be located in your C:\Users\[your username]\.VirtualBox folder. Type the same name as your VM’s name in the Location field so you know which virtual hard disk goes with which VM, adjust the Size slider to the maximum size you want the virtual hard disk to be (I chose “8GB” which was the default), and click Nextto continue.

    Virtual disk location and size selection
    Create a name, select a location, and choose the size of the virtual hard disk
  14. You’ll see a Summary screen confirming the settings you just chose. Click the Finishbutton to create your virtual machine.

    Virtual Machine Wizard completed
    The Create New Virtual Machine wizard provides a summary of your settings; click Finish to complete the initial setup of the VM
  15. Now that our VM is created, we have a few more settings to adjust. Select your VM in the pane on the left side of the VirtualBox screen, then click the Settings button. On the Settings window that appears, click “System” in the left pane to bring up the System settings, then click the Processor tab. Choose the number of processors the VM should have access to (I chose “2” for mine; you probably want to choose half the total number of cores your PC has). You may see a message in orange text appear at the bottom of the window. This is just letting you know that some other settings need to be enabled and VirtualBox will enable them automatically. I also selected the “Enable PAE/NX” checkbox for my configuration, but it’s not necessary for your VM to function.

    Configure CPU settings
    Select the number of processor cores the VM will have access to
  16. Now click on “Display” in the left pane to bring up the Display settings. Adjust the Video Memory slider to your preference. I chose the maximum of “128MB” because my video card has 1GB of total video memory (plenty to spare). Also check both boxes for Extended Features.

    Configure the display settings
    Select how much video memory the VM will have access to and enable video acceleration
  17. Click OKto save the settings. We’re now ready to fire up the VM and install Ubuntu.

    Fully-configured virtual machine
    Our virtual machine is now configured and ready to install a guest OS

On the next page I’ll cover the installation and setup of Ubuntu on the VM.

Pages: 1 2 3 4


  1. Great tutorial, thanks - I've done the same with VMWare server 1 and later.... the thing that always gets me is when I set Wordpress to permanent links - it messes everything up!
  2. [...] This entry is part 4 of 4 in the series WordPress Development EnvironmentI do most of my WordPress development using a test environment that I installed on a Ubuntu Virtual Machine (VM). This let’s me play around as much as I want without any risk to my production website or my computer; everything is contained within the VM, and it costs me nothing because I only use open-source and/or free software (read about it at [...]
  3. I can recommend VirtualBox, since it is completely free and it offers pre-configurations for nearly all OS's. One thing you have to care about, maybe, is the netowrking-settings, since this stuff really *may* influence the internet-speed of the guest system, but you can fix this. Regards

Comments are closed