I recently downloaded and installed FreeBSD 8.0 as a VirtualBox guest (running in an OpenSolaris host, natch), and quickly discovered two things; i) FreeBSD doesn’t use a desktop GUI by default, and ii) Oracle don’t provide VirtualBox Guest Additions for FreeBSD, such that one cannot handily run a FreeBSD guest full-screen.
The following is a quick how-to which will address both issues, for new guys like me wanting to install FreeBSD 8.0 quickly and use a desktop GUI at larger than 800×600 resolution. For kicks, I thought I’d use KDE for this example – only really having used GNOME on my OSS OS tinkerings to date.
I am using VirtualBox 3.1.4 on an OpenSolaris snv_134 x64 host, and I’m going to install a VM using 8.0-RELEASE-i386-dvd1.iso. This guide assumes familiarity with installing VirtualBox guests. Host and guest OSs must have internet access.
First hiccup; I had to attach the FreeBSD guest hard disk to a SATA (not IDE) controller in my VM, otherwise I encountered the error described by the original poster at http://forums.virtualbox.org/viewtopic.php?f=8&t=19447:
From the FreeBSD ports packages installation options, install:
kde4-4.3.1
xorg-server-1.6.1,1
xorg-drivers-7.4_2
Once FreeBSD reaches the end of the installation process, reboot, login as root, then edit /etc/rc.conf to include the following:
local_startup="${local_startup} /usr/local/kde4/etc/rc.d"
kdm4_enable="YES"
(see http://www.freebsd.org/doc/handbook/x-config.html)
hald_enable="YES" dbus_enable="YES"
(see http://www.freebsd.org/doc/handbook/x-config.html)
Alter the non-root account you (hopefully) made during installation such that it can su to root:
# pw user mod davenz -G wheel
See http://www.cyberciti.biz/tips/freebsd-becoming-super-user-su-or-enabling-su-access-to-user.html for more information.
Now, reboot the guest and you should now see a KDE welcome/login screen.
Next, we install open source VirtualBox Guest Additions. Be warned that this section may take quite some time to finish – and you also need guest internet access.
Open a terminal and enter the following:
# portsnap fetch update # portsnap extract # cd /usr/ports/emulators/virtualbox-ose-additions && make install clean
I used the following options when prompted:
Once complete, add the following to /etc/rc.conf:
vboxguest_enable="YES"
Reboot the guest, and when KDE runs you should now notice mouse integration between host and guest OS is now working.
Next, we enable a guest display resolution of 1280×1024 pixels.
Reboot FreeBSD into single user mode, login as root, and perform the following:
# mount -a # Xorg -configure # mv /root/xorg.conf.new /etc/X11/xorg.conf
Edit /etc/X11/xorg.conf and add the following after the “Device” section identifying the “VirtualBox Graphics Adapter” (in my case, I removed all the other “Display” subsection entries as well):
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection
Reboot the machine, et voila:















