Howto: Gentoo Guest OS in VirtualBox.

I spent a few tries on this as I have never used VirtualBox before. I think this may be randomly documented on the web but I am putting this here for archive purposes (myself) and in case other stumble upon this.

Step 1:
Create a VM in Virtual box and set the type as Gentoo Linux. I think anyone can handle this because there is a pretty nice wizard that helps you out. Some notables: Base Memory: 512, Boot hardisk: 20 gigs (8 is plenty for a minimal install and not much else).
Fire it up and it will ask for a boot disk. An .iso on the hard drive works fine. I choose to try out the new Gentoo Linux 2008.0 Minimal Install CD.

Step 2:
If you have never installed Gentoo before. Please follow the detailed install handbook. If you have installed Gentoo before, this is no different than any other Gentoo install, take your time and read the instructions!

Step 2a:
When you get to the compilation of your kernel step. You may have good luck with these notes:

1. Processor type and features

* Processor family->
* Enable Tickless System (Dynamic Ticks)
* Remove High Resolution Timer Support
* Remove Symmetric multi-processing support
* Subarchitecture Type->PC-compatible
* Remove Machine Check Exception
* Remove 64 bit Memory and IO resources
* High Memory Support (off)

2. Power Management Options

* Remove Suspend to RAM and standby
* Remove Hibernation
* Enable ACPI Support

3. Device Drivers

* Remove Macintosh device drivers
* Remove Virtualization

4. Device Drivers -> ATA/ATAPI/MFM/RLL support

* enable Generic PCI bus-master DMA support -> Intel PIIXn chipsets support
* enable PCI IDE chipset support

5. Device Drivers -> Serial ATA and Parallel ATA drivers

* enable Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support

6. Device Drivers -> Network device support

* Remove Ethernet (1000 Mbit)
* Remove Ethernet (10000 Mbit)

7. Device Drivers -> Ethernet device support -> Ethernet (10 or 100Mbit)

* Remove 3COM cards
* Remove “Tulip” family network device support
* Remove Broadcom 4400 ethernet support
* Remove nForce Ethernet support
* Remove Intel(R) PRO/100+ support
* Remove RealTek RTL-8139 C+ PCI Fast Ethernet Adapter Support
* Remove RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter Support
* Enable AMD PCnet32 PCI support

8. Device Drivers -> Graphics support

* Remove Lowlevel video output switch controls
* Enable Support for frame buffer devices
* Enable Support for frame buffer devices -> VESA VGA graphics support

Step 3:
Continue with the install and when you get to the reboot step you should also unmount the boot cd from virtualbox.

Step 4:
Fire up your new VM and start configuring it how you like it. It should seem like a brand new Gentoo install which is pretty bare bones in itself. I would recommend picking a WM to install like GNOME, KDE, or Xfce4

Step 5:
Have fun. You may be interested in the ‘snapshot’ feature of virtualbox. I also hit “Save State’ when I close my VM. I guess you could analogue that to hibernating or ‘pausing’ as it literally comes back to where you were when you fire it up again.

