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 Responses to Howto: Gentoo Guest OS in VirtualBox.

  1. charcourt says:

    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.

  2. jolexa says:

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

  3. charcourt says:

    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?

  4. jolexa says:

    @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?

  5. charcourt says:

    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.

  6. tukak says:

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

  7. opensas says:

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

    if it works, it would be great to add it to

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

    but none for virtualbox, it’s a shame…

  8. jolexa says:

    @tukak: Nope

    @opensas: Go for it.

  9. chinaman says:

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

  10. jolexa says:

    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:

  11. opensas says:

    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….

  12. Michael S says:

    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.

  13. Pirx says:

    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.

  14. pennyw1se says:

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

  15. sirgt says:

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

  16. sirgt says:

    thanks for the tutorial btw xDD


Get every new post delivered to your Inbox.

%d bloggers like this: