We’ll hear a lot more about virtualisation when Vista ships, so stay one step ahead
Last month I walked you through the basics of using the Microsoft Virtual Server 2005. This month it’s the turn of VMware and its VMware Server, which can similarly be downloaded and used to build and host virtual machines completely free of charge.
Why VMware?
On the face of it VMware Server would appear to be a relatively new product, but
in fact only the name is new. It’s really based on a much more mature server
virtualisation solution, called GSX Server, first released long before Virtual
Server 2005 put in an appearance, and with a number of significant advantages
over the Microsoft package.
There are some similarities. For example, like Virtual Server 2005, it can be deployed on 32-bit or 64-bit x86 hardware and requires a host operating system to run, but it differs in that this can be either Windows or Linux. VMware Server also differs in the range of guest operating systems it can handle with, as well as Windows and a huge number of Linux distros, support for Sun Solaris and Novell NetWare.
You also get support for two-way virtual multiprocessing, although you’ll need at least two physical processors to get this facility. Plus it can take advantage of the latest processor virtualisation technologies, and can even import and run virtual machines created with the Microsoft package.
Getting started
Here you’ll find all the relevant links for downloading
the program and registering (free but required) with VMware. You’ll need to
decide whether to go for the Windows or Linux version but, either way, be
prepared for some hefty (100+ MB) download files.
VMware Server comes in two parts – the core server plus a client package containing, among other things, the console needed to create, run and generally manage virtual machines. The client package also comes in both Windows and Linux flavours and can either be run on the host server or remotely, enabling you to manage a Linux server from Windows and vice versa.
The Windows implementation is the easiest to start with, installing like any other Windows application. However, the Linux version isn’t that much harder with a choice of either a Tar binary or an RPM package.
Anyone with a modicum of Linux knowledge should be able to follow the instructions provided with a couple of install scripts involved in each case. That said, unless you’re particularly adept at compiling applications it’s best to stick with one of the supported Linux hosts, like Red Hat, Suse or Ubuntu for which pre-compiled binaries are provided.
You’ll also need to activate the server. However, there’s no charge and once you’re registered you’re emailed the serial codes required which can be applied during the install or later from the management console.
Creating a virtual machine
Having installed everything, the first thing to do is run the client console and
log on to the host server. Whereupon you should see a display taken from a
Windows console logged onto VMWare Server running on a Red Hat Enterprise Linux
host.
Notice that because I use VMware Server a lot I’ve got several different virtual machines configured already, which I can simply select and run. You can also download pre-built virtual machines from the VMware website and run those. But chances are you’ll want to build new machines from scratch, for which a wizard is provided.
Start the wizard and select the ‘typical’ configuration and a lot of the settings will be configured for you. You will, however, be asked which guest operating system you want to run, often including the exact version involved.
You’re then asked to give your VM a name and specify where all the files will be stored, after which you can select the type of virtual networking you want to use.
Personally, I tend to stick with bridged networking, where the virtual machine gets its own IP address, rather than use Nat (Network Address Translation). I do sometimes opt for a private VLan when I don’t need more general network access.
Next you’re asked for the size of the virtual disk. It’s crucial to get this right as changing the disk size later isn’t straightforward (see box ‘Expanding a virtual disk’). Also bear in mind that changing things like the disk and memory sizes on a VM running Windows XP can cause the Windows activation software to kick in and ask you to re-activate your licence.
Disk space can be allocated straight away or as required to make best use of what you’ve got. It can also be allocated in 2GB chunks, which can be helpful when taking backups, and you can also add extra virtual disks later on if you want.
Similarly you’re not asked about other options such as memory size, virtual CD-Rom and floppy setup and so on until you choose a custom setup. However, most of the settings can be edited after a VM has been created, via the VMware Console.
Running it
Having created a VM, simply click the button marked ‘Start this virtual machine’
and it will be booted on the remote server with the console displayed on the
management PC. You can then install the OS of your choice, either from a
physical CD-Rom on the host server or an Iso image file.
Once the OS is installed there’s just one last thing to do – install the VMware Tools, which are effectively custom drivers designed to enhance video and mouse performance. These need to be installed on each VM individually, something that can only be done while they are running.
Start the VM, then click ‘Install VMware Tools…’ on the VM menu to attach a virtual CD-Rom to the selected machine. With Windows the setup program on the virtual CD will start automatically and take you through the install procedure. On a Linux guest the CD will be mounted, but you’ll need to run the install script yourself with a choice of either a compressed Tar or an RPM package.
And that’s about it. You’ve created your first VM, loaded an OS and are ready to start using it. Of course, there’s a lot more you can do, such as take snapshots and roll back changes, not to mention clone virtual machines and build virtual appliances. But that will have to wait for another time.
Expanding a virtual disk
Disk resizing isn’t an option in the VMware console. It can be done only from
the command line using a tool called the VMware Virtual Disk Manager
(vmware-vdiskmanager.exe). This is installed on the host server and needs to be
run there – not on a remote PC running the VMware console.
On the Red Hat host on which my VMware Server runs, for example, I would do this by opening a terminal window and changing to the directory containing the virtual machine I want to alter.
The command I would type in is:vmware-vdiskmanager –x sizeGB file.vmdk. You’ll need to replace ‘sizeGB’ with the size you want the new disk to be in GB and ‘file.vmdk’ with the name of the virtual disk involved.
You don’t need to be logged on as root to run this command. Indeed it can cause problems if you are, as the expanded virtual disk will be owned by the root user and will not usually be accessible by others.
This, of course, isn’t an issue on Windows servers.Bear in mind, too, that increasing the size of the virtual disk doesn’t make the partitions defined on it any bigger.
To take advantage of the extra space on a Windows VM, for example, you’ll need to run Symantec Partition Magic or something similar to dynamically expand any existing partitions. Likewise with Linux, where open-source partition management utilities can be used.
No VM? No problem
Here’s a useful website I found the other day. It’s called
EasyVMX
and it lets you create new virtual machines for use with VMware Player.
Why might it be useful? One of the drawbacks with VMware Player is that it only lets you open existing virtual machines, not build your own. For that you need the free VMware Server or the commercial VMware Workstation package. That means installing and learning another application when all you want is a virtual machine for use with Player.
EasyVMX gets round this by enabling you to create a virtual machine for any VMware-supported guest operating system. All you have to do is specify the name you want to give the new VM, the guest OS required, the amount of virtual memory to allocate and the disk size. You’re then given a link from which the new VM can be downloaded. More advanced options are available if you choose the Expert mode.
Of course, the new VM won’t have the guest OS installed, but open it with VMware Player and you can boot from CD-Rom and install the required operating system, just like you would on a ‘real’ machine.