To fix this set the environment variable VMWARE_JAVA_HOME to proper path:
– SSH to vcenter # vi /usr/lib/vmware-vsphere-client/server/wrapper/conf/wrapper.conf
– Under Environment variables add: set.default.VMWARE_JAVA_HOME=/usr/java/jre-vmware
– Restart vsphere-client # /etc/init.d/vsphere-client restart
Stopping VMware vSphere Web Client...
Stopped VMware vSphere Web Client.
Starting VMware vSphere Web Client...
Intializing registration provider...
Getting SSL certificates
Service with name was updated.
Return code is: Success
Waiting for VMware vSphere Web Client......
In case you see an error: “Permission to perform this operation was denied”, right click and run the program as Administrator.
Provide the source and destination information, the source is the physical server to be converted and the destination vCenter.
Follow the steps, to do the conversion , a temporary OS will be started on the destination, by default it try to get an IP address from the DHCP server so that it can connect to the source machine and fetch the files required. But in case if you don’t have DHCP server you might see error like: “Unable to obtain the IP address of the helper virtual machine” . Fix this issue by setting up a static IP to the helper virtual machine during the conversion setup. Basically the helper VM IP should be able to communicate with the source machine which needs to be migrated
Proceed with the conversion, the duration will be based on the size of the VM and the connectivity if it belongs to another site/LAN.
You may need to change the network configuration (eg: HWADDR) and the MAC address mapping (/etc/udev/rules.d) to get it connected.
You can use the host-only-adapter networking, if you require the virtual machine to be accessible only from the host machine. In this case your virtual machine will not have access to anywhere outside the host. Read more about virtual box networking at http://www.virtualbox.org/manual/ch06.html
On the other hand NAT enabled interface can communicate with clients outside the host, but the host cannot access the services on the virtual machine directly. We need to enabled port forwarding with NAT interface to achieve this.
If you need to have ssh accessible from host machine to virtual machine,
These rules will be added to the .VirtualBox/Machines/machine_name/machine_name.xml file like: < Forwarding name="openssh" proto="1" hostip="127.0.0.1" hostport="2222" guestip=10.0.2.20 guestport="2222"/>
You can forward connection to any port on virtual host like this.
Make sure that the virtual machine interface is closed and the vm is not running while you change it, otherwise the changes will not take effect.
It took a while to get the KVM image working with Sun virtual box.
The advantages of a virtual box image is, you can run it on any platform (linux, mac or windows), works without virtualization enabled processor and will work on a 32bit machine
Here are the steps to create an image that works with virtual box:
From the KVM installed server
$ qemu-img convert kvm-os.img -O raw kvm-os-raw.img
Copy the image (kvm-os-raw.img) to virtual box machine
Here the path to vdi image must be absolute.
Now you can create a new virtual machine from virtual box console/command line, with the vdi image as storage.
Boot the machine and hope for the best 🙂
But it wasn’t easy for me even after this beautiful vdi image, boot hangs with a kernel panic, file system not found.
To fix this issue, we need to recreate the initrd image in the virtual machine:
instructions to do it for redhat: – Boot the virtual machine in rescue mode with Redhat CD
To install the KVM guest operating system (eg: RHEL) from the network
– Create the bridge interface on the KVM host machine (http://arunnsblog.com/2010/04/09/virtualization-with-kvm-under-redhat-linux-migrate-vmware-virtual-images-to-kvm/)
– Make sure that the gateway is configured in the bridge interface (GATEWAY=).
– Make sure that you have the required rules added to the iptables: -A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
– Create virtual machine with supported network interface type (pcnet, rtl8139 used to work)
– Add the mac address of kvm guest to the dhcp server
Start the virtual machine and see if it can kick start from the network.
You can trouble shoot with a tcpdump on the KVM host machine: tcpdump -i br0 port bootps -vvv -s 1500
Convert qcow2/raw images to LVM logical volume to use with KVM:
– Convert the qcow2 image to raw format (if it is in qcow2) $ qemu-img convert image.qcow2 -O raw image.raw
– Create the physical volume for LVM # pvcreate /dev/sdb
(replace the device with correspond to the system)
– Create the volume group # vgcreate pool1 /dev/sdb
(replace pool1 with the name as required)
– Create Logical volume with same size as the image # lvcreate -n justaname --size 50G pool1
(replace justaname and size as per the requirements)
Use lvresize incase you required the change the volume size
– dd the raw image to lvm logical volume # dd if=image.raw of=/dev/pool1/justaname bs=8M
(Change the block size according to the requirements.
Edit the kvm xml configuration for the corresponding virutal machine to use the logical volume
KVM (Kernel Based Virtual Machine) – http://www.linux-kvm.org/ , is one of the best choice to do virtualization under linux, and especially without extra licensing cost.
To install KVM on redhat enterprise linux:
– Install the machine with 64 bit version of EL5
– Register the machine with redhat (rhn_register)
– enable virtualization entitlement for the system in RHN
– Install KVM package: # yum install kvm # yum install virt-manager libvirt libvirt-python python-virtinst
Migration VMware virtual machines to KVM:
– Login to the vmware server
– make single vmdk image with vmware-diskmanager
eg: # vmware-vdiskmanager -r path_to_vmware_virtualmachine.vmdk -t 0 destination_file_vmware.vmdk Creating disk ‘destination_file_vmware.vmdk’
Convert: 100% done.
Virtual disk conversion successful.
– Copy the image to KVM server
– Convert the image to KVM supported format with qemu-img # qemu-img convert destination_file_vmware.vmdk -O qcow2 kvm_supported.img
Create bridge interface to to share the network card.
* This section assumes that you have two nic in your server and would need to have bonding along with bridging and you have static ip required for virtual machines. incase you using dhcp and single network interface create the bridge interface accordingly.
– Configure the bond interface: $ cat /etc/sysconfig/network-scripts/ifcfg-bond0
– Configure eth0 and eth1 $ cat /etc/sysconfig/network-scripts/ifcfg-eth0
– Change bonding to active-backup , i have faced some issues with xor – might be silly to fix # cat /etc/modprobe.conf
options bond0 miimon=100 mode=active-backup
– Restart network interface and check the bridge status # brctl show , it will show bond0 as an enabled interface.
Create KVM virtual machine:
– it can be done from the command line or with virt-manager
– open virt-manager application
– click create new, and select qemu hypervisor
– during disk selection, choose the converted vmware image path
– done, just start it.
Register the virtual machine with Redhat, save some license 😉
– enabled network tools entitlement in RHN
– install the package rhn-virtualization-host on the core machine
– # yum install rhn-virtualization-host
– enable virtualization under the properties of host in RHN
– execute the following commands on host machine # rhn_check # rhn-profile-sync
– login to virtual machine and use rhn_register, now it will be registered as a virtual machine under the core license.