Server Virtualization Blog - A SearchServerVirtualization.com blog

Server Virtualization Blog:

 

A SearchServerVirtualization.com blog


A server virtualization blog covering virtual machine (VM) management and administration, VMware, Xen, Microsoft, server consolidation and hardware, backup and disaster recovery, VDI (virtual desktop infrastructure) and more.

Powerful scripting options with the VBoxManage command

Sun xVM VirtualBox offers a powerful command-line interface (CLI) component, VBoxManage, which can perform most functions within VirtualBox. Having a robust CLI is key to automation and scripting, even in a workstation virtualization product. In my continued coverage of VirtualBox, this blog will highlight some of the parameters of VBoxManage with some examples and areas where this command can be of use.

Modifyvm parameter
Probably one of the more versatile commands for VBoxManage is modifyvm. This parameter can set memory, operating system type, pae settings, monitor quantity, hardware inventory as well as snapshot configuration. Here is a sample command that sets a memory amount, makes the CD-ROM disk the first boot device and disables USB support:

vboxmanage modifyvm XP-TestSystem -memory 512 -boot1 dvd -usb off

The modifyvm parameter also has extended options such as BIOS display time, network interface driver type, host network interface assigned to the VM and enabling or disabling of the clipboard. Overall, modifyvm has over 50 parameters for an individual VM.

Controlvm parameter
From an automation standpoint, the controlvm parameter would be used to start a VM at host system boot. Controlvm can also be used to attach USB or DVD devices. The entry below will disconnect the media of the two virtual Ethernet adapters and reset the power state:

vboxmanage controlvm XP-TestSystem reset setlinkstate1 off
vboxmanage controlvm XP-TestSystem setlinkstate2 off

Note that in the case of an inventory of multiple devices of the same type, a separate entry would be required as in the case of disabling the network interface.

Snapshot parameter
The snapshot parameter can be used to manage all elements of a snapshot. In the case of a frequently used test system, it may be a good idea to automate the change back to the base snapshot. The following command would revert a VM to the existing snapshot:

vboxmanage snapshot XP-TestSystem discardcurrent -state

This command cannot be executed while the VM is running, yet a leading with a power down controlvm parameter can get the system to a state where running the snapshot parameter will do the trick.

Powerful Stuff
This is a very quick sample of what is capable with the VBoxManage command. I don’t know of anything that can be done in the interface that cannot be done with this command. VBoxManage commands also interact the same way across different platforms of xVM VirtualBox. This flexibility offers a compelling solution for an automated deployable solution at the zero-cost of xVM VirtualBox. The online user manual has the entire chapter 8 dedicated to the VBoxManage command, which can be downloaded from the VirtualBox website.

Sun xVM Virtual Box expands reach with global OEM agreements

Santa Clara, California-based Sun Microsystems, Inc. announced a handful of multi-year original equipment manufacturer (OEM) agreements with Avanquest Software, Q-layer and Zenith InfoTech Ltd. to allow them to deliver Sun’s xVM VirtualBox virtualization platform.

Sun xVM VirtualBox software is a component of Sun’s broader xVM virtualization and management software portfolio, which includes Sun xVM Ops Center, Sun xVM Server and the Sun Virtual Desktop Infrastructure (VDI) Software. The xVM VirtualBox software is the free, entry-level offering into the Sun xVM platform.

Sun xVM VirtualBox supports whichever operating system and application stack a user chooses, and has a small enough footprint to be an embedded component in OEM equipment. 

Since its release in January 2007, Sun xVM VirtualBox has surpassed 5 million downloads, and is the first free hypervisor to support all major host operating systems, including Mac OS X, Linux, Windows, Solaris and OpenSolaris.

The 20 megabyte download installs in less than 5 minutes, and has received positive third-party reviews and awards, and is being used by the Texas Advanced Computing Center, or TACC on part of its 4,000-node supercomputer.

La Garenne-Colombes, France-based Software publisher Avanquest Software will produce and publish Sun xVM VirtualBox bundled with OpenSolaris and sell it in retail outlets in the UK, Germany, Italy, Spain and France. Beginning this fall, Avanquest will provide Mac users with a solution to run the Windows operating system through Sun xVM VirtualBox.Mountain View, Calif.-based Q-Layer, a provider of cloud computing through Virtual Private Data Centers (VPDC), is using Sun xVM VirtualBox to deliver virtualization capabilities for its customers.

Bombay, India-based Zenith InfoTech Ltd., a managed services and business continuity software provider, has built its network attached storage appliance for small and medium-sized businesses using Sun xVM VirtualBox.

Sun xVM VirtualBox is available free of charge under a Personal Use License. OEMs have two options for licensing xVM VirtualBox: open source edition under GPLv2 or under a commercial license.

VBox 1.6.4 upgrade fixes folder sharing, VRDP

Sun has released VirtualBox 1.6.4, and the upgrade process requires some forward planning. Version 1.6.4 is a collection of fixes to the previous release that mostly revolve around shared folders and the VRDP (VirtualBox Remote Desktop Protocol) implementation. Here is what you need to know if you are upgrading:

During the upgrade installation, you are presented with the familiar message about installing a device that has not passed Windows logo testing. These messages are common across virtualization platforms, as these drivers and devices enable the hypervisor to present the virtual machines. A typical message is shown below:

Windows message

After these messages are accepted, the installation will continue and allow you to access your existing VMs from the previous version that you may have. 

The one unfortunate point of the upgrade process is that any host interfaces created on an existing installation of 1.6.2 or earlier will be removed by the upgrade process. Overall, I think VirtualBox’s networking implementation is a little short of both VMware Workstation and VMware Server’s VMware bridge protocol. Before you embark on the upgrade, I recommend you enumerate any host interfaces that you have created. Then, make a quick script in the following fashion that will recreate them with the same names you already have:

VBoxManage createhostif "VM-Bridge1"
VBoxManage createhostif “VM-Bridge2″
VBoxManage createhostif “VM-Bridge3″

Any VMs with a bridged interface will be configured to an invalid network interface after the upgrade to 1.6.4. I have an earlier blog posting about bridged networking on VirtualBox, and the commands and planning points are unchanged from 1.6.2 to 1.6.4.

The VMs will not need to be upgraded directly, but it would not hurt to get the 1.6.4 version of Guest Additions installed to optimize the corrected functionality between these two versions. Once the new version is installed, the systray icon and the VBoxControl getversion will show the 1.6.4 release.

Version 1.6.4 is still lean, at only 23 MB, it remains a ready to go virtualization platform and is still freely available from the Sun website.

Seamless windows in Sun xVM VirtualBox

A product that provides a smooth transition between host and virtual machine helps when selecting a product for virtualization on a workstation. Sun xVM VirtualBox offers a seamless session that can make the transition between your guest and host quite transparent. The seamless window functionality is available on Windows and some Linux guest VMs for VirtualBox. The Guest Additions package is required for both platforms to use the seamless window feature.

To enable the seamless window, press the host key (which is the right CTRL key by default) and the letter ‘L’ together. VirtualBox will present the following information message before engaging the seamless Window functionality:

Image 1

For Windows host systems, the VM will still reside as a separate window in the taskbar. When you select the VM in the taskbar, the active items are overlaid onto the host. For Windows systems, the guest VM desktop is not shown unless the show desktop command is sent. In the example below, a Windows Server 2008 guest VM is running in a seamless window on the Windows XP host:

Image 2

This seamless functionality makes it feel less like a VM, and all keyboard and mouse operations are entirely smooth. To exit the seamless window feature, host key and the ‘L’ key together will switch the VM back to a contained window. VirtualBox can also do mixed video modes in the seamless window quite well. For example, if the guest VM is running at a 16-bit color depth, and the host is running at a higher rate the lower rate is mixed in for the VM components well.

The seamless window feature has available in VirtualBox since version 1.5. More information on VirtualBox can be found online at the Sun website.

Sun xVM VirtualBox easily enables folder sharing

One of the features that make desktop virtualization packages attractive is the ability to move files from the host to the guest virtual machine without the use of a network. Sun xVM VirtualBox has this functionality, so let’s go through it for use on Windows systems.

Enabling shared folders is fairly straight forward within VirtualBox, but must be configured when the virtual machine (VM) is turned off. In the properties of the VM, the share is configured as shown in the figure below:

Image 1

Once the VM is powered on with this configuration, it can now access this shared folder. For Windows clients, the shared folder will be visible in My Network Places as shown in the figure below:

Image 2

The security permissions are available as read-only or full control for the share, and multiple shares can be made available to a VM. The shared folder is presented to the VM as a server name of VBOXSVR, so be sure not to use that name on your network. The VBOXSVR name does not resolve to an IP address but is provided to the VM by the installation of Guest Additions. You can also script out the use of a shared folder with the VBoxManage command as shown below:

VBoxManage sharedfolder add "XP-RedPill" -name "zzVirtualMachineShared" -hostpath "C:\zzVirtualMachineShared"

Using the scripted option can be helpful in assigning a single shared folder to multiple VMs on the same VirtualBox installation. VirtualBox allows a shared folder to be created as a transient share, which is removed when the VM is powered off. This option is either configured in the interface or denoted by using the ‘-transient’ option in the VBoxManage command.

Sun xVM VirtualBox 1.6.2 is freely available for download from the Sun website.

Using USB device filters with Sun xVM VirtualBox

A virtualization package is ready for prime time when it has a full array of device connectivity between the host and the guest virtual machine (VM). Let’s take a quick look at USB device redirection in Sun xVM VirtualBox 1.6.2.

The USB device functionality has a nice feature that allows a selective mapping of USB devices from the host to the guest. This can be beneficial if you want a USB device (such as a license key) to be available only to the guest VM and not the host, or vice versa. Within the VM’s configuration, you have the option to specify all devices or specified devices to be connected to the guest VM through USB device filters in the properties of the guest VM. These changes must be made offline, and for Windows hosts the VirtualBox USB controller needs to be added with the native driver. Likewise, the USB root hub that arrives via plug-and-play needs to be installed with the driver on the guest VM (which is automatic when guest additions is installed.) The figure below shows a specific device being permitted to be passed to the VM:

Figure1

The filter icons highlighted on the right side allow the VM to be presented with all USB devices, remove a filter and to add a filter that is based on user entered criteria or a selection among the currently installed devices. The filters are incredibly versatile as you could redirect certain devices by many factors to be available to the guest VM.

When a device is designated to go to the guest VM, it becomes unavailable to the host system. So there may be some practice issues to get used to losing a device when the VM is powered on. One note of caution is that the mouse and keyboard devices, if USB, are inherently made available to both the host and guest. However, if you add a device filter to add the USB mouse to the guest VM, the mouse would be only available to the guest VM.

Likewise, when the VM is powered off, the USB device will arrive back to the host and then be available for use. If snapshots are being used on the VM, the hardware inventory and specific configuration is managed in the snapshot, so USB filters will be deleted if you are reverting to a snapshot made before the filter was made.

Overall, this USB functionality is quite granular and a strong offering for desktop installation. More information on VirtualBox’s USB support can be found in the VirtualBox online user manual.

Guest Additions installation makes the grade with VirtualBox

The Sun xVM VirtualBox Guest Additions host and guest driver integration suite optimizes the guest experience in a way similar to the VMware Tools installation. The virtualization suite installs within the guest operating system with a small footprint on most of the supported platforms within VirtualBox. Let’s take a quick look at how the Guest Additions installation considerations on a Windows guest system within VirtualBox.

The Guest Additions installation is launched via the virtual machine (VM) console from the devices menu. During this task, one of the VM’s optical drives will be directed to use the Guest Additions .ISO image kept locally. The install is vary straightforward, and the native drivers are updated with the optimized drivers for the video, fixed disk, audio, optical drive and other system components. The networking drivers will likely remain unchanged after installing the Guest Additions package within the VM. Among the unique features of VirtualBox compared to other products is the option to choose among four device types presented to the VM. The Intel Pro and AMD PCnet device options will have different compatibilities with various guest operating systems. Check out last week’s SearchServerVirtualization blog entry about related networking topics on VirtualBox.

Once Guest Additions is installed, the experience is markedly improved on the guest VM. The easy way to see if it is running is to look in the Windows system tray as shown in the figure below:

Seeing Guest Additions version

Note that hovering over the tray icon also gives you the version running on the guest operating system. That is a nice feature if you are using VMs created in VirtualBox 1.6.0 or another mixed environment. If you want to retrieve the current version of Guest Additions in a scripted fashion, the following command would be run:

VBoxControl getversion

This command is located by default in the Program Files\Sun\xVM VirtualBox Guest Additions path. VirtualBox commands are generally the same across platforms, so the same command on a Linux host would retrieve the version running locally.

Guest Additions is available on Windows NT, 2000, Server 2003, Vista and XP. Windows Server 2008 functions correctly in my experience, though it is not explicitly listed as a supported platform in the VirtualBox documentation. It is also is available for Linux and Solaris platorms.

Guest Additions is included with the VirtualBox 1.6.2 product and is available for download from the Sun website.

Dissecting bridged-network functionality on Sun xVM VirtualBox for Windows

If you have not noticed, I have been on a Sun xVM VirtualBox kick recently. I think it is beneficial to virtualization administrators and managers to be familiar with at least two hypervisors — so why not learn more about xVM?

VirtualBox has a smooth interface for a version 1 release, but the one area that would require the most adjustment is the virtual networking. Let’s take a closer look at network functionality in VirtualBox.

Virtual networking on VirtualBox has a few key differences that VMware users would need to develop an understanding about before fully utilizing the potential of the product. The first difference is the concept of the virtual networking hardware. VirtualBox allows a virtual machine (VM) to have one of four network interface cards virtually assigned. These are the AMD PCNet PCI II, AMD PCNet FAST III, Intel Pro/1000 T and the Intel Pro/1000 MT. This array of virtual adapters allows a VM to have broad support for multiple operating systems, but the corresponding bridging functionality may make network administrators a little uneasy.

Spanning Tree
For Windows systems, VirtualBox uses a spanning tree algorithm from the native operating system bridging that may cause issues on systems with multiple interfaces in managed network environments. The bridged network functionality puts the VMs on the same physical network as the VirtualBox host system. In this fashion, a VM would be able to retrieve a DHCP network from the physical network and interact as if it were placed on the network parallel to the host. Windows XP and Server 2003 products’ bridging functionality is explained on the TechNet website.

Another key difference is that in order for a VM to use the bridged network is the addition of a bridging interface. Adding an interface is fairly straight forward with the use of the VBoxManage command. The following command would add a bridging interface named “VM-Bridge”:

VBoxManage createhostif "VM-Bridge"

Once this command is completed, the VM-Bridge interface is now present in the network connections inventory of the Windows control panel. Then a VM can be configured to use bridged networking with the newly created interface as shown in the figure below:

VirtualBox Bridging

At this point, the VM-Bridge interface can transparently place the VM on the same network as the host when the Windows bridged connections are correctly configured. Note also that in the network configuration you can fully edit the MAC address of the VM. While exceptionally convenient, this can introduce risk for some environments and situations.

Now that we have gone through a quick look at VirtualBox’s implementation of bridging network connections for VMs, I would have to nudge the VMware products to be a little more seamless in the category of bridged networking. By having the VMware bridge protocol binding used instead of a separate series of adapters for the same purpose, VMware’s bridging fits better for most environments.

Make no mistake, the comprehensive VirtualBox networking implementation is fully competitive with VMware. There is much more to the VirtualBox networking implementation available for download in the online user guide in section 6.

Importing VMDK disk files into Sun xVM VirtualBox

Sun xVM VirtualBox for Windows offers the capability to import VMware-based VMDK files into a virtual machine (VM), making a migration or cross-platform deployment quite enticing. VirtualBox 1.6.2 does not yet support the Open Virtual Machine Format (OVF) implementation; however, native handling of the VMDK files will suffice for most situations. Let’s go through importing a VMDK file for use in VirtualBox.

The critical tool in VirtualBox is the Virtual Disk Manager (VDM) for disk access. For most of us with a VMware-centric background, this will be a new concept. The VDM is a single tool where all virtual disks are inventoried. This can span multiple locations as well as multiple disk types - such as floppy, CD-ROM, and hard drives. Further, for the hard drive inventory, it is ubiquitous as to whether the disk is a VMware VMDK file or a VirtualBox VDI file. The figure below shows the VDM with an inventory of both VMDK and VDI files:

VDM View

When a VM is created (or when modifying and existing VM), the drive inventory can be specified to create a new virtual disk or use a disk that is listed in the VDM inventory. By managing the virtual disks within the VDM, the VMs can pull directly from this inventory based on your configuration. The VDM can provide disks of all types from remote locations, such as a UNC path or a mapped drive.

There are a few important notes on the use of VMDK files within VirtualBox. First is that the snapshot functionality is not yet supported for VMDK files within VirtualBox. Second, if you intend to boot from the VMDK file, the VM may need boot device modifications. And lastly, the VMDK is modified when used by VirtualBox, so if you go back to using it with a VMware product, depending on what you have done to it - it may not be accessible. For non-boot drives, this should be a transparent exchange.

More information on the use of VMDK files within VirtualBox can be found in the online user guide for VirtualBox in section 5.4.

Getting to know Sun xVM VirtualBox snapshots

Desktop virtualization packages rely on snapshots and virtual drive functionality. The de facto functionality standard here is found in VMware Workstation and VMware Server, but the tools in Sun’s VirtualBox may be setting a new standard. Let’s take a quick look at how snapshots and virtual drives work within Sun xVM VirtualBox.

VirtualBox snapshot technology provides the same basic functionality as the VMware products in that they can be taken while the virtual machine (VM) is running or offline.  The snapshots are taken from two different places depending on the state of the VM. For a running VM, the snapshot is taken from the running console as shown in the figure below.

Figure1

When a VM is powered off, snapshots may be taken in the properties of the VM. This difference is a slight inconvenience, but is an easy learning curve to overcome. Further, if a VM needs to revert to a saved snapshot, this same location is where the VM would be reverted. VirtualBox gives the option to build from the snapshots, so there can be multiple point-in-time restores for a single VM. Snapshots in VirtualBox are kept in the .VirtualBox\Machines\VMName\Snapshots location by default, and are a collection of .VDI and .SAV files. The figure below shows three point-in-time restores for a single VM:

Figure2

As with all snapshot restores, you should be sure that you want to restore as the reverting process is authoritative to the VM. Reverting to a VirtualBox snapshot taken while the system is running reverts precisely to that point with the VM running, rather than a powered off state. Overall, the functionality inventory of VirtualBox snapshot functions as advertised and brings another positive view to this exciting virtualization platform.

More information on the VirtualBox 1.6.x product can be found in the online user guide.