Thursday, March 21, 2013

PC-BSD 9.1 Two Months

v 0.2
21 Mar 13

I've been using, reading about and playing with PC-BSD for two months now.  What do I think?

PC-BSD is an excellent server and desktop operating system.  I would gladly give my Parents such a system to use in their day-to-day lives.  It is stable, easy to use and provides a large number of easily installed third party applications.

It is not perfect, mind you.  An nVidia video card is highly recommended for a trouble-free experience, and the default desktop of KDE is strongly advised.  Automounting of USB devices does not occur, and the tray application in KDE must be used to detect and mount these.  Once the device is recognised and told to automount next time, you can use another desktop, however KDE remains the most reliable general desktop to use with PC-BSD.  That is not to say the others don't work well, but KDE is the most mature in this circumstance.  (and I say that as someone who was dragged back to admit that).  Should you disbelieve me - go ahead and find out yourself.  Automount has not worked in Gnome for some time, and the KDE tray app only mounts a USB device that it already knows about (in Gnome).

PC-BSD has introduced a "Rolling Release" concept.  I have not been successful in having it work flawlessly and at this time would recommend against using it - stay with 9.1 for the moment.

If you would prefer to stay with FreeBSD, then I still recommend using PC-BSD to install the vanilla OS.  Why?  The PC-BSD installer makes installation using the ZFS filesystem really, really easy.  If you can use ZFS then you should.  It has many really useful features, such as dynamic use of the space to manage its partition scheme, System Snapshots and more.

Easy management of Jails via Warden makes administration of Servers really easy.  You can have several Jails consisting of either BSD or Linux systems that you can snapshot or clone at your desire.  Make no mistake, though - once you go beyond the desktop, you really do need to have as much knowledge as any other system, it is just that you can get that first setup done so much easier.



Perfect?  Far from it.

Worth using?  Most Definitely.




....... Later.

Wednesday, February 6, 2013

PC-BSD 9.1 Linux Jails, VirtualBox, Citadel Groupware

v 0.2
6 Feb 13

The last few days, I've been playing with PC-BSD Jails via Warden.  I've found that the BSD Jails work just great, as I've mentioned previously, however I've been having problems installing servers on a Debian Linux Jail.  Some servers install without a hitch, and others just won't let the outside world see them. 

A case in point is installing Citadel Groupware.  In the Linux Jail, the two components can't talk to each other - Webcit, which provides the outward facing web interface, can't see the Citserver to talk on TCP 504.  Installing on Virtualbox, no problems - it installs without a hitch.

Another example is the installation of Web Servers.  Apache - nope.  Nginx - worked out of the box.  In all cases, the installation was using the standard Debian packages from the Main repository.

Debian Jail - Install Script

The way Debian is installed in a Linux Jail, is using the debootstrap command.  The way this is set in the install script is simply:

debootstrap squeeze

However, there are several architectures for Debian, in particular, the ones we want use the FreeBSD kernel .. should we include the architecture we want?  So, it would look like:

debootstrap --arch kfreebsd-i386 squeeze
or
debootstrap --arch kfreebsd-amd64 squeeze

I haven't really seen any difference, however I wonder ...

Citadel Again

Maybe I take a little longer for the concepts to sink in, but I've finally satisfied myself that the Debian packages do the same installation (albeit with files in different places - because it is Debian).
  • The servers are installed
  • The "citadel" user is created to run the server
  • The init scripts are sorted.
The outcome of all this is that when the machine (virtual or real) is started, Citadel starts as well.

How to re-configure the Citadel Server?  There is a setup script in
"/usr/lib/citadel-server"
Run that script if you need to and you can adjust ports, and add an admin user.

Be aware, that Webcit ignores your setup instructions.  Get a text editor and edit
"/etc/default/webcit"
to your liking.




Later .........


Friday, February 1, 2013

PC-BSD 9.1 - More Jails and Linux

v 0.3.1
1 Feb 13
2 Feb 13
4 Feb 13

As I mentioned a couple of posts ago, most things are easy in hindsight, but maddening when you have to work them out.  Another such example I have found with PC-BSD Jails under the "Warden".  Rather than try and organise what I've found into little chunks, this will be a narration of the adventure.

I started learning about Jails using a Linux Jail.  I used an IP address within the router address space.  All was well until I tried to communicate with services within the Jail that I thought I'd started.  Not only that, but when I check the router's "attached devices" list, my Jail was nowhere to be seen.

