WindowsMacSoftwareSettingsSecurityProductivityLinuxAndroidPerformanceConfigurationApple All

How to Install Ubuntu on VirtualBox

Edited 17 hours ago by ExtremeHow Editorial Team

VirtualBoxUbuntuInstallationLinuxOperating SystemsVirtualizationSoftwareSetupDesktopSystem

How to Install Ubuntu on VirtualBox

This content is available in 7 different language

Installing Ubuntu on VirtualBox is a great way to get to know Ubuntu without replacing your existing operating system. It is a virtual environment, so you can try out different configurations and test your applications without any risk to your main system. Here, we will walk you through the detailed steps you need to follow to set up Ubuntu on VirtualBox. Let's get started with this comprehensive tutorial.

Step 1: Install VirtualBox

Before installing Ubuntu, we need to install VirtualBox. VirtualBox is a free and open-source hosted hypervisor for x86 virtualization. Follow the steps below to install VirtualBox:

Step 2: Download the Ubuntu ISO

Next, you need to download an Ubuntu ISO file. The ISO file is a digital copy of the Ubuntu installation CD/DVD. Follow the steps:

Step 3: Set up the new virtual machine

Now we need to set up a new virtual machine in VirtualBox to run Ubuntu. Here's how:

  1. Open VirtualBox and click "New" to begin the process of creating a new virtual machine.
  2. In the “Name” field, type a name for your virtual machine, such as “Ubuntu VM”.
  3. Select “Linux” from the “Type” dropdown menu.
  4. Select “Ubuntu (64-bit)” from the “Version” dropdown menu.
  5. Click "Next".
  6. Adjust the memory size. It is recommended to allocate at least 2048 MB (2 GB) of RAM, although more is better.
  7. Click "Next".
  8. Select “Create a virtual hard disk now” and click “Create.”
  9. Select “VDI (VirtualBox Disk Image)” as the hard disk file type and click “Next”.
  10. Select “Dynamically allocated” and click “Next”.
  11. Specify the location and size of the virtual hard drive. A size of 20 GB should be enough, but you can allocate more if you have the space.
  12. Click “Create” to complete setting up your virtual machine.

Step 4: Install Ubuntu on the Virtual Machine

After you've set up the virtual machine, you can now install Ubuntu:

  1. Select your newly created virtual machine in VirtualBox, and click the “Start” button.
  2. A window will open asking you to "Select a start-up disk." Click the folder icon to open the file picker.
  3. Locate and select the Ubuntu ISO file you downloaded earlier.
  4. Click “Start” to boot from the ISO file.
  5. The Ubuntu installer will launch. You have the option to "Try Ubuntu" or "Install Ubuntu." Select "Install Ubuntu."
  6. Select your preferred language for installation.
  7. In the "Updates and other software" screen, you can leave the options as default, but if you're going to use additional media on Ubuntu, make sure "Install third-party software for graphics and Wi-Fi hardware and additional media formats" is checked.
  8. Click "Continue".
  9. Select "Erase disk and install Ubuntu" (this will only erase the virtual disk) and click "Install Now".
  10. Click “Continue” on the summary of the partitions to be used.
  11. Select your location on the map for the timezone settings and click “Continue.”
  12. Set your keyboard layout and click “Continue”.
  13. Fill in your name, your computer's name (or keep the default), choose a username, and set a password.
  14. Once all fields are filled in, click “Continue.”
  15. Ubuntu will now begin installing. This process will take a few minutes.
  16. Once the installation is complete, you will be asked to restart. Click "Restart Now."
  17. You will be prompted to remove the installation media and press ENTER. Since this is a virtual machine, you do not need to physically delete anything. Just press ENTER.

Step 5: Initial setup and updates

After rebooting, Ubuntu will load, and you will be taken to the login screen:

Step 6: Install VirtualBox Guest Additions

VirtualBox Guest Additions are important for improved performance and usability of your virtual machine. They offer features such as improved screen resolution, shared clipboard, and folder sharing between host and guest. To install them, follow these steps:

  1. Go to the “Devices” menu in your virtual machine’s window.
  2. Select “Insert Guest Additions CD Image.”
  3. Open a terminal inside Ubuntu (you can press Ctrl + Alt + T to open the terminal).
  4. Run these commands to update your system and install the packages required for Guest Additions:
    sudo apt update
    sudo apt upgrade
    sudo apt install build-essential dkms linux-headers-$(uname -r)
        
  5. Go to the directory where the VirtualBox Guest Additions CD image is mounted. Typically, this is /media/<your_username>/VBox_GAs_<version>.
  6. Run the Guest Additions installer script with the following command (replace <version> with your version number):
    sudo ./VBoxLinuxAdditions.run
        
  7. After installation, restart your virtual machine to apply the changes.

Conclusion

You now have a working Ubuntu environment on VirtualBox! This setup is perfect for experimenting with Ubuntu, learning Linux or even running Linux-specific applications. You can start using Ubuntu for software development, web browsing or simply exploring the wide world of Linux software. If you ever need to modify your VirtualBox settings, simply close Ubuntu and make any necessary changes through the VirtualBox interface.

Remember, the beauty of using virtual machines is that you can always switch back and forth between your host operating system and the virtual machine. Be happy!

If you find anything wrong with the article content, you can


Comments