KVM: Difference between revisions

From DWIKI
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Links=
 
= Links =
 
*[http://www.linux-kvm.org/ Homepage]
*[http://www.linux-kvm.org/ Homepage]
*http://www.linux-kvm.com/
=Docs=
*[http://blog.ericwhite.ca/articles/2010/10/kvm-ubuntu-vm-using-debootstrap/ Creating a KVM Ubuntu VM using Debootstrap]
*[http://www.linux-kvm.org/page/FAQ FAQ]
*[http://wiki.debian.org/KVM KVM on Debian]
*https://wiki.centos.org/HowTos/KVM


=Hardware=
= Docs =
 
*[https://help.ubuntu.com/community/KVM/FAQ Ubuntu KVM FAQ]
*[http://blog.ericwhite.ca/articles/2010/10/kvm-ubuntu-vm-using-debootstrap/ Creating a KVM Ubuntu VM using Debootstrap]
*[http://www.linux-kvm.org/page/FAQ FAQ]
*[http://wiki.debian.org/KVM KVM on Debian]
*[https://wiki.centos.org/HowTos/KVM https://wiki.centos.org/HowTos/KVM]
*[https://lonesysadmin.net/tag/linux-vm-performance-tuning/ Linux VM performance tuning]
 
= Hardware =
 
Required CPU flags:
Required CPU flags:
  egrep '^flags.*(vmx|svm)' /proc/cpuinfo
  egrep '^flags.*(vmx|svm)' /proc/cpuinfo


=Management tools=
= Management tools =
*https://www.linux-kvm.org/page/Management_Tools
 
===proxmox===
*[https://www.linux-kvm.org/page/Management_Tools https://www.linux-kvm.org/page/Management_Tools]
==GUI==
 
 
[[QEMU]]
=== proxmox ===
 
== GUI ==
 
=== [[Virt-manager|virt-manager]] ===


===[[virt-manager]]===
Only manages connecting?
Only manages connecting?


===aqemu===
=== aqemu ===
 
looks promising
looks promising


===convirt===
=== convirt ===
 
seems broken/gtk
seems broken/gtk


==CLI==
== CLI ==
===virt-install===
 
=== virt-install ===
 
=== vmdeboostrap ===
 
For quick debian installation. [https://github.com/funollet/vmbootstrap https://github.com/funollet/vmbootstrap]


===vmdeboostrap===
 
For quick debian installation.
https://github.com/funollet/vmbootstrap


=Cheatsheet=
= Cheatsheet =
 
== Clone a virtual machine ==


==Clone a virtual machine==
Copy the xml file found in /etc/libvirt/ to myclone.xml
Copy the xml file found in /etc/libvirt/ to myclone.xml


You will problable need a new random MAC address, one way you find [here]
You will problable need a new random MAC address, one way you find [here] Also generate a new uuid (todo: get script)
Also generate a new uuid (todo: get script)


Edit myclone.xml: -update <name>, <uuid>, <mac address, <disk><source>


Edit myclone.xml:
then you will probably need to change things like IP address, /etc/hostname etc.
-update <name>, <uuid>, <mac address, <disk><source>


then you will probably need to change things like IP address, /etc/hostname etc.
== Install to drbd ==


==Install to drbd==
  kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -cdrom /tmp/debiansqueeze.iso  -boot d -m 384
  kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -cdrom /tmp/debiansqueeze.iso  -boot d -m 384


Line 54: Line 71:
  kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -boot c -m 384
  kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -boot c -m 384


&nbsp;


&nbsp;


virt-install -d --name=squeeze --ram 512 --disk path=/dev/drbd/by-res/squeeze,bus=virtio,cache=none --virt-type=kvm --network bridge=br0,model=virtio --vnc --accelerate --location=[http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/ http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/]


virt-install -d --name=squeeze --ram 512 --disk path=/dev/drbd/by-res/squeeze,bus=virtio,cache=none --virt-type=kvm --network bridge=br0,model=virtio --vnc --accelerate --location=http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/
and start using


and start using
  kvm start squeeze
  kvm start squeeze


&nbsp;
== Grow disk ==
qemu-img resize <my_vm>.img +10G
== Run vmdk in kvm ==
without converting?


==Grow disk==
=FAQ=
==IDE controllers are unsupported for this QEMU binary or machine type==
try specifying machine type

Revision as of 09:55, 16 November 2022

Links

Docs

Hardware

Required CPU flags:

egrep '^flags.*(vmx|svm)' /proc/cpuinfo

Management tools


QEMU

proxmox

GUI

virt-manager

Only manages connecting?

aqemu

looks promising

convirt

seems broken/gtk

CLI

virt-install

vmdeboostrap

For quick debian installation. https://github.com/funollet/vmbootstrap

 

Cheatsheet

Clone a virtual machine

Copy the xml file found in /etc/libvirt/ to myclone.xml

You will problable need a new random MAC address, one way you find [here] Also generate a new uuid (todo: get script)

Edit myclone.xml: -update <name>, <uuid>, <mac address, <disk><source>

then you will probably need to change things like IP address, /etc/hostname etc.

Install to drbd

kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -cdrom /tmp/debiansqueeze.iso  -boot d -m 384

And then use -boot c to actually boot it:

kvm -name squeeze1 -usbdevice tablet -vnc :1 -hda /dev/drbd0 -boot c -m 384

 

 

virt-install -d --name=squeeze --ram 512 --disk path=/dev/drbd/by-res/squeeze,bus=virtio,cache=none --virt-type=kvm --network bridge=br0,model=virtio --vnc --accelerate --location=http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/

and start using

kvm start squeeze

 

Grow disk

qemu-img resize <my_vm>.img +10G

Run vmdk in kvm

without converting?

FAQ

IDE controllers are unsupported for this QEMU binary or machine type

try specifying machine type