Notepad:KVM: Difference between revisions

From Amar
Jump to navigationJump to search
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
= KVM =
= KVM =
== Networking - brctl ==
== Networking - brctl ==
[https://wiki.archlinux.org/index.php/Systemd-networkd#Bridge_interface systemd-networkd]
== Start/Start libvirtd ==
== Start/Start libvirtd ==
== Virtual Shell virsh ==
== Virtual Shell virsh ==
[https://libvirt.org/sources/virshcmdref/html-single/ virsh man]
[https://libvirt.org/sources/virshcmdref/html-single/ virsh man]
== Transfer Running Machines ==
* Windows [http://www.johnwillis.com/2014/05/p2v-windows-2008r2-to-kvm.html Transfer a running Windows]
* Linux [http://manuel.kiessling.net/2013/03/19/converting-a-running-physical-machine-to-a-kvm-virtual-machine/ Transfer a running Linux]
== Expand the size of QCOW2 disk ==
[http://www.naturalborncoder.com/virtualization/2014/12/05/increasing-the-size-of-a-qcow2-image-under-kvm/ Expand the size of a QCOW2 disk image ]
== Shrink a QCOW2 disk ==
Clear the empty space
sudo dd if=/dev/zero of=/zerofile bs=1M
sudo rm -f /zerofile
or
sdelete.exe -z C:
Then change the size
qemu-img convert -O qcow2 -c input.qcow2 output.qcow2
=== Copy a Sparse File ===
From [https://serverfault.com/questions/665335/what-is-fastest-way-to-copy-a-sparse-file-what-method-results-in-the-smallest-f Fastest way to copy a sprse file] the end result was :
* cp --sparse=always srcFile dstFile
* dd if=srcFile of=dstFile iflag=direct oflag=direct bs=4M conv=sparse
* rsync --ignore-existing -aS srcFile dstFile
* virt-sparsify srcFile dstFile
{{notepad}}
{{notepad}}

Latest revision as of 22:59, 14 May 2024

From: HowTos | KVM

KVM

Networking - brctl

systemd-networkd

Start/Start libvirtd

Virtual Shell virsh

virsh man

Transfer Running Machines

Expand the size of QCOW2 disk

Expand the size of a QCOW2 disk image

Shrink a QCOW2 disk

Clear the empty space

sudo dd if=/dev/zero of=/zerofile bs=1M
sudo rm -f /zerofile

or

sdelete.exe -z C:

Then change the size

qemu-img convert -O qcow2 -c input.qcow2 output.qcow2

Copy a Sparse File

From Fastest way to copy a sprse file the end result was :

  • cp --sparse=always srcFile dstFile
  • dd if=srcFile of=dstFile iflag=direct oflag=direct bs=4M conv=sparse
  • rsync --ignore-existing -aS srcFile dstFile
  • virt-sparsify srcFile dstFile

← Back to Notepad



<insert>googlesearchwiki</insert> <insert>paypal</insert> <insert>analytics</insert>