Moving A VirtualBox Virtual Machine

Virtual Box Logo

As part of a recent PC reorganization I wanted to move some existing virtual machines and duplicate some others. Both Windows and OS X are used as hosts and VirtualBox 4.2.4 is used all around. The process is the same whether the host OS’s are Windows or OS X although all the screenshots here are from an OS X host. Since I’m moving from VirtualBox to VirtualBox this is all pretty straight-forward. Be aware that if you are moving Windows VM’s you may have to activate Windows again once it runs on the new host.

Clone The VM To Be Moved

I always clone the VM as a first step. This makes sure all the files are in one spot and leaves unnecessary files behind. So I do this even if the plan is to delete the original VM. This also provides a nice backup for the inevitable mistake.

1. Open VirtualBox Manager, right-click the machine to duplicate and select “clone”.

Clone Menu Selection

 

2. Enter in a machine name if you do not like the default provided. Select “Reinitialize the MAC addresses of all network cards” if you plan on using both the old and new machine at the same time.

Clone Virtual Machine Dialog

 

3. Wait for the clone to finish

4. Locate the cloned VM on the disk. It will be located in the default location and be a folder with the same name as the cloned machine. This can be found in preferences

Default VM Location
Default Location In Settings
VM File Location
The VM Directory

Copy this entire folder to an external disk or other central location so that it can be transferred to the other machine.

Now it’s time to setup the new VM.

Setup The New Virtual Machine

VirtualBox doesn’t create the default folders until the first virtual machine is created. If no virtual machines have been created since VirtualBox was installed either create a dummy VM or create the default directory specified in settings. You can use any location, it doesn’t have to be the default. Just be sure to remember the location if it’s not the default. Copy the Virtual Machine directory from step 4 to your selected location on the new machine.

1. Select Machine -> Add from the VirtualBox Manager menu.

Add a New Virtual Machine

 

2. Browse to the newly copied directory and browse into it to locate the *.vbox file and select it.

Select the VBox File

3. The machine will be loaded and may be ready to use. If you want to run this machine in addition to the original machine you will have to change the machine name. You’ll also need to have selected “Reinitialize the MAC…” in step 2 of the cloning process. You can optionally rename the Virtual Machine. You may also have to do some of the additional tasks listed below.

Additional Tasks

You may have to:

  •  Change the network adapter used in the VirtualBox settings for the machine. If so a warning will be displayed and you’ll be brought to the correct preference setting and VirtualBox will have put in a valid entry. If you have multiple network cars you may want to change VirtualBox’s choice.
  • Activate Windows (again)
  • If you use Windows Home Server AND duplicated the machine (meaning both old and new will run) uninstall and re-install the connector software on the new VM.

 

Ubuntu 10.10 (Maverick Meerkat) Installed to VirtualBox

Virtual OS - Ubuntu 10.10 tile

Virtual OS - Ubuntu 10.10 tileA lazy Sunday afternoon is a perfect time to install a new OS and today happened to be when Canonical officially Released Ubuntu 10.10. I started downloading all 4 ISOs (32 and 64bit each for Desktop & Server). The 64-bit desktop happened to be the first ISO download that finished to I decided to make that my first VirtualBox installation.

I’m running VirtualBox 3.2.8 r64453 (the most current version) on Windows 7 Professional with all the latest security patches to date. I’ll be installing Ubuntu 10.10 64-bit. Ubuntu is calling this version “The Perfect 10” for obvious, if man-made reasons. For those really into numerology I’m doing this on 10/10/10 and in binary 101010 is 42, the answer to the Ultimate Question of Life.

But enough of that numerical nonsense. I’ll be doing a walkthrough of the operating system and then a walkthrough of the VirtualBox Guest Additions.

Download the appropriate iso image from Ubuntu, no need to burn it to DVD or copy to USB, as long as your PC can access the file. In my case I save all my DVD images to a Windows Home Server share so access it over my local network. If you need VirtualBox you can get it from VirtualBox.org.

Ubuntu 10.10 Installation Walkthrough

The installation process of the 32-bit and 64-bit desktop versions is the same although the screenshots shown here will be from the 64-bit version. Almost every selection I make is the default option. The few changes I make don’t have anything to do with making the installation work, they just configure it the way I want (like putting the virtual machine on a different drive).

The new button in VirtualBoxStart VirtualBox and click the “New” button to start the new virtual machine wizard. The first screen is just an intro screen while the second is where you name the virtual machine and let VirtualBox know what the OS will be. You can name the machine anything you want. Usually once I type “Ubuntu” VirtualBox picks the correct OS type. For some reason it used “Debian” rather than Ubuntu so I picked Ubuntu 64-bit manually. Ubuntu is Debian based and maybe VirtualBox doesn’t recognize the shiny new version so played it safe. I also kept the default memory setting of 512KB, I can always increase it later.

New VM Wizard Screen 1 New VM Wizard screen 2 New VM Wizard screen 3

Then it’s time to create the virtual hard disk. I’ll be creating a new disk and letting this VM use the entire disk. Except for the name & location, I keep the default settings. The Dynamically expanding storage means it will grow to the size I specify, but won’t allocate space until it’s needed.

New vm wizard screen 4 New Virtual Disk Wizard intro screen Select storage type screen

It’s the next screen where I change the name, and then click the fold icon (Click this icon to change disk location)to change the default location.

Virtual disk location and size screen The virtual disl settings I used

Once the new virtual disk wizard ends VirtualBox has all the information it needs to a summary screen is displayed for final confirmation. Once “Finish” is clicked the virtual machine is added to the VM list. Make sure it’s selected and click the “Start” button to start the first run.

New virtual machine wizard summary and confirmation screen The virtual machine list with the new vm selected First run wizard intro screen

The Ubuntu 10.10 iso image isn’t yet listed as an available media source so I click the folder icon (VMfoldericon) to start the Virtual Media Manager. I click the “Add” button in media manager and browse to the Ubuntu iso image and select it. When I’m done it’s now the selection in the Installation Media list.

Select Installation Media screen The main Virtual Media Manager screen I select the Ubuntu 10.10 iso image from the file system

The first run wizard is ready and will boot the Ubuntu CD

Once the “Finish” button is selected the VM will start to boot from the Ubuntu 10.10 CD image. It will take some time and may seem to be frozen but be patient, eventually there will be a welcome screen. Since this is a VM and I’m not wiping anything out I go straight for “Install Ubuntu” and don’t bother trying. The virtual machine passes all the requirements. There are two installation options, both off by default. I leave “Download Updates while installing” unchecked. I can update when the install is done and I want to keep the install simple and it will be easier to troubleshoot any problems. I do check “Install this third-party software”. Some may want a pure open source installation but most people would want MP3 playback ability and this seems the best way to get it. I also keep the default disk allocation selections, giving the entire virtual disk over to Ubuntu.

Ubuntu is thinking about booting The welcome screen - select Install Ubuntu The default install options screens, no optional installs enabled

The install options screen with my choices Aloocate drive space screen 1 Aloocate drive space screen 2

Once the installation starts you’ll notice the messages allow the bottom indicate the install is progressing while you enter in some additional required information. Nice! Ubuntu did a good job picking my time zone and hardware.

Time zone selection screen Keyboard selection screen

Then there’s a prompt for user information. Once a name is answer the rest of the information is prefilled (except the password). I didn’t keep the default values, wanting to stick with my naming convention.

User info entry screen User info screen prepopulated User information screen with my info

That’s all the information Ubuntu needs. The installation continues along for several more minutes. You can view a slideshow with info about Ubuntu while that happens. Once the installation is done there’s a restart prompt. Since the virtual machine isn’t really shutting down I manually amount the installation CD so it doesn’t boot from that. VirtualBox may automatically un-mount the CD but I do it manually to be safe. I click the “Restart Now button and un-mount the CD when Ubuntu prompts for it’s removal. To un-mount the drive select Devices –> CD/DVD Devices from the VirtualBox menu and the select the mounted image (the one that’s checked) and it will be removed.

Ubuntu installation is finished Remove CD Prompt Unmount the selected=

Once the CD is un-mounted I hit <Enter> so Ubuntu reboots and then I login when the logon prompt appears.

Ubuntu right after the reboot Logon prompt The Ubuntu 10.10 default desktop

I then see if there are any updates – there are a couple even though the bits I installed were fresh. To get the updates I select System –> Administration –> Update Manager from the Ubuntu desktop menu. This lists the recommended updates which I go ahead and install. Like any good OS I’m required to enter my password before the updates are applied. The screenshots below show this process.

Update Manager menu selection Recommended Updates Authenticate Prompt

Apllying the updates Update completion message

I reboot one more time just to make sure all is well then I move on to installing the VirtualBox Guest Additions.

Installing VirtualBox Guest Additions for Ubuntu

Installing the guest additions isn’t quit as easy as doing so with a Windows guest OS, but it’s not all that difficult. The installation normally doesn’t require anything beyond what was installed with Ubuntu 10.10, but see the end of this section for the needed X Window fix. Hopefully this fix will not be needed after the next VirtualBox update.

At the time I did this it’s day one for Ubuntu 10.10 and the X Window System drivers in the guest additions don’t recognize the version so don’t install. Once the guest addition drivers are updated the process can be repeated to upgrade guest additions.

Select Devices –> Install Guest Additions… from the VirtualBox menu. This will attach the guest additions CD but not actually install anything. The easiest way (imo) to mount the CD is to select it from the Places menu. This will mount the drive and open it in a window. You can close the window and ignore the icon that was put on the desktop.

Guest Additions Menu Selection Select the Additions CD from the Places menu The desktop icon

Then to mount the drive open terminal from the Accessories menu and issue the following command to change to the drive:

cd /media/VBOXADDITIONS_3.2.8_64453

If you have a different virtual box addition you’ll need to change the command to match the CD name.

Then run the following command to install the additions:

sudo VBoxLinuxAdditions-amd64.run

if you install the 32-bit version of Ubuntu then run the following command:

sudo VBoxLinuxAdditions-x86.run

The guest additions will install which will take a couple of minutes. The status will be displayed, the screenshot below shows that the X Windows drivers did not install.

Guest additions install messages

The Unixmen’s site has a workaround to the X Window issue. Run the following commands:

sudo apt-get update

sudo apt-get install build-essential linux-headers-$(uname -r)

sudo apt-get install virtualbox-ose-guest-x11

I was prompted whether or not I wanted to keep my current configuration file or replace it, I chose to keep it.

Once the last command finishes reboot the virtual machine. The display can then be resized.

Wrapping It Up

The installation of Ubuntu 10.10 Desktop under VirtualBox is straight-forward and no more difficult that installing it on bare metal. If anything it should be easier since the virtual hardware is consistent no matter what the actual metal is.

Having to use the X Windows work around is a bit of a pain but that’s the problem with new operating systems, it’s takes awhile to catch up.

If you want detailed reviews of Ubuntu 10.10 itself you can start with a review at ExtremeTech or at Expert Reviews.

Virtualization Software: VirtualBox

Virtual Box LogoI’ve been using Oracle’s VirtualBox software to run a virtual machine on my Windows 7 PC and I recently started using it as the virtualization software on my Virtual Server Testbed. I’ve used both Parallels and VMware Fusion on my Mac. Both of these worked fine and are commercial apps. Despite having already bought them I decided not to use them when I switched to the Mac Mini. VirtualBox can run on Mac OS X but I switched to Windows since my Windows machines have more horsepower.

Licensing

VirtualBox is available under a couple different versions/licenses. One is the open source GPL license, the other is a closed source license. The differences between the versions is documented here. The primary differences are that the closed source edition provides an RDP server and USB support. The open source edition provides a VNC server instead of RDP and lacks the USB support. I went with the closed source version mainly because it’s the one I downloaded and installed before I knew there were two versions. But I kept it primarily because of the USB support. The closed source version is free for personal use and evaluation.

Host Operating Systems

VirtualBox can be installed on Windows and most desktop and server versions since Windows XP and Windows Server 2003 are supported. For Windows XP and Windows 2003 only 32-bit is supported. For Windows Vista, Windows 7  and Windows Server 2008 both 32 and 64-bit are supported. I’m using it on Windows 7 64-bit. I’ve installed it on Windows 7 32-bit but haven’t created any VMs on it.

Mac OS X 10.5 and up are supported as are numerous flavors of Linux. A updated list of supported hosts are in the online user manual.

Guest Operating Systems

VirtualBox supports a wide range of guest operating systems. Windows 7 32 and 64-bit, Ubuntu 9 and later for both desktop and server along with Windows Server 2008 are the ones that are on my list of requirements and they are supported. All Linux 2.6 versions and editions are supported along with FreeBSD and OpenBSD (among others) so I’ll have plenty of choices to play with. The complete list of supported guest OS’s is in the online user manual.

VirtualBox Installation on Windows 7

The VirtualBox installation on Windows 7 is straight-forward. Download the installer, execute it and answer the prompts in the wizard. There’s nothing special in the wizard prompts. I’ve put screenshots of each wizard screen below. Click the thumbnail for full size.

virtualbox-install01 virtualbox-install02 virtualbox-install03 virtualbox-install04 virtualbox-install05 virtualbox-install06

Once I click the Install button the progress status is displayed:

virtualbox-install07During the install there will be several driver prompts which will require confirmation and maybe a UAC prompt but eventually the completion dialog will appear:

