In this series, I’ll demonstrate some of the web development tools I use. Today we’ll cover VirtualBox — an Open Source Virtualization product for your local machine.
Oracle VM VirtualBox (formerly Sun VirtualBox, Sun xVM VirtualBox, and Innotek VirtualBox) is a free and open-source hosted hypervisor for x86 computers and is under development by Oracle Corporation. VirtualBox may be installed on a number of host operating systems, including Linux, macOS, Windows, Solaris, and OpenSolaris. There are also ports to FreeBSD and Genode. It supports the creation and management of guest virtual machines running versions and derivations of Windows, Linux, BSD, OS/2, Solaris, Haiku, OSx86 and others, and limited virtualization of macOS guests on Apple hardware.
In general, our application for web development is to emulate our production web server environment which is often a LAMP or WIMP stack. For our examples in this series, we’re going to look at the most popular, the LAMP stack (Linux, Apache, MySQL, and PHP).
The installation and setup of VirtualBox are very simple:
- Verify that you have a supported host operating system – that is, the desktop operating system that you’re on right now. https://www.virtualbox.org/manual/UserManual.html#hostossupport
- Navigate to https://www.virtualbox.org/wiki/Downloads and download the version that is right for your host operating system.
- Host OS Specific Steps:
- For Windows installations double-click on the downloaded executable file. Select either all or partial component installation – for web development make sure the network components are also selected — USB and Python support is optional
- For Mac installations double-click on the downloaded dmg file. And follow the prompts.
- For Linux – see this link: https://www.virtualbox.org/manual/UserManual.html#install-linux-host
For most people that is just about it, you’re installed and all set with VirtualBox. The next step for most web developers will be to install Vagrant, which makes managing virtual images super easy!
In some situations, your host machines BIOS settings need to be changed because your manufacturer has turned off the required settings by default. You don’t need to worry about this unless you get an error when trying to use a virtual machine. You might get a message like:
- VT-x/AMD-V hardware acceleration is not available on your system
- This host supports Intel VT-x, but Intel VT-x is disabled
- The processor on this computer is not compatible with Hyper-V
This issue is can occur regardless of the virtualization technology you use (VMWare, XenServer, Hyper-V, etc).
How to configure Intel-VT or AMD-V:
- Reboot the computer and open the system’s BIOS menu. Depending on the manufacturer, this is done by pressing the delete key, the F1 key or the F2 key.
- Open the Processor submenu (also may be listed under CPI, Chipset, or Configuration)
- Enable Virtualization, Intel-VT, or AMD-V. You may also see Virtualization Extensions, Vanderpool, Intel VTd, AMD IOMMU, if the options are available.
- Select Save & Exit.
You should be now all set, reboot into your host operating system and try again.
Version Disclosure: This document was written while the current version of virtual box is 6.0.4 – different versions might be slightly different.