This article will explain how to install Ubuntu on VirtualBox. If you do not want to clean your hard drive completely, then go with the VirtualBox installation method. Using this method, you can install Ubuntu inside a virtual machine, making it fully independent of the primary system. This is excellent for those who wish to test out various Linux distributions or install third-party software packages for Ubuntu.
Table of Contents
Download and Install VirtualBox
Download the newest version of VirtualBox. Once downloaded, run the executable to install VirtualBox on Windows 11.
Download and Install Linux ISO
Once VirtualBox installation is done, launch it by using the desktop shortcut, and then click on the New button to create a new virtual machine.

Enter the virtual machine name, location, type, and version, and click next.

Select the option Create a virtual hard disk now, and then click Create.

Choose the hard disk file, and then click next.

Select dynamically allocated and click next.

Select the file location and size, and click Create.

Virtual Machine Settings
Now the virtual machine has been created. Click on Settings, as we will have to assign the Ubuntu ISO image downloaded earlier.

In the Ubuntu settings, click on Storage, click on Empty, click on CD icons, and then assign the ISO image.

Choose the Ubuntu ISO image, and then click Open.

Click ok.

Click on the start button.

Install Ubuntu on VirtualBox
On the new Oracle Ubuntu installation screen, click on the Try or Install Ubuntu option.

Choose the language, and then click on the Install Ubuntu option.

Select the keyboard layout, and then continue.

Select the normal installation, and then click continue.

For the Ubuntu Installation type, select Erase Disk and then install Ubuntu.

When asked about partitioning, select Continue.

Next up, select the time zone, and then click continue.

Fill in the name, username, and credentials, and then click continue.

Click Restart Now.

Enter the password, and then hit enter.

Refer to this article to get more details on how to install Ubuntu in VirtualBox.