VirtualBox 4.2.1 which you can download from here (Windows Users) and from here (Mac Users)

Windows 8 Developer Preview (32-bit) which you can get from here (2.8 GB) and here (3.6 GB) (64-bit)

Okay now open up the downloaded and installed VirtualBox. Click “New” then “Next”.

Now type a name for your Virtual Machine under Name. As we are going to Install Windows 8, I’ve named mine Windows 8. Now select Microsoft Windows for Operating System and Windows 7 as Version. If you are installing Windows 8 64-bit, select Windows 7 64-bit Version.

The next step is to choose the system resources of your Virtual Machine. For RAM, choose little bit less than half of your RAM.

For Hard disk, a 20GB dynamically allocated VirtualBox Disk Image would suffice.(If you want to use the same disk image with a virtualization software other than VirtualBox later, select VHD as the type of file for the virtual disk in virtual disk Creation wizard.)

After you’ve created the virtual disk, click create to setup the virtual machine.

Now its time to tweak your virtual machine for optimum performance. In the VirtualBox manager, right click on the virtual machine that you just created and select Settings and make the following changes.

Now start your virtual machine by right clicking and selecting start. As you are running it for the first time, a first time wizard will be shown. Click Next.

In the next step, select the Installation Media. Select the ISO file of Windows 8 that you had downloaded earlier. Click Next. Now your virtual machine will boot with the ISO file as the installation media and once the necessary files are loaded, you will see the below screen. Click Next.

After you accept the EULA, select the partition to install Windows 8 (The 20GB partition that we created earlier) and click Next.

Now click Install and the installation will begin.

Once it finishes, create a user account and configure the network, Windows Update settings etc. Windows will take a few minutes to apply the configuration and that’s it!