How to Install Debian on VirtualBox (with Screenshots)

Channel: Linux
Abstract: Create a virtual disk image Select the virtual disk type. VDI is the default disk format for the open-source Oracle VM VirtualBox. The other twoand cl

In this tutorial, we learn how to install Debian 11 on VirtualBox. VirtualBox is open-source cross-platform virtualization software that allows running multiple guest operating systems.

Debian 11 comes with multiple Desktop environments such as Gnome, KDE, LXDE, LXQT, Mate, Xfce, and Cinnamon.

Let's install Debian 11 on VirtualBox with Gnome Desktop Environment.

Prerequisites

  • VirtualBox installed on your computer
  • Minimum 1GB RAM (Recommended 2GB)
  • Minimum 10B free disk space (Recommeded 20GB)
  • Internet connectivity
  • Hardware virtualization enabled
Step 1: Download Debian ISO

First, download Debian 11 ISO image from the official website. You can either download the minimal CD (called netinst) which is a smaller size iso, fetch remaining packages over the internet, or full DVD/CD image with all the packages. Debian supports both 64 bit and 32 bit computers.

Step 2: Create a VirtualBox Guest Virtual Machine

Assuming you've downloaded a Debian 11 iso and have VirtualBox installed.

Open the VirtualBox and on the VirtualBox Manager click New.

Create a new Virtual Machine Create a new Virtual Machine

Set a name for your guest virtual machine, type - should be 'Linux' as Debian is a Linux distribution, and version - from the drop-down menu choose respective Debian version.

Set name, type, and version of the Guest OS Set name, type, and version of the Guest OS

Set required RAM to be allocated for the guest virtual machine in megabytes:

Set memory size Set memory size

Create a Virtual Hard disk:

Create a virtual disk image Create a virtual disk image

Select the virtual disk type. VDI is the default disk format for the open-source Oracle VM VirtualBox. The other two, VHD ( developed by Microsoft) and VMDK (VMWare’s Virtual Disk File Format) also support Linux.

Here I choose VDI disk file type.

choose hard disk type Choose hard disk type

Set Virtual hard disk allocation type, choose if you want hard disk file to grow automatically as its fills up or a fixed size.

Here I choose the Dynamically allocated option.

Choose dynamically grow

Choose the file location and maximum size for the hard disk file to store the data.

choose file location and disk size Choose file location and disk size Step 3: Attach Debian ISO Image to IDE

Here we attach the ISO image which we downloaded in step 1. You can attach ISO images in two ways, either Start the newly created VM or go to Settings -> Storage -> Add Disk image to the Optical Drive.

Select your just created VM and click the Start button:

Click the Start button Click the Start button

Click on the folder icon highlighted to choose iso image file:

Select the start-up disk

This will open the Optical Disk Selector menu

Optical Disk Selector Optical Disk Selector

Click Add, it will open a file picker dialog for you to select your downloaded iso. Your selected file will be added to VirtualBox, select and click Choose:

Step 4: Start the Debian Installation on the VM

After selecting your iso, click Start to start the Debian installation.

start the installer Start the installer

From the Debian installer menu choose your mode of installation. Graphical installation might have a slight difference in visual appearance when compared to text mode

Debian installer menu Debian installer menu

The next three pages would be to select your preferred language, location, and keyboard.

Select a language Select a language select the time zone Select the time zone configure the keyboard Configure the keyboard

Now start the configuration of the network, start with setting a hostname for the system - which is a single word identifier of your system in the network.

Set hostname for the system Set hostname for the system

Add the domain name to which this host belongs, you can leave it blank if it's not part of any domain or can configure later.

add domain name associated for this host Add domain name associated with this host

Now set up users and passwords. First create a root password, if left blank - then the root account will be disabled and initially user will be given sudo access. Recommend setting up a root password.

Set root password Set root password

A user account will be created with non-administrative privilege. First, enter the full name of the new user.

Full name of the new user Full name of the new user

Type username for your account:

username for your account username for your account

Enter your new user password and enter the same password to verify:

setup users password Setup users password

Now configure the clock to set the desired timezone.

select the desired timezone Select the desired timezone

The installer now will guide you through partitioning the disks.

Use the entire disk Use the entire disk

Select the disk to partition:

select the disk to partition Select the disk to partition

Here I choose All files in one partition which is recommended for new users.

All files in one partition All files in one partition

Here looks at the overview of the configured partitioned.

Overview of partitions Overview of partitions

Choose Yes to write changes to disks.

confirm to write to disk Confirm to write to disk

This starts the base system installation

install the base system Install the base system

If you have additional media can add it here or else just skip by selecting the No option.

scan more media scan more media

Next, configure the package manager - First choose the mirror location close to your network.

select the closest mirror repo Select the closest mirror repo

Select a Debian archive mirror from the list.

select archive mirror Select archive mirror

Add HTTP proxy server information, if required to access the internet or else leave it blank.

http proxy http proxy

Participate in the package usage survey or else choose No option.

package usage survey package usage survey

You can now select a predefined collection of software such as Desktop environment, web server, SSH server. We keep continuing with the default settings ie with GNOME desktop.

This will retrieve files from the mirror repo and take some time to complete the installation.

Software selection Software selection

Choose Yes to install the GRUB bootloader on your primary drive.

install grub bootloader install grub bootloader

Choose the device for boot loader installation.

choose device for GRUB installation choose device for GRUB installation

Finally, the installation finished screen pop up, and click the Continue button to reboot.

installation finished Installation finished

Debian 11 Login screen - click on the user account and then give the password

Debian 11 Login screen Debian 11 Login screen

Enjoy using Debian 11 with GNOME on your VirtualBox.

Debian 11 GNOME Desktop Debian 11 GNOME Desktop

You can install VirtualBox guest additions to improve guest OS performance.

Conclusion

In this tutorial, we learned how to install Debian 11 on VirtualBox. Enjoy using Debian on your Virtual machine for your test and development.

Ref From: linuxopsys

Related articles