Fedora can be easily installed on virtualbox if you want to try it out without doing a real install to your hard drive. In this tutorial we are going to do that. Since we shall be using 64bit fedora, virtualbox would need to have the VT-x/AMD-V virtualisation feature in bios. These are the virtualisation extension of the underlying CPU hardware.
1. The first step would be to install Virtualbox on your host operating system if you have not already done so. Then download the Fedora iso image from http://fedoraproject.org/
You would need plenty of ram and cpu power to be able to play with virtualization. It is recommended that you have atleast a quadcore processor and 4gb or more of RAM.
2. Launch VirtualBox and create a new virtual machine/disk. This is easy to do with the wizard.
Select Linux from the Operating System list and Fedora (64bit) in the Version list. Next select the size of the virtual disk and the amount of RAM you would like to give to fedora to run on. Keep in mind that the drive size cannot be changed later on. However RAM and some other parameters can be changed from the settings later.
3. Once the virtual disk is created, it shall be listed on the left, right click on it and click Start. On starting it will ask for the iso disk. Select the iso disk from the file system. Now Fedora will boot in live mode.
4. Once the desktop arrives, it will give the option to "Install to Hard Disk". Click on it and proceed. The process is quite self explanatory, and even if you do something wrong, there is not much to worry about since it is not going to effect your system.
5. Once the installation finishes, switch off the virtual disk, and remove the fedora iso from the settings, and then reboot again. Now fedora will start from the virtual hard drive.
6. After fedora boots, the first thing you might want to do is setup internet connectivity. For this only 1 thing needs to be done, that is setup the nameservers/dns servers.
So edit the /etc/resolv.conf file
$ sudo gedit /etc/resolv.conf
and fill it with this content
# Generated by NetworkManager nameserver 126.96.36.199
Now trying pinging google.com to check if internet is up and running. Then open things with Firefox browser.
Install the Guest Additions
After the above steps are done, the next thing to install would be the guest additions. What is the guest additions exactly ?
To install the guest additions on fedora, first the kernel headers have to be installed. So run the following commands.
$ yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
Now in the Virtualbox menu goto
Devices -> Install Guest Additions
Or press Host+D. Host is the right ctrl key by default unless you have changed it. A popup would come up in fedora asking to run the guest addition installer. Click run and it would complete the process.
If the popup does not come double click the guest additions cd icon on the desktop and in that folder open a terminal. Then run the following command
$ sudo ./VBoxLinuxAdditions.run
It will start the installation process of the guest additions. After installing the guest additions, restart the virtual machine again. Now when Fedora boots up, its video resolution would match that of virtualbox window and there wont be any scrollers and no part of the screen would be hidden, making it easy to use.
If fedora appears to be slow and user interface lags, then speed it up by giving it more cpus. First shutdown fedora.
In the VirtualBox Manager window right click the Fedora device and go to settings. In there go to System > Processor.
Set the CPU to 2 and Execution cap to 100%. Click OK and restart Fedora. Now it should be smoother and faster.
Trying to give it more CPUs might actually hinder the performance and slow down the system.
You might want to configure the network for better functionality. Virtualbox by default setups the guest network adapter over NAT and gives it an ip address like 10.0.2.15
Then its not possible to connect to it from your host os or other computers over the local network.
To modify this, open the settings window of the virtual hard drive in the virtualbox manager window and go to Network tab.
Errors with older version of VirtualBox
If you are using older version of Virtualbox like 4.1 then the compilation of the guest additions would fail since Fedora 17 is a recent release with a newer kernel. Some errors in the /var/log/vboxadd-install.log
might look like
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. Creating user for the Guest Additions. Creating udev rule for the Guest Additions kernel module.
Uninstalling modules from DKMS Attempting to install using DKMS Creating symlink /var/lib/dkms/vboxguest/4.1.18/source -> /usr/src/vboxguest-4.1.18 DKMS: add completed. Error! echo Your kernel headers for kernel 3.3.4-5.fc17.x86_64 cannot be found at /lib/modules/3.3.4-5.fc17.x86_64/build or /lib/modules/3.3.4-5.fc17.x86_64/source. Failed to install using DKMS, attempting to install without /tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. Creating user for the Guest Additions. Creating udev rule for the Guest Additions kernel module.
or some other compilation error. So install Virtualbox 4.2.6+