Installing Debian Linux in a VirtualBox Virtual Machine

October 6, 2012

Debian 8.2 Running

In this article, we will review the procedures required to install Debian Linux in a virtual machine managed by the VirtualBox application. A summary of the procedures is listed below:

  • Download the Debian install DVD.
  • Create a virtual machine using the VirtualBox application.
  • Boot the virtual machine from the DVD image we downloaded
  • Install the Debian Linux operating system on the virtual machine.

We will install Debian Linux because it is the version of Linux that is used by most of the researchers who have developed the network simulation tools we wish to investigate. Also, Debian is a conservative Linux distribution so we can be fairly confident that if we run into issues, we will not need to debug the operating system.

Here is the procedure we followed:

NOTE: This post was updated on January 4, 2016. I updated it to show the procedure for installing Debian 8 in VirtualBox 5.

Step 1: Download the Debian network installer

Go to and download the network installer disk image. In this example, the network installer disk image was: debian-8.2.0-amd64-netinst.iso.

Step 2: Create a new VirtualBox VM

Click on the New icon in the VirtualBox menu bar.

This will start the New Virtual Machine Wizard. The first screen is just a welcome screen so click Continue to proceed.

VM Name and OS Type

In the Name field type any name you choose (we chose “Debian 8.2”). In the Operating System field, enter “Linux” and in the Version field, enter “Debian (64 bit)”. The click Continue.

b-VirtualBox 7


Use the default setting for the amount of base memory. In our case, the default value is 768 MB. In this example, we set it to 1024 MB and we can change it later if we need to.

b-VirtualBox 7-37

Virtual Hard Disk

We will create a new virtual hard disk to use as our VM filesystem. So, use the default setting on this screen.

b-VirtualBox 7-36

In the next screen, select the format for the virtual hard disk. Here. we will us the default settings, again. So, we will use the native VirtualBox Disk Image (VDI) format. Then, click Continue.

b-VirtualBox 7-35

In the next screen, we need to choose between a Dynamically Allocated or a Fixed size virtual disk file. We should choose “dynamically allocated”, which is the default. The VirtualBox user manual says that a fixed size virtual disk file offers better file system performance but we do not know ahead of time how much disk space we really need, so it’s easier to use the default setting.

b-VirtualBox 7-34

Then, choose the location and maximum size of the VM disk image file on your host computer’s file system. Again, we just use the defaults.

In this case, the default virtual disk file size is 8GB. But, since we chose a dynamically allocated size disk file, the initial size of the disk file will be much less than 8GB. The dynamically allocated virtual disk file size will depend on the actual size of the filesystem installed in it. As we add software to the virtual machine and as running software generates log files and other data in the virtual machine, the filesystem size will grow.

b-VirtualBox 7-33

Note that the reverse does not happen. If files are deleted in the virtual disk image, the size of the virtual disk image file does not become smaller.

Click Create to proceed.

Now we see we have a Debian 8 VM available in VirtualBox and it is in the Powered Off state.

b-VirtualBox 7-32

Step 3: Insert the Debian install DVD image into the VM storage system

Now, we need to install Debian Linux. We need to configure this new virtual machine so it will boot from the network installer ISO disk image we downloaded earlier.

Select the Debian 8 virtual machine in the left side of the VirtualBox window and then click on the Settings icon in the VirtualBox menu bar.

In the screen that appears, click on the Storage icon. You will see items called IDE Controller and SATA Controller in the left side of the screen. It shows it is connected to an empty optical disk. We need to configure it so the network installer ISO disk image appears where the empty disk is now. This is just like inserting a CD or DVD installer disk into a normal host machine.

DVD’s and CD’s are attached to the IDE Controller in a real computer so click on the Empty optical disk icon below the IDE Controller. Then, click on the optical disk icon on the far right side of the window next to the CD/DVD Drive field.

b-VirtualBox 7-1

Then select the option: Choose a virtual CD/DVD disk file.


Navigate to the Downloads folder (or wherever you stored the ISO image) and select the network installer ISO image which, in this case, is debian-8.2.0-amd64-netinst.iso. Then, click Open.

b-VirtualBox 7-39

Now the disk file is available to the virtual machine and shows up as a DVD attached to the IDE Controller in the Storage Tree. Click OK to proceed.

b-VirtualBox 7-2

Now you can see that the network install ISO image is configured for the Debian 8 VM. We should be able to start it now and it will boot from the image and the software on the disk image will start the Debian Linux installation process in the virtual machine.

b-VirtualBox 7-29

Step 4: Install Debian Linux on the new virtual machine

Start the Debian virtual machine by selecting it in the VirtualBox VM Manager and then clicking on the green Start arrow. The VM will boot from the DVD, which will start the installer program on the DVD. See below for the configurations used in each of the key configuration screens. In most cases, we will use the default values.

Debian 8.2 [Running]-2

Select the country in which you a working and keyboard layout that matches the computer hardware you are using.

b-VirtualBox 7-22

b-VirtualBox 7-21

After selecting the keyboard key map, the installer installs some components and then pauses to ask for the host name. You can choose anything you want for the host name. I chose “debian”.

b-VirtualBox 7-20

It is best to leave the domain name blank, for now. We can configure it later, if we need to.

b-VirtualBox 7-19

Next, select the root password for the system. The root password is used when you need to make changes to the system’s critical software and configurations.

b-VirtualBox 7-18

Now, you will set up the user name, user id, and user password for the account you will use when working with this virtual machine. In this example, I used my real name for the user name, then I used my first name as my userid. You can use any user name and userid you wish. Then I chose a password.

b-VirtualBox 7-16

b-VirtualBox 7-15

b-VirtualBox 7-14

Next, choose the time zone in which you are working.

b-VirtualBox 7-12

In the next screen, select the default choice, Guided – use entire disk. The LVM option is an advanced disk configuration that might be useful in a real host machine but is not needed in a virtual machine. It is OK to use the LVM option, if you want.

b-VirtualBox 7-11

b-VirtualBox 7-10

All files in one partition is the simplest configuration and it is the default choice.

b-VirtualBox 7-9

b-VirtualBox 7-8

Now, you commit the disk configuration and the Debian installer will partition and format the virtual disk image file to paper it for the installation of the new Debian Linux operating system.

b-VirtualBox 7-7

The package manager application needs to be configured with information that tells it where to download additional software from, and where to find software updates in the future. the following two screens help you to choose the appropriate server. First, select the country in which the server you wish to use is located.

b-VirtualBox 7-6

Then, select the server in the country you chose. You can probably guess from the domain names which server is the most reliable. Or you can research the institutions associated with the domain names to determine which one is likely to be the best source. Don’t worry too much about choosing the best server. Any server listed will be adequate.

b-VirtualBox 7-5

Since my network does not have a proxy server, I can leave the next screen blank. Most home networks will not have a proxy server. If your network has a proxy server, enter it’s information on this screen. You may need to ask your network administrator for the proxy server information.

b-VirtualBox 7-4

b-VirtualBox 7-3

Now, the system will spend some time downloading and installing all the additional software it needs from the server you specified. This may take up to 20 minutes on a typical broadband connection.

The next screen will ask you what additional software you want to select. Debian Desktop Environment and Standard System utilities are selected by default. You should also select SSH Server so you can securely log into the virtual machine over the network if you need to.

b-VirtualBox 7-28

Next, install the GRUB bootloader.

b-VirtualBox 7-27

I suggest you install GRUB on the disk recommended by the installer. In this case, select /dev/sda from the menu in the screen below.

b-VirtualBox 7-26

b-VirtualBox 7-24

After the installation is complete, the Debian operating system boots up in the virtual machine.

Debian 8.2 [Running]-3

Log in using the userid and password you selected during the installation process.

Debian 8.2 [Running]-1

The system will be up to date. But, when you want to check for more updates, use the Debian Update Manager application.

Debian 8.2 [Running]-0

You can now proceed to install more software from inside the virtual machine, using the tools provided by the Debian Linux operating system.

In this example, I chose to shut down the virtual machine and stop at this point. I will discuss installation of additional software later, when needed.

Looking at the VirtualBox Virtual Machine Manager window, You can see that the Debian virtual machine is now configured to boot from the VDI file and the IDE controller no longer has the .iso DVD image attached to it. the .iso disk image file was automatically “ejected” by the Virtual Machine Manager application after the installation was completed.


66 responses to Installing Debian Linux in a VirtualBox Virtual Machine

  1. Richard Zijdeman March 5, 2014 at 5:52 am

    Hi, Thank you very much for providing this excellent walk through. I just successfully installed the Debian 7.4 on a macbook pro running OS X 10.9.1 (March 5th, 2014)

  2. Shawn Mathiesen March 5, 2014 at 6:37 pm

    I teach Windows OS in a community college and one of the topics will be virtualization. This tutorial is perfect for my students to use to learn all about setting up a virtual machine using all freeware.
    Thanks so much for creating it!

  3. Hi Brian ,
    Can we install the debian through USB ?If so what should be format of Debian OS as it was .iso in the DVD?Does the installation of virtualbox differ when this mode is followed ?
    Thanks in advance

    • Hi Dino,
      USB would appear as just another available disk to VirtualBox so if you have the ISO file on a USB drive, you should be able to use it to install Debian in VirtualBox. The procedure would be the same.

    • thanks Brian.Your tutorial helped me a lot

  4. HI Brian
    I am working in windows with virtual box and this tutorial is very helpful for me but i got struck ed after the partition disk (i.e..,) the scanning of cd rom it remain in 11% and it is working after that plz guide me…
    thanks in advance….

  5. @it is not working after that how to overcome this

  6. Very good article explaining steps..i successfully installed debian.
    Pls tell, now how to install gnu octave in debian and other softwares.

  7. Great tutorial! Thanks a lot!

  8. I’ve been a developer on Windows all my career (20+ years). This walkthrough helped me install Linux for the very first time, painlessly. Thanks for taking the time!

  9. this artikel very good

  10. can u please send me a URL of the Debian 6 version to download it??

  11. Great tutorial. Thank you!

  12. Thanks for your excellent walk through. I manage to install Ubuntu Server 14.04.

  13. Thanks ! Great job ! It took me 1 hour to install it all. I have a question. How to instal additional software collections after installation is completed, because I pressed ENTER as I was trying to mark all collections to install but ENTER sent me to start installation.

  14. Thanks dude 😀 its very helpful

  15. Very Useful. Thanks


  17. Ok I followed all the steps and everything went great, until debian tried to boot and then I got an error “A problem has occurred and the system can’t recover. Please contact a system administrator”. Any ideas?

    • Hi you have to go in your computer BIOS system and enable the virtual technology probable is disabled. This is how I did it on my laptop having the same error mesage like you and after that everything was OK.Just check on the internet how you can access your computer type BIOS as on each computer you have to type different keys.

  18. same error message as andi“A problem has occurred and the system can’t recover. Please contact a system administrator”.
    before that also when the screen is black the first text message is”failed to access perfctr msr”
    is this message that could lead to the problem mention first?

  19. dear sir
    let us know latest update as you know on debian


  20. Thanks. But this definitely does no work. The scene is W7 sevice Pack 64 bits. Image is the latest. These walk thru stpe do work with Ubuntu hosting Virtual Box. W7 does not.
    The message “boot failure” keeps always the same. SHA 1 is ok.
    Don’t know any step further.
    Would you have any hint?

    • Excuse-me. Service Pack 1, Windows 7 64 bits. Debian iso should be debian-8.4.0-AMD64-netinst AND NOT debian-8.4.0-arm64-netinst.
      Now it is working! Nice work, Linkletter.

  21. Richard Savage April 27, 2016 at 2:49 am

    Hi. I followed all the instructions and at the end I get a blank screen that does nothing. No blinking cursor. Nothing. Please advise.

  22. Hi Brian,
    I am running Linux Mint 17.3 and my root is on sda (500G SSD) I have a 1TB SATA drive partitioned into two (sdb1 and sdb2) (my /home folder for Linux Mint is on sdb1) During the installation I have only 1 choice and it offers configure iSCSI volumes SCSI1 (0,0,0) (sda) – 268.4GB ATA VBOX HARDISK. I so do NOT want to screw up my linux mint on sda. Why does the installer not recognize all the other partitions that are available?

    • This post is about installing in a virtual machine, so the issues of drivers does not come up. You are attempting to install on a real machine with multiple drives and partitions. That’s a more complex case and I cannot help with that. Sorry.

      • Hi Brian, no, I am following your tutorial. There is nothing about installing on a real machine when you are in VirtualBox. Anyway as you can see in my previous post I got to the step in your tutorial of the slide indicating When I saw this choice and I knew my current linux distro is installed on sda, I baulked and did not complete the installation because it “appears” as if my sda will be erased/formatted. do I have anything to worry about? or is all this information looking like its going to do real damage just part of creating the virtualbox installation and drives are not going to be erased or re-partitioned or destroying any current real machine configuration?

  23. Hi Brian, the article is good. But, i have one question. If we do netinstall how much data will it download. I want to know this because here data is costly and i have to know how much will it download so i can check if sufficient data balance is available before starting installation. You can assume a fairly smaller install for normal usage. Thanks.

    • Hi Jakvara,
      You raise a good point. I did not measure how much data I used when I did the netinstall of Ubuntu. If bandwidth is limited, then I suggest you install Ubuntu from DVD. The procedure outlines in this post will also work for the other Ubuntu ISO images, including the DVD.

  24. I am using Windows 7 64bit home. After installing VM and selecting New and then selecting Linux it only gives me 32 bit versions of Linux types to choose from. Why would that happen? I was hoping debian 7 64bit would show up on list as choice.

  25. GANESH KUMAR P June 29, 2016 at 12:47 am

    Thank you very much. I am a school teacher. Now I successfully installed the VM for linux. I feel comfort to teach both windows and linux simultaneously. Thanks a lot.

  26. Hey, I did everything like you did but now in the end I only get a black (boot) screen. In the top left is a static underscore “_” and I can’t type nothing.

  27. Hi. I seem to be running into a problem between the “Install GRUB boot loader…” step. There is a step between Install GRUB boot loader and “finish the installation…” that you did not cover.When I try to start the VM, it does not boot. Any suggestions?

    • I see I used an incorrect screen capture. Use the “dev/sda” selection and it will work. Do not use the “manual” selection.

      I will update my post with a correction. Thank you for finding this error.

  28. Confirmed to work on ASUS Laptop within Windows 10 with Debian 8.5.0.

  29. pls how can i convert the CLI to GUI.

  30. Any ideas why even though I choose to install a desktop environment I’m still booting into the command line with no way to access a GUI?
    I used this iso file: debian-8.6.0-amd64-CD-1.iso

  31. Well, using the net installer debian-8.6.0-amd64-netinst instead solves the problem.

  32. Thank you so much for putting everything in proper detail, Brian!
    Even for a complete layman like me, this post has been very helpful guiding exactly in the right steps.
    Thanks a bunch!


  33. Hi Brian,
    I got stuck up with “Bad Archive mirror” while configuring the package manager.
    I use How to proceed from here?
    Any help would be appreciated!!
    Thanks in Advance!

  34. Hi Brian
    I used debian-8.5.0-amd64-netinst.iso and after the installation is complete, the Debian operating system boots and opens the terminal asking for “hostname login:” for which i gave the username which i gave during the process. it got logged in with the password.
    BUT My question is why is not the desktop GUI is not available as you shown in ur screen shots?????
    Thanks in Advance!!!

  35. Great. Thank you for the installation Guide.:)

  36. Juneld Nerosa April 4, 2017 at 9:50 pm

    Thanks a lot.

  37. Hello Brian, many thanks for your detailed tutorial. It help me a lot when installing my first Debian OS.

    I was getting lost with the official tutorial :

    then this way:

    then I found your tutorial and with the .iso choice (network install) was much more easier.

    but this was because I need to get used to this “world”, your tutorial is a quicker and more simple way.

    Next challange to install it in the other way 🙂

    thank you again.


Trackbacks and Pingbacks:

  1. The Cognitive Security Analytics Company – Machine Learning, Data Science, AI and Security – Use Virtualization to Run Insecure Apps Securely - May 4, 2014

    […] follow these instructions to create a VM on VirtualBox and install the OS (Debian) you just […]

  2. How to Host a Wargame: Red Dragon Server - Level Up Guides - October 12, 2014

    […] I get around to it / people request it, I will do my own tutorial but untill then: Just make sure that with this link you do Debian 32 bit. Also Diban UI is different so install with […]

  3. Need Debian installation service - - November 14, 2014

    […] weeds wrote: Hi, I am needing a debian installation on my laptop urgently within these few days. If you think you can do it, do PM me your contact number and your rate. * Mods: I not too sure where to post this, if I am posting in the wrong forum, please help to move to the correct forum, thanks! Download Oracle Virtualbox and you can install as many times you wish until you are familiar with it. Installing Debian Linux in a VirtualBox Virtual Machine | Open-Source Routing and Network Simulation […]

  4. How to install the Mininet SDN Network Simulator | Open-Source Routing and Network Simulation - December 12, 2014

    […] in VirtualBox and install Ubuntu Server on it. Use the steps described in my previous post about installing Debian in a VirtualBox VM. The procedure is the […]

  5. Debian on OSX | - June 25, 2015

    […] VirtualBox […]

  6. Ranga’s Blog » Blog Archive » AGS on Debian/Parallels - September 14, 2015

    […] mostly followed Brian Linkletter’s very helpful instructions for installing Debian under VirtualBox and for installing Parallels Tools on a Debian virtual […]

  7. Mininet-WiFi: Software defined network emulator supports WiFi networks | Open-Source Routing and Network Simulation - April 22, 2016

    […] Server in a new VM. Download an Ubuntu Server ISO image from the Ubuntu web site. See my post about installing Debian Linux in a VM. Follow the same steps to install […]

  8. Using Virtualization to Run Insecure Apps Securely - June 30, 2016

    […] follow these instructions to create a VM on VirtualBox and install the OS (Debian) you just […]

  9. Setup up Beagle Bone Black Cross Compilation Infrastructure – Digital Brix - July 24, 2016

    […] get Debian installed as the Guest OS follow this link – It has the BEST documentation on how to do […]