Expand/Increase ext3 root partition

Please follow the steps to Expand/Increase ext3 root Partition of a VMware Server disk (.vmdk)

Step-1 Shutdown the VM which you want to Expand/Increase ext3 root partition.
Step-2 Backup your original VMDK file to a different location
Step-3 Now we can Expand/Increase the disk
Syntax:vmware-vdiskmanager -x (Which you want to expand)
EX:vmware-vdiskmanager -x 50GB yyy.vmdk
If the command ran successful then you will get below message.
=================================================================
Disk expansion completed successfully.
WARNING: If the virtual disk is partitioned, you must use a third-party
utility in the virtual machine to expand the size of the
partitions. For more information, see:
http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647
==================================================================
Now disk size is increased but operating system will only show old size.To add new disk we will need to use a third-party utility such as GParted to resize the expanded partitions. The GParted application is the GNOME partition editor for creating, reorganizing, and deleting disk partitions. GParted is a live Linux based CD.
Step-4 Download latest version here or use wget command
http://nchc.dl.sourceforge.net/sourceforge/gparted/gparted-live-0.4.5-2.iso
or
cd /tmp
wget http://nchc.dl.sourceforge.net/sourceforge/gparted/gparted-live-0.4.5-2.iso
Step-5 Boot the VM with GParted ISO.
Once the vm boots up, Press enter to go to next screen. Press enter till you get the GParted Screen.
Step-6 Right click on the partition which you want to expand and select "Resize/Move"
Step-7 Set a new size to maximum size (it is displayed on the screen itself) and Finally, Click on Resize/Move button to start the process.
Step-8 Click "Apply" to run the resize task. Depending on the amount (disk size and storage type) and type (resize or move) operation resize may tae a long time. After sometime Gparted will give out the final confirmation about disk resize operation (you must not get any error on screen)
Step-9 Click on Close and then exit to shutdown Gparted.
Step-10 Remove the GParted ISO and boot the vm with HDD
Step-11 Login into vm and verify the new disk size.

LVM disk backup in to image file

vmname-002 is running on LVM partition so I am taking vmname-002 LVM disk backup in to image file.

dd if=/dev/VG_Guests/vmname-002 of=newimage.img bs=1M

Virtual Machine(VM) Migration From ESX to KVM

Windows Virtual Machine(VM) Migration From ESX to KVM
Follow the steps to migrate Windows XP Virtual Machine from ESX to KVM

Before migrating any Virtual Machine we need to enable IDE in the registry and need to uninstall VMware tools form the VM

1. Uninstall VMware tools form VM

2. Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the %SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder. Now we will Import new registry settings into windows registry

Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.

Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file
http://www.proxmox.com/cms_proxmox/cms/upload/misc/mergeide.reg

Right click on saved file-->Click Merge-->Click yes-->Click Ok

3. Copy VMDK,Flat.VMDK and VMX files to KVM
4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml . Install virt-goodies in your KVM system.
apt-get install virt-goodies
5. vmware2libvirt -f ./file.vmx > file.xml
6. virsh -c qemu:///system define file.xml
The first command converts the VMware 'file.vmx' file to the libvirt compatible 'file.xml'. See man vmware2libvirt for details. The second command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.

Once you converted to xml file, we need to edit VMNAME, OS Arch & Disk name or source file name. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.

Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:

vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.

Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.
The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:

7. Now we will convert .vmdk file to qcow2 file format
qemu-img convert diskname.vmdk -O qcow2 new-diskname.qcow2

8. Define the xml file and start the VM.Change the XML file as per your new-diskname.qcow2 and start the VM

#virsh -c qemu:///system define file.xml

#virsh start vmname

Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.

Note: We can follow same procedure for Windows XP, Windows Server 2003 & Windows Server 2008.

unhide files and folders in windows

go to Start > Run > type cmd
type dir /ah -- this will show all hidden files
go to the drive or directory which you want to unhide
attrib *.* -h this would unhide any file or directory
or
type the following command attrib -r -a -s -h *.*

get help by type attrib /?