Building virtual appliances with VMware Studio and SUSE Studio

Appliance Builder

© Peter Galbraith, Fotolia

© Peter Galbraith, Fotolia

Article from Issue 98/2009
Author(s):

A virtual appliance combines the benefits of virtualization with the simplicity of a single-service device. We show you how to roll your own virtual appliances with VWware Studio and SUSE Studio.

Appliances are electronic gadgets placed in a server room to do one specific job. In the IT space, hardware-based appliances index documents, provide firewall security, and serve as content management systems. These hardware appliances are easy to deploy and configure, but they still take up space. If you're worried about the complications of adding more iron to your rack, you might be looking for something a little more virtual.

A virtual appliance is a virtual machine (VM) that includes a minimal operating system with only the most essential applications – typically centered around a custom tool designed for a specific business need. Virtual appliances can do almost anything a hardware appliance can do. Virtual appliances are deployed as intrusion detection devices, honeypots, firewalls, mail servers, DNS servers, CMS appliances, and much more.

A virtual appliance has all the advantages of other virtual systems – easy deployment, lower utility cost, minimal hardware expense – and it even offers some advantages over conventional virtual systems, such as a smaller OS footprint and reduced memory requirements. Virtual appliances also provide some security benefits: because the system is pared to absolutely minimal functionality, fewer ports are open to intruders. Many virtual appliances get by with only a single dedicated service plus sshd for administrative access.

Dozens of pre-built, ready-to-use virtual appliances are available on the Internet (see a list of sites in the Info box at the end of the article), but you'll find that most virtual appliances are of the VMware variety. Although other virtualization technologies are perfectly capable of running appliances, the alternatives don't have the broad support VMware's products enjoy. As Xen, Sun's xVM, and KVM gain wider acceptance, appliance support for these technologies will grow as well.

A VMware-based appliance is run in VMware's free VMware Server or VMware Player. To use appliances with ESX or ESXi, you'll need to convert them to OVF format using the VMware Converter tool. Most of the appliances you find on the Internet are ready to go to work with very little customization, and many are web-enabled for easy management.

If you can't find what you're looking for online, you might want to build your own virtual appliance. Built-from-scratch appliances offer one thing you can't get from a pre-built appliance: complete creative control. A number of options exist for creating home-grown virtual appliances. Of course, you could start with a full Linux distro and remove the tools and services you don't need. However, if you prefer a simpler and more structured approach, a number of tools have appeared recently for the purpose of creating virtual appliances. Two of the best known and most developed applications are VMware Studio and SUSE Studio. These tools perform a similar function, but they take very different approaches. VMware Studio is an appliance used exclusively for creating other appliances. SUSE Studio, on the other hand, is a 100 percent web-based solution.

Automated tools such as VMware Studio and SUSE studio are not intended for building fully customized and localized appliances. The idea is to create an extremely minimal system with only the services you need. Once this system is created, you can adapt the configuration as necessary and roll out one or many instances of the finish version.

In this article, I will explain how to start building a virtual appliance in VMware Studio or SUSE studio.

VMware Studio Features

VMware supports features such as:

  • Web console with appliance templates
  • Virtual appliance customization and build engine
  • Patch repository creation and publication
  • Build process automation with a command-line interface
  • Open Virtualization Format (OVF) support for VMware ESX and ESXi
  • Integration with the VMware infrastructure
  • Integration with third-party management software

VMware Studio

As I mentioned earlier, VMware Studio is itself a virtual appliance that you can use to create other virtual appliances. To use it, you'll need access to a VMware Server host or VMware Player.

First, download VMware Studio 1.0 from the VMware website [1], then unzip the VMware Studio virtual machine and start it in VMware Server or VMware Player. Once the system is fully booted, VMware Studio provides a URL to use for the web-based appliance console (see Figure 1). From the VMware Studio console, log in to use the command-line interface, configure your network settings, and set your time zone.

Figure 1: The Virtual Machine Console in VMware Studio.

To get started, open a browser and point it to the URL provided on the VMware Studio startup screen (e.g., https://10.0.1.40:5480). Now log in as root, using the password you created on first boot of the VMware Studio VM.

Once you are logged in to VMware Studio, you'll see the appliances you have created in previous sessions. To begin creating a virtual appliance, click the Create Appliance button under Actions on the right-hand side of the screen.

The Create New Appliance wizard screen now appears (Figure 2). First enter a unique appliance profile name for the new appliance and select an operating system template from the list. For this demonstration, use web_database for the profile name and Centos 5.2 for the template. Note: To use any of the listed operating system templates, you must download the ISO images from the vendor sites and place them in the VMware Studio directory /opt/vmware/www/ISV/ISO.

Figure 2: The Create A New Appliance screen in VMware Studio.

To continue, click the Create New Appliance button. The pages that follow provide customization prompts that you can use to configure your appliance. The first page (shown in Figure 3) allows you to name and set the version number, vendor name, and description of the appliance. Additionally, enter your EULA (if any), Welcome text, logo and related information, boot scripts, and SSL certificate information.

Figure 3: Editing the new virtual appliance settings.

Select the Hardware tab to edit the number of CPUs (1 or 2), RAM (MB), number of network adapters, disk names and sizes, partitions, mount points, filesystem types, and swap space. Also, you can add additional virtual disks.

The OS tab provides a location for your chosen operating system, the root password for the new appliance, and any pre-install and post-install scripts you want to run. On this page, you can also add other users.

The Application tab allows you to select additional application package repositories and add or remove software packages to your appliance. By default, this appliance includes libcurl3, libglib2.0-0, libpcre3, librpm4.4, openssh-server, and openssl.

To add new packages, enter the package name in the Additional Packages field and click the Add button. The Output tab prompts you for a name and distribution format (OVF or ZIP) for your appliance.

If you're going to maintain updates for your appliance, use the Update Repository area to provide information to your appliance users.

Once you complete all configuration settings for your appliance, click the Validate button to check your profile for errors. You'll receive a dialog box notifying you of errors, if any. If your profile is correct, your message reports: Profile Validation Passed.

When validating an appliance configuration, you might receive a successful validation but still get an error such as openssl-0.9.7 not found. To remedy this error, create the following symbolic links on the host machine and try your validation again.

ln -s /usr/bin/libcrypto.so /usr/bin/libcrypto.so.0.9.7
ln -s /usr/bin/libssl.so /usr/bin/libssl.so.0.9.7

Use these two links on your VMware host regardless of the actual version of OpenSSL you are running.

To finish your creation, you have to apply remedies to any errors that the validation process finds and continue to run the validation process until the appliance configuration is free of errors. When your profile validation comes back clean, click the Save and Build buttons. Finally, click the Build Appliance button when prompted with the Build Summary.

While the build is in progress, the build log and live status display on the screen. When the build is complete, your appliance is ready for download and deployment in the format you chose (OVF or ZIP).

SUSE Studio

SUSE Studio, which is still in alpha development and not publicly available as of this writing, is a 100 percent web-based appliance creation studio [2]. The web interface works in Firefox and Safari, but not Internet Explorer. SUSE Studio appliances use an openSUSE 11.0 JeOS (Just Enough OS) template. From that basic template, you can choose one of the following generic appliance types: Text Only, Minimal X, KDE 3, KDE 4, or GNOME.

For this demonstration, I'm using the Text Only template, which is intended for systems with no graphic user interface. Text Only appliances typically serve as small server systems that require very little user interaction.

To create a new virtual appliance with SUSE Studio, you must log in at http://www.susestudio.com. After login, SUSE Studio presents you with the options page, as shown in Figure 4. Select the Text Only option, and, on the Start page, name your appliance.

Figure 4: The Create A New Appliance screen in SUSE Studio.

Clicking the Software tab takes you to the Software screen (Figure 5), where you will add software packages to your appliance to customize it. In this case, the sample appliance will be a web database, so I need Apache, MySQL, PHP, and Perl. To add a package, either select a software group or type the name into the Quick Add field and then choose Add. This is the fastest method if you know the package name.

Figure 5: The SUSE Studio Software tab.

Once you've added all the software you want, click the Configuration tab. This tab contains the main settings area for your appliance, with several configuration subcategories: General, Startup, Server, Desktop, Storage & memory, and Personalize. The General subcategory prompts you to set the default locale (language), keyboard layout, region, time zone, network settings (including Firewall), and any additional users and groups.

Startup sets your default run level (1,2,3, or 5). The Server section is for specific settings related to any configurable server packages that you chose in the Software tab. (MySQL database configuration is one example of a server configuration you can accomplish through the Software tab.) Desktop allows you to set an automatic login with a particular user account and add any programs that launch at startup.

The Storage & memory subcategory is where you set up RAM (MB), virtual disk size (GB), and swap partition size (MB).

With the Personalize subcategory, you can upload or choose a logo and a background for your appliance. Select the Files tab to add custom files to your appliance.

When you're ready to create your appliance, select the Build and choose the type of image you want to generate: a hard disk or USB stick (the Disk image option), a Live CD/DVD image, or a VMware image (.vmdk and .vmx). It is a good idea to use the versioning system. For example, enter 1.0. Figure 6 shows the VMware virtual machine image I created.

Figure 6: To create your new virtual appliance, click Build.

The new image created in this demo is 603MB, which is compressed to a more download-efficient size of 212MB.

Click the Build button to build the appliance. Depending on your choices, the build might take from a few to several minutes. Once the build is finished, an Action button appears with the following options: Download, View log, Testdrive, File browser, and Remove. The Testdrive option is a SUSE Studio bonus for appliance troubleshooting. Selecting this option boots your appliance and allows you to work with it for 30 minutes. Testdrive lets you see whether your appliance performs as you expect before committing to a completed image.

After your new appliance build is complete, you can download, untar, deploy, and start the new VM in either VMware Server or VMware Player.

Summary

Virtual appliances are the latest buzz in the virtualization world. The small footprint and single-purpose orientation makes them easy to deploy and maintain in any virtual data center.

Between the two appliance studio applications reviewed in this article, I prefer SUSE Studio over VMware's virtual appliance because of its completely web-based architecture, ease of use, and speed. The Testdrive is an excellent add-on because it saves time on appliance creation, download, deployment, and testing. Currently, SUSE Studio only supports appliances that run in VMware Server or Player, but in the future, you'll have the choice of saving your appliances in a variety of formats, including Microsoft's Hyper-V, VMware, OVF, Xen, and Amazon EC2.

Infos

  1. VMware Studio: http://www.vmware.com/download/va_authoring
  2. SUSE Studio: http://www.susestudio.com
  3. VMware's Appliance Marketplace: http://www.vmware.com/appliances
  4. ThoughtPolice VMware Images: http://www.thoughtpolice.co.uk
  5. JumpBox VMware Appliances: http://www.jumpbox.com
  6. Enterprise Virtual Appliances: http://virtualappliances.net

The Author

Ken is a freelance technical writer and journalist. He covers a variety of open source topics, including Linux, databases, and virtualization. You can reach him via his website at http://www.kenhess.com.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News