How to Install VirtualBox 6 & 7 on Debian 12

In this article, I will explain to you the method of creating virtual machines in the Debian 12 Linux distribution. Of course, I will also cover the process of installing and using Oracle VM VirtualBox.

First of all, Oracle VM VirtualBox helps you run Windows, Linux & macOS operating systems virtually. You can also use more than one OS, thanks to its flexibility and ease of use.

Installing VirtualBox on Debian PC

How to Use Oracle VM VirtualBox to Create a Virtual Machine on Debian 12

You can download the VirtualBox program, developed by Oracle company, from the official website for free and simultaneously run one or more systems on your host PC.

Once you’ve installed Debian, a highly favored Linux distribution, on your host computer, installing VirtualBox as a critical program for your system is imperative. This program lets you install a Windows 10 virtual machine and your Linux system.

Suppose you install a Windows operating system next to your current system using the Dual-Boot method. In that case, you must restart your PC each time during system transitions. With VirtualBox, you can seamlessly launch and operate your Windows guest system without rebooting your PC.

How to Download and Install VirtualBox

You can choose to configure both APT and Oracle repositories as the method of installing Oracle VM VirtualBox on your PC. However, downloading and installing the deb package from their website is the easiest method.

Step 1

To download Oracle VM VirtualBox to your PC, visit this webpage and hit the Download image as in the image below.

VirtualBox 6.1 Download for Linux

Step 2

On the Download VirtualBox website, click Linux Distributions from Platform packages.

Linux Distributions

Step 3

Click on the Linux distribution installed on your computer, choose to save the deb package on the page that opens, and click OK.

Downloading Deb Package for Debian 11

Step 4

Before installation, provide to run the “sudo apt update” command in the terminal to refresh the package list for Debian.

sudo apt update

Updating the Debian Package List

Step 5

After refreshing the package list, install the necessary Linux kernels for VirtualBox on your system. Type “sudo apt install build-essential dkms” in the terminal to install the required Linux kernels.

sudo apt install build-essential dkms

Installing Linux Kernels

Step 6

Once you have reviewed the new packages scheduled for installation on your system, press the Y key followed by Enter to confirm.

Confirming Packages to Install

Step 7

After making the necessary preparations, open the terminal and go to the Downloads location with the “cd ~/Downloads” command. To see what’s in a directory and ensure the deb package is available, type “ls” in the terminal.

To quickly set up the VirtualBox.deb packet, execute the “sudo dpkg -i virtualbox-6.1_6.1.34-150636.1~Debian~bullseye_amd64.deb” command in the terminal.

sudo dpkg -i virtualbox-6.1_6.1.34-150636.1~Debian~bullseye_amd64.deb

Installing the VirtualBox.deb Package

Step 8

You can see in the terminal output that some dependent packages should be installed while installing the VirtualBox.deb package. Type “sudo apt install -f” in the terminal to install the packets immediately.

sudo apt install -f

Force Installation of Dependent Packages

Step 9

Likewise, press Y and Enter to confirm the packages to be installed.

Confirming Packages to Install

Step 10

After installing VirtualBox, please search for the program from the Activities section and run it.

Running VirtualBox

Step 11

By accessing the Help / About section and inspecting the version details, you will find that version 6.1.34 of the Oracle virtualization software has been successfully installed.

Checking VirtualBox Version

How to Install Extension Pack

After installing VirtualBox on Debian, you need to install the Extension Pack to install the drivers for guest machines and to use devices such as USB and webcam.

Step 1

After clicking File / Preferences in the Oracle VM VirtualBox Manager tool menu, you can check whether the Extension Pack is installed in the Extensions section in the open window.

Checking for Extension Pack Installed

Step 2

To download the extension package, revisit the VirtualBox download website, click All Supported Platforms, and save the VBox-Extpack package to your computer.

Extension Pack Download

Step 3

Go to Downloads and double-click on the VBox-Extpack package to start the installation.

Installing VBox-Extpack

Step 4

Click the Install button to configure the Extension package in the open information window.

Starting Installation

Step 5

If you want to read the license thoroughly, click the “I Agree” button and scroll down the opened page.

Accepting the License Agreement

Step 6

After successfully installing the Oracle VM VirtualBox virtual machine tools, click OK.

Ext Pack Installed Successfully

Step 7

Now that you view the Extensions settings again, you can see that the Ext Pack has been installed in your VirtualBox program.

Checking Extensions

How to Create a New Virtual Machine in Debian

With Oracle software on your Debian system, you can now create new virtual machines and install Windows 10 or one of the other operating systems.

Step 1

Open Oracle VM VirtualBox Manager and click the New icon to start the virtual machine wizard.

Creating a New Virtual Machine on Debian

Step 2

Type a name for the operating system you will install in the virtual machine creation wizard and click Next after selecting the installation location.

Configuring the Guest OS Name and Location

Step 3

For the virtual operating system to work more efficiently, determine a suitable virtual memory size according to the memory capacity of your host.

Increasing Memory Size

Step 4

For the hard disk configuration of the virtual machine, choose to create a new virtual disk and click Create.

Create a New Virtual Hard Disk Now

Step 5

Configure the file type of the virtual hard disk as VDI (VirtualBox Disk Image).

Selecting VDI (VirtualBox Disk Image)

Step 6

You can set up both fixed-size and dynamically expanding virtual disk storage on your physical computer. If you want the virtual system to take up less space on your host disk, check Dynamically Allocated and continue.

Choosing a Dynamically Allocated Disk Structure

Step 7

Configure an appropriate disk size depending on what you will do in your Windows 10 virtual system.

Configuring Virtual Disk Size

Step 8

After preparing your virtual computer, open advanced settings to adjust performance and other locations.

Opening Virtual Machine Settings

Step 9

To transfer files and copy text between your Windows 10 VM and your host system, change the Shared Clipboard and Drag’n’Drop properties to Bidirectional in Advanced settings.

Enabling Shared Clipboard and Drag and Drop Features

Step 10

In the Motherboard settings of the virtual system, disable Floppy from the devices in the Boot Order list and set the Optical device as primary.

Changing the Boot Order

Step 11

According to the processor type of your host computer, set a suitable vCPU number for your virtual machine in the Processor settings.

Increasing the Number of Virtual Processors

Step 12

Enable 3D Acceleration in Display properties from Display hardware for enhanced image quality on the Windows 10 guest machine. Next, determine an appropriate video memory size based on the capacity of your host GPU.

Enabling 3D Graphics Acceleration

Step 13

Select Controller: SATA from Storage Devices and enable Host I/O Cache from Attributes.

Enable Host I/O Cache

Step 14

Likewise, configure the Windows 10.vdi virtual disk file as a Solid-State Drive (SSD) to increase disk performance.

Configuring VDI Virtual Disk Type as SSD

Step 15

To add the Windows 10 image file to the virtual machine you have prepared, select the Empty optical drive, click the CD/DVD icon, and click Choose a disk file from the options that appear.

Adding a Debian ISO File to a Virtual Machine

Step 16

Access the Windows 10 ISO file from its downloaded location, be it an internal or external drive.

Choosing the Debian ISO File

Step 17

Finally, select the USB 3.0 (xHCI) Controller and close the settings to use USB 3.x devices in your virtual machine.

Selecting a USB 3.0 Controller

Step 18

Run your Debian virtual computer to start the Windows installation.

Running the Virtual Computer

Step 19

The setup wizard for Windows 10 will be initiated shortly after the virtual computer is launched.

Windows 10 Setup Wizard

How to Delete the Virtual Machine from Debian

You can quickly delete a guest machine installed with Oracle VM VirtualBox software from your Linux computer.

Step 1

Right-click on your guest machine installed in the VirtualBox library and click Remove. In the open window, click Delete All Files to delete the Windows 10 VM from your host disk completely.

Completely Deleting the Created Virtual Machine from Disk

Step 2

You can check that the guest machine you installed in the Home / VirtualBox VMs location on your Linux system is completely deleted.

Checking VirtualBox VMs Location

How to Uninstall VirtualBox from Debian

Uninstalling the Oracle virtualization software from a Linux computer can be done swiftly using the terminal.

Step 1

After backing up your installed systems, execute the “sudo apt remove –purge *virtualbox*” command in the terminal to uninstall VirtualBox.

sudo apt remove --purge *virtualbox*

Uninstalling Oracle VM VirtualBox

Step 2

Press Y and Enter to confirm VirtualBox-related packages are to be removed.

Confirming Packages to be Deleted

Step 3

Some folders or files may still be on your system when you uninstall VirtualBox. To delete unnecessary folders from your system, execute the commands below in the terminal.

sudo rm -rf ~/"VirtualBox VMs"
sudo rm -rf /usr/lib/"virtualbox"

Deleting Unnecessary Directories

Step 4

Execute the “sudo apt autoremove && sudo apt autoclean” command to clean the dependent packages installed while installing VirtualBox completely.

sudo apt autoremove && sudo apt autoclean

Deleting Relic Packages

Step 5

Finally, to delete the VBoxUsers group created during installation, check the group and then delete it.

compgen -g | grep -i "vbox"
sudo groupdel vboxusers

Deleting the VBoxUsers Group

Video

Conclusion

As a result, Oracle VM VirtualBox allows us to create and run virtual machines on the Debian 12 Linux distribution. This feature provides a versatile and user-friendly platform.

If you follow all the steps I have outlined in this article, you can install VirtualBox effortlessly. Moreover, you can install the necessary extensions and know how to run various operating systems.

This way, you can test different software environments or use other operating systems if you are developing applications. In summary, VirtualBox offers a powerful solution to meet your virtualization needs. Plus, you can seamlessly experience various OSes on a single host without the hassle of rebooting the system.

Add a Comment

Your email address will not be published. Required fields are marked *