Novell Home

Moving Linux Virtual Machine (VM) from Windows Host to Linux Host

Novell Cool Solutions: Tip
By Chris Randles

Digg This - Slashdot This

Updated: 25 Jan 2007
 

This information relates ONLY to VMware virtual machines and is not Xen related in any way.

If you move a Linux virtual machine (VM), which was created on a Windows host, to a Linux host, then there's a good chance that some things will stop working inside the virtual machine.

One of the main issues that can occur is not being able to run the Linux GUI on reaching 'init stage 5'. This is due to differences in how the host operating system is interfaced with, when compared to VMware running under Linux and VMware running under Windows.

Another problem often seen is that on moving a VM from Windows to Linux, all LAN connectivity (both virtual and real) will stop working, especially if when challenged by VMware, you choose to create a new Unique Identifier for the VM.

How To Fix The Linux GUI:

Login to the box as the root user using one of the text consoles (e.g. CTRL-ALT-F1).

Execute the following commands:-

init 3 
sax2 -r 
say 'ok' to accept the new sax configuration. 
init 5 

With that done, you should be now looking at the normal GUI login.

NOTE: Using sax2 -r will remove the previous graphics detection data and do a re-detect forcing the creation of a new Xorg configuration. You may want to backup the existing xorg.conf file prior to executing the above commands.

How To Fix The VM's LAN Access:

Launch YaST as root, go to Network Devices, Network Card, highlight the configured network card entry and delete it.

Choose Finish to save this configuration.

Go back to Network Devices, Network Card and reconfigure.

Choose Finish to save the configuration.

Your Virtual Machine's LAN connectivity should then be working again (you may have to shutdown the VM and restart it).

NOTE: In the later versions of VMware, SUSE Linux Enterprise Server 10 will identify the virtual Network Card as an 'AMD PCnet - Fast 79C971'. Other versions of SUSE Linux and other Operating Systems may identify the virtual network card as something else. However, most OS will see the card as some derivative of an AMD network card.

Some other things that can change for a virtual machine when moving between Windows and Linux :-

  • Diskette drive device identifier
  • CD Rom drive device identifier

You can either manually fix these affected virtual devices by using the settings option via the VMware interface, or you can directly modify the .vmx file for the virtual machine (VMware creates one vmx configuration file for each virtual machine created). The vmx file is found in the same location as the rest of the files that constitute the virtual machine.

NOTE: Don't modify a vmx file manually whilst VMware is accessing the virtual machine associated with that vmx file. Make changes before you start the VM.

This is one example of how the .vmx file device identifiers differ, between using a virtual machine on a Windows or Linux host:-

On A Linux Host:
On A Windows Host:
ide1:0.fileName = "/dev/hdc"
ide1:0.fileName = "E:"
ide1:0.deviceType = "atapi-cdrom"
ide1:0.deviceType = "cdrom-raw"
floppy0.fileName = "/dev/fd0"
floppy0.fileName = "A:"

NOTE: This is just an example comparison. The 'Drive Letters', IDE and SCSI bus interface numbers (e.g. ide1:0, ide1:1 etc) and device names will vary.

If you set the floppy and CDRom to 'Auto Detect' then you should not have to change these when moving the VM between hosts.

Network device, sound card and others can also change when moving a VM but these can be fixed by removing and re-adding devices.

One thing you might like to do, if you often transfer a particular VM between different host OS, is to have 2 .vmx files, one configured for use under Windows and one for use under Linux.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell