Oftentimes I find myself creating server-based virtual appliances, that is virtual machines with a server-oriented operating system as the guest OS. Most of the time I have a good reason -or at least a reasonable excuse- for doing so. For example, I may want a flexible testbed to learn about and/or experiment with a technology which is new to me, like I’ve done in the past with Linux’s logical volume manager and Oracle’s ZFS filesystem. Or maybe I just want to try out a new network service before I actually use it within my home network. Whatever the case may be, I end up installing either Ubuntu Server or FreeBSD.
This post serves as a short but comprehensive guide to all those who haven’t considered Ubuntu Server for their needs yet, but would like to try it out without much hustle. It will also come in handy as a reference or appendix for future articles you’ll be reading in Parabing!
For the creation of our Ubuntu Server-based virtual appliance we may choose any of the famous desktop hypervisors, like VirtualBox (for Windows/Mac OS X/Linux), VMware Player or Workstation (for Windows/Linux) or VMware Fusion (for Mac OS X). In the remainder of this post we’ll be using the latter, though you can freely select any one of the other and proceed accordingly – maybe with some minor changes here and there.
First thing we ought to do is to create and configure our virtual machine. Flip through the pictures of the following gallery and read the captions so you can see how I usually go about doing exactly that.
Now that the virtual machine is ready we can power it up and begin the installation of the guest OS. For the purposes of this demonstration we use the 32bit edition of Ubuntu Server 11.04 (Natty Narwhal). We won’t give to our VM more than 1GB of RAM, so there’s really no reason to go with the 64bit edition.
When we log in into our brand new Ubuntu Server, one of the first things we should do is refresh the OS’s repositories…
sub0@defiant:~$ sudo apt-get update [sudo] password for sub0: ... [snip] ... Fetched 324 kB in 6s (46.5 kB/s) Reading package lists... Done sub0@defiant:~$
…then download and install any available updates:
sub0@defiant:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: bind9-host dnsutils libbind9-60 libdns69 libisc62 libisccc60 libisccfg62 liblwres60 libpam-modules libpam-modules-bin libpam-runtime libpam0g 12 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 1,481 kB of archives. After this operation, 4,096 B of additional disk space will be used. Do you want to continue [Y/n]? Y ... [snip] ... ldconfig deferred processing now taking place sub0@defiant:~$
Ubuntu Server is configured by default to ask for an IP address from the local DHCP server. This means that every time the OS boots it gets a dynamic IP which, as you would expect, is subject to change at the next reboot/power up. That’s fine for a desktop system but for a server OS a static IP is much better. One way to configure your Ubuntu Server for a static IP address is described in this post.
That’s all for now. Have fun with your new, shiny virtual appliance and if you’re having difficulty imagining what to do with it, remember: Pretty soon we’ll be coming back with a few ideas :)