Have the OS disk image downloaded in advance so you can complete the installation all the way through once you start.
Choose the type and Version of the OS you want to install:
You can choose the amount of memory according to what is available to you on the host machine and on whether you plan to do memory-intensive tasks on the virtual one:
The Hard drive option can be confusing. Unless you understand all the options here and need full control simply choose to create a virtual drive. In the end, it will be a file on the host machine that will act as the HDD storage for the virtual machine.
As before, unless you know you need something else choose the default VDI (VirtualBox Disk Image):
One of the later options will be to choose the size of the virtual hard drive (8 GB was already recommended, although that may not be enough for certain OSes).
If you choose the Dynamically allocated storage, it means that the disk footprint of the virtual hard drive on your host machine will be smaller than the size you set for it. It will grow as you use the virtual machine and more data gets added to it.
In my case, Fedora 19 took around 4.1 GB after the installation, even though I set the drive to over 30 GB.
After the virtual machine is created you can see its settings in the VirtualBox Manager window:
You can see that the Storage IDE Controller is empty. We need to set it to use the OS disk image file we want to install by going to Settings > Storage > Controller: IDE > Empty and clicking on the disk icon drop-down:
In my case the file was Fedora 19 disk image file:
Before starting the virtual machine for the first time and installing the OS you can adjust various useful options in the Settings.
If your host machine has enough CPU cores you can allow the virtual machine to use more than one, without affecting the host machine performance:
If you have VirtualBox Guest Additions installed (on the host machine) some useful options are available, such as copying between the host and the virtual machine:
Or sharing files from locations on the host machine:
You're probably doing all this to install the OS:
The first option is to choose the language:
Next comes Keyboard layout:
Choose Automatic Installation destination
You don't have to do any special disk partitioning to use the virtual hard drive created in previous steps:
With Storage set you can Begin installation:
During the installation you can set the root user password and create a regular user (note the passwords you set here, and mind the keyboard layout currently used, it may not be the one set to be used after the installation!):
This is what the Create user screen looks like (don't forget to check which keyboard layout is being used, as you may use characters you don't intend to if you're used to them being in a different position in a different layout):
When the installation is complete you see this screen and the message to reboot, which is usually done when installing an OS the usual way, but in VirtualBox we need to do some more steps before starting the new VM again, the first time after the installation:
The system now needs to shut down, not reboot, because we need to adjust some virtual machine settings before we boot it again.
To shut it down click on the Live System User drop-down in the top right corner and choose Power Off:
We have installed OS on the virtual drive so we don't need the disk image any more:
If you choose to keep it the disk image just in case you'll have to keep it in the same location, or update the location of the file if you move it.
Move the Hard Disk option on top, and you can turn off the CD/DVD option:
When you start the VM for the first time after the OS installation you will see whatever the OS designers programmed you to see. In my case on Fedora 19 it was to show Gnome 3 intro video, in the language of your choice:
After that you can enjoy your new virtual but very real OS the usual way: