Virtual Machine-VirtualBox

Written by  //  05/05/2009  //  Isio-gawanyo  //  Zima maoni

Installing gentoo on VirtualBox

Host preparations:
Open VirtualBox
-Click new and follow the instructions on the screen.After you have finished, go to cdrom and attacht rescuecd.iso on it.
-Done with creating the guest oss, then click start to boot into the rescuecd.iso.

Instructions (general installation-routine for gentoo)
Please feel free to skip this and use the excellent official handbook.

-Prepare network, net-setup will do.But ping isnt working even though connected to internet.I used to open firefox for the handbook :)
-Click start to Boot rescuecd, after the process type “startx” and then gparted to prepare disks.Skip the “startx” if you feel good.
-If you choose to startx then gparted is excellent, if you stay on the console fdisk is your friend.

Example for VB VM:
-Table:
/dev/hda1 logic partition
/dev/hda5 /boot
/dev/hda6 /
/dev/hda7 /home

Installation of tarbals stage && portage
Mount partions:

#mount /dev/hda6 /mnt/gentoo
#mkdir /mnt/gentoo/boot
#mount /dev/hda5 /mnt/gentoo/boot

Download the tarbals:

#cd /mnt/gentoo
#wget "http://ftp.snt.utwente/pup/os/linux/gentoo/releases/x86/current/stages/stage3-i686-2008.0.tar.bz2"
#wget "http://ftp.snt.utwente.nl/pub/os/linux/gentoo/snapshots/current/portage-2008.0.tar.bz2"

Extract the tarbals:

#tar xvjpf stage3-i686-2008.0.tar.bz2
#tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr

/etc/make.conf

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /etc/make.conf.example for a more detailed example.

#cflags
#Warning:Dont edit chost
CHOST=”i686-pc-linux-gnu”
CFLAGS=”-march=prescott -O2 -pipe -fomit-frame-pointer”
CXXFLAGS=”${CFLAGS}”

#Portage:

MAKEOPTS=”-j3″
#Accept keyword
ACCEPT_KEYWORDS=”x86″
PORTAGE_NICENESS=”15″
SYNC=”rsync://rsync.europe.gentoo.org/gentoo-portage”
GENTOO_MIRRORS=”http://de-mirror.org/distro/gentoo/
http://ftp.fi.muni.cz/pub/linux/gentoo/ ht# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/devtp://mirror.muntinternet.net/pub/gentoo/”

FEATURES=”buildpkg ccache collision-detect strict userfetch userpriv
metadata-transfer parallel-fetch assume-diget digest”
AUTOCLEAN=”yes”
LINGUAS=”en en_GB nl”
#VIDEO_CARDS=”vesa”
#ALSA_CARDS=”snd-hda-intel”
INPUT_DEVICES=”mouse keyboard”

#USE flags
USE=”-X mysql apache2 php”

#distfiles
DISTDIR=/usr/portage/distfiles
#PORTDIR_OVERLAY=/usr/local/portage
PORT_LOGDIR=/var/log/portage/elog

/***************************************end make.conf***************************/

ready to chroot:
prepare:

#cp -L /etc/resolv.conf /mnt/gentoo/etc/
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

now chroot

# chroot /mnt/gentoo /bin/bash
#env-update && source /etc/profile

update the tree

#emerge --sync

Change profile:
#emerge -av eselect
#eselect profile list
#eselect profile set 12

Optional glibc locales:(i normally uncomment 1st 2 here)
#nano -w /etc/locale.gen

Kernel configurations:

check date:
#date

install sources:
#emerge -av gentoo-sources

check where does it point:
ls -l /usr/src/linux

configure it:
#make menuconfig

Compile the kernel:
N:S
The option that needs attention the most is cpu, the rest can be re-compiled later on.
We need up en running VM asap.
Processor type and features —>

Check if modules are built:
#find /lib/modules/

#make && make modules_install
#cp arc/i386/boot/bzImage /boot/kernel.img

System Configurations:
fstab:
#rm /etc/fstab
#nano -w /etc/fstab
#

/dev/hda5 /boot ext3 defaults 1 2
/dev/hda6 / reiserfs defaults 0 1
/dev/hda7 /home ext3 defaults 1 2

Password
#passwd

Change the clock to local in /etc/conf.d/clock

System tools
#emerge -av pciutils syslog-ng vixie-cron reiserfsprogs slocate dhcpcd \
gentoolkit grub\
&& rc-update add syslog-ng default && rc-update add vixie-cron default

Configure grub.conf:
#grub --no-floppy

grub> root (hd0,4) (Specify where your /boot partition resides)
grub> setup (hd0) (Install GRUB in the MBR)
grub> quit (Exit the GRUB shell)

grub.conf

default 0
timeout 30

#splash image to spice things up
splashimage=(hd0,4)/boot/grub/splash.xpm.gz

#booting Gentoo linux
title=Gentoo Linux
root (hd0,4) #position of the kernel image in the boot partition ofcoz /dev/sda8
kernel /boot/kernel.img root=/dev/hda6 video=vesafb:mtrr:3,ywrap,vga=0x31B

Create a user:
#useradd -m -G users,wheel,audio -s /bin/bash john
#passwd user john

Finalize:
rm stage**
rm portage**

Self-remarks:
-Video mode isnt correct, but you can pick up from the list en bootup process will continue
-Go to network and change the ethernet controller to intel/PRO/1000 works with NAT.Probably the other works too,but havent checked them.
-Ping doesnt working on guest, even though guest connected to the internet.Probably known issue with VB.
-You can set bridge which seemed like I need more time on it, never worked with it before.Probably next move for me

Please leave critics or tips on the thread :)

snapshot1

Comments are closed.