First Look at Ubuntu 12.04 Server into Virtualbox VM 4

Posted by JD 04/28/2012 at 21:00

I prefer LTS Ubuntu releases because they come with 5 years of support – patches. They are usually a little more stable as well. The downside is that after about 18 months, developers usually stop developing for the older LTS release so new programs do not work on these older releases. For most desktop users, that is a huge negative and they will migrate to a non-LTS release. That’s find if you have 1 or 2 machines to maintain. That does not work when you have 10 or 2000 machines to maintain.

I’m excited about Ubuntu 12.04. My 8.04 and 10.04 servers AND desktops are feeling a little old, out of date, even with the weekly patching. 8.04 server is still supported and receives patches from Canonical. Most of the servers running here are still running 8.04 Ubuntu LTS which will be under support for another year.

It is time to migrate from 8.04 to 12.04. Thankfully, I have some time, about a year to make it happen. When it comes to servers, caution is best. Unplanned downtime is the enemy.

Below are my first impressions of a test install using VirtualBox. I do this just to become familiar with any changes to the installer and to check out the new install options. This install will probably last a week.

Ok, let’s get started.

Download

I grabbed both the x64 and i686 versions of Ubuntu 12.04 Server from a local University. The FTP download took less than 10 minutes for each ISO. Thank you Georgia Tech. For this test, the i686 version will be used. This is not the desktop version because I consider all Ubuntu Desktops to be bloated. Sorry.

VM Settings

  • 1024 MB of RAM (virtual)
  • 2 CPUs (virtual)
  • VT-x Support enabled / Nested paging
  • 12MB of graphics RAM – this is a server.
  • 8GB of pre-allocated storage (virtual)
  • IHC9 chipset (virtual)
  • SATA IHC6 disk controller (virtual)
  • Intel PRO/1000 MT network adapter (virtual)
  • Bridged network, not NAT

Nothing too great, but enough to get going.
The ISO used was ubuntu-12.04-server-i386.iso (705998848 bytes)
MD5: 32184a83c8b5e6031e1264e5c499bc03

Installation Highlights

  • Language: English
  • Install Ubuntu Server – MASS is an option, but I do not choose it
  • Selected English-US about 5 other times
  • Did not allow keyboard recognition – this never worked well for my anyway
  • Hostname: ubu1204
  • Username and password
  • Encrypt HOME: No
  • Timezone successfully detected
  • Partitioning – Guided, use entire HDD. No LVM selected.
  • Ext4 is the default file system
  • Installation began at :20 after the hour. The hostOS was doing a few other tasks AND running multiple VMs while this happened.
  • Proxy question at :22 after – this halted the install
  • Package selection was limited to ssh-server only. This is how I roll with server installs.
  • :24 and the package installs began again …. claiming 50% completed.
  • :27 grub2 installed to MBR
  • Restart
  • :28, login prompt

All worked as expected, though the excessive Language questions was odd. I honestly did not read each of the questions carefully. The only question that cause a pause was whether to use US-English with dead-key support or not. I decided against at this stage.

About 10 minutes to install the OS. The pre-allocated storage really makes a huge difference in disk performance.

First Login

After I enter my id and password, I see that 6 packages need to be updated. The ISO file was downloaded 2 days prior. Ok, fine, Linux updates happen.

The shell feels quick, like it should. No GUI, no graphics. Remember, this is a server install with just ssh-server enabled.

My First Commands

I need to switch to a static IP, remove nano, put in my LAN /etc/hosts file, drop my aliases in and update the already installed packages.

  • df -k # shows 14% of 7.3G used. About 910MB used.
  • sudo apt-get purge nano # I hate nano; never want to see it
  • sudo visudo # update sudo settings to make things easier
  • scp 192.168.×.x:/etc/hosts . # Get a copy of the hosts file for this LAN segment; this file blocks about 12,000 ad and tracking networks in addition to having data for local devices and servers.
  • sudo -s # get into root
  • cp ~user/hosts /etc/hosts
  • vi /etc/hosts # need to put the localhost name back in and pick a static IP
  • vi /etc/networking/interfaces # setup static IP
  • /etc/init.d/networking restart # restart networking;
  • ifconfig # verify the static IP is working; time to switch to a more convenient xterm interface to allow copy/paste instead of the uncomfortable console

So there was a message that running /etc/init.d/networking restart was deprecated, but it still worked. Interesting. The new static IP worked.

ssh-key Setup

I love ssh. It is one of the few programs that is actually more convenient to use AND more secure to use. A big part of that is the ability to use key-based credentials for logins. From my main desktop, with a fresh xterm, I run a few commands:

  • sudo vi /etc/hosts # add the new static IP for the new server
  • ssh ubu1204 # verify my ssh login works, yep
  • ssh-copy-id ubu1204 # push my key to the new box,
  • ssh ubu1204 # works, yep

