Commit a4685b54 authored by xavki's avatar xavki

add 2

parent 88a0c69c
......@@ -33,3 +33,10 @@ lsmod | grep -i kvm
```
sudo systemctl start libvirtd
sudo systemctl enable libvirtd --now
```
* pour de meileure performance
```
sudo modprobevhost_net
```
<network connections='1'>
<name>default2</name>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address='52:54:00:0a:cd:22'/>
<ip address='192.168.123.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.123.2' end='192.168.123.254'/>
</dhcp>
</ip>
</network>
......@@ -5,3 +5,11 @@
# KVM : premiere vm
* nat default
```
virsh net-list --all
virsh net-start default
virsh net-autostart default
virsh netdefine default.xml
```
%title: KVM
%author: xavki
# KVM : premiere vm virsh
%title: KVM
%author: xavki
# KVM : premiere vm virt install
virt-install -n ubuntu20-04 --description "xavki vm" --ram=10960 --vcpus=1 --disk path=/var/lib/libvirt/images/ubuntu-server.qcow2,bus=virtio,size=20 --network bridge=virbr0 --location /home/oki/Downloads/ubuntu-20.04-desktop-amd64.iso --vnc --noautoconsole --extra-args console=ttyS0
%title: KVM
%author: xavki
# KVM : premiere vm virsh
<br>
* liste des machines
```
virsh list --all
```
<br>
* création du disk
```
sudo truncate -s 25G /var/lib/libvirt/images/xavki20.04.iso
```
<br>
* dump du xml
```
virsh dumpxml ubuntu20.04 > create-vm.xml
```
------------------------------------------------------------------------------
# KVM : premiere vm virsh
<br>
* modification du xml
```
<name>xavki20.04</name>
<boot dev='cdrom'/>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/xavki20.04.iso'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/oki/Downloads/ubuntu-20.04-desktop-amd64.iso'/>
<target dev='sda' bus='sata'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
```
<br>
* création
```
virsh create create-vm.xml
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment