freebsd 9.1 install gnome

+++Objectives+++

Install FreeBSD 9.1 x64
Install Gnome and XFCE (like to have a second option)
Setup Jails

+++ Hardware +++

motherboard: ASRock 970DE3/U3S3
cpu: AMD FX 6100 Six-Core
video card: Nvidia GeForce 8400GS
network cards:
-Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
-Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
-Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
-Intel Corporation 82541PI Gigabit Ethernet Controller
storage:  (1) 128GB SSD SATA III drive and (1) 1TB Hitachi 7200rpm SATA II drive

+++Partition Setup+++

I put my /boot and / directory on my SSD using UFS.  Then I put my /usr and /home directory on my SATA HDD using UFS.
I’ve used ZFS and I’m not that impressed with it at the moment, still a little buggy and the main feature is utilizing SSD drives better and snap shots.  Personally, UFS worked better on my SSD than ZFS did, even fine tuned ZFS.
***if you are new to FreeBSD or PC-BSD, keep the defaults and choose guided partition table and let the system setup.

+++The Install+++

Several ways of installing.  I went old fashion with downloading the DVD .iso and installing from a DVD disc
Follow the install instructions here in the handbook  CLICK HERE

The handbook is your friend!  Use it!

NOTE:  during the install, when you get into putting the name for your computer, make sure you use a full dns name.  For example,  mycomputer.mydomain.com.   I used computername.local    If you do not do this, you’ll get a timeout during the initial boot of your system and it will hang trying to resolve the full hostname.

During the setup it will prompt you to install Docs, SSD trim, and a few other things.  I only did the Docs and 32-bit libraries.

+++The Setup+++

So you’ve rebooted, removed the DVD and are now booted into your live environment.

Login as root

Run the following commands…

# freebsd-update fetch
# freebsd-update install

Reboot

Now lets get the ports directory filled so we can install software…

# portsnap fetch
# portsnap extract

NOTE: If you ever go to update your ports collection use…   (update your ports at least once a month)

# portsnap update

Now lets install your kernel sources, you’ll need them for gnome…but first we need to install subversion.  Its used to pull down the sources from the repo’s…

# cd /usr/ports/devel/subversion
# make -DBATCH install clean
# rehash

Now run the subversion command…

# svn checkout https://svn0.us-west.freebsd.org/base/releng/9.1/ /usr/src

Now lets install X11…

# cd /usr/ports/x11/xorg
# make -DBATCH install clean

Now lets install Gnome…

# cd /usr/ports/x11/gnome2
# make -DBATCH install clean

Now lets install XFCE

#cd /usr/ports/x11-wm/xfce4
# make -DBATCH install clean

IMPORTANT:  You will get an error message that xfce-notifyd conflicts with package notifications-0.7 whatever.  These packages are basically the same, the notifications package is used by Gnome but they can use one or the other but not both.  So we use “portmaster” command to fix this.

Install portmaster

# cd /usr/ports/ports-mgmt/portmaster
# make -DBATCH install clean

# portmaster -o deskutils/xfce4-notifyd notification-daemon

Continue building XFCE…

# cd /usr/ports/x11-wm/xfce4
# make -DBATCH install clean

After that is complete run portmaster command below to check for any dependency issues but you should be good…

# portmaster –check-depends

Now we configure the X server…

- follow the xorg guide on FreeBSD website HERE
Also, you can install two nvidia tools…. nvidia-xconfig and nvidia-settings found HERE  see down at bottom of page.  nvidia will auto configure your settings.

Now we setup GDM…follow instructions HERE

After you configure, reboot and you should be at GUI login in prompt and login to your new Gnome environment.

Install all desktop related tool and programs that you need from the ports as described in the handbook.
Now for jails.  FreeBSD 9 changed the way you can do jails a bit.  You can use the old way by building your jails and putting your configurations in /etc/rc.conf or you an do the new way and use the “jail” command and /etc/jail.conf file.   I will work with the newer method.  Also, you can use ezjail but do a google search on that as I will not be using that way.  There is also PC-BSD which has a GUI interface to manipulate jails and simplify jails.

*** Jails ****

Follow the instructions in the Jail man page HERE   Scroll down to about half way, the instructions start there.

Once thats completed, you’ll need to create a /etc/jail.conf file.  Below is mine…

ssh {
path = /usr/jails/ssh;
mount.devfs;
host.hostname = ssh;
ip4.addr = 192.168.1.18;
interface = re1;
allow.raw_sockets = true;
exec.start = “/bin/sh /etc/rc”;
exec.stop = “/bin/sh /etc/rc.shutdown”;
}

You need to change your “interface” to your network cards interface, change your IP address to your network, and if you want your jails name.

After you have done this…you can easily start and stop your jail from outside the jail with the command…
jail -c ssh start
jail -r ssh  stop
jail -cr ssh  restart

Remember to add a /etc/resolv.conf into your jail so it can find a nameserver.

So, that is the new way of making a jail.  Not to bad.  But this will not let your jail start automatically at boot time.  You still have to do it the old way with putting info into the /etc/rc.conf file. Example of my file is below…

# Jails
jail_enable=”YES”
jail_list=”ssh”
jail_ssh_rootdir=”/usr/jails/ssh”
jail_ssh_hostname=”ssh.local”
jail_ssh_ip=”192.168.1.18″
jail_ssh_devfs_enable=”YES”
jail_ssh_exec_start=”/bin/sh /etc/rc”

ifconfig_re1_alias0=”inet 192.168.1.18 netmask 255.255.255.255″

You have to create an alias for your network card with the IP address of the jail…see above…again change the name of the interface per your network card.  You have to start with alias “zero”.

Do you want your jail to ping from inside?  add this into your /etc/sysctl.conf

security.jail.allow_raw_sockets=1

Restart your computer, jails should fire up.  You should be good to go.

FYI:  jail command looks at the “jail.conf” file…the jail info in rc.conf is used at boot.  You can use the command “jls” to view what jails are running.  you can also use “jexec” to get into the jail shell.  Example…jexec 1 sh    the 1 is from the jls, meaning jail #1 in the list.


你可能感兴趣的:(FreeBSD,gnome,BSD)