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.
Click next to start moving through the wizard.
Name your Virtual Machine and select its type from the drop downs.
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).
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.
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.
Name the image and select its base size (default of 8.0GB is fine).
Click Finish to confirm your image settings.
You will be sent back to the Virtual Hard Disk screen again, just click next.
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.
Click ‘Select’ and you’ll return to the ‘CD/DVD-ROM’ screen.
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.
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.
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.
Do you use virtualisation or dual booting? Is there anything you liked or didnt like about this post? Please leave a comment.
