sudo virsh net-list
sudo virsh net-dhcp-leases default | grep server_hostname
Tag Archives: kvm
virt-install error setting up software (Installation source not set)
3) [!] Installation source 4) [!] Software selection
(Error setting up software (Installation source not set
source)
You need to check location and url address in kickstart file:
url –url=”http://mirror.litnet.lt/centos/7/os/x86_64/”
virt-install –location=http://mirror.litnet.lt/centos/7/os/x86_64/
virt-install console exit (deatech)
CTRL+Shift+]
‘utf-8’ codec can’t decode byte 0xf0 in position 0: invalid continuation byte virt-install
Error: --disk path=/var/lib/libvirt/images/centos7.qcow2,size=15,device=disk,bus=virtio,format=qcow2: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte
sudo virt-install --connect=qemu:///system --network=bridge:virbr0 --extra-args="ks=http://192.168.0.101:1111/centos7.cfg console=tty0 console=ttyS0,115200" --name=aaa --disk path=/var/lib/libvirt/images/centos7.qcow2,size=15,device=disk,bus=virtio,format=qcow2 --ram 1500 --vcpus=1 --check-cpu --accelerate --hvm --location=http://mirror.cherryservers.com/centos/7/os/x86_64/ --nographics
virsh # pool-list
Name State Autostart
------------------------------------
boot-scratch active yes
images active yes
tmp active yes
virtio-win active yes
vit active yes
virsh # pool-destroy vit
Pool vit destroyed
virsh # pool-destroy virtio-win
Pool virtio-win destroyed
'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte error was because of virStorageVolGetName:
File "/usr/lib64/python3.7/site-packages/libvirt.py", line 3650, in name
ret = libvirtmod.virStorageVolGetName(self._o)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte
[Mon, 17 Feb 2020 15:26:54 virt-install 57908] DEBUG (cli:263) File "/usr/share/virt-manager/virt-install", line 1005, in
virt-install should be working now again
unsupported driver name ‘file’ for disk ‘hdc’
virsh add iso image like this:
virsh edit some_vm <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/systemrescuecd-6.0.2.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk>
kvm add usb
lsusb
usb.xml
virsh attach-device vn-centos /saved/path/to/usb.xml
kvm install windows 10
Download there:
https://the-eye.eu/public/MSDN/Windows%2010/
sudo virt-install --name=windows10 --ram=2192 --cpu=host --vcpus=2 --os-type=windows --os-variant=win8.1 --disk /dev/mapper/vg-win,bus=virtio --disk /tmp/en_windows_10_enterprise_x64_dvd_6851151.iso,device=cdrom,bus=ide --disk /usr/share/virtio-win/virtio-win.iso,device=cdrom,bus=ide --network bridge=virbr0 --graphics vnc,listen=0.0.0.0
Kickstart install Centos 7 using virt-install
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/centos7.qcow2 15G
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
or
firewall-cmd --zone=external --add-masquerade --permanent
firewall-cmd --reload
This helps avoid errors like: dracut-initqueue[688]: Warning: unknown network kickstart URL: ...
mkdir kick && mkdir kick
vim centos7.cfg
#version=RHEL7
install
auth --enableshadow --passalgo=sha512
repo --name="EPEL" --baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64
eula --agreed
reboot
url --url="http://mirror.litnet.lt/centos/7/os/x86_64/"
firstboot --enable
ignoredisk --only-use=vda
keyboard --vckeymap=en --xlayouts='en'
lang en_US.UTF-8
network --bootproto=dhcp --device=enp0s3 --noipv6 --activate
network --hostname=centos7.test.local
rootpw mypassword
services --enabled=NetworkManager,sshd,chronyd
timezone Europe/Vilnius --isUtc --ntpservers=0.centos.pool.ntp.org,1.centos.pool.ntp.org,2.centos.pool.ntp.org,3.centos.pool.ntp.org
user --groups=wheel --homedir=/home/monit --name=monit --password=password --iscrypted --gecos="monit"
bootloader --location=mbr --boot-drive=vda
autopart --type=lvm
zerombr
clearpart --all --drives=vda
selinux --permissive
%packages
@base
@core
chrony
yum-cron
%end
python -m SimpleHTTPServer 1111
Serving HTTP on 0.0.0.0 port 1111 ...
or
python3 -m http.server 1111
Serving HTTP on 0.0.0.0 port 1111 (http://0.0.0.0:1111/) ...
sudo virt-install --connect=qemu:///system --network=bridge:virbr0 --extra-args="ks=http://192.168.0.101:1111/centos7.cfg console=tty0 console=ttyS0,115200" --name=centos7 --disk /var/lib/libvirt/images/centos7.qcow2,size=15,device=disk,bus=virtio,format=qcow2 --ram 1500 --vcpus=1 --check-cpu --accelerate --hvm --location=http://mirror.litnet.lt/centos/7/os/x86_64/ --nographics
CentOS Linux 7 (Core)
Kernel 3.10.0-862.el7.x86_64 on an x86_64
centos7 login:
ERROR Host does not support any virtualization options
sudo dnf install qemu-kvm
ERROR Cannot access storage file kvm
sudo vi /etc/libvirt/qemu.conf
user = "root"
group = "root"
sudo systemctl restart libvirtd.service
access KVM image data from raw image
dd if=/dev/vg_kvm/vsv999-03ly-o5sq7ktzgnbva56l of=/backup/data.hdd bs=512 conv=noerror,sync
qemu-img info /backup/data.hdd
image: /backup/data.hdd
file format: raw
virtual size: 50G (53687091200 bytes)
disk size: 50G
guestmount -a /backup/data.hdd -i --ro /mnt
ls -la /mnt
qemu start vm on boot
Start KVM vm on server boot:
virsh autostart VM_NAME
Domain test_server marked as autostarted.
disable OOM Killer for specific process
pidof kvm
echo -n ‘-17’ > /proc/kvm_proccess_id/oom_adj
linux kvm check ksm usage
grep -H ” /sys/kernel/mm/ksm/pages_*
kvm add iso: virsh add cdrom iso image
virsh # qemu-monitor-command DOMAIN –hmp –cmd “info block” | grep removable
virsh # qemu-monitor-command DOMAIN –hmp –cmd “change drive-ide0-1-0 /tmp/some.iso”
virsh # qemu-monitor-command DOMAIN –hmp –cmd “eject drive-ide0-1-0”