Most people seem to think installing a GUI on FreeBSD is a difficult task. Here’s how to do it, including little tweaks to make it work even better 😉
Login to your computer as root (or su to root from a regular user)
Use your favourite editor (check my blog for instructions on using ‘ee’ which is included in FreeBSD) to edit /boot/loader.conf – add the following lines:
linux_load=”YES”
linprocfs_load=”YES”
atapicam_load=”YES”
This will load the linux compatibility layer, and linux procfs compatibility modules (these will most likely be used later when you need to install flash plugins) and also the ATAPI scsi emulation driver. This is used for cd/dvd recording tools within gnome.
Next make sure that the linux proc folder exists by typing:
mkdir -p /compat/linux/proc
And now we will edit the /etc/fstab file. Add the following lines if they do not exist already:
proc /proc procfs rw 0 0
linproc /compat/linux/proc linprocfs rw 0 0
Next, we will tell FreeBSD to initialise the linux compatibility layer on boot-up. Edit /etc/rc.conf and add:
linux_enable=”YES”
Ok, now you’re ready to install gnome. Make sure you’re connected to the internet, and type:
pkg_add -r xorg gnome2
This will install xorg (if needed) and gnome. It will fetch all dependencies it needs, so it may take a while. You will be returned to a prompt when it’s finished.
Now to help things move along smoothly, you need to find out your computer’s hostname and add it to your hosts file… Run the following command to get your hostname:
hostname
Next edit /etc/hosts and add the following line at the bottom (replace ‘hostname’ with the output of the above command):
127.0.0.1 hostname
Now just one thing left to do, and that is to tell FreeBSD to load the gnome components next reboot… Edit /etc/rc.conf and add:
gnome_enable=”YES”
hald_enable=”YES”
gdm_enable=”YES”
dbus_enable=”YES”
reboot, and you will be presented with the gnome login prompt 🙂
Dan,
A new problem. I installed Gnome2 and it works fine the firs time, all day yesterday. I change mu password encryption to blowfish instead of md5 following your instructions, reboot the computer. It immediately started the gnome desktop but no login screen. It will not do anything from there. Instead of a login screen I have a green screen with the FreeBSD 8.1-Release prinited on the screen. Is there a way to by-pass the desktop to log back into command line so I can check and make sure i did it all right?
Also, any ideas for KDE4 installation. I’ll like to try it your way.
ctrl+alt+f1 from within gui will take you back to a non-gui textual login screen. I can’t think of any reason why that change would stop a login box appearing though.
From the textual screen, you can use alt+F keys to switch between terminals… one of them will be the gui (F8 on a standard install)
From my tests, a lot of kde4 conflicts with gnome – so its a real pain to switch between them. Personally, i’m a Gnome persion so not really pursued KDE much i’m afraid 🙁
Im noy sure if its the change or maybe something else I did not do correctly. Its the firt time I reboot since yesterday. So it may have been an issue all along.
PLease let me know when you’ve had enough of me. Another question is How you used wine on FreeBSD before and how.
wine only works on i386 freebsd (not amd64 – although I think I saw some people with patches to make it compile). It works fine, but try to get hold of winetools to install some common things if you do plan on using it.
I just want to ask, have you experienced something wrong in your mouse?
My FreeBSD box have been successfully installed with Gnome2 but one thing I’ve seen is the mouse problem. Hope you could reply to this request, since I got some errors from it.
Have you experienced the same with mine?
Thanks!
Good day!
what sort of problems? and what sort of mouse is it? there’s a few different mouse drivers included with Xorg, it might be that you need to choose another one. Personally, i’ve never had a problem with a mouse in Xorg.
Actually I’m using FreeBSD 8.1 amd64 release-version.
Specifically, my mouse cursor is not working and I can’t navigate through the system. My FreeBSD box is connected to a KVM switch which uses a PS/2 interfacing.
Also have you mentioned that there are different mouse drivers with xorg, then how can i change the configuration pertaining to its mouse driver? (Sorry for it’s technicalities..hehe!..:D)
Thanks Sir Dan!
Hmm unusual… you could read through the Xorg startup log (/var/log/Xorg.log I think) to see if it shows anything obvious in there. The various input drivers can be seen in the ports collection in /usr/ports/x11-drivers/ starting “xf86-input-” but they’re for more exotic input devices (synaptics touchpads, vmware accellerated mice etc) – for standard ps/2, the default driver (xf86-input-mouse) should be fine, and is installed by default when you install Xorg.
Have you tried a mouse direct to it, not through the KVM switch, just to rule that out?
Thank you Dan. Before this I failed at 1st attempt to install gnome for FreeBSD 8.1. Now it was up and running after I studied your steps aforementioned here.
Dan – I would like to start at the the normal FreeBSD command line and start Gnome manually. How much of the last step (the /etc/rc.conf edit) do I omit to have it start this way?
If you set gdm_enable=”NO” then it wont start the gnome display manager, which should leave you at a CLI on boot.
Dan – among other things, pkg_add installed apache2.2, samba3.4 and samba4 devel. (It appeared to fail before completing samba4.) My installation is for a specialized function and has no need for e.g. samba.
Can the extraneous programs / versions simply be deleted by pkg_delete or must they stay on the system?
It installs those to make parts of Gnome work (samba for SMB access/file sharing, apache for DAV calendars etc). pkg_delete might cause the system to become unstable if parts of gnome have been compiled against them.
If you need a very custom tuned system to that degree, you need to install things from ports with each port set to your options – but it will take hours to compile.
Packages use the most common settings that people use.
Dan – I just finished installing FreeBSD and upgrading to 8-STABLE with cvsup. I am now trying to install using the instructions above. But “pkg_add -r xorg gnome2” installs xorg and then terminates with the messages:
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/gnome2.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch ‘ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/gnome2.tbz’ by URL
#
Is there a new method to install gnome2?
I see the package for amd64 there, but not i386. It’s possible that a package hasn’t been built for i386 yet – or it failed to compile on the build cluster for some reason.
You can build it from ports (it compiles it) – but that takes a LONG time.
Other that waiting for a package to appear, the only other way I know of installing it would be via ports.
Hello Mr.dan,
I installed 8.1 from CD (following your instructions),
I tried to install GUI, everything went fine,
but when I gave the “pkg_add -r xorg gnome2 command,
downloading began as it should,
but it kept on going…
it says “Fetching ftp://ftp.freebsd.org/utlityname…” and then “Done>”
this keeps on going with different names,
even after two hours, the files were being downloaded,
(I usually get 200 kbps speed for ftp downloads, that is almost 1 Megabyte per 5-6 seconds.)
What is the size of total download?
PS, I’m using FreeBSD 8.1 i386
I’m not sure of the total download size, but it’ll be big – that’s a lot of software to install. FreeBSD downloads a file then installs it – so it also depends on the speed of your disk. The downloading part is only between the “Fetching …” and “done.” – after the “done.” message, it starts extracting it on the computer.
Dan sir,
A problem, I successfully installed the GUI,
after the booting process, the moment where I was supposed to see GNOME login prompt,
the screen went completely blank (black).
I’m using an IBM Thinkpad, with 256 MB RAM and 1.3 GHz celeron processor.
Do you think GUI isn’t supporting this hardware?
If this is right, which FreeBSD should I install? which supports any GUI.
Regards,
Kiran.
You can check if X started up ok by looking at /var/log/Xorg.log. Also, I doubt 256MB ram is going to be enough to run Gnome! You should consider something with some more RAM.
Can I use FreeBSD 7 or some previous version?
I need GUI, and I don’t want to upgrade my thinkpad.
🙂
I doubt you’ll get Gnome to work with 256mb ram in any release. You should look at a lightweight window manager if you need it to run within 256mb ram. It depends what you want to run in it too of course – e.g. firefox under any window manager is going to eat over 100mb ram itself.
Any other GUI/ Window manager is welcome as well.
Which one should I use?
And how to download/install it?
I found about XFCE (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11-wm.html)
It says:
A binary package for Xfce exists (at the time of writing). To install, simply type:
# pkg_add -r xfce4
Alternatively, to build from source, use the Ports Collection:
# cd /usr/ports/x11-wm/xfce4
# make install clean
Now, tell the X server to launch Xfce the next time X is started. Simply type this:
% echo “/usr/local/bin/startxfce4” > ~/.xinitrc
The next time X is started, Xfce will be the desktop.
As before, if a display manager like XDM is being used,
create an .xsession, as described in the section on GNOME,
but with the /usr/local/bin/startxfce4 command;
or, configure the display manager to allow choosing a desktop at login time,
as explained in the section on kdm.
Well, I installed the xfce4, but I’m having the same problem,
Can you please tell me how to install any desktop environment which would run on 256 MB of RAM?
Hi Dan!
Great tips. Now I am using Gnome on my first FreeBSD install. Thanks a lot.
Netx step 🙂 How do I install Firefox 6 or Chrome?
Regards
To install firefox (latest version, currently 6.0.2 as of this post)…
cd /usr/ports/www/firefox
make install distclean
it’ll take a long time to compile…
OR
you can use packages (precompiled, but older):
pkg_add -r firefox
Hey dan, if i have a free bsd 8.2 which in offline. Is there any way to install the gui like gnome in it?
Like download from somewhere,burn it and give it to the bsd,i mean that kind of facility.
If you use the “dvd1” image and install from DVD, it contains a lot of packages on the DVD.
You can skip the “-r” in pkg_add (which tells it to fetch from remote), but you would have to navigate to the correct folder on the DVD first.
It’s always best to do online if you can, as you’re more likely to get the latest updates. DVD images are not updated once they are released.