About Archive Tags RSS Feed

 

A brief introduction to freebsd

29 October 2014 21:50

I've spent the past thirty minutes installing FreeBSD as a KVM guest. This mostly involved fetching the ISO (I chose the latest stable release 10.0), and accepting all the defaults. A pleasant experience.

As I'm running KVM inside screen I wanted to see the boot prompt, etc, via the serial console, which took two distinct steps:

  • Enabling the serial console - which lets boot stuff show up
  • Enabling a login prompt on the serial console in case I screw up the networking.

To configure boot messages to display via the serial console, issue the following command as the superuser:

 # echo 'console="comconsole"' >> /boot/loader.conf

To get a login: prompt you'll want to edit /etc/ttys and change "off" to "on" and "dialup" to "vt100" for the ttyu0 entry. Once you've done that reload init via:

 # kill -HUP 1

Enable remote root logins, if you're brave, or disable PAM and password authentication if you're sensible:

 vi /etc/ssh/sshd_config
 /etc/rc.d/sshd restart

Configure the system to allow binary package-installation - to be honest I was hazy on why this was required, but I ran the two command and it all worked out:

 pkg
 pkg2ng

Now you may install a package via a simple command such as:

 pkg add screen

Removing packages you no longer want is as simple as using the delete option:

 pkg delete curl

You can see installed packages via "pkg info", and there are more options to be found via "pkg help". In the future you can apply updates via:

 pkg update && pkg upgrade

Finally I've installed 10.0-RELEASE which can be upgraded in the future via "freebsd-update" - This seems to boil down to "freebsd-update fetch" and "freebsd-update install" but I'm hazy on that just yet. For the moment you can see your installed version via:

 uname -a ; freebsd-version

Expect my future CPAN releases, etc, to be tested on FreeBSD too now :)

| 2 comments

 

Comments on this entry

icon Steve Kemp at 21:14 on 29 October 2014
http://steve.org.uk/.

IPv6 is available natively at the hosting company, Bytemark, so I wanted to configure this too.

The default route for all hosts is fe80::1, which is neat and consistent within their network. However FreeBSD assigns this to lo0 by default which caused me some hair-pulling.

The solution was to update /etc/rc.conf like so:

ipv6_activate_all_interfaces="YES"
ifconfig_em0_ipv6="inet6 2001:41c8:10b:110::10 prefixlen 64"
ipv6_defaultrouter="fe80::1%em0"

The key thing is to set the interface name on the default router line - in my case em0 is my primary NIC so that's what I had to specify.

With that configured things work as expected.

icon rjc at 13:09 on 30 October 2014

There's a lot to be said about the *BSDs in general.

I have been using OpenBSD for a while now and am well impressed - a breath of fresh air, IMVHO.

Sure... it doesn't have ZFS, Bluetooth, 802.11n or [...] support. But it's lean, rock solid and very well documented. Especially when it comes to the latter, Debian could learn something from them, IMHO, and put more pressure on https://www.debian.org/doc/debian-policy/ch-docs.html#s12.1 - less "googling", more RTFM! ;^)