17 Comments

  • July 11, 2008 - 1:09 pm | Permalink

    Thanks for that – I attempted to install Gentoo in VirtualBox not long ago, but I never got a kernel compiled that would boot. Now you’ve saved me the trouble of working it out for myself.

  • jolexa
    July 11, 2008 - 1:34 pm | Permalink

    Glad I could help. The default gentoo-2.6.24-r8 config with the above notes applied WORKEDFORME.

  • July 23, 2008 - 1:56 pm | Permalink

    Finally got around to giving this another go. Your kernel config works for me with gentoo-2.6.25-r7.

    I can’t seem to get the framebuffer (vesafb) to work though (window resizes to the correct size, but I get a blank window) – have you had any luck with a framebuffer?

  • jolexa
    July 25, 2008 - 9:05 am | Permalink

    @charcourt: Good to know that my notes also apply nicely to .25-r7. As far as vesa, my windows resizes to the correct size when X starts, is this what you mean?

  • July 26, 2008 - 7:37 pm | Permalink

    No – I don’t have X installed (I use the VM for testing server stuff). I mean the console/terminal framebuffer (vesafb, I believe). With the framebuffer enabled (adding “video” param to boot line) the system boots fine, but you get a blank window (resized to the correct size to set resolution).

    It’s not a big problem, but I like to have a better resolution for the terminal then the standard 80 cols. I’ve probably done something stupid with the configuration somewhere (probably grub.conf).

    Thanks for the response.

  • tukak
    July 28, 2008 - 3:06 am | Permalink

    Hi, did you try and have any success with installing the virtualbox additions?

  • opensas
    September 14, 2008 - 12:39 pm | Permalink

    thanks for the tip, I’m already giving it a try…

    if it works, it would be great to add it to http://gentoo-wiki.com

    there’s one for vmware, with gentoo as guest,

    http://gentoo-wiki.com/HOWTO_Install_Gentoo_on_VMware_in_Windows_NT/2K/XP

    but none for virtualbox, it’s a shame…

  • jolexa
    September 14, 2008 - 1:05 pm | Permalink

    @tukak: Nope

    @opensas: Go for it.

  • September 17, 2008 - 8:45 pm | Permalink

    Hi
    Where did you get words for this paper? From your head???

  • jolexa
    September 18, 2008 - 12:20 pm | Permalink

    chinaman: mostly. The steps are mine, freelanced. I found a couple hits with google and the kernel config is on a couple of sites already. Like I said, this is mainly for archive purposes for me, I’m glad others find it useful as evident from the number of hits this post has received. :)

    @opensas: BTW, there is this: http://gentoo-wiki.com/VirtualBox

  • opensas
    October 6, 2008 - 10:38 pm | Permalink

    thanks jolexa, what I mean is that there’s no gentoo as a guest wiki…

    by the way, could you install virtual box additions?

    I had they running ok (the screen automatically resized every time I resized the window, and going full-screen really took the whole wide screen), but then I upgraded my kernel from 2.6.25-r7 to 2.6.25-r8 and now I can’t make it work, not even booting with the 2.6.25-r7 kernel… I tried re-emerging vb additions but it didn’t work, and when I try to install them from the iso image I don’t know where to find the cd….

  • Michael S
    October 13, 2008 - 10:23 am | Permalink

    Hey, thanks for your advices. I was able to boot the 2008.minimal install, but for whatever reason names are being resolved with ping, but 100% packet loss. Hmmm. ifconfig eth0 looks just fine.

  • Pirx
    October 15, 2008 - 8:06 am | Permalink

    Nice tutorial, thx.
    @Michael S : Try setting your network to bridged instead nat if you really care about pings:). I’ve read somewhere virtualbox nat doesn’t support ping. Despite ping nat works good for me.

  • pennyw1se
    October 21, 2008 - 12:06 pm | Permalink

    really nice would be a .config, so that I don’t have to menuconfig myself :) yes, I’m lazy :)

  • December 4, 2008 - 1:59 pm | Permalink

    i have problems with the “default” nic.. in my case the one that work was the intel 1000/proMT Desktop

  • December 4, 2008 - 1:59 pm | Permalink

    thanks for the tutorial btw xDD

  • naturegirl
    March 1, 2011 - 9:19 am | Permalink

    If you follow the instructions in the gentoo handbook and have a seperate /boot partition with ext2 filesystem,
    then you have to make sure that ext2 is selected in the kernel configuration. (Default is off, while ext3 is on)
    Otherwise there is a simple way to convert ext2->ext3 that worked for me, since I already had the boot partition.
    tune2fs -O has_journal /dev/yourdevice
    and then modify the boot partition in /etc/fstab accordingly to ext3.
    Hope it helps!

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>