Copy VMWare Server virtual servers (Ubuntu) between physical machines, avoid locking errors and fix missing eth0

I needed to copy a virtual Ubuntu Server install from our backup store to a new physical server (server A) as our old server (server B) suffered a major failure and wouldn’t even boot. This meant copying the whole VMWare directory containing the Ubuntu virtual machine from the backup store (a USB harddrive in this case) to the new physical server (server A). I had installed the free VMWare Server on both server B and A so that if anything happened to server B I would be able to get up and running quickly on server A.

Note: I am assuming you can install and configure VMWare Server for Windows, which is what I’m using here.

Once I copied the whole directory from the backup store to server A’s VMWare directory (in this case c:vmware) I then used the VMWare web interface to “Virtual Machine – Add Virtual Machine to Inventory” which allowed me to select the .vmx file in my datastore that corresponded to my copied Ubuntu virtual machine.

On trying to start the virtual machine I get a warning message and a choice:

msg.uuid.altered: This virtual machine may have been moved or copied. In order to configure certain management and networking features VMware Server needs to know which. Did you move this virtual machine, or did you copy it? If you don’t know, answer “I copied it”.

I select “I copied it” and then click “ok”, which then brings up an error:

“Power On Virtual Machine” failed to complete

If these problems persist, please contact your system administrator.
Cannot open the disk ‘C:vmwareVIRTUALSERVERNAMEVIRTUALSERVERNAME.vmdk’ or one of the snapshot disks it depends on. Reason: Failed to lock the file.

Ok, so it seems that because I copied the virtual server from the backup store it also included the .lck directories, which are used while the server is running. The simple fix is to delete these directories in C:vmwareVIRTUALSERVERNAME and allow VMWare server to rebuild them. Once I had deleted the two directories “VIRTUALSERVERNAME.vmdk.lck” and “VIRTUALSERVERNAME.vmem.lck” I could start the virtual machine.

I then ran into another problem, which was that my network instance eth0 was not being set up correctly even with VMWare Server set to use “Bridged” networking which worked on the old server. Running “ifconfig -a” showed that eth0 wasn’t there and it didn’t have the static IP I had given it previously in “/etc/network/interfaces”. The loopback interface, l0, was there but not eth0.

Orzeszek has an easy solution for this, which is to delete the “/etc/udev/rules.d/70-persistent-net.rules” file and “sudo reboot” to allow Ubuntu to rebuild the file with the correct MAC address, set up by VMWare Server when we originally added the virtual machine to the inventory. Now everything should be working perfectly.

Some people have reported other errors, which can be fixed by changing the name of eth0 in “/etc/network/interfaces” to eth1, which I didn’t need to do but you might.


Managing VMWare Server 2 hosts with vSphere

You can download VMWare Server 2 for free and it comes with a web interface to create/manage virtual machines. I ideally wanted something similar to Microsoft System Centre Virtual Machine Manager to manage multiple hosts. Unfortunately you have to pay for both VMWare and Microsoft’s offering (but SCVMM is free on our MSDN subscription).

To manage a single host, without using the slow/buggy web interface you can use the free vSphere management app that comes with the free version of ESXi. You need to download and copy a directory to your install dir of vSphere, which is available here.

Full instructions are available at Andrea Benini’s blog at

VMware Tools & Solaris 10 (dont do it)

Well after fighting one of our servers which refused to run vmware server properly (services wouldnt start) I installed it on my local machine to do some testing (after having to uninstall vmware workstation for some reason). Everything was going fine installing Solaris 10, albeit a bit slower than VMware workstation until I finished the install, got into the desktop and installed the VMware Tools. This was a mistake.

I have installed VMware Tools several times on VMware workstation but on VMware server it disabled and removed my network connection in Solaris and set the screen size to some massive resolution (2xxx by 1xxx). I set my desktop resolution in Solaris back to 1024×768 and it was fine, but didnt resize the VMware window. Nothing I could do could shrink the VMware window.

Lesson: Always take snapshots before doing anything, even if it worked fine the last 9999999 times.

Using TOAD for Oracle With a Remote Oracle Installation

I couldn’t figure out how to connect to my remote Oracle install on a VMWare Solaris install using TOAD until I found this page at trap17. Turns out you need to install the Oracle Instant Client (or at least have it installed somewhere) with the correct environment variables for TOAD to pick up your Oracle install. I followed this guide and it worked straight away:

Here’s how you do it (Although I’ve done my best to present an accurate procedure, I can’t guarantee this will work for everyone. Messing around with your environmental variables is not for the weak, proceed with caution):

1) Prepare your mind for information that should be used once and then quickly discarded. Otherwise the following information may stick to your brain and take up valuable space. You are warned.

2) Install the oracle instant client. I don’t know why…I kinda wish I did. You probably can get away with installing just the basic package. Unzip the files to a directory, and then copy the path of this directory to the clipboard.

3) Add this directory to the PATH environmental variable. To do this, right click on My Computer, go to the Advanced tab, and click ‘Environment Variables’. Under System variables, find ‘Path’. Select it, and click edit. ctrl-v to paste the directory into the string, and say OK. e.g.:

Before: %SystemRoot%system32;%SystemRoot%;C:Program FilesATI TechnologiesATI Control Panel;
After: %SystemRoot%system32;%SystemRoot%;C:Program FilesATI TechnologiesATI Control Panel;C:instantclient;

4) In the same window, under ‘User variables for …’, Click the New button. Call the variable ‘TNS_ADMIN’. ctrl-v to paste the directory path into the ‘variable value’ field. Say OK, and close out the ‘My Computer’ properties windows.

5) Create a file called ‘TNSNAMES.ORA’ in your instant client installation directory. In this file designate the connection parameters for your database. Mine looked something like this:

(SID = orcl)

replace the DB_ALIAS,, port, and SID with your settings. If you don’t know what any of this means, good for you, you’ll live longer.

6) Reset your computer, fire up Toad, and then open a new connection. You should see DB_ALIAS as an option under the database field. Set your username and password, hit connect, and you should be in business.

I guess Toad looks in certain places for the drivers and configuration files it needs to connect to oracle. Setting the environmental variables tells Toad where to look. If you had a local install of Oracle I imagine you could fire up Toad and all the files it needed would already be in the right place, but you can follow these steps instead. Woot!