For debugging, I needed to install a Gentoo installation in a virtual machine. Here is a quick howto.
Create the virtual machine with some memory (1GB should be enough) and boot from the Gentoo Live CD (or any decent boot live cd like Ubuntu).
Disk Layout
n → 1 → primary partition (root partition) max - 2GB
n → 2 → primary partition (swap partition) remaining 2GB
Make FS, active SWAP and mount FS
- mke2fs /dev/sda1
- mkswap /dev/sda2
- mount /dev/sda1 /mnt/gentoo
- swapon /dev/sda2
- cd /mnt/gentoo/
Download latest autobuild stage3 in the mount point
untar the latest stage3 into the gentoo mount point
- cd /mnt/gentoo/
- tar -xvjpf stage3-…..tar.bz2
chroot to the mount point
- chroot /mnt/gentoo/ /bin/bash
- env-update
mount /proc
update the Gentoo repo
- change the nameserver (/etc/resolv.conf → nameserver 8.8.8.8)
- emerge --sync (…make some tea…)
- emerge vim (or any of your favorite text editor)
compiling a kernel
(the fastest way especially if don't know exactly the hardware of your virtual machine)
- emerge genkernel
- zcat /proc/config.gz >/usr/share/genkernel/arch/x86_64/kernel-config (get the config for the existing booted kernel (livecd))
- emerge gentoo-sources
- genkernel all (go for a walk or do something else)
edit fstab
- vim /etc/fstab → 1 → root and → 2 → swap
- vim /etc/mtab
- emerge grub
- emerge tmux (yes, I need it ;-)
- update /boot/grub/grub.conf to add the kernel compiled with genkernel including the initrd
- grub-install /dev/sda
add DHCP client
set a root password
and you can reboot