<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Qemu on nagg.eu</title><link>https://nagg.eu/tags/qemu/</link><description>Recent content in Qemu on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 25 Jul 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/qemu/index.xml" rel="self" type="application/rss+xml"/><item><title>Debian QEMU/KVM bridged networking and VLAN</title><link>https://nagg.eu/debian-qemu-kvm-bridged-networking-and-vlan/</link><pubDate>Sun, 25 Jul 2021 00:00:00 +0000</pubDate><guid>https://nagg.eu/debian-qemu-kvm-bridged-networking-and-vlan/</guid><description>&lt;p&gt;By default on every Linux distro after installing &lt;code&gt;QEMU&lt;/code&gt; and &lt;code&gt;libvirt&lt;/code&gt; two
kinds of networking are available:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;NAT: VM sits behind a NAT.&lt;/li&gt;
&lt;li&gt;MACVTAP: without going into much details it acts more or less like a
bridged network, except not really. One of the most annoying limitations is
that host to guest communication and vice versa are not really working well.
Other important things might be broken as well, like for example VRRP.
This mode is good for quick and dirty testing but not really for a stable
environment.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;BRIDGED networking is also supported by &lt;code&gt;libvirt&lt;/code&gt; but requires some manual
work.&lt;br&gt;
A possible networking schema could be the following:&lt;/p&gt;</description></item><item><title>Resize QCOW2 disk image</title><link>https://nagg.eu/resize-qcow2-disk-image/</link><pubDate>Wed, 05 Dec 2018 00:00:00 +0000</pubDate><guid>https://nagg.eu/resize-qcow2-disk-image/</guid><description>&lt;p&gt;QCOW2 disk images can be easily grown using libvirt command line utils.&lt;br&gt;
Unfortunately it isn&amp;rsquo;t possible to grow QCOW2 images in-place or online.&lt;br&gt;
First of all, power off the virtual machine, grow the file and make a copy of
it:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
$ qemu-img resize image.qcow2 +200G
$ cp image.qcow2 image-new.qcow2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Identify the specific partion you intend to grow:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
$ virt-filesystems -a image.qcow2 -l
Name Type VFS Label Size Parent
/dev/sda1 filesystem ext4 - 536870912 -
/dev/sda3 filesystem xfs - 45885612000 -
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Expand the actual partition:&lt;/p&gt;</description></item><item><title>FreeBSD network performance on KVM/Qemu</title><link>https://nagg.eu/freebsd-network-performance-on-kvm-qemu/</link><pubDate>Tue, 13 Nov 2018 00:00:00 +0000</pubDate><guid>https://nagg.eu/freebsd-network-performance-on-kvm-qemu/</guid><description>&lt;p&gt;Today I red an article that was comparing Fedora 29 and FreeBSD 11.2 network
performance in a KVM/Qemu environment.&lt;br&gt;
Since I use KVM/Qemu and also Fedora and Freebsd I powered on a couple of vm
and did my own tests.&lt;br&gt;
Results are quite interesting, I expected FreeBSD to be faster but it turns out
Fedora 29 actually is.&lt;br&gt;
Host system configuration:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
CPU: Ryzen 7 1700x @4 GHz
Motherboard: Gigabyte X370 K7 - BIOS F23d
RAM: 2x16 GB DDR4 @3133 MHz CAS 16
HDD: Some Samsung SSD

Operating systems
Host: Fedora 29 x86_64
Fedora VM0: Fedora 29 X86_64
Fedora VM1: Fedora 29 X86_64
FreeBSD VM0: FreeBSD 11.2 x86_64
FreeBSD VM1: FreeBSD 11.2 x86_64

Virtualization techonology: Qemu+KVM
Linux kernel version: 4.18.17-300.fc29.x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What I did was setup 2 hidentical Fedora 29 virtual machines and 2 hidentical
FreeBSD 11.2 virtual machines, every one of them had &lt;code&gt;iperf3&lt;/code&gt; installed on it.&lt;/p&gt;</description></item><item><title>Copy Linux sparse files over network</title><link>https://nagg.eu/copy-linux-sparse-files-over-network/</link><pubDate>Wed, 09 Nov 2016 18:19:35 +0000</pubDate><guid>https://nagg.eu/copy-linux-sparse-files-over-network/</guid><description>&lt;p&gt;Sparse files are nice to use to store virtual machine&amp;rsquo;s virtual disks but can be a real pain in the ass to backup efficiently, especially over the network.&lt;br&gt;
Luckily &lt;code&gt;rsync&lt;/code&gt; provides a way to intelligently copy sparse files both locally and over the network.&lt;br&gt;
The trick is use &lt;code&gt;--sparse&lt;/code&gt; and &lt;code&gt;--inplace&lt;/code&gt; options.&lt;br&gt;
Let&amp;rsquo;s say we have a sparse 60 GB qemu virtual disk with only around 7 GB used:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ ls -lh fedora24.qcow2 
-rw------- 1 root root 61G Nov 8 19:11 fedora24.qcow2
$ du -h fedora24.qcow2 
7.2G	fedora24.qcow2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first thing to note is that ls does not recognize sparse files while du does.&lt;br&gt;
The first time a file is copied use the &lt;code&gt;--sparse&lt;/code&gt; option:&lt;/p&gt;</description></item></channel></rss>