Installing Debian Linux in a VirtualBox Virtual Machine

October 6, 2012 — 13 Comments

A39 Debian 6.0 [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:

Step 1: Download the Debian network installer

Go to http://www.debian.org and download the network installer disk image. In this example, the network installer disk image was:
debian–6.0.5-amd64-i386-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 6.0″). In the Operating System field, enter “Linux” and in the Version field, enter “Debian (64 bit)”. The click Continue.

A01 Create New Virtual Machine

Memory

Use the default setting for the amount of base memory. In our case, the default value is 384 MB. It probably could be set higher but we’ll use the default values, for now. We can change it later, if we need to.

A02 Create New Virtual Machine

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.

A03 Create New Virtual Machine

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.

A04 Create New Virtual Disk

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.

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.

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 Continue to proceed.

A05 Create New Virtual Disk

Finally, we see a Summary screen and we can review the settings and then click Create.

A06 Create New Virtual Machine

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

A07 Oracle VM VirtualBox Manager

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 6.0 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.

A08 Debian 6.0 - Storage

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.

A09 Debian 6.0 - StorageThen select the option: Choose a virtual CD/DVD disk file.

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

A12 VirtualBox

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.

A13 Debian 6.0 - Storage

Now you can see that the network install ISO image is configured for the Debian 6.0 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.

A14 Oracle VM VirtualBox Manager

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.

A15 Debian 6.0 [Running]

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

A16 Debian 6.0 [Running]

A17 Debian 6.0 [Running]

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”.

A18 Debian 6.0 [Running]

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

A19 Debian 6.0 [Running]

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.

A20 Debian 6.0 [Running]

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 created a classic “unix user name”, where I use the first letter of my first name and the first seven letters of my last name (or the entire last name if it is less than seven letters long), to create a unix user id that is eight characters (or less) in length. You can use any user I’d you wish. Then I chose a password.

A21 Debian 6.0 [Running]

A22 Debian 6.0 [Running]

A23 Debian 6.0 [Running]

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

A24 Debian 6.0 [Running]

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.

A25 Debian 6.0 [Running]

A26 Debian 6.0 [Running]

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

A27 Debian 6.0 [Running]

A28 Debian 6.0 [Running]

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.

A29 Debian 6.0 [Running]

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.

A30 Debian 6.0 [Running]

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.

A31 Debian 6.0 [Running]

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.

A32 Debian 6.0 [Running]

A33 Debian 6.0 [Running]

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. Graphical 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.

A34 Debian 6.0 [Running]

A35 Debian 6.0 [Running]

A36 Debian 6.0 [Running]

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

A37 Debian 6.0 [Running]

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

A38 Debian 6.0 [Running]

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

A39 Debian 6.0 [Running]

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.

A41 Oracle VM VirtualBox Manager

13 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
    Dino

  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.
    thanks

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: http://www.brianlinkletter.com/installing-debian-linux-in-a-virtualbox-virtual-machine/ Just make sure that with this link you do Debian 32 bit. Also Diban UI is different so install with […]

Leave a Reply

*

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>