I remembered there were two tutorial articles about Jails in BSD Magazine, one on Linux Jails in issue 12/12 and a tutorial on installing OwnCloud in a Standard Jail in issue 9/12.

The article on Linux Jails went into NAT configuration on the host and editing a few configuration files - I must confess I found this puzzling as a requirement since everything else about PC-BSD organisation of Jails was so automated.  Eventually I went back to the beginning and went through the tutorial setting up a standard BSD Jail.

What I found with the BSD Jail was that there were several other tools to manage these Jail types - including a Process manager, where I could make sure the processes I wanted were started.  That is where I started remembering the list of ports being monitored in the Linux Jail ....  Also, it was about that time I chanced on reading a statement in the PC-BSD forums where the poster pointed out that Warden does quite a few things in the background.

So ...

I cloned my BSD Jail, giving one an IP in the router address space, and the other another address in another address space.  I made sure the Apache process was started in each Jail and that the firewall had opened port 80.  Then I went to another computer on my network and simply typed in the IP address of each jail in a web browser.  The Jail with the router address space address worked immediately and Apache talked back.  The other one, not.

My conclusion as to Jail IP address:
  • If you are simply starting a Jail - give it an IP in the router address space.
  • If you are going to configure NAT on the host system, use another address space.
How do you find the Jail if the router does not know about it?  When you address your Jail, the router queries each of its attached machines.  When it queries the host machine, that machine recognises the Jail address and passes the request on to the Jail.  So the router doesn't have to know about the Jail, it just has to be able to have an address in its address space that it can give to the host machine that then knows.

NOW .. I went back to my Linux Jail - with its IP address in the router address space.  I installed an SSH server, made sure it was started (the listened port came up on the info tab).  I opened the SSH port on the firewall.  I then went to another machine on the network,

ssh (ip address)

The Jail replied!  Victory!

So you can now configure your router to talk to a Jail just like any other attached machine.  I would guess you could even assign a static IP to a Jail, using the mac address of the host machine.

A final note about Debian Jails.  When you install the Jail, there are several configuration tasks that are not taken care of that would normally be done so in a Debian Install, but are not.  That is my next little task to take care of with a Debian Linux Jail ....


Later ............

PS
For Debian,
  • an easy way to manage startup services is to load package " rcconf " and use that to graphically set services.
  • to set the default Locale, install package  " locales " and run " dpkg-reconfigure locales " to select and set your desired Locale.


Tuesday, January 29, 2013

PC-BSD 9.1 Jails and a bit of PBI

v 0.2
29 Jan 13



PBI

I should mention a couple of niceties in dealing with PBI installs: 
  • The package does not appear on your menu until the next time you log in.
  • There is a preference selection to prevent the package making an icon on the desktop if you wish.


Jails

I started my exploration of Jails with a Linux Jail.  First thing you have to decide is what local network address you are going to assign the Jail.  At the very least, assign an address high up in the local address space - say 192.168.1.160 ..  Next you get to name the jail and finally to choose which of the two scripts to use to install it.  At the moment, there is the choice between Debian Squeeze and Gentoo.  I chose Debian, since I'm more familiar with it and just like it and intend using Debian Jails.

Once you start the script, it just works.  No deciding how big or anything like that.  The Jail uses what it needs to.  Nice.  Note the checkbox that starts the jail on system startup.  Oh, and when you shut down, the Jail is gracefully shut down before PC-BSD exits.

Upon completion, the Warden presents you with a list of your Jails and their status.  Select your Jail, and under the "Tools" tab, you can start a root terminal to use the Jail.  At the moment, the intent is text only via the terminal, however with more development, an X server environment will be easily achievable.

Would you like Wheezy or Sid with your Jail?

Whilst I am really happy that Debian is one of the two Linux distros selected for scripts to start Jails, probably because Debian has the BSD kernel available, Debian 6.0 Squeeze is old.  It is on the verge of being "Old-Stable".  Debian 7.0 Wheezy is on the verge of being the new Debian Stable for Servers.  What to do?

The answer is really, really, simple.

The shell script used to start the Debian Squeeze Jail is located in
/usr/local/share/warden/linux-installs

You can look at the script or view the source here:
http://trac.pcbsd.org/browser/pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze

Look at Line 18 of the script:
debootstrap squeeze ${jDIR}

Here you can see that the way that Debian is installed is that "debootstrap" is called to load "squeeze" over the internet.  Replace "squeeze" with "wheezy" and you will load Debian 7.0 Wheezy into the jail.  I see no reason why this should not work with Sid as well.


Now that is cool.




Later .........