Tuesday, September 11, 2007

Running Fedora 7 on Virtual PC 2007

(from the Hardware vs. Software 2 - this time it's personal! department)

Hi everyone,

Here's a (very) quick guide as to how I got Fedora 7 running on Virtual PC 2007. These are necessarily terse notes to myself - experienced Linux users (and Virtual PC users) will dig 'em. If there's interest in a step-by-step guide for normal (?) Linux users, I'd consider writing that as a separate blog entry.

Quick Guide/Notes:

  1. I decided to perform an FTP install of Fedora, so I only downloaded ISOs for the Live CD (Fedora-7-Live-i686.iso) and the Rescue CD (F-7-i386-rescuecd.iso).
  2. Virtual PC was set to use shared networking. (I'm not sure if this is a requirement or not - that's just how I did it.)
  3. Booted from the Live CD and followed the instructions for an FTP install of Fedora 7.
  4. You must perform a text based install. The graphics won't work by default since Virtual PC uses a 16-bit display and the installer defaults to 24-bit.
  5. When you reboot after the install, use a recovery disc and get to a command prompt. You'll want to change /etc/X11/xorg.conf and switch it to 16 bit graphics:
    Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    DefaultDepth 16
    SubSection "Display"
    Viewport 0 0
    Depth 16
  6. You'll also want to comment out the S3 driver (with a "#") and add the framebuffer driver:
    Section "Device"
    Identifier "Videocard0"
    # Driver "s3"
    Driver "fbdev"
  7. Next, we need to start the kernel with extra parameters. This starts the kernel in framebuffer mode, fixes mouse support, adds mouse wheel and fixes a clock issue. I did this by editing the kernel entry in /boot/grub/grub.conf as follows (split into three lines for browser compatibility on the main blog page):
    kernel /vmlinuz-2.6.21-1.3194.fc7 ro
    root=/dev/VolGroup00/LogVol00 rhgb quiet vga=791
    i8042.noloop psmouse.proto=imps clock=pit
    1. The vga=791 selects 1024x768 screen and 16 bpp. You can set the pixel resolution to whatever you like by putting in the appropriate VESA value, however, for Virtual PC 2007, you must pick a 16 bpp mode. There's a handy list of them here at Wikipedia.
    2. The i8042.noloop fixes the mouse issue (i.e. PS2 mice that the emulator creates don't work with some kernels)
    3. The psmouse.proto=imps gets the mouse wheel working.
    4. The clock=pit fixes a clock issue

  8. Finally, I had to edit /etc/inittab to switch to X11 graphical boot instead of a text boot. Look for this line, and change the "3" to a "5" as follows:
  9. That's it!
Regular Virtual PC 2007 and Fedora 7 usage I leave as an exercise for the reader. *grin*

Update: Here are a few more notes that might prove useful.
  1. When you set time zone, be sure to indicate that the System Clock does *not* use UTC. Otherwise, you will find that your Fedora clock is off by a number of hours, depending on how many time zones you are away from UTC. If you set this by mistake, you can change it later in the GUI by selecting System-->Preferences-->System-->Date & Time.
  2. You may be able to use the graphic installer after all. When you boot the installer, use "Tab" to edit the command line, and try adding "vesa i8042.noloop psmouse.proto=imps clock=pit" after the "vmlinuz initrd=initrd.img". I'm testing this now, and will update my blog notes accordingly.



Dave said...

Thank you! Your instructions worked like a charm. I had already changed the color depth to 16 as some others recommended, but that still didnt fix the problem for me. Your fix did it. Thanks again.

Pt said...

Thanks for sharing your solution.

Sorry my bad english :)

Anonymous said...

Thanks for the nice instructions. Here's what I did :

1) Hit Tab in the boot menu and add "vesa i8042.noloop psmouse.proto=imps clock=pit" to the end of the vmlinuz line

2) Install as usual

3) Capture the rescue CD image upon reboot and choose "Rescue an installation"

4) Apply changes in the article (color depth, adapter, etc.)

Ray said...

Great article Dave!

