Tag Archives: Development VM

Configure a Lubuntu 14.04 Development Image

I tend to follow a model of disposo-images for new development projects.  I create an image in ESXi for a project, put just the tools I want into the image, use it only for a month or two and then blow it away when I have either finished the project or simply want to return to a clean environment.  In the past I have used Ubuntu but most recently I have been using a lighter Lubuntu install and using X2Go for remoting the desktop.

The process below works for the 14.04 LTS release of Ubuntu.

Installing Lubuntu

The easiest way to install a minimal Lubunutu instance is to use the alternative installation process with the Ubuntu mini-iso distribution.  A link to the Lubuntu minimal install documentation appears below:

https://help.ubuntu.com/community/Lubuntu/Documentation/MinimalInstall

The mini-iso is small and the majority of the distribution is downloaded during the install process.  The installer is the standard Ubuntu text-graphical tool, not the more polished desktop installer.  The first screen appears below:

 

Lubuntu Install First Screen

First screen of the Ubuntu mini-iso installer.

Choose the ‘Install’ option and follow the dialogs.  I typically just choose to use the entire disk when prompted for storage options.  I also typically leave automatic updating off and handle that manually if I feel it makes sense to update.  Eventually, it will get to the Tasksel dialog.

Tasksel dialog.  Choose the OpenSSH server and the Lubuntu Desktop options.

Tasksel dialog. Choose the OpenSSH server and the Lubuntu Desktop options.

On this dialog I usually just choose OpenSSH and the Lubuntu Desktop.  The Lubuntu desktop doesn’t have nearly the bloat of the Ubuntu desktop so while it is not truly the ‘minimal installation’, it is very light none-the-less and you would have to install the majority of the pre-installed apps anyway.

If you are using ESXi you can install VMWare Tools at this point but you do not have to install them as most of the virtual drivers are already in the Ubuntu distribution and we will not be needing the nice X integration into the VSphere client.

Installing X2Go

X2Go is an implementation of the NX protocol and is based on the NX 3.x libraries as NoMachine went closed-source starting with the V4.0 libraries.  My experience with X2Go has been very good, the quality of the server and client are such that the projects have been adopted by the Fedora community.  Installing the X2Go server on Lubuntu is a breeze:

sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession x2golxdebindings

Once installed, reboot the VM and you should be able to connect with an X2Go client.  As Lubuntu uses the LXDE desktop environment, it is necessary to configure the client session type as a ‘custom desktop’ with the following command:

lxsession -s Lubuntu -e LXDE

I typically map the desktop display to an entire monitor.  Sometimes on the first connection after a reboot, the desktop does not resize to fill the screen but I’ve found that suspending the session and then restarting it forces the display to resize.  Maybe there is a more elegant fix out there but the suspend/reconnect works anyway.

Installing Eclipse

I use Eclipse CDT as my C++ IDE.  Installation into a minimal Lubuntu environment is straightforward.  First, install a JRE or JDK and then just download the ‘Eclipse for C/C++ Developers’ zip file from the Eclipse website.  I use the OpenJDK 7 JDK

sudo apt-get install openjdk-7-jdk

After you have downloaded the Eclipse CDT zip file and extracted everything, it is usually nice to create a desktop shortcut.  You can do this in Lubuntu using the lxshortcut tool.  Open a terminal window and move to your ~/Desktop directory, then do the following.

cd ~/Desktop
lxshortcut -o eclipse

That will pop a small dialog, just click ‘OK’.  You should see a shortcut labelled ‘eclipse’ on your desktop.  Right-click on the icon and select ‘Shortcut Editor’ from the drop-down menu.  A dialog for the shortcut editor will open and will allow you to choose the executable for the shortcut (i.e. eclipse) and an icon file (i.e. icon.xpm from the eclipse install directory).

Installing the GCC C/C++ Compilers

The minimal install of Lubuntu does not include the GCC C/C++ compilers.  Adding them is also very straightforward.

sudo apt-get install build-essential

Conclusion

At this point, you should have an image with compilers, JDK and Eclipse CDT installed and configured.  I usually snapshot the image at this point so I can branch new, clean images for other projects without having to go through the install process again.

 

Building an Ubuntu 12.04 VM for Development

I use the ESXi hypervisor, I find it ‘just works’ and the VSphere client is easy to use.  That said, as the bulk of virtualization is moving into the CPU silicon there is increasing parity amongst the mainstream hypervisors.  There is no reason why Xen, KVM, Hyper-V or VirtualBox won’t work equally well.

For Ubuntu 12.04 on ESXi, I take the defaults presented for a ‘typical’ Ubuntu 64Bit VM.  I allocate 48GB of thin-provisioned storage and 2GB of memory.  For this example I used the 12.04.1 64Bit Desktop Ubuntu Desktop build:

Ubuntu 12.04.1 Desktop 64 Bit

I prefer the Gnome Classic desktop and I install it immediately after the obligatory update and upgrade.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gnome-shell

Reboot after the update and gnome-shell install.  When the login screen reappears, click on the Ubuntu icon to the right of the user name.  A dropdown menu will appear with a number of desktop selections, I choose ‘GNOME Classic’.

For remoting the Ubunutu GUI, I find FreeNX provides the easiest to use, most responsive platform.  The install and configuration of that package may be found here: https://help.ubuntu.com/community/FreeNX and the condensed procedure for 12.04 follows:

sudo add-apt-repository ppa:freenx-team
sudo apt-get update
sudo apt-get install freenx
cd /usr/lib/nx
sudo wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
sudo tar xvf nxsetup.tar.gz
sudo ./nxsetup --install --setup-nomachine-key
cd ~

I use the NX Client for Windows to connect to the development server.  The client may be found here: http://www.nomachine.com/select-package-client.php

For ESXi, I also install open-vm-tools, it is easier than adding the VMWare repositories or installing the tools from the server itself (which bypasses the package systems as well).


sudo apt-get install open-vm-tools

After all of the above is complete, I typically export the VM as an OVF so I can quickly rebuiild the OS if I damage the one I am working with or create new VMs without the handiwork.