{"id":299,"date":"2018-04-29T20:12:29","date_gmt":"2018-04-29T18:12:29","guid":{"rendered":"https:\/\/ubuntu.dirkschmidtke.de\/?post_type=portfolio&#038;p=299"},"modified":"2025-01-05T13:17:59","modified_gmt":"2025-01-05T12:17:59","slug":"virtualbox","status":"publish","type":"portfolio","link":"https:\/\/ubuntu.dirkschmidtke.de\/en\/portfolio\/virtualbox\/","title":{"rendered":"VirtualBox"},"content":{"rendered":"<p>Among Linux users, <a href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">VirtualBox<\/a> has the best reputation as a free out-of-the-box virtualization solution for the desktop, because the software, which was developed in Germany and later acquired by Sun, then by Oracle, is particularly easy to set up and administer.<\/p>\n<p>The earlier distinction between open source edition and commercial version has been dropped <a href=\"http:\/\/blogs.oracle.com\/wim\/entry\/oracle_vm_virtualbox_40_extens\" target=\"_blank\" rel=\"noopener noreferrer\">since VirtualBox 4<\/a>. The program has been distributed freely and open source since then.<\/p>\n<h3>Separate extension pack<\/h3>\n<p>To activate USB support (from version 5 also USB 3.0), an <a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\" target=\"_blank\" rel=\"noopener noreferrer\">Extension Pack<\/a> must be downloaded from the manufacturer Oracle and then selected in the VirtualBox GUI under File-&gt;Global Settings-&gt;Additional Packs. This extension is still under a proprietary license, but is free for education and personal use.<\/p>\n<p>Besides USB support, the extension pack teaches the virtual machine also to use the RDP (remote desktop) protocol and disk encryption.<\/p>\n<h3>Adding the Guest Additions<\/h3>\n<p>The <em>VirtualBox Guest Additions<\/em> provide for a better integration of the guest with the host system &#8211; including better graphics support as well as a shared clipboard. They are included in an ISO file, which is to be installed in the host, so that it can be mounted in the guest system like a secondary drive. You don&#8217;t have to do that on the command line. Just click on devices in the VirtualBox graphical user interface and click &#8220;Insert Guest Additions CD Image &#8230;&#8221; to start the setup dialog.<\/p>\n<h3>Installation<\/h3>\n<pre>sudo apt-get install virtualbox virtualbox-guest-additions-iso<\/pre>\n<h3>Troubleshooting kernel modules and secure boot<\/h3>\n<p>VirtualBox requires three kernel modules that are not part of the Linux kernel and therefore have to be loaded separately. During kernel updates, dkms takes care of rebuilding and loading these modules. You can also initiate this process yourself in case of problems:<\/p>\n<blockquote><p><code>sudo apt install --reinstall virtualbox-dkms<\/code><\/p><\/blockquote>\n<p>Nevertheless, it can happen after upgrades of Ubuntu machines with Secure Boot that the kernel modules cannot be loaded anymore. The corresponsing systemd journal entry is:<\/p>\n<blockquote><p>modprobe vboxdrv failed. Please use &#8216;dmesg&#8217; to find out why<\/p><\/blockquote>\n<p>If you follow the advice and <code>sudo dmesg | tail<\/code> holds a line that complains about a missing signature, you have to sign the modules manually:<\/p>\n<p>First, create a new password, which will later be used for the key creation, while we make sure, that the password is not recorded in .bash_history:<\/p>\n<blockquote><p><code>$ read -s SIGN_PIN<\/code><\/p><\/blockquote>\n<p>Now, type in the passwort and press enter to finish. Next we store the entered password and the kernel version in variables for later use:<\/p>\n<blockquote><p><code>$ export SIGN_PIN<br \/>\n$ VERSION=\"$(uname -r)\"<\/code><\/p><\/blockquote>\n<p>Change into the directory, where dkms has created the modules, and use a loop to sign all of them:<\/p>\n<blockquote><p><code>$ cd \/lib\/modules\/\"$VERSION\"\/updates\/dkms<br \/>\n$ for i in *.ko ; do sudo --preserve-env=SIGN_PIN \/usr\/src\/\"$VERSION\"\/scripts\/sign-file sha256 \/var\/lib\/shim-signed\/mok\/MOK.priv \/var\/lib\/shim-signed\/mok\/MOK.der \"$i\" ; done<\/code><\/p><\/blockquote>\n<p>Afterwards, you should be able to load the signed modules:<\/p>\n<blockquote><p><code>$ modprobe vboxdrv<br \/>\n$ modprobe vboxnetadp<br \/>\n$ modprobe vboxnetflt<\/code><\/p><\/blockquote>\n<p>&#8230; and VirtualBox works again!<\/p>\n<p><strong>References:<\/strong> <a href=\"https:\/\/www.virtualbox.org\/ticket\/11577\" target=\"_blank\" rel=\"noopener\">Bug ticket at VirtualBox<\/a>, <a href=\"https:\/\/wiki.debian.org\/SecureBoot\" target=\"_blank\" rel=\"noopener\">Debian wiki on SecureBoot<\/a><\/p>\n<h3>Alternatives<\/h3>\n<p>The commercial <a href=\"https:\/\/www.vmware.com\" target=\"_blank\" rel=\"noopener noreferrer\">VMWare<\/a> is a close rival to VirtualBox. Bur there are also proven open source solutions, namely <a href=\"https:\/\/www.linux-kvm.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">KVM<\/a>, a virtualization framework included in the Linux Kernel, which uses\u00a0<a href=\"https:\/\/www.qemu.org\/\" target=\"_blank\" rel=\"noopener\">QEMU<\/a> for the actual virtualization, and <a href=\"https:\/\/www.xenproject.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Xen<\/a>, a hypervisor supporting paravirtualization, which is also fully supported in the Linux kernel. Ubuntu has <a href=\"https:\/\/virt-manager.org\/\" target=\"_blank\" rel=\"noopener\">virt-manager<\/a>, a graphical administration interface for the open soruce solutions mentioned above.<\/p>","protected":false},"excerpt":{"rendered":"<p>How to install, use and troubleshoot VirtualBox, which is probably the easiest virtualisation solution for the<br \/>\nLinux desktop.<\/p>\n","protected":false},"author":1,"featured_media":301,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"portfolio_category":[23],"portfolio_tag":[],"class_list":["post-299","portfolio","type-portfolio","status-publish","has-post-thumbnail","hentry","portfolio_category-virtualisierung-emulatoren"],"_links":{"self":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio"}],"about":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/types\/portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":8,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/299\/revisions"}],"predecessor-version":[{"id":951,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/299\/revisions\/951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/media\/301"}],"wp:attachment":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"portfolio_category","embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio_category?post=299"},{"taxonomy":"portfolio_tag","embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio_tag?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}