Using your article I yanked a Fedora 7 VMWare Appliance from Thought Police. I converted this to a Virtual PC disk using vmToolkit's VMDK to VHD Converter. I then fixed the disk size using their VHD Resizer to improve performance.

I booted up the image but the screen was unusable. I ssh'ed to the box using putty and followed the instructions from your blog. Fedora 7 works perfectly and at several times the speed of VMPlayer.


Mr Wizard said...

Your guide worked great. Thanks a lot.

Anonymous said...

Great article

there are a lot of them on the Internet. I am complete newbie on this OS (all Linux). This article helped me so much that I in a few days are seriously concerning leaving my MS OSes!


Anonymous said...

Works for Fedora 8 as well - thanks!

69 said...

You did an excellent job! I am new to Linux, posts like this make me want to learn more about the OS. Again thanks for the instructions.

Delighted! said...

You, Sir, are indeed a scholar and a gentleman!

Thank you, thank you, thank you!

Anonymous said...

Also works for CentOS 5.


Anonymous said...

Yet another satisfied customer! F8 on MS 2005

Anonymous said...

Great article. Thank you for sharing your solution!

Branko Santo said...

Thank you sir, it really helped! :)

aks said...

Incredible, this works like a dream. Thank you so much. I am new to Linux, so this was really useful to me.

Although, I did have a strange problem where it automatically wrapped the lines in grub.conf to the next line, this prevented Fedora from starting but it was easily solved by making everything fit on one line (after some fighting against the auto line wrap feature :-P ).

Anonymous said...

thank you Dave
Work perfectly , it takes me 2 min in VI to edit those parameters on Fedora 8.

Paul said...

"Thank you Dave?"

Who's Dave? I'm Paul :)


Anonymous said...

Hmm... 40 something scorpio like myself. I'm pretty new to Linux, but it was awesome Paul! I had figured out the text mode part already and wondered how I was going to get in there and change those files. Then I came upon your page. Halfway through the rescuecd download I read Ray's comment mentioning ssh. Why didn't I think of that. Heck I can handle that, and while fumbling for the SecureCRT icon I clicked WinSCP, even easier than I thought it would be. Now if I could get vga=817 to work... c'Ya, Terry

addy.cs said...


I am new to Linux environment. need Ur help.

i have downloaded fedora 7 iso images on my HDD( i am using winXP) and want to startup linux using MS virtual PC.

when i start fedora with virtualPC by capture CD image option and capturing "F-7-i386-rescuecd" file, i get fedore boot menu. when i choose to install in text mode the installation process freezes after a few seconds after displaying some messages like

Loading vmlinuz................................
Loading initrd.img..............................
Uncompressing Linux... Ok, booting the kernel.

i have another file "F-7-i386-DVD" which is comparatively very huge than "F-7-i386-rescuecd", arround 2 GB, dont know what to do with this file.

please help.

Thanks in Advance !!

Anonymous said...

thanks buddy !! it worked like a charm

Cleiton Souza from Brazil said...

Greate Article, Thank you very much!

Anonymous said...

After several hours of trying to figure this out, I reached your post. It worked like a charm.

Thanks a lot for your great contribution to the net comunity.


Anonymous said...

Thanks a lot for your great solution it works perfect !!!

Roy Child said...

Excellent info! I needed to install Fedora 7 so I would have a dev instance to mirror a Godaddy VPS server. This was incredibly useful. Thanks!

Anonymous said...

Thank You Paul!! If your ever in Fay, NC Beers are on me! This works on CentOS 5.2 when installing in VirtualPC2007.

Anonymous said...

thanks alot buddy without this information i wud hav been sufferin to install fedora!!..:)..Thanks once again..;)..

Ben Roberts said...

thanks - it works now - you earned 10 brownie points!

Anonymous said...

Wow Thank you so much you are my hero for this night!!!!!

Anonymous said...

Followed the instruction and successfully installed CentOS 5.3 on Windows 7 enterprise. Thank you for really valuable posting.

Anonymous said...

Hello. And Bye.

ytosa said...

Thank you for your note.

CentOS 5.4 (2.6.18-164.e15) now has a mouse pointer! However, the mouse movement is sluggish. Is there a solution?