“virsh” shell for KVM.
virsh list --all
virsh define <xyz.xml>
virsh start <xyz>
virsh edit xyz
virsh vncdisplay xyz
In order to test your USB using KVM use following command.
qemu-kvm -hdb <device>
In my case device was “/dev/sdb”.
use following command.
qemu-img convert own_Cloud.vmdk -O qcow2 ownCloud.qcow
what is ova - Open Virtualization Format
Download - Open Virtualization Format Tool
Install it, which give you command “ovftool”.
ovftool -tt=vmx Amazon-EC2-VM-Import-Connector.ova amazon_kvm
converting .ova is just easy
some times ovftool failing
<span style="color:red;font-size:150%;">If Above does not work just do</span>
<p><span style="color:red;font-size:150%;"> tar -xvf Amazon-EC2-VM-Import-Connector.ova </span></p>
Now follow Converting VMWARE image for KVM
virt-install --name=own_cloud --arch=x86_64 \ --vcpus=1 --ram=512 --os-type=linux --os-variant=sles11 \ --hvm --connect=qemu:///system --network bridge:br0 \ --import --disk path=/home/vmware/ownCloud_in_a_box-1.0.4/ownCloud.qcow \ --accelerate --vnc --noautoconsole --keymap=us
NOTE :
- This will turn off your Guest.
- it will create snapshot in current working directory.
- Use `virsh pwd` to check your current working directory.
virsh save <Domain Name> <fileName>
help Prints basic help information. list Lists all guests. dumpxml Outputs the XML configuration file for the guest. create Creates a guest from an XML configuration file and starts the new guest. start Starts an inactive guest. destroy Forces a guest to stop. define Outputs an XML configuration file for a guest. domid Displays the guest's ID. domuuid Displays the guest's UUID. dominfo Displays guest information. domname Displays the guest's name. domstate Displays the state of a guest. quit Quits the interactive terminal. reboot Reboots a guest. restore Restores a previously saved guest stored in a file. resume Resumes a paused guest. save Save the present state of a guest to a file. shutdown Gracefully shuts down a guest. suspend Pauses a guest. undefine Deletes all files associated with a guest. migrate Migrates a guest to another host.
setmem Sets the allocated memory for a guest. setmaxmem Sets maximum memory limit for the hypervisor. setvcpus Changes number of virtual CPUs assigned to a guest. vcpuinfo Displays virtual CPU information about a guest. vcpupin Controls the virtual CPU affinity of a guest. domblkstat Displays block device statistics for a running guest. domifstat Displays network interface statistics for a running guest. attach-device Attach a device to a guest, using a device definition in an XML file. attach-disk Attaches a new disk device to a guest. attach-interface Attaches a new network interface to a guest. detach-device Detach a device from a guest, takes the same kind of XML descriptions as command attach-device. detach-disk Detach a disk device from a guest. detach-interface Detach a network interface from a guest.
create disk of size 10G
qemu-img create -f raw vdisk.img 10G
OR
dd if=/dev/zero of=vdisk.img bs=1G count=0 seek=[NUMBER_OF_GB]
Modify guest.xml file and listen variable.
<graphics type='vnc' port='-1' autoport='yes' listen='192.168.1.4' passwd='testing1'/>
This appears to be the far easy solution than I thought.
Link to official Document
For RHEL you require the following packages installed.
mkdir test virt-copy-out -a machine2.qcow2 /metadata/testing/users test/
This is a simple way to extract or access files.
Scan and assign the dev node.
losetup --partscan --find --show sdcard.img
List all the block devices, including newly scanned.
lsblk --fs
Mounting the file system
mount /dev/loop0p2 /mnt/sdcard
Once unmounted remove the lo drive.
losetup --detach-all