Installing Fedora 10 on Windows XP using VirtualBox

For a lot of developers, they like to have multiple operating systems available for development testing or office chores on one and development on the other. Personally, I like Windows for email, organisation, gaming, but hate developing on windows, I prefer to develop in a Linux environment. Mike on the other hand, likes to have his primary OS as Linux but likes the option of a Windows machine every now and then for testing in IE or using Windows-only applications. For a long time the tried and tested method of running multiple OS’ on a single machine was to do the ol’ dual boot action which was ok, but became tedious if you forgot something from one OS and had to reboot a few times to get it. Virtualisation is not new by any means, but what is relatively new is the free availability of an extremely easy to use Virtual machine client such as VirtualBox. It makes setting up VirtualMachines extremely easy and takes the requirement of dual booting away for ever, especially when you can get such amazing performance from your guest operating system.

I will be installing Fedora 10 (guest) on a Windows XP (host).

What’s needed;
Virtualbox (I am using 2.1.4 in this post)
Fedora 10

Firstly, I’ll go step-by-step (oooh baby) to install VirtualBox and get the Live CD version of Fedora up and running under XP.

Once you have downloaded the VirtualBox installed and obtained a copy of the Fedora 10 Live CD iso (A Live CD is a CD that will boot and run a copy of Linux without needing to be installed, it’ll run entirely from memory – we do get an option to install to HDD once its booted though, which we will do), we need to simply run the VirtualBox setup and create a new virtual machine.

Install VirtualBox

Installing VirtualBox is as easy as installing any other application. Just follow the prompts. As it needs to install a bunch of extra network controllers and what not, you might get a bunch of warnings / confirmations from Windows about whether you would like to continue. If you don’t continue you may as well stop reading now. :)

Once VirtualBox is installed, open the app and click on the ‘New’ button.
empty_virtualbox 

Click next to start moving through the wizard.
new_vm1 

Name your Virtual Machine and select its type from the drop downs.
new_vm2

Select the amount of memory to allocate to your Virtual Machine. I usually choose a minimum of 512mb or it gets just a little too slow to use. (You can also increase your video memory alocation at a later stage).
new_vm3

On this next screen we need to create the hard drive for the vm. Whats needed is a file for VirtualBox to cloak as a hard drive for the vm.
Click ‘New’ and then click ‘Next’ to start the virtual disk wizard.
new_vm_new_hdd1

This next screen is up to you. I like to know that if I need the extra space on the vm, the disk will grow as its needed, but if you are short on space or want to restrict it, you can simply have a fixed-size image. Whatever you prefer.
new_vm_new_hdd2

Name the image and select its base size (default of 8.0GB is fine).
new_vm_new_hdd3

Click Finish to confirm your image settings.
new_vm_new_hdd4

You will be sent back to the Virtual Hard Disk screen again, just click next.
new_vm4

Now you’re pretty much done. Just click through to the end of the wizard and you have created your Virtual Machine. What we need to do now is tell our new VM to use the Live CD iso disk image when we boot up. Go into the settings of your VM and click ‘CD/DVD-ROM’ and check the ‘Mount CD/DVD Drive’. Put a check in ‘ISO Image File’ and click the little folder icon on the right hand side.
Once that opens, click the ‘add’ button and select your iso file for Fedora 10.
new_image

Click ‘Select’ and you’ll return to the ‘CD/DVD-ROM’ screen.
mount_cd

Click ‘OK’ to exit the settings.

Now comes the exciting part. Click ‘Start’ above your Fedora 10 VM and watch the magic. You might get a notification about the host key (Right CTRL) or the colour settings (24 instead of 32 bit), just check ‘do not show this message again’ and click ‘ok’.

When Fedora has booted, you’ll notice its just running Fedora without installing anything, this is the Live CD at work. Click the icon on the desktop that says ‘Install to had drive’.

Install Fedora 10

Follow the prompts through the installer. All of these settings can be changed later so don’t worry too much. Make sure you disable ‘System clock uses UTC’ as it will conflict with the system clock and you’ll get all sorts of weird times displaying in your guest.

After inserting your root password, you will get a prompt stating that the partition cannot be read and would you like to format, click ‘Yes’. You will then come to the partitioning screen. Some people like to create separate partitions for /home and /boot and all the others, but personally as this is for development only (ie, nothing really saved on there) I just leave it as default and click next.
install_partitions

Now we just need to sit back and wait for the installer to do its thing.

When the installer is complete, click on ‘System’ and ‘Shut down’ – do not reboot as the Live CD image is still ‘in’ the machine and you will just boot back into that.

Once the machine is shut down, you can go back into the settings of the CD/DVD-ROM and uncheck the ‘Mount CD/DVD Drive’ (or you could leave that checked and select ‘Host CB/DVD Drive’ and check ‘Enable Passthrough’ for your system cd/dvd drive to work in the guest OS). Once that is done, start the VM again.
Fedora will boot into a ‘Welcome’ setup wizard.

Keep clicking forward until you reach the Create User screen. If you are new to Linux, then you should be aware that you need to have at least one other non-root account which you will use on a day to day basis, only switching to root for certain actions. Create your user account, select the date and time and then (if you want) send your hardware profile.

Once complete, you will receive the login screen, login with the user you created.

Installing KDE

If you are new to Linux, you wont know that there are many different ‘desktop environments’ available and the two most popular are Gnome (installed by default) and KDE. I much prefer KDE, so before I do anything in my new Guest OS, I will install that.
To install KDE:
Click ‘Applications’ > ‘System Tools’ > ‘Terminal’.
Then type the following (each new line represents ‘enter’)

$ su –
{Enter your password}
$ yum -y install kdebase kde-workspace

This is about 90MB.

Once installed, we need to log out (’Administration’ > ‘Logout’) and we need to restart the X environment by holding CTRL+ALT and hitting Backspace.
When X comes back up, we can log back in, but we want to go back to the main login screen (not the ‘this screen is locked’ screen) and down the bottom, from the ’sessions’ list, select KDE, then login.
Once you log in, you’ll see that KDE is super sexy!
Now, we need to update our system and install some other bits to make our VirtualBox experience even greater.

Update the system

In our ‘F’ menu, click into ’search’ type ‘Term’ and open the terminal.
Type

$ su –
{enter your password}
$ yum -y update

Once that has downloaded and installed all updates (337 updates for me at 400MB) we’ll start getting the system ready for the really cool VirtualBox features and we’ll also get a better resolution, too.

In the terminal, we need to install a few new items.

Installing VirtualBox Guest Additions

Type

$ yum -y install kernel-headers gcc

Note: thanks to Carlos in the comments, kernel-devel is also needed!
After it has installed, reboot the machine (its not Windows, I know, but we did just change the kernel files).
When it has booted back up and you have logged in, un-capture your mouse with right CTRL, then on the VirtualBox window, click ‘Devices’ > ‘Install Guest Additions’. This mounts a directory within your Guest file system but you wont be able to see it till you open it with a file browser, so open the F menu, go to File Manager (Dolphin) and browse to /media/VBOXADDITIONS* (Whatever version you have). Then in your terminal…

$ su –
{enter your password}
$ cd /media/VBOXADDITIONS*
$ sh VBoxLinuzAdditions-x86.run

Wait till the install has finished and reboot again (I know, I know…)

Now it starts getting sexy, on boot up, you’ll receive a message about mouse pointer integration, this means that you can mouse in and out of your guest without needing to capture and release your mouse from VirtualBox. You’ll also likely have a better resolution and you will also have cut’n'paste between host and guest (although in my experience, this functionality can be a little flakey). Right CTRL + F will make your guest full screen and if you click on ‘Machine’ (in VirtualBox top menu) and select ‘Auto resize guest display’ you can have your display resize when you resize / full screen the window which is cool.

fedora_installed

You can also do a lot of other configuration tweaks to VirtualBox based on what you want out of it, but for me, this is all I (and most other devs) need. Head on over to the VirtualBox site and check out their wiki if you want to explore some of the other features (like port forwarding to the guest, which is also cool but a bugger to get working).

Now you have a fully functioning Fedora 10 install on your windows machine. You can install / remove / develop / whatever you want. If its in full screen, you wont even notice windows is there (which is always nice).

Following these instructions, you can install any OS inside any other OS. Windows in Mac, FreeBSD in Fedora, Centos in Mac. Whatever you want. VirtualBox really does make virtualisation seriously easy and available to anybody with only minimal tech knowledge needed.

For developers, you might want to start by installing a few of the development packages available to you.

fedora_yum

Do you use virtualisation or dual booting? Is there anything you liked or didnt like about this post? Please leave a comment.

  • jay1091
    I am using this guide to install virtual box and fedora 12. However, there may be a slight difference with version 10 and 12, but I cannot seem to follow through to install fedora 12 after installing the virtual box. The section for click 'CD/DVD-ROM' is not in the setting for version 12. Help! How do I get Fedora to get started on Virtual box.
  • cbiggins
    Hi,

    So, there is no option in virtualbox for using a disk image? Is that right or am I misunderstanding?
  • Subhransu
    Hi,
    I am facing some issue with gcc. I hav installed using the above terminal command and it got instlled properly. I can see the gcc version through "gcc -v" command. But when I am trying to run a very simple c program it is giving really silly errors. It is not able to recognize double qoutes. So giving error at printf("\n Hello world"); Is there anything that I have missed to install for gcc to work. Please help
  • cbiggins
    Hmmm, this is a hard thing to troubleshoot. Can you post the error?
  • Akilesh
    I need a clarification. I have got 512mb RAM. Is it possible to run fedora as a guest os under WinXP? How much memory should i allocate to the guest os if possible? I rarely use fedora. Please help...
  • cbiggins
    Hi Akilesh, I would just experiment, you can change it later. Start by assigning it 256mb.

    I cant say that you will get good performance, but it should still work.
  • swati
    thanks.........for helping
  • Salamo Alikom
    whould you pleas upload the libsound.so.6 or the similar to that ,because i need it or email to me .
  • ralphin
    great work u made me learn the power of virtualbox option of installed fedora to run on the computer after it restart the windows computer after following the instruction of this manual.
    great i tried but never knew about the virtualbox option great work.

    also u have give the advance option to get a good set up installation great work.

    this should be in all the place of linux
    in my case i used fedora 9 it works.
  • So you have it running as a dual boot now? Or on a separate machine?

    My advice would be to install another version as a guest VM and copy all your configs and files over. Its a bastard, I know, but you can't just copy the install into a VM. :(
  • Guru
    Thanks,

    So this isn't fruitfull if we have Fedora10 already installed and wish to run it as guest on WinXP(host)?

    Guru
  • RJ
    I got all working but can't switch to the KDE Desktop. I tried switchdesk kde and the logout and choose the session from the login screen, but I just get the normal choose a user to login as with no such options.
  • Did you install KDE?
    Do you not have a 'session chooser' menu on the login screen?
  • PK
    Many thanks to all. This was really a big help. Without that I had thrown away VirtualBox and Fedora. But know ;-)

    Makes a lot of fun
  • RV
    Ok, It didn't work as good for me. I booted Fedora just as you said, but when the load bar is completed below, the entire loading bar and "Fedora 10" goes grey, and becomes unresponsive, also virtual machine puts it in pause mode? Please help, I would really like to just test fedora but keep windows xp.
  • Hi RV,
    Make sure you have enough memory on the machine and that you didn't set the virtual machines memory too high. Virtualbox can flip out and pause when system resources are not high enough. Try closing all other apps and see how it goes.
  • Colombo
    This is all everyone needs to get started. Thanks Carlos
  • B. King
    Nice work! This helped quite a bit. Thank you!
  • Thanks Carlos, you're right - I have updated the post.
  • Lloyd
    Thanks, this is a much better option than dual booting for my purposes (mostly learning to program).

    Thanks also to Carlos, I needed to install kernel-devel as well and never would have figured that out on my own.
  • Carlos
    Nice guide.

    For Fedora 10, I found that instead of yum -y kdebase kde-workspace, I had to run yum -y kdebase kdebase-workspace. Also instead of just yum -y install kernel-headers gcc, I had to run yum -y install kernel-headers kernel-devel gcc.

    Other than those things, everything ran smoothly.

    Thanks for writing this.
blog comments powered by Disqus