
{"id":45014,"date":"2023-12-28T13:22:27","date_gmt":"2023-12-28T13:22:27","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=45014"},"modified":"2024-09-12T15:32:17","modified_gmt":"2024-09-12T15:32:17","slug":"install-virtualbox-ubuntu-2204","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/12\/install-virtualbox-ubuntu-2204\/","title":{"rendered":"Install VirtualBox 7.1.x in Ubuntu 22.04\/24.04 &#038; Keep Updated"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-44276\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This tutorial shows how to install Oracle VirtualBox in Ubuntu 22.04 and\/or Ubuntu 24.04<\/p>\n<p>VirtualBox is a popular free open-source tool for running different operating systems in virtual machines.<\/p>\n<p>The tool is available in Ubuntu system repositories, but old. So, here&#8217;s the step by step how to install guide for latest version for beginners.<\/p>\n<div id=\"attachment_45015\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-45015\" class=\"size-large wp-image-45015\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager-600x396.webp\" alt=\"\" width=\"600\" height=\"396\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager-600x396.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager-300x198.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager-768x506.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-manager.webp 1033w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-45015\" class=\"wp-caption-text\">VirtualBox VM Manager<\/p><\/div>\n<p><b>NOTE: VirtualBox so far only support x86_64 (amd64) CPU architecture type. Meaning for modern Intel &amp; AMD CPUs.<\/b><\/p>\n<h3>Step 1: Download &amp; Install the .deb package (Optional)<\/h3>\n<p>Oracle provides official .deb &amp; .rpm packages for installing the software in Debian\/Ubuntu &amp; Fedora based systems.<\/p>\n<p>User can select download the package by going to its website via the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/www.virtualbox.org\/wiki\/Linux_Downloads\" target=\"_blank\" rel=\"noreferrer noopener\">Download VirtualBox for Linux<\/a><\/div>\n<\/div>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-vbox71.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47221\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-vbox71-700x488.webp\" alt=\"\" width=\"610\" height=\"425\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-vbox71-700x488.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-vbox71-300x209.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-vbox71.webp 756w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Next, open the Downloads folder, then either <strong>double click on the package or use right-click menu &#8220;<i>Open With Other Application<\/i>&#8221; and select open the <code>.deb<\/code> package you just downloaded via <i>Software Install (or App Center)<\/i>.<\/strong> Finally, click install button to install it.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47222\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71-700x457.webp\" alt=\"\" width=\"610\" height=\"398\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71-700x457.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71-300x196.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71-768x502.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71-1320x862.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/click-install-vbox71.webp 1384w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><i><b>NOTE: The installing process may fail sometimes due to old package in your system, in the case, just uninstall the old one (go to bottom for how) then try to re-install again.<\/b><\/i><\/p>\n<p>Once installed, search for and launch it either from start menu or &#8216;Activities&#8217; overview depends on your desktop environment.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-vbox71.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-47223\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-vbox71.webp\" alt=\"\" width=\"514\" height=\"286\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-vbox71.webp 514w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-vbox71-300x167.webp 300w\" sizes=\"auto, (max-width: 514px) 100vw, 514px\" \/><\/a><\/p>\n<h3>Step 2: Add VirtualBox repository to keep it up-to-date<\/h3>\n<p>The .deb package you installed via &#8216;Step 1&#8217; used to automatically add the repository. However, it does NO longer do the trick in recent versions.<\/p>\n<p>So, here&#8217;s how to do it step by step via the new Ubuntu PPA policy.<\/p>\n<h4>1. Download &amp; install the key<\/h4>\n<p>First, press <b>Ctrl+Alt+T<\/b> on keyboard to open up a terminal window.<\/p>\n<p>When it opens, run command to make sure &#8220;\/etc\/apt\/keyrings&#8221; directory exist:<\/p>\n<pre>sudo mkdir -p \/etc\/apt\/keyrings<\/pre>\n<p>Then, run command to use <code>wget<\/code> to download key, dearmor it (so unreadable), and finally save it to that directory:<\/p>\n<pre>wget -q -O- https:\/\/www.virtualbox.org\/download\/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output \/etc\/apt\/keyrings\/oracle-virtualbox-2016.gpg<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45020\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy-600x389.webp\" alt=\"\" width=\"600\" height=\"389\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy-600x389.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy-768x498.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-key-jammy.webp 822w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>You can finally verify the key file, by running command:<\/p>\n<pre>cat \/etc\/apt\/keyrings\/oracle-virtualbox-2016.gpg<\/pre>\n<p>As the screenshot above shows you, it should outputs unreadable text.<\/p>\n<h4>2. Add VirtualBox repository<\/h4>\n<p>Before adding the source repository, first run command to <b>get system code name:<\/b><\/p>\n<pre>cat \/etc\/os-release<\/pre>\n<p><i>The apt repository so far only support Debian Stable (&amp; old stable), Ubuntu 22.04 &amp; 20.04 LTS (focal, jammy). For all their based systems, use the code-name you got via this command.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45021\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease-600x308.webp\" alt=\"\" width=\"600\" height=\"308\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease-600x308.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease-300x154.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease-768x395.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/jammy-osrelease.webp 804w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Then, in terminal window, run command to create &amp; edit a sources file:<\/p>\n<pre>sudo nano \/etc\/apt\/sources.list.d\/virtualbox.sources<\/pre>\n<p><i>Then in the terminal window, paste following lines:<\/i><\/p>\n<pre>Types: deb\r\nURIs: https:\/\/download.virtualbox.org\/virtualbox\/debian\r\nSuites: <b>jammy<\/b>\r\nComponents: contrib\r\nArchitectures: amd64\r\nSigned-By: \/etc\/apt\/keyrings\/oracle-virtualbox-2016.gpg<\/pre>\n<p><i>Replace <b>jammy<\/b> (for 22.04, Mint 21.x) according to last command output, such as <strong>noble<\/strong> for 24.04\/Mint 22, <strong>focal<\/strong> for 20.04\/mint20.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45022\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1-600x417.webp\" alt=\"\" width=\"600\" height=\"417\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1-600x417.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1-300x209.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1-768x534.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-sources-1.webp 871w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>When done, press either <b>Ctrl+S<\/b> or <b>Ctrl+O<\/b> and hit Enter to save file, then press <b>Ctrl+X<\/b> to exit.<\/p>\n<p>Finally, verify the sources file by running command:<\/p>\n<pre>cat \/etc\/apt\/sources.list.d\/virtualbox.sources<\/pre>\n<p>It should outputs the content you just added into that file.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45023\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources-600x254.webp\" alt=\"\" width=\"600\" height=\"254\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources-600x254.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources-300x127.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources-768x325.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/verify-vboxsources.webp 777w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h4>3. Update system package cache<\/h4>\n<p>After setup the source repository, run command to refresh your system package cache:<\/p>\n<pre>sudo apt update<\/pre>\n<p>The terminal output should print a line looks like:<\/p>\n<p><i>&#8220;Hit:5 https:\/\/download.virtualbox.org\/virtualbox\/debian jammy InRelease&#8221;<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-update-vbox.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45024\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-update-vbox-600x272.webp\" alt=\"\" width=\"600\" height=\"272\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-update-vbox-600x272.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-update-vbox-300x136.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-update-vbox.webp 768w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h4>4. Install or Update Virtualbox<\/h4>\n<p>If you skipped the &#8220;Step 1&#8221;, then you can install it (7.0.x series at the moment) by running command in terminal:<\/p>\n<pre>sudo apt install virtualbox-7.1<\/pre>\n<p>Finally, when a newer release is out, you&#8217;ll be able to update it through <b>Software Updater<\/b> (Update Manager) tool.<\/p>\n<h3>Uninstall<\/h3>\n<p>To remove VirtualBox, open terminal (Ctrl+Alt+T) window and run command:<\/p>\n<pre>sudo apt remove --autoremove virtualbox virtualbox-7.1<\/pre>\n<p>And, remove the source repository by simply deleting the key &amp; sources files:<\/p>\n<pre>sudo rm \/etc\/apt\/keyrings\/oracle-virtualbox-2016.gpg \/etc\/apt\/sources.list.d\/virtualbox.sources<\/pre>\n<p>Also, run <code>sudo apt update<\/code> to refresh package cache.<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to install Oracle VirtualBox in Ubuntu 22.04 and\/or Ubuntu 24.04 VirtualBox is a popular free open-source tool for running different operating systems in virtual machines. The tool is available in Ubuntu system repositories, but old. So, here&#8217;s the step by step how to install guide for latest version for beginners. NOTE: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":44276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[38],"class_list":["post-45014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-virtualbox"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=45014"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45014\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/44276"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=45014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=45014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=45014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}