Running Fedora on VMWARE

Running Fedora on Windows using VMWARE.



VMWare Inc released its free VMWare Player last week. It provides ability to run a guest operating system inside another OS, which would be perfect for my needs — running Linux inside a virtual machine, on top of my existing Windows XP system.

And here is my guide on how to get it working.

Installing Gentoo Linux on VMWare running on Windows

Problem

You cannot use VMWare Player to create virtual machine images — VMWare requires you to get their Workstation or Server version to do that. It can be overcome by downloading an existing VM, and then re-install it with the OS of your choice. Or alternatively, use QEMU to create VM images in VMWare’s virtual disk file format.

Operating Systems

My host operating system is Microsoft Windows XP SP2. Installed by techies at work, and I don’t even have Administrator password for it. It is running on a Dell Latitude D600 notebook with 1Gb of RAM and 60Gb on IDE0.

I chose Gentoo Linux as my guest operating system. It is the operating system I use on this server box. It is very versatile, easy to upgrade, has huge number of packages, very well supported and Gentoo just gives you that “cool” factor. Doesn’t real man compile his operating system?

At the same time, Gentoo might not be the best choice for a VMWare guest OS, as a simple emerge world inside the virtual machine is going to put heavy tax on the CPU. I will recommend Ubuntu Linux if compiling the OS is not your thing.

We are also assuming the guest OS will be installed on “C:\linux\gentoo.vmdk“, where the VMWare configuration file will be called “C:\linux\gentoo.vmx“.

Downloads

Get these ready before starting out.

  • VMWare Player
  • QEMU — we actually just need qemu-img.exe to create the VM image.
  • Gentoo Linux — you will need:
    • /releases/x86/2005.1/installcd/install-x86-minimal-2005.1.iso — LiveCD to boot the VM into Gentoo Linux.
    • /releases/x86/2005.1/stages/i686/stage3-i686-2005.1.tar.bz2 — Stage 3 to bootstrap installation.

Installation

  1. Install both VMWare Player and QEMU. You will need to restart Windows afterwards.

  2. Assuming you have installed QEMU in “C:\Program Files\QEMU”, fire the following command inside a Windows console to create the virtual machine image allocating 10Gb of space:

    C:\> "C:\Program Files\Qemu\qemu-img.exe" create -f vmdk c:\linux\gentoo.vmdk 10G
    Formating 'c:\linux\gentoo.vmdk', fmt=vmdk, size=10485760 kB
    C:\>

    It actually does not create a 10Gb file in that directory, as space will only be allocated when needed. So it might be wise to create something a bit bigger, depending on your need.

  3. Create a virtual machine configuration file (using notepad.exe will do), and save it as “C:\linux\gentoo.vmx“:

    config.version = "8"
    virtualHW.version = "4"
    memsize = "256"
    ide0:0.present = "TRUE"
    ide0:0.fileName = "c:\linux\gentoo.vmdk"
    ide1:0.present = "TRUE"
    ide1:0.fileName = "c:\linux\install-x86-minimal-2005.1.iso"
    ide1:0.deviceType = "cdrom-image"
    ethernet0.present = "TRUE"
    ethernet0.connectionType = "nat"
    usb.present = "TRUE"
    sound.present = "TRUE"
    sound.virtualDev = "es1371"
    displayName = "Gentoo Linux"
    guestOS = "other26xlinux"
    nvram = "gentoo.nvram"
    scsi0:0.redo = ""
    ethernet0.addressType = "generated"
    uuid.location = "56 4d d9 96 08 47 ef ee-bf f2 48 a8 ce 89 7f 68"
    uuid.bios = "56 4d d9 96 08 47 ef ee-bf f2 48 a8 ce 89 7f 68"
    ide1:0.autodetect = "TRUE"
    ethernet0.generatedAddress = "00:0c:29:89:7f:68"
    ethernet0.generatedAddressOffset = "0"
    checkpoint.vmState = "gentoo.vmss"
    tools.remindInstall = "TRUE"
    ide0:0.redo = ""

    You should also save Gentoo Linux’s LiveCD ISO image inside C:\linux (referred by ide1:0.fileName in the configuration file). Now it is almost ready to go!

  4. Double click on the VMX file. Windows might prompt you, asking which application it should use to open the VMX files. Associate that with VMWare Player. VMWare might ask you about the UUID — just create a new one as it is a new image. You’ll then see the virtual machine POSTs, booting off the CD, and eventually give you a root prompt!

    Now, you can just install Gentoo Linux like installing it on any other PC’s. Preparing the disk (it would be /dev/hda), unpacking the installation stage tarball, chroot, and start emerge sync && emerge system!!

Well, I know this installation guide is sort of incomplete, as it stops at the stage where the OS is not even on the partition. I guess the important part is just documenting the hack using qemu-img.exe to create virtual machine image, and Linux is now ready to be installed inside this prepared VM. However, if you have not installed Gentoo Linux before, I will recommend their quick installation guide which contains almost everything you need to get bootstrapped (if you already know Linux). There are other documentations on Gentoo’s website worth checking out.

コメント

人気の投稿