Steps to Mount KVM image and access the files inside VM from the node.

Steps to mount KVM image and access the files inside VM from the node.

Step 1: ShutDown VM using the below pasted command
virsh shutdown kvm185
or
virsh shutdown kvm185 –mode acpi
or
virsh destroy kvm185

Step 2: kpartx -av /dev/vg_kvm/kvm185_img

Step 3:Mount all the wanted img and important
mount /dev/mapper/vg_kvm-kvm185_img1 /mnt/linux
mount -o bind /dev /mnt/linux/dev
mount -o bind /sys /mnt/linux/sys
mount -o bind /proc /mnt/linux proc

Step 3: chroot /mnt/linux /bin/bash
Step 4: passwd
step 6: exit
step 7: umount /mnt/linux
Step 8: kpartx -dv /dev/vg_kvm/kvm185_img
Step 9: Start VM
virsh start kvm185

If you need any further assistance contact me @ [email protected].. prefer hangout ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.