Download and install VirtualBox
The first step in running Windows 10 as a virtual machine on your Mac is to get your hands on a virtualization product. Luckily that part doesn’t have to cost you anything!
VirtualBox is a free download from here. Opt for the latest edition by clicking the ‘amd64’ link beside VirtualBox 5.0 for OS X Hosts in the VirtualBox binaries section at the top of the page. Once the disk image has downloaded, locate it on your Mac, mount it and double-click the VirtualBox.pkg file to install the application.
You’ll need 175MB of free space on your computer to accommodate it, in addition to the space required by Windows (up to 32GB). When the installation completes, launch VirtualBox from your Applications folder.
Download Windows

Download your copy of Windows 10 from here and put it somewhere convenient so you can access it from within the VirtualBox installer. We’re using the pre-release beta edition, but the process will be the same with the shipping code.
Click the New button on the VirtualBox toolbar and give your new virtual machine a name (‘Windows 10’ in our instance) and select the operating system you’re installing from the Version drop-down menu. Click Continue.
Devote sufficient resources

When Windows is up and running it will behave like a separate computer from the rest of your Mac, which will continue to run OS X. To do this it needs to ‘borrow’ resources from your Mac, which your Mac won’t be able to touch while the virtual machine is running. The most important of these is memory.
VirtualBox suggests 2GB (2048MB) on our machine (a Mac mini with 16GB RAM), but we’re going to increase this to 4GB (4096MB) to give Windows some room to breathe. If you want to do the same, use the slider and then click Continue.
Read more about Windows 10:
Create a virtual disk

When you set up a virtual machine, not only the operating system but also the applications running on it and the files created and edited in it are stored in a bundle, which your Mac will see as a virtual hard drive.
This is convenient as it means you won’t get your Windows and OS X assets mixed up, but it also means that you’ll put a large chunk of your disk out of reach of OS X. For this reason we’re going to stick with VirtualBox’s fairly conservative recommendation of a 32GB virtual disk for Windows.
When you click Continue you’ll be asked what kind of drive you want to create. Stick with VDI (VirtualBox Disk Image) unless you’re going to use this installation of Windows with a different virtualization application, such as Parallels Desktop.
Put off the inevitable

VirtualBox can either take away the 32GB immediately or take it piecemeal as and when required by increasing the size of the Windows drive over time as your files and range of installed applications grows.
It makes sense to opt for the latter, so unless you have any particular reason for giving up the full amount right away, leave the storage option set to Dynamically allocated and click Continue.
Install Windows

You’ve now created your new virtual machine – all you need to do now is install Windows on it. VirtualBox new shows you a summary of the composition of your virtual machine, and allows you to switch between different virtualized environments in the sidebar if you have set up more than one.
Click Start to begin the Windows installation process.
Locate your installation file

We’ve stored our installation download on an SD card in the slot on the back of our Mac mini. We need to tell VirtualBox where this is, so we click the folder icon on the screen that popped up when we clicked Start and select the ISO file on the card. Clicking Open returns us to the set-up screen where we click Start to open the disk image and use it as the installation media.
Walk through Windows

Once you’ve selected your language the installer needs to know whether you’re upgrading an old version or opting for a Custom install. Pick Custom, as you’re setting up a brand new virtual machine and then, on the following screen, make sure Drive 0 is selected as the installation drive (this should be the only option).
Sign in to Windows

The virtual machine will reboot a couple of times during the installation before asking you to set up your preferences. You can opt for Express Settings, which accepts all of Microsoft’s defaults, including using Bing as your search engine, automatically installing updates when they become available, and sending your browsing history to Microsoft.
If you don’t want to do this, click the Customise button and tweak the settings by hand. Next, you need to tell Windows whether the machine belongs to yourself or your organisation. Only you know the right answer here, but if you’re a home or small business user, the chances are the second option is the most appropriate.
Click Next, then enter your Microsoft account details to log in. If you don’t already have a Microsoft account, click Create one.
Finish up

The final two steps ask if you’d rather use a PIN that in place of a password, and whether you want to store your files on OneDrive or the local virtual machine. When you’ve decided what you want to do in each instance, Windows reboots one last time before presenting your with the desktop.
Congratulations: you’re running Windows 10 on your Mac.
Read more about the different ways you can run Windows 10 on your Mac here:
How to run Windows 10 on Mac: How to run Windows 10 using Boot Camp