User Tools

Site Tools


command_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
command_line [2011/06/02 16:30]
k2patel
command_line [2020/08/10 02:35]
127.0.0.1 external edit
Line 1: Line 1:
 +
 +
 ====== KVM Command Line ====== ====== KVM Command Line ======
  
Line 29: Line 31:
  
 [[http://​libvirt.org/​formatdomain.html|Domain Format in KVM]] [[http://​libvirt.org/​formatdomain.html|Domain Format in KVM]]
 +
 +==== Test your bootable USB on kvm ====
 +In order to test your USB using KVM use following command.
 +<code bash>
 +qemu-kvm -hdb <​device> ​
 +</​code>​
 +In my case device was "/​dev/​sdb"​.
  
 ==== Converting Existing Image ==== ==== Converting Existing Image ====
 === Converting VMWARE image for KVM === === Converting VMWARE image for KVM ===
 +
 use following command. use following command.
 <code bash> <code bash>
Line 48: Line 58:
 </​code>​ </​code>​
  
-Now follow [[ Converting VMWARE image for KVM ]]+converting .ova is just easy\\ 
 +some times ovftool failing\\ 
 + 
 +<​html>​ 
 +<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>​ 
 +</​html>​ 
 + 
 +Now follow [[ #Converting VMWARE image for KVM | Converting VMWARE image for KVM ]]
  
  
Line 114: Line 132:
 </​code>​ </​code>​
  
 +==== FU Commands ====
 +
 +=== Create Disk ===
 +create disk of size 10G
 +<code bash | for dynamic allocation>​
 +qemu-img create -f raw vdisk.img 10G 
 +</​code>​
 +OR
 +<code bash | preallowcation>​
 +dd if=/​dev/​zero of=vdisk.img bs=1G count=0 seek=[NUMBER_OF_GB]
 +</​code>​
 +
 +==== How to allow network access to KVM Guest ====
 +
 +Modify guest.xml file and listen variable.
 +<code bash | vi /​etc/​libvirt/​qemu/​Archlinux.xml>​
 +<​graphics type='​vnc'​ port='​-1'​ autoport='​yes'​ listen='​192.168.1.4'​ passwd='​testing1'/>​
 +</​code>​
 +
 +==== Extract folder from KVM Guest Image ====
 +This is appear to be far easy solution then i thought.\\
 +[[http://​libguestfs.org/​virt-copy-out.1.html|Link to official Document]]
 +
 +For RHEL you require following packages installed.
 +  * libguestfs-tools
 +  * libguestfs-xfs ​ # if guest filesystem is XFS.
 +
 +<code bash>
 +mkdir test
 +virt-copy-out -a machine2.qcow2 /​metadata/​testing/​users test/
 +</​code>​
command_line.txt · Last modified: 2021/08/24 21:11 by k2patel