{"id":846,"date":"2022-07-24T07:46:10","date_gmt":"2022-07-24T07:46:10","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=846"},"modified":"2022-07-24T07:46:10","modified_gmt":"2022-07-24T07:46:10","slug":"virtual-box-tutorial","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=846","title":{"rendered":"Virtual Box Tutorial For Beginners: Step By Step Guides"},"content":{"rendered":"<p>In this <strong>Virtual box tutorial<\/strong>, you will learn how to create a virtual machine in Virtual box software. Also we will look at the important Virtual box concepts.<\/p>\n<h2 id=\"what-is-virtual-box\">What is Virtual Box?<\/h2>\n<p>Virtual Box is a Virtualization software that falls under <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hypervisor?ref=devopscube.com\" rel=\"noreferrer noopener\">Type 2 hypervisor<\/a> category. It helps you to create guest operating systems (virtual machines) on a host operating system (desktop\/Laptop).<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/type-2-hypervisor-drawio-1-1.png\" class=\"kg-image\" alt=\"virtual box type 2 hypervisor\" loading=\"lazy\" width=\"471\" height=\"471\"><\/figure>\n<p>If you are starting your Cloud or <a href=\"https:\/\/devopscube.com\/what-is-devops-what-does-it-really-mean\/\">DevOps<\/a> journey, Virtual box is a great software to practically learn virtualisation concept. You can create Linux and Windows based virtual machines on your workstation. The number of virtual machines that you can create is based on the underlying CPU and memory resources of your workstation.<\/p>\n<h2 id=\"virtual-box-installation\">Virtual Box Installation<\/h2>\n<p><strong>Step 1:<\/strong> Go to <a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads?ref=devopscube.com\" rel=\"noreferrer noopener\">VirtualBox Downloads page<\/a> and download the application based on your Operating System.  It is available for MAC, Windows and Linux System.<\/p>\n<p><strong>Step 2:<\/strong> Install the Virtual box application from the downloaded binary.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-13-36.png\" class=\"kg-image\" alt=\"Virtual Box application UI\" loading=\"lazy\" width=\"628\" height=\"347\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-13-36.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-13-36.png 628w\"><\/figure>\n<h2 id=\"download-iso-image\">Download ISO Image<\/h2>\n<p>To create a virtual machine, you need to have an ISO image.<\/p>\n<p>For this example, we will use the ubuntu server image which is freely available on the official ubuntu website.<\/p>\n<blockquote><p><strong>Note<\/strong>: You can use any ISO image. Centos, Ubuntu Desktop, Windows etc. You can find all Virtual Machine images and its download links in the <a href=\"https:\/\/virtualboxes.org\/images\/?ref=devopscube.com\" rel=\"noreferrer noopener\">Images Page<\/a>.<\/p><\/blockquote>\n<p>Go to Ubuntu <a href=\"https:\/\/ubuntu.com\/download\/server?ref=devopscube.com\" rel=\"noreferrer noopener\">Server Downloads<\/a>. Choose the manual server installation and download the latest server image.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-14-51.png\" class=\"kg-image\" alt=\"Virtual Box ubuntu ISO download\" loading=\"lazy\" width=\"576\" height=\"431\"><\/figure>\n<h2 id=\"creating-virtual-machines-in-virtual-box\">Creating Virtual Machines in Virtual Box<\/h2>\n<p>Follow the steps given below to create a virtual machine using Virtual Box.<\/p>\n<p><strong>Step 1:<\/strong> Click the new button.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-15-35.png\" class=\"kg-image\" alt=\"create new virtual machine on Virtual Box.\" loading=\"lazy\" width=\"607\" height=\"349\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-15-35.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-15-35.png 607w\"><\/figure>\n<p><strong>Step 2: <\/strong>Type in a name and choose options as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-16-39.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"512\" height=\"367\"><\/figure>\n<p><strong>Step 3:<\/strong> Add the memory as per your requirement. Make sure you leave enough room of the host operating system.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-17-33.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"516\" height=\"338\"><\/figure>\n<p><strong>Step 4: <\/strong>Choose the option to create a virtual hard disk as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-18-35.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"532\" height=\"341\"><\/figure>\n<p><strong>Step 5:<\/strong> Choose VDI option.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-19-36.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"546\" height=\"346\"><\/figure>\n<p><strong>Step 6:<\/strong> Choose &#8220;Dynamically allocated&#8221; option.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-20-37.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"534\" height=\"440\"><\/figure>\n<p><strong>Step 7:<\/strong> Add a disk storage size and click create.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-21-38.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"527\" height=\"439\"><\/figure>\n<p>You should see the VM in the powered off state.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-22-34.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"526\" height=\"349\"><\/figure>\n<p><strong>Step 8:<\/strong> Right click on the VM, go to start and then click Normal start. It will open a <strong>pop-up to add the ISO  image.<\/strong><\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-23-36.png\" class=\"kg-image\" alt=\"Start virtual box VM\" loading=\"lazy\" width=\"584\" height=\"377\"><\/figure>\n<p><strong>Step 9:<\/strong> Click the folder option in the popup.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-24-30.png\" class=\"kg-image\" alt=\"load ISO image in Virtual box\" loading=\"lazy\" width=\"578\" height=\"319\"><\/figure>\n<p>Use the <strong>plus button<\/strong> and load the downloaded ISO image from your computer as shown in the below images.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-25-31.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"596\" height=\"373\"><\/figure>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-26-29.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"590\" height=\"373\"><\/figure>\n<p><strong>Step 10:<\/strong> Once the ISO image is loaded, click the start option.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-27-27.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"596\" height=\"320\"><\/figure>\n<p><strong>Step 11:<\/strong> In the next popup, enter the first option that says &#8220;Install Ubuntu Server&#8221;<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-28-25.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"599\" height=\"521\"><\/figure>\n<p>You need to proceed with the normal booting process of the servers. Not all the screenshots are added as these options are self explanatory.<\/p>\n<blockquote><p><strong>Note: <\/strong>Use the keyword up and down arrows to move and space button to the select option<\/p><\/blockquote>\n<p>When you get the following option, select the disk we created in the initial steps.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-29-26.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"642\" height=\"491\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-29-26.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-29-26.png 642w\"><\/figure>\n<p>In the profile setup, provide name and password that you remember. You will need the user name and password to login to the server. Select &#8220;Done&#8221; and press enter.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-30-23.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"635\" height=\"492\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-30-23.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-30-23.png 635w\"><\/figure>\n<p>You can choose to ignore the server update and  proceed with logging in to the server.<\/p>\n<h2 id=\"start-stop-and-delete-virtual-box-vms\">Start, Stop and Delete Virtual Box VMs<\/h2>\n<p>Once you have virtual machines created in Virtual box, you can start, stop and delete it using the Virtual box UI as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-31-17.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"615\" height=\"407\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-31-17.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-31-17.png 615w\"><\/figure>\n<h2 id=\"virtual-box-networking-modes\">Virtual Box Networking Modes<\/h2>\n<p>Virtual box has the following networking modes.<\/p>\n<ol>\n<li><a href=\"https:\/\/devopscube.com\/what-is-nat-how-does-nat-work\/\">NAT<\/a><\/li>\n<li>Bridged<\/li>\n<li>Internal network<\/li>\n<li>Host-only adapter<\/li>\n<li>NAT network<\/li>\n<li>Cloud Network<\/li>\n<\/ol>\n<p>With each networking modes, you will get a different <a href=\"https:\/\/devopscube.com\/ip-address-tutorial\/\">IP address<\/a> that is part of the Networking mode.<\/p>\n<p>For example, in bridged network mode, your virtual machine will get an IP address from the Router you are connected to. Meaning, anyone in the router network can access your VM running inside your workstation.<\/p>\n<p>You can change the networking modes from the settings of the Virtual machine as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-32-28.png\" class=\"kg-image\" alt=\"Virtual Box networking modes\" loading=\"lazy\" width=\"636\" height=\"421\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-32-28.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-32-28.png 636w\"><\/figure>\n<h2 id=\"possible-virtual-box-errors\">Possible Virtual Box Errors<\/h2>\n<h3 id=\"ubuntu-errors\">Ubuntu Errors<\/h3>\n<p>In Ubuntu systems, while trying to create a virtual machine, you might get the following error.<\/p>\n<pre><code>Kernel driver not installed (rc=-1908)\nThe VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please reinstall virtualbox-dkms package and load the kernel module by executing\n\n'modprobe vboxdrv'\n\nas root.\n\nIf your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.\n\nwhere: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.<\/code><\/pre>\n<p>If you get the above error, enter the BIOS settings via reboot.<\/p>\n<p>In that, go to Advanced settings and secure boot. Then disable secure boot.<\/p>\n<h3 id=\"mac-errors\">MAC Errors<\/h3>\n<p>In MAC systems, you might get the following networking error.<\/p>\n<pre><code>VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine\n\nVBoxManage: error: Failed to create the host-only adapter<\/code><\/pre>\n<p>To rectify it, go to MAC system preferences &#8211;&gt; security and privacy &#8211;&gt; Restart to enable system changes by Virtual box.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>In this <strong>virtual box tutorial<\/strong>, we learning how to create virtual machines on Oracle Virtual Box software.<\/p>\n<p>If you would like to automate the Virtual machine creation on Vagrant for Development and testing purposes, you should checkout Vagrant. In the <a href=\"https:\/\/devopscube.com\/vagrant-tutorial-beginners\/\">Vagrant tutorial for beginners<\/a>, you will find step by step instructions to automate VM provisioning and configurations.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/virtual-box-tutorial\/\" target=\"_blank\" rel=\"noopener noreferrer\">Virtual Box Tutorial For Beginners: Step By Step Guides \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/virtual-box-tutorial\/<\/p>\n","protected":false},"author":1,"featured_media":847,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-846","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=846"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/846\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/847"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}