Application programmers targeting desktops and servers typically have the luxury of using a single machine as a development and test platform. Embedded developers do not often have that luxury, but in many cases the target is running the same processor as the host. In this case, a virtual machine manager (VMM) usually makes development easier. In this issue of EIED Online, I take a look at a pair of VMMs: Microsoft’s Virtual PC and VmWare’s VmWare Workstation. Both target the x86 market.
A typical development scenario has a host operating system supporting the VMM. Development is done using the host. The target operating system is then started to test the application. Often the application and associated data are placed on a shared network drive because a VMM-hosted operating system can be given access to a local network that can include the host PC. Of course, the target can run continuously, but it is often more efficient to stop or pause it to gain access to the resources that it uses.
Resources are the real kicker when it comes to VMMs. There is no such thing as a free lunch. So if a host PC runs the host operating system, the VMM, and a client operating system and application, then there needs to be sufficient memory, disk space, and processing power to handle it. The advantage for a developer is that the beefed-up memory and processing power can be used for a faster compile if the client is not active. On the other hand, an underpowered system simply results in sluggish operation when the VMM is running. Bottom line: get the fastest, most fully-loaded system possible for developers.
Peripherals are typically virtualized so a client hard disk can be stored as a file on the host operating system. Screen size and configuration can be adjusted to allow it to easily fit into a window on the host’s screen. The client operating system is typically able to access host devices, therefore installation of the client operating system is often done using the standard installation CD.
VMMs have a significant advantage over a hardware target because the VMMs can actually snapshot and save the current system state, allowing it to be restarted again and again. This can be an invaluable debugging tool when the system setup needed to repeat a bug is complex. Of course, this approach does not always work, especially when there is other hardware or network connections involved.
Still, the ability to stop and restart an entire logical system is a tool worth having. Likewise, the ability to run two client systems side-by-side provides an interesting comparison method for recreating and debugging problems.
Virtual PC Not surprisingly, Virtual PC runs on top of Microsoft’s operating systems and is designed to host Microsoft operating systems. It will support “other” operating systems, so it is possible to start up a virtual session from a Linux CD or another operating system like QNX Software’s Neutrino RTOS.Concentrating on Microsoft’s own operating systems allowed the inclusion of virtual machine additions. These provide a tighter integration with client operating systems and deliver features such as cross-operating system drag-and-drop, folder sharing, and clipboard sharing. It also allows optimization of the client operating system operation. In particular, it will mean that idle time is not wasted. It’s possible to share folders across the VMM boundary when Windows operating systems are in play.
Virtual PC installation is extremely easy. The printed documentation is targeted at installation, while the online support provides a more detailed view of its operation. The application interface is simple, and features a window that lists all the created virtual machine sessions. Creating a session is a matter of specifying the criteria for the system, such as the virtual hard disks to utilize. Running a session is just a couple of clicks.
From a user’s point of view, the virtual PC interface is identical to a remote control program except that the client is on the same machine. A control-alt-delete for the client is done using a menu item on the client’s window.
Most people use Virtual PC with standard Windows distributions, but it worked equally well with the embedded versions of Windows. I did not get to try an x86 version of Windows CE but, in theory, it should work. It ran rather nicely with Linux and QNX, at least through installation. I did not exercise it greatly past this point.
This is the key advantage of a VMM. It does not really care what operating system or even bare application is used. It will likely run without a hitch as long as a standard BIOS will boot whatever is provided. Of course, the level of integration will vary.
Overall, Virtual PC has a nice, clean interface that any developer will love. It is fast and efficient and provides a good, network-based debugging environment.
VmWare Workstation VmWare works with a Windows or Linux host, or in a standalone configuration. Although comparable to Virtual PC in functionality, it has more powerful siblings, such as VmWare ESC Server and VmWare GSX Server. These are heavy-duty systems designed to host many clients and provide services like load balancing across a cluster. They also have remote management capabilities that far exceed VmWare Workstation and Virtual PC. These services are of more interest to enterprise installations and are typically used out of the realm of embedded developers. However, some developers or quality assurance people might use such systems for regression testing.One big difference between Virtual PC and VmWare Workstation is in the documentation. VmWare is definitely more client-operating-system agnostic. It also supports non-Windows hosts that should be of interest to developers that work from different platforms. Also, the latest version of VmWare Workstation had a number of new features, including experimental support for 64-bit hosts, and support for preboot execution environment (PXE) and point-to-point tunneling protocol (PPTP) over network address translation (NAT). Windows developers will appreciate support for Debugging Tools for Windows (WinDbg) and the Kernel Debugger (KD). It is even possible to debug an application in a virtual machine session from another virtual machine session.
VmWare’s list of client operating systems is about twice that of Virtual PC, although Virtual PC is likely to support these as well. The list is useful as it indicates that VmWare has tested that set of operating systems. It includes all major Windows and Linux distributions, Novell Netware, FreeBSD, and x86 Solaris.
As with Virtual PC, VmWare can share folders and map .ISO CD images to a logical CD-ROM drive. The latter lets you keep any necessary CDs on the hard disk, which makes installation significantly easier.
VmWare shines when it comes to network support. It is more sophisticated than Virtual PC’s support but just as easy to use. It’s possible to setup a NAT environment so the VMs are on their own logical network. The BIOS support includes network booting.
VmWare installation was comparable to Virtual PC. The most notable difference is that VmWare uses a tabbed interface while Virtual PC shows each virtual session in its own window. I found the tabbed interface to be preferable, but then again I like a tabbed browser like Firefox as well. It is a non-issue when using only one virtual session.
Windows-centric developers will prefer Virtual PC. Those needing a wider range of operating systems will lean towards VmWare Workstation. Its network and debugging support give it the edge. And if you need to have a server-based solution, check out VmWare’s other offerings.
Other VMMs And VMM Uses Virtual machine managers are by no means a new phenomena. They have been on mainframes for ages and available on PCs almost since the inception of virtual memory on a microprocessor. Using VMMs for development work is just one use. In fact, even in the embedded environment, VMMs can be useful as a deployment device.There are a number of other VMM-style products out there, and they are often targeted at running Linux atop an RTOS such as Green Hills Software’s Padded Cell technology for its Integrity RTOS. There is also the open source XEN VMM. It’s a great alternative if you are using non-Windows clients like Linux and BSD.
Another alternative to VMMs are user mode (UM) operating system implementations. This approach has been most common with open source operating systems like Linux. It requires low-level changes to the client operating system, but it also provides a more efficient implementation.
So when are you going virtual?
www.ghs.com
Microsoft
www.microsoft.com
QNX
www.qnx.com
VmWare
www.vmware.com
Xen VMM
www.cl.cam.ac.uk/Research/SRG/netos/xen/