At this point, I don’t need the console anymore.
Nothing feels any different from other Ubuntu Servers at this point. 8.04 or 10.04 or 12.04 all feel the same to me.

First Patching

  • sudo apt-get update
  • sudo apt-get dist-upgrade

Why do I use apt-get and do a dist-upgrade? A regular upgrade will not install a new kernel version. There are times when you don’t want a new kernel, just a patched old one, but I’ve found that Canonical and the upstream guys do a great job releasing stable kernels. If the kernel gets updated, it is usually for a security issue. Seeing linux-image-3.2.0-24-generic-pae get installed was nice.

As usual, after a new kernel is installed, a reboot is needed. If you don’t believe me, look for the /var/run/reboot-required file.

  • sudo reboot

Summary

I guess the main take-away for this exercise is no surprises.

For me, there isn’t much more I’m interested in doing with this VM that would interest too many readers. VirtualBox is great for testing, but not so great for running production systems. To test more, I need to do a similar install under a KVM and migrate a few services there.

I also need to install 12.04 onto bare hardware and start running a KVM and LXC host on it so that multiple, 8.04 and 10.04 and 12.04 client OSes can be run.

More to come in the following days, weeks, months on this.

  1. JD 04/28/2012 at 17:15

    So after the reboot, name resolution wasn’t working. It took a little looking around to realize the issue.
    So /etc/resolv.conf didn’t have anything inside it except a warning that this file was over written through an automatic process.

    The file comments pointed towards some program called resolvconf, but that didn’t seem to be what I needed. Google found an example /etc/network/interfaces file that contained some settings I’ve never seen before.

    • dns-nameservers
    • dns-search

    New to me.

    auto eth0
    iface eth0 inet static
      address 192.168.101.38
      gateway 192.168.101.1
      netmask 255.255.255.0
      dns-nameservers 192.168.101.200
      dns-search example.com internal.foo
    

    A network restart and DNS began working nicely. All is good.

    Seems there are slight differences between ubuntu versions over the years. I don’t know yet if this is better than the prior solution, but it does let DNS settings be connected to individual network interfaces, which is a great idea. There may be downsides that I haven’t discovered at this point, but so far so good.

  2. JD 04/30/2012 at 13:03

    Falco has made another Perfect ISP Server Guide for Ubuntu 12.04 . If you really want to understand your ISP setup, installing one of these servers and using it locally is probably the best way.

    His How-To includes: Apache2, BIND, Dovecot, ISPConfig 3 and lots of other little tips like fixing dash, running fail2ban, SquirrelMail, and setting up ssh before ISPConfig3 – or it doesn’t work. Anyone with a little knowledge, not experts, can follow these guides.

    Good stuff to know.

  3. JD 05/02/2012 at 16:00

    Falco has done his Perfect Desktop Ubuntu 12.04 article.

    He usually includes how to replace unwanted apps with the ones you like and how to load those non-free codecs and 3rd party programs for Flash and PDF viewing.

    Enjoy.

  4. JD 01/23/2013 at 21:34

    So, if we assume you’ve setup a server with a static IP, hosts files to make access easy and ssh access through keys, what is next? Certainly, we aren’t done.

    I load a few other programs.

    • ntp – time is critical (really important for security)
    • ssh security
    • fail2ban – automatically block repeated ssh attempts
    • postfix – I like to forward email to my real email account(s)
    • cron – running scheduled jobs rocks

    I’ll configure my ~/.ssh/config for the new server. This is a point of documentation for me – AND lets me use an easy to recall alias to access it with an odd userid and hostname.

    I’ll prevent direct root login over ssh and prevent password-based logins too. /etc/ssh/ssh_config and /etc/ssh/sshd_config have those settings.

    At this point, I’ll enable the firewall to block everything except ssh. Depending on the purpose for this specific server, I’ll either use iptables directly or use ufw. Be certain you have console access to the server before you screw around with the firewall.

    sudo ufw allow ssh

    At this point, it is time to setup backups. I used to backup the entire OS, apps and data, but about 2 yrs ago, I stopped that. Now I backup the data and app settings only. The OS and apps are almost always installed from a repository, so I only need a list of the installed apps to be golden. That is simple using dpkg —get-selections and placing that output into a file area that DOES get backed up. It is part of my backup script.

    Backups are critical.

    If I’m using ruby or perl on the box, I’ll load rvm and/or perlbrew on the box to keep my scripting environments away from the OS versions of these tools which are often 2+ yrs old.

    Don’t forget to purge nano from your system. If you are a UNIX/Linux admin, learn vi or vim. Get over it.