My Brain on Code

X Server on Gentoo Virtual Box Guest

Well, after a very long time of playing around with my Gentoo Virtual Box Guest, I finally got X Server working!

I first needed to make sure hal was installed:

# emerge hal

Then I started it up:

# /etc/init.d/hald start

Then I made sure it started at boot:

# rc-update add hald default

Next, I installed the Virtual Box Guest Additions by Going to Devices –> Install Guest Additions on the Virtual Box Window. This puts a “CD” in the guests CD drive so we need to mount it:

# mount /mnt/cdrom

Now we need to run the install script that’s on the “CD”

# bash /mnt/cdrom/

It took a bit for it to install, and then the system needs a reboot once the vbox additions are installed.

# reboot

Once the system is back up I needed to make sure my xorg.conf was correct. I ended up using:

# Xorg -configure

After the file is generated (should be /root/ open it up with your favorite text editor:

# vim /root/

Go down to the mouse section and make sure it looks like this:

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "vboxmouse"
    Option      "Protocol" "auto"
    Option      "Device" "/dev/input/mice"
    Option      "ZAxisMapping" "4 5 6 7"

Then go down to the video device section and make sure it looks like this:

Section "Device"
    Identifier  "Card0"
    Driver      "vboxvideo"
        # Add the rest of yours here if its present. 
        # The main thing is to make sure the above line shows "vboxvideo"

Then the screen section should look like this:

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
    DefaultDepth 16
    SubSection "Display"
        Depth     16

Finally add this to the end of the file:

Section "Serverflags"
        Option "AIGLX" "off"

Save the file and copy it over to the default location of the xorg.conf:

# cp /root/ /etc/X11/xorg.conf

Now you can run startx to start your X server! If all went well you should be presented with a nasty looking window manager (twm). To finish the twm session, type in exit or Ctrl-D in the upcoming xterms. That’s it! You are now free to install your own window managers.