virtualbox-install08 virtualbox-install09 virtualbox-install10

I accept the defaults except for the creation of the desktop and quick launch shortcuts which is just a personal preference to avoid shortcut overload. Be aware of the warning that the network connection will be briefly dropped.

Once VirtualBox is started the following screen will be displayed and the virtual machines can be created.

virtualbox-install11

Preferences

By default VirtualBox will create virtual machines and hard disk in the user profile directory. This isn’t where I want them so I go into File –> Preferences and change the defaults. They can also be changed on the individual virtual machines.

virtualbox-install12Other than that I’ve been running with the defaults.

Tips

The “Host” key is the right “Ctrl” (Control) key by default. To send a <Control> –<Alt> – <Delete> to the virtual machine use <Host>-<Del>

As each virtual machine is created and started the first time be sure to install the guest additions using the Device menu.

virtualbox-install13

Summary

As someone who doesn’t have any business specific needs for their virtual machines I find the free VirtualBox software is more than the equal of the VMware and Parallels software I was using. Although I’m admittedly still in the honeymoon phase and my feelings may change as I create more virtual machines with different guest OS’s.

System Build: Virtual Server Testbed

Picture of the M4A785TD-V Asus MotherboardI’ve been wanting to put together a box that I could use to set up test machines and servers. The easiest way for me to do this was to use some virtual server software so I could just create a new virtual machines when I needed a new configuration. The ability to roll back to an earlier state would also be a plus as would the ability to store machines until needed.

The Hardware

Awhile back I bought what I needed but never got around to the build. My requirements were simple:

  • Low Cost – speed is not an requirement
  • Run several VMs at once – this means enough memory to run several virtual machines at the same time
  • The CPU needed to support two virtualization specific technologies: Intel Virtualization Technology (Intel VT) for Intel CPUs or AMD Virtualization Technology (AMD-V) for AMD CPU’s along with Hardware Data Execution Protection (DEP).

So back in February (like I said, this is a long dormant project) I headed out to Newegg and looked for the cheapest CPU/motherboard combination that met my needs. I didn’t have a preference of Intel or AMD, but if all else was truly equal I would have gone with Intel.

I went with the ASUS M4A785TD-V EVO AM3 AMD 785G HDMI ATX AMD Motherboard which had a pre-combo price of $99 at the time ($89 today). It supported the CPU I picked  and supported up to 16GB or RAM. It also had 5 internal SATA connectors, 1 eSata connector and a bunch of USB connectors which would allow considerable expansion if needed. It also had onboard video so I could skip a video card. Since I’d only be accessing the box remotely it wouldn’t need much on the video side.

Picture of an AMD CPU boxFor the CPU I went with the AMD Athlon II X2 240 Regor 2.8GHz 2 x 1MB L2 Cache Socket AM3 65W Dual-Core Processor at $56.99. While it wasn’t the absolute cheapest CPU at the time it seemed the best value among it’s price peers. I went with the stock cpu cooler and fan.

In general, the only RAM that stayed within my price range were 2GB sticks so I went with the cheapest 2GB sticks from a reliable vendor which were two Patriot Gaming Series 4GB (2 x 2GB) 240-Pin DDR3 SDRAM DDR3 1333 (PC3 10666) Desktop Memory Model PGS34G1333ELK at $96.99 each at the time but were up to $109.99 when I checked today.

I like Antec power supplies and wanted to stick with what works, so while not the cheapest I went with the Antec Basiq BP430 430W Continuous Power ATX12V Version 2.2 Active PFC Power Supply at $44.99 at the time but down to $39.95 today.

The final item was the case. I expected the case to remain untouched once the PC was built and it would also be sitting off in a corner under my workbench. So I didn’t need much. I went with Newegg’s house brand Rosewill R230-P-BK Black SECC Steel ATX Mid Tower Computer Case which was on sale for $23.99 at the time.

While these may not have been the absolute cheapest components, between free shipping for everything (including the large case and heavy power supply) and a combo deal the entire thing was pretty reasonable and within my $400 budget.

For hard drives I’d be using what I already had around. I ended up using a Western Digital Caviar Black WD1001FALS 1TB 7200 RPM 32MB Cache SATA 3.0Gb/s 3.5″ Internal Hard Drive that had been in my PC but was now on the shelf. For data drives (to hold the VMs) I went with three HITACHI Deskstar HD32000 IDK/7K (0S00164) 2TB 7200 RPM 32MB Cache SATA 3.0Gb/s 3.5″ Internal Hard Drives which I had picked up on sale but had yet to use.

It all went together rather easily. The Rosewill case was serviceable, especially considering it’s price. But it lacks a polished finish and I had to be careful to avoid cutting myself on the edges. The pop-open USB/audio port tray on the front panel is hard to open and close. If it needed to be open and closed very often it would be annoying at best and probably break eventually.

I did struggle a bit getting the AMD fan/cooler secured on the CPU but this was my first AMD experience.

The Software

I first took a look a Microsoft’s Hyper-V Server 2008 R2. Besides being free, this seemed like a low overhead solution. The install went fine but the configuration is where it became problematic. All but the basic setup is remote and I was having trouble getting a remote connection. While it seemed I was doing everything right it didn’t work until I turned off the firewall completely. At this point I decided that Hyper-V was at a complexity level I just didn’t want to deal with and decided to go with something else.

Among other options I looked at were VMware Player and VMware Server from, you guessed it, VMware. Both are free and both must be installed on a host operating system. For VMware server the only choice is Windows Server 2008. This was again more complexity than I wanted so it was immediately dropped from my list. VMware Player could be hosted on Windows or Linux but was limited in it’s ability to edit existing virtual machines. I eliminated it since it seemed a bit like a crippled product product that led into the paid offerings.

I didn’t really consider Microsoft Virtual PC. While I am interested in learning about it I didn’t want to worry about a Microsoft lock-in and Microsoft targeting mainly their desktop OS’s for support as guests. I also didn’t consider any commercial products as I’m convinced a free or open source product could meet my simple needs.

Birtual Box LogoI ended opening going with my fall-back choice from the beginning – VirtualBox from Oracle (originally from Sun which was acquired by Oracle). I’ve been running VirtualBox on my Windows Desktop to create a virtual machine I can use to VPN into my employers network and it’s been solid. I haven’t tried a lot of different guest OS’s yet. VirtualBox is available under a GPL license. This GPL version lacks “a few features that primarily target enterprise customers”. The full version a also available free for personal and evaluation use. I ended up using the full (but free) version and not the GPL version. Virtual Box can be installed on Windows, Linux or OS-X.

So I ended up installing Windows 7 Professional as the host OS since it seemed the simplest choice. I have a TechNet Subscription which allows multiple OS installations for testing purposes and this certainly falls within those boundaries, otherwise I would have gone with Linux. I went with the Professional flavor so I could fall back to Windows Virtualization with little effort. It also allows me to use Remote Desktop to access the box since it won’t typically have a keyboard and monitor connected.

I installed Windows 7 to the Western Digital system drive. As for the 3 Hitachi Drives I configured them for stripping across all three drives in order to improve performance. This is where my Virtual Machines will reside. This is RAID 0, which is properly nicknamed “scary RAID”. Data protection is usually inferred when the term “RAID” is seen, but with RAID 0 the data is split evenly across all physical drives in order to improve performance and there is no data protection. In fact, in increases the chance of data loss, in my case I have three times the chance to lose data. When I lose any one of these 3 drives I will lose all my data. Notice I said ‘”when”, not “if”. I’ll need good backups because it’s only a matter of time.

The motherboard does support RAID but I chose to go through software for now to stay flexible and reduce complexity.

For backups I’ll keep copies of my virtual machines on another server. Since this is a test box I’m not overly concerned with having to roll back to a backup created a couple days ago. In the event I’m into some heavy testing I’ll have to be sure to keep up to date backups.

Summary

So I ended up with the following as my Virtual Server Testbed:

  • Asus Motherboard with 5 SATA ports and numerous other expansion options
  • AMD Athlon II X2 2.8Ghz dual-core processor
  • 8GB DDR3 RAM
  • 1GB System Drive
  • 3 i 2TB drives configured as a stripped set giving me a 6GB logical drive
  • Windows 2007 Professional
  • Oracle VirtualBox

I ran some benchmarks with Passmark Software’s Performance Test and it returned a overall rating of 944.2 when benchmarking the Western Digital drive and an overall rating of 1049.0 when benchmarking the stripped set as the hard drive. This compares to an overall rating of 1205.3 for by Quad-core Windows PC. Considering the low cost I was surprised it benchmarked so well. It also feels snappy enough while using it.

The box had a Windows Performance Rating of 4.6 which broke down as follows:

  • Processor: 6.3
  • Memory: 7.2
  • Graphics 4.6
  • Gaming Graphics: 5.5
  • Primary HDD: 5.9 (this would be the Western Digital)

So, the box has been moved under the workbench, hooked to power and the network, and it’s waiting to have some guest OS’s installed on it.