Need a system or two to validate a new architecture? When combined with Linux, VMware Server provides a sophisticated and highly adaptable infrastructure that allows you to test complex customer client-server software configurations on a single machine.
If you’re lucky enough to work from home or if you work in IT in a large company, you may sometimes find it difficult to acquire enough equipment and infrastructure to validate a solution. Production equipment can’t be perturbed, nor can your desktop or laptop, which dutifully serves as your personal production environment. So what’s a system administrator, architect, or software developer to do? You could stockpile equipment for a rainy day, but thanks to virtualization software such as Xen and VMware Server, a new (albeit virtual) machine is just a few mouse clicks away.
In combination with Linux, VMware Server provides a sophisticated and highly adaptable infrastructure that allows you to test complex customer client-server software configurations on a single machine. Multiple instances of operating systems may run at once, each in its own virtual machine, segregated from your desktop or laptop’s own operating system. Operating system images can be cloned and copied between systems, significantly reducing development and testing time, especially when a complex software software stack needs to be refreshed, reloaded, or reconfigured.
Use VMware Server to test Linux and open source solutions such as Apache, JBOSS, and MySQL; prototype a system based on Solaris 10; evaluate “fat stack” desktop applications running on Windows, particularly those requiring VPN access or client software that can easily corrupt a desktop; and run completely protected, segregated network applications consolidated under a single system. Use your imagination: With VMware, you carry a virtual machine room on your hard drive.
VMware Server runs on all the major versions of Linux, including Red Hat, SuSE, and Debian. While all of the various flavors offer similar performance and ease of installation, I am biased towards OpenSUSE (http://en.opensuse.org, formerly known as SUSE Linux) as a VMware testing system. OpenSUSE is free of charge to download and use, is also sold by Novell as a boxed, shrinkwrapped product (http://www.novell.com/products/suselinux/index.html).
Red Hat Linux Enterprise can also be downloaded as an evaluation version, but you can’t get bug fixes for it after the evaluation period ends; to continue receiving updates, you must buy a support entitlement to Red Hat Network. Fedora, Red Hat’s free Linux version geared toward software developers, is similar to OpenSUSE, but releases new versions of its “core” twice a year, and thus becomes outdated quickly. While OpenSUSE releases new versions under a similar schedule, OpenSUSE’s support community is vast and updates for each release continue for several years.
Additionally, because OpenSuSE is meant to address end-users (not just software developers who will accept unstable and bleeding edge patch updates) it could be said that an OpenSUSE-based environment is more stable than Fedora. Moreover, OpenSUSE’s administrative tools are superior, easier to use, and are better integrated than Fedora’s or Red Hat’s. Finally, OpenSUSE has the distinction of being the only distribution that can reliably install alongside an existing Windows operating system, safely resize an NTFS-formatted disk, and install a dual-boot system during the installation process.
Remember, you first install the “host” operating system — the system that runs VMware. If you want to simply test Red Hat or Fedora, they run just as as well as “Guest” operating systems as they do as hosts. We’ll get to that later.
For a VMware Server test system, I recommend that you have 2 GB of RAM installed in your laptop or your desktop PC, and a minimum of a 1.4 Ghz Pentium 4 processor. Obviously, if you have access to a server with more RAM and more powerful processors, it’s better. I recommend that you allocate at least 40 GB of disk space for a full OpenSUSE and VMware install. I personally use a USB 2.0 400 GB hot pluggable external hard disk to hold the operating system images separately from the Linux operating system installed on my laptop.
After downloading your Linux CDs or DVDs, burn them and start the Linux install process. Simply pop in the first installation CD, reboot your laptop or desktop, and follow all the default prompts. When installing Linux, I like to install all of the development tools, both the GNOME and KDE desktops, as well as the kernel development tools and libraries. This provides the foundation for everything VMware needs to install and then some.
Specifically, VMware needs the kernel source (sometimes referred to as kernel-source in your native package or software manager), the kernel headers (kernelheaders, which is required for installing on Red Hat and Fedora) and the GNU Compiler Collection (GCC) that comes with your Linux distribution.
If you’ve installed complete versions of Red Hat, Fedora, SLES 10.0 or OpenSUSE 10.2, including all of the developer tools, you’re good to go; otherwise, check your distribution and your system to make sure you have all of those prerequisites installed before proceeding with the VMware installation.
VMware Server is designed to run on just about every Linux distribution on the face of the earth, but there are some gotchas. Namely, the software is dependent on a few kernel modules to perform a couple of critical functions. The two important modules are vmmon, the VMware virtual machine monitor, and vmnet, the virtual network device driver.
Since every kernel in every Linux distribution is compiled specifically for that distribution, the VMware modules also have to be compiled for each distribution. Thus, only a few of the most popular distributions include pre-compiled kernel modules — among these are fairly recent versions of Red Hat Linux, Fedora, SUSE Linux Enterprise (SLES 10 and SLED 10) and OpenSuSE 10.2. However, as you run updates on these operating systems and install updated versions of the kernel, the pre-compiled kernel modules may no longer work, and you’ll be forced to re-run the VMware installation program. Once all of the previously mentioned pre-requisites are installed, the VMware installation program can automatically recompile the vmmon and vmnet modules to run on your current kernel.
In addition to installing the prerequisites mentioned above, follow the steps in the installer to disable the firewall (as well as SELinux on Fedora and Red Hat) when prompted, and enable remote console management (VNC). The latter is necessary so you can remotely access the consoles for each VM that is running within the VMware Server. On an OpenSUSE machine, after disabling the firewall and enabling remote management, you can connect to the server remotely using the full Linux desktop GUI with a VNC client on a Windows box (http://www.tightvnc.com) using the first virtual console(: 1). Thus if your Linux machine’s IP is 192.168.15.102, you’d specify 192.168.15.102:1 in the connection options in TightVNC.
If you’re installing OpenSUSE 10.2, I strongly recommend reading the Linux Magazine article, “Tweaking OpenSUSE” (http://www.linux-mag.com/content/view/2609/) about keeping your system up-to-date with the latest fixes and security patches, prior to installing VMware Server. And if you need to know how to network your Linux box with other Windows systems on your LAN, consult “A Trio of Linux Tricks” (http://www.linux-mag.com/content/view/2590/) as well. The latter article is particularly useful if you need to move Virtual Machine image directories off the system using the network or for copying CD-ROM ISO files into the system for use as installation sources.
OBTAINING AND INSTALLING VMware SERVER
In Mid-2006, VMware announced that its new entry-level virtualization server, VMware Server, would be downloadable and usable under a free license with no restrictions on usage. This, along with the release of a free VMware Player application, allows operating system images created with VMware Server and VMware Workstation to run on Linux or Windows-based PC workstations.
To download VMware, head over to the VMware Server Web site at http://www.VMware.com/download/server/. Click on the “register” icon to receive your free VMware Server serial number (see Figure One). Your registration also grants you access to VMware’s developer Web site, as well as the company’s customer support forums, which are helpful for networking with other systems professionals and getting help with installing and using the software.
Once you’ve registered, download the Linux (.tar.gz) version of VMware Server, as well as the client (s) for Linux and or Windows(. zip file), depending on whether or not you will need to be remotely accessing the VMware Server from another machine. The Web-based management interface is optional and if you are simply using your personal desktop or laptop for this install, it’s overkill.
Next, as root, use the file manager in OpenSUSE to copy both the VMware Server .tar.gz file and the VMware Server Console .zip file over to the /root directory. Then, open a terminal window and type:
# tar xzvf VMware-server-1.0.0-28343.tar.gz
(The filename above may vary slightly depending on the release. After unpacking the file, cd to the new directory named VMware-server-distrib and run the installer.
# cd vmware-server-distrib
The VMware installer program asks a series of questions. Simply take the defaults and hit Enter until you get to the End User License Agreement screen. You can simply hit the letter “Q” to exit the scrolling EULA text and continue with the install. As with the previous questions, simply hit Enter to take the defaults.
Towards the end of the installation, you will be asked where you would like to hold your Virtual Machine files. The default is /usr/lib/vmware/Virtual Machine, but I like to change this to /home/vm or to a subdirectory hosted on a mounted volume (such as my USB 2.0 disk), such as /data01/vm. Just make sure that the volume you use to hold the Virtual Machine files have plenty of space (30 GB or bigger is a good start) because the machines need to hold the images of complete installs of other operating systems. As a general frame of reference, a base Windows guest operating system should be allocated no less than 4 GB (8 GB for a server and 20 GB for a minimal Windows Vista); A Linux install should be allocated no less than 2 GB for a text-based web server system and 6 GB for a complete install with GUI and apps and tools.
After choosing your Virtual Machine directory, type in your VMware Serial number. You only have to do this once — if you ever have to run the VMware-install.pl script again, such as after a kernel update, you won’t need to repeat this step; re-running the install script preserve your registration and networking settings as well, so it is just a quick one minute process to get the kernel modules up and running again.
After the install script ends, the vmmon and vmnet services should be running and you should see a message similar to what is shown in Figure Two. This means your VMware Server is running, and you can connect to it with a remote or local VMware Console client. On an OpenSUSE system, the console port defaults to 904, so if the IP address of your Linux box is 192.168.15.102, connect to 192.168.15.102:904 with the VMware Console on a remote machine by choosing “Remote Host” on a remotely networked workstation. On the local VMware Server Linux box, if you’ve installed the VMware Console you can connect to the server by choosing “Local Host”.
Installing and Configuring the VMware Console
On a Windows machine, installing the VMware Console is simply as easy as unzipping the VMware-server-win32-client1.0.1-29996.zip file to a temporary directory with WinZIP (http://www.winzip.com) and then double-clicking on the extracted VMware-console-1.0.129996.exe file (as with previous examples, the exact file name may vary). This launches the installer, and when complete results in a VMware Server Console icon on your Windows desktop that you can use to connect to your remote VMware Server.
On a Linux machine, there are a few extra steps. From a command prompt within the /root directory where you’ve copied the VMware installation files, issue the following:
# unzip VMware-server-linuxclient-1.0.1-29996.zip
# rpm -Uvh VMware-serverconsole-1.0.1-29996.i386.rpm
You should get the message shown in Figure Three. Next, issue the command:
As with the VMware-install.pl script, this script asks you a few questions. Again, take the defaults and press “Q” on the EULA page. You can then launch the VMware Server Console (see Figure Four) by typing the following command:
Configuring Virtual Machines
Once you’ve connected to the VMware Server using the Console, its a fairly simple process to configure a new virtual machine. From the Console “home” tab, choose “New Virtual Machine”. Follow the series of wizards to choose an operating system to install and to set aside some amount of disk space.
After the initial Virtual Machine setup is completed, you can then choose to boot that Virtual Machine or you can alter the settings and change the amount of memory, how many processors are to be allocated, how many virtual Ethernet devices are connected, et cetera, using the point and click GUI (see Figure Five.) If you choose to boot the Virtual Machine, have a CD-ROM or a CD or DVD ISO image handy to install a new operating system on the blank machine.
Of particular interest is how you choose to network your Virtual Machine with the outside world. You have the choice of NAT or “bridged”. NAT uses your Linux host’s IP address as a firewall and assigns to you a DHCP address that is non-routable from the outside world. Bridged allows your Virtual Machine to have a direct Layer 2 network connection to your LAN and acquire its own unique IP address. (There is also the option for “Host Only” networking, meaning that the Virtual Machine can only communicate with other Virtual Machines running within the confines of the VMware host. This is useful if you were simulating a firewall with two Ethernet devices, one connected either via NAT or Bridged, and the other running host-only.)
VMware supports a wide variety of operating systems that can be installed as “guest” Virtual Machines – every version of Linux is supported, as well as several Intel versions of UNIX including SCO Unix, FreeBSD and Sun Solaris. Microsoft operating systems are also supported, starting all the way back with DOS and Windows 3.1, and up to and including Windows Vista and Longhorn Server. (The very latest version of Mac OS X Tiger for the x86 architecture has also been verified to work using some novel workarounds, although this violates Apple’s digital rights management and their EULA.)
For all practical purposes, an x86 operating system views VMware as a PC, with a BIOS and hardware resources just like any other PC. Be advised, however, that you can only install the 64-bit versions of these operating systems on hosts that support 64-bit Intel or AMD extensions. Make sure you have either an AMD64 or Opteron Processor, or an Intel Xeon or Pentium 4 Processor supporting the latest “VT” extensions.
After installing your Virtual Machine, install the VMware tools for your guest operating system to optimize networking, video and file system performance. Select “VM” from the menu bar and choose “Install VMware tools”. With Windows-based guest operating systems, the procedure is completely wizard-based. With Linux-based systems, follow the instructions in the VMware Guest OS Installation Guide at http://www.VMware.com/pdf/ GuestOS_guide.pdf.
In addition to directly installing operating systems on VMware, you can save some time by downloading pre-configured Virtual Machines (with preconfigured application servers) from VMware’s “Virtual Appliance” directory at http://www.VMware.com/vmtn/ appliances/directory/cat/52/. Some of the canned images include Red Hat Enterprise Server, SUSE Linux Enterprise Server, Ubuntu Linux, JBOSS, Solaris 10, and Oracle Desktop Data Center.
Invaluable and Ingenious
VMware Server has become a mission critical application in my home office, and an absolute essential tool whenever I need to pick up a new skill or try a new platform. It’s perfect for evaluating new distributions, and an ideal way to test configurations before loosing changes on production machines. Make a mistake? No problem. Just throw away the image and start over.