Moxa NPort errors with "COM3 is used currently"

In a process of upgrading our virtualization environment, I moved a Windows2019 based guest from XenServer to VMWare 7. While it the move was pretty straight forward process, after the first boot I was met with a cacophony of error messages from the server software run in the virtual.

The software that lives in this virtual interfaces with a huge number of legacy hardware that uses serial ports. We have a plenty of Moxa NPort-series serial to Ethernet-adapters in use, all of which terminate at this server. All the serial ports ceased to function, NPort administration tool gave an error message "COMx is used currently" to any attempts to configure the adapters remotely. Other utilities, such as Putty in serial port mode gave out similar errors about the port being used.

After comparing the differences in this virtual before and after the migration, I noticed UEFI secure boot was now enabled. This prevented the NPort serial driver from loading and all the administration tools giving out really confusing errors. Disabling secure boot brought the system back to life.

XenServer to VMWare without V2V tools

I was faced with a challenge of moving virtuals off a XenServer host onto a VMWare 7 host without access to all the nice automated tools that come when you stack enough money on the table for the licenses.

XenCenter has an option to output an OVA file, VMWare can import them. Sounds like a piece of cake, until the point where the format just isn't compatible and VMWare's import just dies. The cost-effective solution was just to dump the VHD files out of XenServer, convert them to VMDK and them upload them onto the freshly installed ESXi installation.

I downloaded the VHD images to a Linux desktop through XenOrchestra. The export option was under the virtual machien's page, Disks then Export VDI content button at the end.

The VHD needed to be converted into VMDK for ESXi to accept it. The qemu-img utility from qemu-utils package did that nicely.

qemu-img -p -O VMDK input.vhd output.vmdk

The file was then ready to be uploaded to the ESXi host with SFTP. SFTP needs SSH to be enabled, had to enable it from ESXi's web GUI.

I created a directory for the new image under the /vmfs/volumes/datastore1 which was the default location and then uploaded the new .vmdk file. Last step in image handling was to turn the .vmdk file into thin provisioned. ESXi comes with the vmkfstools utility to do just that.

vmkfstools -i input.vmdk final-name.vmdk -d thin

The old vmdk file could now be removed and the image was ready for use. I created a new virtual and instead of creating a new harddisk, I selected to use an existing image, then chose this freshly copied one.

For Windows hosts I copied the network adapters' MAC addresses so they stay activated.

Windows hosts will take a bit longer on the first boot, as they first try to search for the XenServer's devices before giving up and finding the VMWare's virtual disk controller.

As a finishing touch, I removed the XenServer guest tools and installed VMWare's offering.