{"id":14,"date":"2024-12-05T07:19:20","date_gmt":"2024-12-05T07:19:20","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/?p=14"},"modified":"2024-12-05T07:21:23","modified_gmt":"2024-12-05T07:21:23","slug":"roadblocks","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/2024\/12\/05\/roadblocks\/","title":{"rendered":"Roadblocks"},"content":{"rendered":"\n<p>For every computer-related project I undertake, challenges inevitably arise. Regardless of how much I think I know about a subject, there\u2019s always a new obstacle that pushes me to expand my understanding. Yet, these challenges often broaden my horizons and ultimately serve me well. That said, I can\u2019t help but feel a bit sorry for my beleaguered computer, which has endured countless experiments and adjustments. As a result, I\u2019ve decided it\u2019s more practical to preserve its stability and instead rely on virtual machines (VMs) as a sandbox for my projects.<\/p>\n\n\n\n<p>When working on a project, it always seems like the tasks you anticipate being the easiest turn out to be the most time-consuming and frustrating. This was precisely the case when I hit a roadblock in setting up Docker in a Linux Virtual Machine. I booted up Ubuntu through Oracle VirtualBox and started downloading Docker\u2014a platform designed to run applications in lightweight, isolated containers. Docker, however, requires <strong>KVM (Kernel-based Virtual Machine)<\/strong>, which provides hardware acceleration for virtualization. To my surprise, I was met with this error message:<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-f8b023bcd0c93119b84c26169d067bac\" style=\"color:#bd0707\"><strong>\u201cYour CPU does not support KVM extensions. KVM acceleration can NOT be used.\u201d<\/strong><\/p>\n\n\n\n<p>Ok\u2026 why?<\/p>\n\n\n\n<p>To investigate, I ran the command <strong><em>lscpu | grep -i virtualization<\/em><\/strong> in my terminal, which returned:<br><strong><em>Virtualization type: full<\/em><\/strong><br>This confirmed that my host system supports full virtualization but didn\u2019t clarify whether nested virtualization was enabled inside the VirtualBox VM.<\/p>\n\n\n\n<p>So, I tried the command <strong><em>egrep -c &#8216;(vmx|svm)&#8217; \/proc\/cpuinfo<\/em><\/strong> to check for CPU virtualization extensions. Result: <strong><em>0<\/em><\/strong>.<br>This indicated that the virtual CPU presented to my Ubuntu VM lacked the required VT-x (Intel) or SVM (AMD) extensions. These extensions are necessary for nested virtualization, and their absence usually means the hypervisor (VirtualBox) hasn\u2019t enabled them.<\/p>\n\n\n\n<p>To be thorough, I checked the VM\u2019s BIOS settings and confirmed through Task Manager on my Windows host that nested virtualization was supported. I also discovered that VirtualBox had a setting to <strong>&#8220;Enable Nested VT-x\/AMD-V.&#8221;<\/strong> Great! Problem solved, right? Wrong. The checkbox was greyed out. Why??<\/p>\n\n\n\n<p>Time to investigate further. I ran <strong><em>systeminfo<\/em><\/strong> in my Windows PowerShell and found this message: <strong><em>A hypervisor has been detected. Features required for Hyper-V will not be displayed.<\/em><\/strong><\/p>\n\n\n\n<p>This suggested that Hyper-V, a competing hypervisor, was interfering with VirtualBox\u2019s ability to access VT-x\/AMD-V. To disable it, I ran: <strong><em>dism.exe \/Online \/Disable-Feature:Microsoft-Hyper-V<\/em><\/strong> and <strong><em>bcdedit \/set hypervisorlaunchtype off<\/em><\/strong>. After rebooting, I checked again\u2014no luck. Hyper-V was still causing issues.<\/p>\n\n\n\n<p>Next, I went into Windows settings to disable related features. From <em><strong>Control Panel &gt; Programs &gt; Turn Windows features on or off<\/strong>,<\/em> I unchecked:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Hyper-V<\/strong><\/li>\n\n\n\n<li><strong>Windows Subsystem for Linux (WSL 2)<\/strong><\/li>\n\n\n\n<li><strong>Virtual Machine Platform<\/strong><\/li>\n\n\n\n<li><strong>Containers<\/strong><\/li>\n<\/ul>\n\n\n\n<p>After restarting the computer, I returned to VirtualBox, and finally, the <strong>&#8220;Enable Nested VT-x\/AMD-V&#8221;<\/strong> checkbox was no longer greyed out. I enabled the setting, started the VM, and ran the <strong><em>egrep -c &#8216;(vmx|svm)&#8217; \/proc\/cpuinfo<\/em><\/strong> command again. This time, it returned <strong><em>1<\/em><\/strong>. Success! KVM was now functional, and Docker installed without further issues.<\/p>\n\n\n\n<p>This roadblock perfectly illustrates how a single issue can spiral into a labyrinth of interconnected challenges with endless variables to consider. While it was tedious to troubleshoot, this is the lifeblood of computer science, and there\u2019s nothing quite like the satisfaction of finally getting things to work. The irony of it all? Setting up Docker was merely the first step.<\/p>\n\n\n\n<p>If you ever encounter this specific issue, I hope this blog post can serve as a helpful guide through the same tangled maze I faced. Whether it&#8217;s shedding light on an obscure error, offering a solution, or simply reassuring you that you&#8217;re not alone in the frustration, I want this to be a resource you can turn to when you find yourself staring at a seemingly insurmountable problem. After all, the best part of solving a tough technical challenge isn\u2019t just figuring it out for yourself\u2014it\u2019s being able to share what you\u2019ve learned to make someone else\u2019s journey a little bit easier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For every computer-related project I undertake, challenges inevitably arise. Regardless of how much I think I know about a subject, there\u2019s always a new obstacle that pushes me to expand my understanding. Yet, these challenges often broaden my horizons and ultimately serve me well. That said, I can\u2019t help but feel a bit sorry for [&hellip;]<\/p>\n","protected":false},"author":14556,"featured_media":16,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","has-thumbnail"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/users\/14556"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/posts\/14\/revisions\/17"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/media\/16"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/brynndevaan\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}