How to Install Ubuntu 22.04 LTS on VirtualBox in Windows 11
In the realm of operating systems, Ubuntu has established itself as a popular choice for users seeking an open-source alternative to proprietary solutions like Windows and macOS. Its flexibility, robust security features, and vast community support make it an appealing option for both beginners and experienced users alike. With the latest Long-Term Support (LTS) release, Ubuntu 22.04 LTS, users gain access to a powerful and up-to-date system that promises stability and security for years to come.
In this guide, we will walk you through the entire process of installing Ubuntu 22.04 LTS on VirtualBox while running Windows 11 as your host operating system. By following these steps, you will be able to create a fully functional virtual environment for Ubuntu without altering your primary Windows setup.
What is VirtualBox?
VirtualBox is a free and open-source virtualization software developed by Oracle. It enables users to run multiple operating systems on a single physical machine, allowing them to create virtual machines (VMs) that behave like standalone computers. With VirtualBox, users can easily test and develop applications in different environments, experiment with new operating systems, or safely run software that may not be compatible with their host OS.
Prerequisites
Before diving into the installation process, ensure you have the following components:
- Windows 11 PC: Make sure your machine meets the minimum system requirements for VirtualBox and Ubuntu.
- VirtualBox Software: Download and install the latest version of VirtualBox from the official website.
- Ubuntu 22.04 LTS ISO File: Download the ISO file for Ubuntu 22.04 LTS from the official Ubuntu website.
- Sufficient Resources: Make sure your PC has enough processing power, RAM, and disk space to run both the host and guest operating systems smoothly. A minimum of 4 GB of RAM and a dual-core processor is recommended for basic Ubuntu usage.
Step 1: Downloading and Installing VirtualBox
1.1 Download VirtualBox
- Open your browser and navigate to the official VirtualBox website.
- Click on the "Downloads" link on the left panel.
- Choose "Windows hosts" to download the Windows installer.
1.2 Install VirtualBox
- Locate the downloaded VirtualBox installer (usually in your Downloads folder) and double-click it to run the installation process.
- Click "Next" on the Welcome screen.
- Accept the default installation folder or choose a different one and click "Next".
- On the next screen, you may be prompted to create shortcuts. Choose your preferences and click "Next".
- Review your settings and click "Install" to proceed. You may need to allow administrative privileges.
- Wait for the installation to complete, and once done, click "Finish" to exit.
Step 2: Downloading the Ubuntu 22.04 LTS ISO
2.1 Download the ISO File
- Visit the Ubuntu downloads page.
- Click the "Download" button for Ubuntu 22.04 LTS. This will download a .iso file, which you will use to install the operating system.
Step 3: Creating a New Virtual Machine
With both VirtualBox and the Ubuntu ISO downloaded, we can create a new virtual machine.
3.1 Launch VirtualBox
Double-click the VirtualBox shortcut on your desktop or search for "VirtualBox" in the Start menu to open the application.
3.2 Create a New VM
- In the VirtualBox main window, click on the "New" button in the toolbar.
- Enter a name for your virtual machine (e.g., "Ubuntu 22.04"). The system will automatically recognize and select the appropriate type and version.
- Click “Next” to proceed.
3.3 Allocate Memory
- You will be prompted to allocate RAM for your virtual machine. The minimum recommended amount for Ubuntu 22.04 is 2048 MB (2 GB), but 4096 MB (4 GB) is preferable for better performance.
- Use the slider or enter the value directly, and then click “Next”.
3.4 Create Virtual Hard Disk
- You will be prompted to create a virtual hard disk. Select "Create a virtual hard disk now" and click “Create”.
- Choose the hard disk file type. The default option (VDI) is fine for most users, so select that and click “Next”.
- Choose whether you want a dynamically allocated disk or a fixed size disk. The dynamically allocated option is often more space-efficient.
- Set the size of the virtual hard disk to at least 25 GB (the more, the better) and make sure to keep the default location for easy access later. Click “Create”.
Step 4: Configuring the Virtual Machine Settings
Before proceeding with the installation, we need to adjust some settings to ensure the best performance and compatibility.
4.1 Accessing Settings
- With your newly created VM highlighted in the left panel of the VirtualBox window, click on the "Settings" button.
4.2 Adjusting System Settings
- Select the "System" section from the left menu.
- Under the "Motherboard" tab, make sure that the "Enable EFI (special OSes only)" option is unchecked.
- Switch to the "Processor" tab and allocate more CPU cores if your system allows it (ideally, allocate at least two cores for better performance).
- Check the "Enable PAE/NX" box for enhanced performance.
4.3 Configuring Display Settings
- Select the "Display" tab from the left menu.
- Increase the Video Memory to the maximum available (typically 128 MB).
- Ensure that 3D Acceleration is enabled.
4.4 Adding the Ubuntu ISO File
- Click on the "Storage" tab.
- Under the "Controller: IDE" section, click on the empty disk icon.
- On the right side, click on the disk icon next to "Optical Drive" and select "Choose a disk file".
- Locate and select the Ubuntu ISO file you downloaded earlier, and click "Open".
4.5 Finalizing Settings
- Click “OK” to save your settings and close the configuration window.
Step 5: Installing Ubuntu 22.04 LTS
Now that we have configured the virtual machine, it’s time to install Ubuntu.
5.1 Starting the Virtual Machine
- Select your virtual machine from the VirtualBox Manager and click the "Start" button.
- The VM will boot from the Ubuntu ISO. You should see the initial Ubuntu installation screen.
5.2 Selecting Installation Option
- You can choose "Try Ubuntu" to test the operating system without installation or "Install Ubuntu" to proceed directly to installation.
- Click on "Install Ubuntu".
5.3 Choosing Installation Language
- Select your preferred language from the list and click "Continue".
5.4 Preparing to Install Ubuntu
Check the boxes for "Download updates while installing Ubuntu" and "Install third-party software for graphics and Wi-Fi hardware and additional media formats". Clicking "Continue" will allow your system to install the latest patches and necessary drivers.
5.5 Installing Type
You’ll see several installation options. The "Erase disk and install Ubuntu" option is suitable since it’s a virtual disk. Don’t worry; this action will only affect the virtual drive you’ve created.
5.6 Choosing the Installation Location
- Click "Install Now".
- A popup will appear asking you to confirm the changes that will be made. Click "Continue".
5.7 Setting Up Location
Select your geographical location from the map to set your time zone and click “Continue”.
5.8 Preparing User Setup
- You will be prompted to fill in details for your user account: your name, the name of your computer, your username, and a password.
- Choose whether you want to log in automatically or require a password.
- Click on "Continue" to start the installation process.
5.9 Installation Process
At this stage, the installation will begin. Depending on your system’s performance and the resources allocated, this could take several minutes. During this phase, you can enjoy some of the Ubuntu installation slideshow, which highlights its features.
5.10 Completing Installation
Once the installation is completed, you will see a dialog prompting you to restart your computer. Remove the installation media (the ISO file) by unchecking the box or selecting "Reboot Now" and clicking "Continue".
5.11 Booting into Ubuntu
The virtual machine should automatically reboot. If prompted, log in using the credentials you created earlier. Congratulations! You are now running Ubuntu 22.04 LTS inside VirtualBox on your Windows 11 machine.
Step 6: Installing VirtualBox Guest Additions
For an optimal experience, it’s essential to install the VirtualBox Guest Additions.
6.1 Starting Installation
- When logged into the Ubuntu virtual machine, navigate to the "Devices" menu in the VirtualBox window.
- Select "Insert Guest Additions CD Image".
6.2 Installing Guest Additions
- When prompted, open a terminal by pressing
Ctrl + Alt + T
. - Install necessary packages by running:
sudo apt update sudo apt install build-essential dkms linux-headers-$(uname -r)
- Mount the Guest Additions CD:
sudo mount /dev/cdrom /media
- Navigate to the mounted directory and run the Guest Additions installer:
cd /media sudo sh VBoxLinuxAdditions.run
- After completing the installation process, you can reboot the system to apply the changes.
Step 7: Configuring VirtualBox Network Settings
After installing Ubuntu and the Guest Additions, it might be necessary to configure network settings, especially if you want your virtual machine to connect to the internet.
7.1 Checking Network Status in Ubuntu
- Within your Ubuntu VM, open a terminal and check the network connection:
ifconfig
- You should see an adapter (e.g.,
enp0s3
) with an IP address assigned.
7.2 Configuring Network Settings in VirtualBox
- Go to the VirtualBox main window and ensure your VM is powered off.
- Highlight the VM and click on "Settings".
- Select the "Network" tab.
- Ensure "Adapter 1" is enabled with the attached to setting set to "NAT" or "Bridged Adapter", depending on your requirements.
Step 8: Performing Updates and Installing Software
Now that your Ubuntu installation is complete and configured, it’s time to update the system and install any additional software you might need.
8.1 Updating Ubuntu
- Open a terminal in Ubuntu and run:
sudo apt update sudo apt upgrade
8.2 Installing Software
- You can install additional software using the terminal. For example, to install
git
, you would run:sudo apt install git
8.3 Using Ubuntu Software Center
Alternatively, you can use the graphical Ubuntu Software Center to find and install applications easily.
Conclusion
Installing Ubuntu 22.04 LTS on VirtualBox while using Windows 11 as a host environment is an excellent way to explore the world of Linux without disturbing your primary operating system. With VirtualBox, you have the flexibility to create, modify, and experiment with different configurations to suit your needs.
Through this detailed step-by-step guide, we’ve covered everything from setting up the virtualization software and downloading the Ubuntu ISO, to configuring system settings and optimizing the environment with Guest Additions. By following these instructions, you can now harness the power of Ubuntu for development, testing, or simply as an alternative workspace.
With the knowledge you’ve gained here, feel free to explore further tutorials and community resources to enhance your Linux experience. Enjoy your journey with Ubuntu!