Installing a Gentoo Linux system in a virtual machine

I've got a Fujitsu Siemens AMILO laptop. It's a "family" computer (i.e. a computer used by all the family) and I can't install Linux.

Neverthless, being a Linux addicted, I wanted to use Linux on this laptop also and a way to do that was setting up a virtual machine and installing my favourite Linux distribution: Gentoo (http://www.gentoo.org)

In the following you find some information about my experience with Gentoo and virtual machines, in the hope you can do the same thing (if you like it) without running into the same troubles I ran into.

Shopping list

Before starting you need to have at least some documentation about Gentoo

  1. The Gentoo Handbook
  2. HOWTO Install Gentoo on VMWare

and some software tools to build and run a virtual machine

  1. Something to build a virtual machine (I used the freely downloadable VMX Builder)
  2. Something to run a virtual machine (I used VMWare Player, it's free)
  3. An ISO image of a bootable Gentoo CD (you can download the "Gentoo Minimal Installation" CD from one of the mirrors you find here)

I followed instructions in The Gentoo Handbook,
they apply to a virtual machine installation also, up to section 7, "Configuring the Kernel".

Kernel configuration

I decided to "merge" the two manuals, using information from both of them. I also used some information I got by probing the virtual machine with 'lspci' (installed using 'emerge pciutils'). To put it in a nutshell, I took the kernel installed through 'emerge gentoo-sources' (kernel version 2.6.27-gentoo-r8) and made the following modifications (I tried to build everything I needed in the kernel, avoiding modules):

File systems ---> reiserfs support
Device Drivers --->
  Networking support --->
    <*> PPP (point-to-point protocol) support
    <*>   PPP support for async serial ports
    <*>   PPP support for sync tty ports
Device Drivers --->
  USB Support --->
    <*>   USB Human Interface Device (full HID) support
(this because I wanted to use a USB mouse)

Loadable module support  --->
  [*] Enable loadable module support
  [*]   Module unloading
  [*]   Automatic kernel module loading
(not required by documentation, I decided to add it)

Device Drivers  --->
  SCSI device support  --->
     <*> SCSI device support
     <*> SCSI disk support
         SCSI low-level drivers  --->
            <*> SYM53C8XX Version 2 SCSI support
            (not required by documentation, I decided to add it)
            <*> BusLogic SCSI support
            (I decided to add it after seeing the output of 'lspci')

Device Drivers  --->
   ATA/ATAPI/MFM/RLL support --->
       <*> Intel PIIXn chipsets support
       (without this I could access the cdrom as there was no /dev/cdrom)

Device Drivers  --->
  Fusion MPT device support  --->
     <*> Fusion MPT ScsiHost drivers for SPI

Device Drivers  --->
  Network Device support  --->
     [*] Network device support
           Ethernet (10 or 100Mbit)  --->
              [*] Ethernet (10 or 100Mbit)
              [*] EISA, VLB, PCI and on board controllers
              <*>   AMD PCnet32 PCI support
              (not required by documentation, I decided to add it)
           Ethernet (1000Mbit)  --->
              [*] Intel(R) PRO/1000 Gigabit Ethernet support
              (not required by documentation, I decided to add it)

Device Drivers  --->
  Sound  --->
     <*> Sound card support
         Advanced Linux Sound Architecture  --->
            <*> Advanced Linux Sound Architecture
            <*> OSS Mixer API
            (not required by documentation, I decided to add it)
            <*> OSS PCM (digital audio) API
            (not required by documentation, I decided to add it)
                PCI devices  --->
                   <*> (Creative) Ensoniq AudioPCI 1371/1373
                  (not required by documentation, I decided to add it)

I didn't know how to boot with a "nice" video mode, the console provided by the default kernel options was too small. I don't like to see a big black screen and being able to type only in a small portion of it. To boot in 1024x768 mode I set the following kernel options (suggestion by flowolf on IRC channel #gentoo, server azzurra.net):

Device Drivers  --->
  Graphic Support  --->
      <*> VESA VGA Graphic Support
            VESA driver type (vesafb-tng) --->
           (1024x768@60) VESA default mode

If you want to experiment different video modes you can use the kernel parameter "video". For instance, if you like working in a small console try "video=vesafb:800x600@60".

Network configuration

I followed the documentation but when I rebooted in the new environment I discovered that /etc/conf.d/net was empty. I wrote the following:

config_eth0=( "192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255" )
routes_eth0=( "default gw 192.168.1.254" )

For some reason the network didn't start at boot, I realised I forgot to add net.eth0 to the script started on start up and I did it:

rc-update add net.eth0 default

At this point I run into the first big trouble. I put in /etc/resolv.conf the line

nameserver 192.168.1.254

which is my ADSL router address. I wanted to use DNS my ISP provides to my router through DHCP. I don't know why but it doesn't work. I solved the problem by putting in /etc/resolv.conf real DNS addresses:

nameserver 208.67.222.222
nameserver 208.67.220.220

I got them from OpenDNS.

Audio

At the beginning was the silence... Something was wrong, "cat sound.au > /dev/dsp" didn't work as expected. I could only hear a click at the beginning and the end of the file but nothing more. Anyway, a click is not so bad to start with, it means there is something reaching the speakers.

Reading some ALSA documentation I remembered that right after installation everything is muted, to 'unmute' it you have to emerge alsautils and then run 'alsaconf'. For some reason 'alsaconf' didn't find any supported audio card. Luckily 'alsamixer' was not so fussy and let me unmute both 'master' and 'CPM' channels. After that "cat sound.au > /dev/dsp" worked as expected.

And that's all... for now. If you know anything that could get this page better please let me know. Email me at

My email address

If you like it, tell your friends, if you don't like it... mind your own business!