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:
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.
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.
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.
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.
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.
Finally, we see a Summary screen and we can review the settings and then click Create.
Now we see we have a Debian 6.0 VM available in VirtualBox and it is in the Powered Off state.
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.
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.
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.
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.
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.
Select the country in which you a working and keyboard layout that matches the computer hardware you are using.
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”.
It is best to leave the domain name blank, for now. We can configure it later, if we need to.
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.
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.
Next, choose the time zone in which you are working.
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.
All files in one partition is the simplest configuration and it is the default choice.
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.
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.
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.
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.
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.
After the installation is complete, the Debian operating system boots up in the virtual machine.
Log in using the userid and password you selected during the installation process.
The system will be up to date. But, when you want to check for more updates, use the Debian Update Manager application.
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.