<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kvm on Chris J Arges</title><link>https://chrisarges.net/tags/kvm/</link><description>Recent content in Kvm on Chris J Arges</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 13 Apr 2015 12:24:22 -0500</lastBuildDate><atom:link href="https://chrisarges.net/tags/kvm/index.xml" rel="self" type="application/rss+xml"/><item><title>qemu/kvm guest debugging</title><link>https://chrisarges.net/posts/2015-04-13-qemu-kvm-guest-debugging/</link><pubDate>Mon, 13 Apr 2015 12:24:22 -0500</pubDate><guid>https://chrisarges.net/posts/2015-04-13-qemu-kvm-guest-debugging/</guid><description>&lt;p&gt;Occasionally it is useful to debug a running guest VM&amp;rsquo;s kernel. Setup your host&#10;machine for virtual machine hosting with QEMU/KVM, and add ddebs to your host&#10;system using this &lt;a href="https://wiki.ubuntu.com/DebuggingProgramCrash"&gt;wiki&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Next, compile your own qemu with &lt;code&gt;--enable-debug&lt;/code&gt;. Setup your environment to&#10;use this binary (if using libvirt), or call it directly using qemu.&lt;/p&gt;&#10;&lt;p&gt;Ensure you have &lt;code&gt;vmlinux&lt;/code&gt; of the L1 guest somewhere in your L0 machine.&lt;/p&gt;&#10;&lt;p&gt;First, setup your L1 guest. If running with qemu add the &lt;code&gt;-s&lt;/code&gt; flag. With&#10;libvirt you can add the following entry to your machine description:&lt;/p&gt;</description></item><item><title>using ktest.pl with ubuntu</title><link>https://chrisarges.net/posts/2014-07-01-using-ktestpl-with-ubuntu/</link><pubDate>Tue, 01 Jul 2014 13:10:00 -0700</pubDate><guid>https://chrisarges.net/posts/2014-07-01-using-ktestpl-with-ubuntu/</guid><description>&lt;p&gt;Bisecting the kernel is one of those tasks that&amp;rsquo;s time-consuming and error prone.&#10;Ktest.pl is a script that lives in the linux kernel source &lt;a href="http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/tools/testing/ktest?id=HEAD"&gt;tree&lt;/a&gt; that helps&#10;to automate this process. The script is extremely extensible and as&#10;such takes time to understand which variables need to be set and where. In this&#10;post, I&amp;rsquo;ll go over how to perform a kernel bisection using a VM as the target&#10;machine. In this example I&amp;rsquo;m using &amp;lsquo;ubuntu&amp;rsquo; as the VM name.&lt;/p&gt;</description></item><item><title>creating a local vm easily and automatically</title><link>https://chrisarges.net/posts/2014-03-05-creating-local-vm-easily-and/</link><pubDate>Wed, 05 Mar 2014 14:22:00 -0800</pubDate><guid>https://chrisarges.net/posts/2014-03-05-creating-local-vm-easily-and/</guid><description>&lt;p&gt;This is the nifty little snippet I use to create a quick and dirty VM for&#10;testing. Just &lt;code&gt;apt-get install vmbuilder&lt;/code&gt; and run the following:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;ubuntu&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbuilder kvm ubuntu --arch &lt;span style="color:#e6db74"&gt;&amp;#39;amd64&amp;#39;&lt;/span&gt; --suite &lt;span style="color:#e6db74"&gt;&amp;#39;precise&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--rootsize &lt;span style="color:#e6db74"&gt;&amp;#39;8096&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--mem &lt;span style="color:#e6db74"&gt;&amp;#39;1024&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--components &lt;span style="color:#e6db74"&gt;&amp;#39;main,universe&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg vim &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg openssh-server &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--addpkg bash-completion &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--user &lt;span style="color:#e6db74"&gt;&amp;#39;ubuntu&amp;#39;&lt;/span&gt; --pass &lt;span style="color:#e6db74"&gt;&amp;#39;ubuntu&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-d /var/lib/libvirt/images/&lt;span style="color:#e6db74"&gt;${&lt;/span&gt;NAME&lt;span style="color:#e6db74"&gt;}&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--libvirt qemu:///system &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-o &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-v --debug &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--hostname &lt;span style="color:#e6db74"&gt;${&lt;/span&gt;NAME&lt;span style="color:#e6db74"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you need additional help consult the&#10;&lt;a href="https://help.ubuntu.com/12.04/serverguide/jeos-and-vmbuilder.html"&gt;serverguide&lt;/a&gt;&lt;/p&gt;</description></item><item><title>creating a local vm domain from an ubuntu cloud image</title><link>https://chrisarges.net/posts/2014-02-17-creating-local-vm-domain-from-ubuntu/</link><pubDate>Mon, 17 Feb 2014 11:43:00 -0800</pubDate><guid>https://chrisarges.net/posts/2014-02-17-creating-local-vm-domain-from-ubuntu/</guid><description>&lt;p&gt;It is very convenient to be able to quickly spin up a local VM in order to do&#10;some sort of bug verification or testing. Generally I can use a cloud provider&#10;to spin up an instance, but occasionally you need the flexibility of a local VM&#10;in order to setup more complex networking or other specific environments.&lt;/p&gt;&#10;&lt;p&gt;This &lt;a href="http://ubuntu-smoser.blogspot.com/2013/02/using-ubuntu-cloud-images-without-cloud.html"&gt;link&lt;/a&gt; was extremely helpful in figuring our how to setup a ready to boot&#10;image, but I noticed a few issues. First, on Precise I didn&amp;rsquo;t have the&#10;cloud-localds tool, and second there wasn&amp;rsquo;t a very simple way to import the&#10;image into libvirt.&lt;/p&gt;</description></item><item><title>automatic bisection of qemu with console and monitor interaction</title><link>https://chrisarges.net/posts/2013-12-16-automatic-bisection-of-qemu-with/</link><pubDate>Mon, 16 Dec 2013 14:39:00 -0800</pubDate><guid>https://chrisarges.net/posts/2013-12-16-automatic-bisection-of-qemu-with/</guid><description>&lt;p&gt;I had some fun debugging a performance &lt;a href="http://pad.lv/1100843"&gt;issue&lt;/a&gt; after VM migration on v1.0.&#10;Because this was fixed in newer versions, a bisect was in order. Doing this&#10;manually becomes very tedious so writing some scripts to use &lt;code&gt;git bisect run&lt;/code&gt;&#10;really helps. Here I&amp;rsquo;ll document how I did this in case others find it useful&#10;when trying to bisect issues in qemu.&lt;/p&gt;&#10;&lt;p&gt;First step is getting the problem reproducible using the command line. In&#10;addition you will also need to output anything that be used to determine if the&#10;test case passes or fails using standard console output. This makes it easy to&#10;run the test case with expect. You will need to &lt;a href="https://help.ubuntu.com/community/SerialConsoleHowto"&gt;follow&lt;/a&gt; on how to setup your&#10;VM to use serial output.&lt;/p&gt;</description></item></channel></rss>