Tag Archives: qemu

‘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

qemu/kvm memory usage

The qemu/kvm process runs mostly like a normal Linux program. It allocates its memory with normal malloc() or mmap() calls. If a guest is going to have 1GB of physical memory, qemu/kvm will effectively do a malloc(1<<30), allocating 1GB of host virtual space. However, just like a normal program doing a malloc(), there is no actual physical memory allocated at the time of the malloc(). It will not be actually allocated until the first time it is touched.

Once the guest is running, it sees that malloc()’d memory area as being its physical memory. If the guest’s kernel were to access what it sees as physical address 0x0, it will see the first page of that malloc() done by the qemu/kvm process.

It used to be that every time a KVM guest changed its page tables, the host had to be involved. The host would validate that the entries the guest put in its page tables were valid and that they did not access any memory which was not allowed. It did this with two mechanisms:

shadow page tables

VMX/AMD-V extensions

 

 

virt-install install Fedora 19 on server

If you love Fedora and want use it on your server, but don’t like graphical interface. Its not problem, lets download Fedora ISO image likeĀ Fedora-Live-LXDE-x86_64-19-1.iso fromĀ http://fedoraproject.org/en/get-fedora-options

virt-install –connect qemu:///system -n Fedora19 –disk path=/var/lib/libvirt/images/guest.qcow2,format=qcow2,bus=virtio,cache=none –cdrom /tmp/Fedora-Live-LXDE-x86_64-19-1.iso –video=vga –network=bridge:virbr0,model=e1000 –accelerate –noapic –keymap=en-us –ram 1024

before you should create qcow disk image:

qemu-img create -f qcow2 /var/lib/libvirt/images/guest.qcow2 10G -o preallocation=metadata

I am using bridge networking so can access Fedora using SSH. You should disable LXDE graphical interface, because I guess you don’t need it.

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

and reboot your Fedora guest