<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title>SysAdmin Journal · Virtualization</title>
        <link>https://sysadmin-journal.com/tag/virtualization</link>
        <description>Posts tagged with Virtualization</description>
        <language>en</language>
        <lastBuildDate>Wed, 08 Nov 2017 21:49:00 +0000</lastBuildDate>
        <atom:link href="https://sysadmin-journal.com/tag/virtualization/rss" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        <item>
            <title>Cannot insert &#039;vboxdrv&#039; into the kernel</title>
            <link>https://sysadmin-journal.com/cannot-insert-vboxdrv-into-the-kernel</link>
            <guid isPermaLink="true">https://sysadmin-journal.com/cannot-insert-vboxdrv-into-the-kernel</guid>
            <pubDate>Wed, 08 Nov 2017 21:49:00 +0000</pubDate>
            <dc:creator>Ish Sookun</dc:creator>
            <category>Virtualization</category>
            <description>I installed VirtualBox on Ubuntu 17.10 running on a machine that has Secure Boot enabled. The installation finished with a warning. WARNING: The character device /dev/vboxdrv does not exist.</description>
            <content:encoded><![CDATA[<p>It became a requirement to sign kernel modules when Secure Boot is enabled a long time back. I only encountered this today.</p><p>I installed VirtualBox on Ubuntu 17.10 running on a machine that has Secure Boot enabled. The installation finished with a warning.</p><!--kg-card-begin: markdown--><pre><code>WARNING: The character device /dev/vboxdrv does not exist.
#011 Please install the virtualbox-dkms package and the appropriate
#011 headers, most likely linux-headers-generic.
#011 You will not be able to start VMs until this problem is fixed.
</code></pre>
<!--kg-card-end: markdown--><p>Yes, I could not create any virtual machine because the <code>vboxdrv</code> kernel module was not loaded. Using <code>modprobe</code> to do it returned the following error:</p><!--kg-card-begin: markdown--><pre><code>modprobe: ERROR: could not insert 'vboxdrv': Required key not available
</code></pre>
<!--kg-card-end: markdown--><p>The full documentation on <strong>module signing</strong> is published on <a href="https://github.com/Canonical-kernel/Ubuntu-kernel/blob/master/Documentation/module-signing.txt">Github</a>. However, if you're here following a Google search and perhaps looking for a quick fix for your broken VirtualBox, then the following is what you need to know.</p><p>The signing keys are created using <strong>openssl</strong>:</p><!--kg-card-begin: markdown--><pre><code>openssl req -new -x509 -newkey rsa:2048 -keyout LKM.priv \
    -outform DER -out LKM.der -nodes -days 36500 \
    -subj &quot;/CN=LKM Signing Key/&quot;
</code></pre>
<!--kg-card-end: markdown--><p>You would probably replace the <code>CN</code> value with a more descriptive name for the keys. The next step would be to sign the <code>vboxdrv</code> module with the key using the <strong>scripts/sign-file</strong> tool available in the Linux kernel source tree.</p><!--kg-card-begin: markdown--><pre><code>sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 LKM.priv LKM.der $(modinfo -n vboxdrv)
</code></pre>
<!--kg-card-end: markdown--><p>The four arguments supplied are actually:</p><ul><li>The hash algorithm (in this case sha256)</li><li>The private key filename</li><li>The public key filename</li><li>The kernel module to be signed</li></ul><p>Before we can load the signed module we have to register the keys to Secure Boot. We use the Machine Owner Key (MOK) utility.</p><!--kg-card-begin: markdown--><pre><code>sudo mokutil --import LKM.der
</code></pre>
<!--kg-card-end: markdown--><p>It will ask for a password which will be required after reboot by Secure Boot. Once it is done, <code>modprobe vboxdrv</code> should execute without any error. In order for VirtualBox to function correctly the following modules will be required (to be signed &amp; loaded) as well:</p><!--kg-card-begin: markdown--><pre><code>vboxnetadp
vboxnetflt
vboxpci</code></pre>
<!--kg-card-end: markdown--><p>More about the VirtualBox modules can be found <a href="https://www.virtualbox.org/manual/ch02.html#externalkernelmodules">here</a>. The <code>vboxdrv</code> module issue with Secure Boot was mentioned on <a href="https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1574300">Launchpad</a>, <a href="https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur">Ask Ubuntu</a> and VirtualBox <a href="https://www.virtualbox.org/ticket/11577">forums</a>.</p>]]></content:encoded>
        </item>
    </channel>
</rss>
