Tag Archives: kvm

‘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

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: