How to Install Debian Linux on VirtualBox with Guest Additions

Creating a Debian 9.7.0 Virtual Machine on Oracle VM VirtualBox 6.0 with Guest Additions Installation


01) Install Oracle VM VirtualBox

Download the correct version of VirtualBox software for your OS from Oracle Download page and install it locally.

02) Download Debian ISO Image

If you have a stable internet connection, download a Debian ISO image for Network Install (netinst).

If you want to install Debian without an internet connection, download a classic bootable ISO image.

Whatever ISO image you download, it is highly recommended to verify the integrity of ISO image file using md5 check sum. If you are a Linux user, you can easily use the in-built md5 checking terminal tool of your OS for this verification.

md5sum debian-9.7.0-amd64-netinst.iso

It will then return the result to your terminal and make sure you cross-check it against the md5sum provided by the download site.

Virtual Machine Creation

03) Now open up Oracle VM VirtualBox Manager and create a new virtual machine for Debian.

Click New button to create a new VM
Provide a name of your choice to the new VM and a directory location to store files related to VM. Also choose Type as Linux and Version as Debian (64-bit) or Debian (32-bit) based on your PC architecture. Finally click Next.
Choose a memory size (RAM) for your VM. Note that the minimum memory requirement for Debian is 512MB. Finally click Next.
Choose ‘Create a virtual hard disk now’ option and click Create.
Choose VDI option and click Next.
Choose ‘Dynamically allocated’ option and click Next.
Provide a Hard Disk size for your VM and click Create.

Debian Installation

04) Provide the downloaded Debian ISO Image to the newly-created VM.

Now click on ‘[Optical Drive] Empty
Select ‘Choose disk image…’. Go to the download location of ISO image and select the image file.
Now things will look like this. Click Start button to start your VM.

05) Start the VM and follow the Debian Installation process.

Note that by clicking ‘Right Ctrl’ button (Host Key) in your keyboard, you can choose whether your action inputs (e.g. keyboard and mouse clicks) should work inside of your VM or outside of it. From the above boot menu, select ‘Graphical install’ using your keyboard.
Select English and Continue.
Select your country and Continue.
If there’s no locale defined for your country, you may have to choose an available locale from the given list. If your country has a locale, you won’t see this window.
Choose a keyboard format and continue.
The installation will start and you may have to wait for a few minutes.
Provide a hostname (without spaces) for your VM.
Provide a domain name. You can leave this field empty if you want.
Provide a password for root user and continue.
Provide a name and continue.
Provide a username and continue.
Provide a password and continue.

Disk Partitioning

06) Following the default options would be fine for most users. But if you are an advanced user, feel free to choose the appropriate settings for your needs.

Choose ‘Guided — use entire disk’ option and continue.

Now select ‘finish partitioning and write changes to disk’.

Select ‘Yes’
Select No and continue.
If you use a home network, you can skip this. But if you are at your workplace or university, you may have to fill this. Go to your network administrator and ask for the proxy settings here.
Wait until the installations complete.
Choose whether you like to contribute for this with your usage stats.
Select the packages you need. You can install/uninstall these later too.
This step will take some time to complete.
Install the GRUB boot loader.
Select /dev/sda
Continue. Your VM will reboot.
Now your VM is ready to use.

Guest Additions

07) Now install Guest Additions by running the following commands as root user on your terminal.


echo deb stretch-backports main contrib > /etc/apt/sources.list.d/stretch-backports.list

apt update

apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r)


Finally, reboot your VM and enjoy your Debian install!

Next Steps

The following tutorials will be helpful for you to configure the VM for development needs.