How to install Debian Linux 8.1 in a VirtualBox VM

There are so many Linux distros available now that it’s hard to choose the one that will be the best for your purposes, but unless you’re looking for something with a specialized focus, Debian Linux has to be one of the best.

install debian linux 8.1 virtual machine 1
Debian Linux 8.1

There are so many Linux distros available now that it’s hard to choose one that will be the best for your purposes, but unless you’re looking for something with a specialized focus, Debian Linux has to be one of the best. It’s extremely stable, fast, and feature-rich and backed by a huge and active development community. In this slideshow I’m going to cover how to set up a virtual machine using the latest version of Debian, Debian Linux 8.1 (“Jessie”) in a virtual machine under Oracle VirtualBox 4.3.28 (I ‘m using VirtualBox under OS X 10.10.3, but it will look much the same under both Windows and Linux).

VirtualBox
Credit: Mark Gibbs
VirtualBox

If you’re going to follow along and build a Debian virtual machine, you’ll need to have Oracle’s VirtualBox installed. While it’s hard to choose between desktop virtualization systems, VirtualBox has a distinct edge over other mainstream solutions because it’s free and open source (although some components of the Extension Pack are supplied in a binary form under a commercial license). As opposed to a Type-1 Hypervisor which runs on “bare metal,” VirtualBox is a Type-2 Hypervisor which means it runs on top of another operating system (Solaris, Windows, OS X, and Linux are all supported). You can download VirtualBox here. Installation is quick and painless so if you want to install it now, we’ll wait for you …

install debian linux 8.1 virtual machine 3
Credit: Mark Gibbs
Build your own

Although many websites offer pre-built Linux VMs (for example, one of the better sources is VirtualBoxes.org), I prefer to build my own using downloads from the distro’s own site. There are sound reasons for doing this: First, it ensures you have a clean installation without extra features or services other people think should be included; and second, you know that the installation media isn’t carrying malware. I’d recommend grabbing CD/DVD images via BitTorrent and then verify the downloaded content.

install debian linux 8.1 virtual machine 4
Credit: xfce.org
Lightweight

We’re going to use a “live”(i.e. “bootable”) CD image named debian-live-8.1.0-i386-xfce-desktop.iso which you can download from the Debian download site. This version uses Xfce desktop manager version 4.12 which is lightweight in terms of resource usage and very stable.

install debian linux 8.1 virtual machine 5
Credit: Mark Gibbs
VirtualBox Manager

When you start VirtualBox the VirtualBox Manager will be displayed. This is where you create, edit, start, stop, and snapshot virtual machines. We’re going to click on “New”…

install debian linux 8.1 virtual machine 6
Credit: Mark Gibbs
Create a virtual hard drive

We’re going to call this VM “Debian-1” with a type of “Linux” and version of “Debian (64bit)”. Click on “Continue” and in the following screens select the amount of RAM you want to allocate (the defaults will all work and you can increase any of the values later). Clicking “Continue” will take you to the “Hard Drive” screen where you can select a virtual hard drive; select “Create a virtual hard drive” and then click “Create”.

install debian linux 8.1 virtual machine 7
Credit: Mark Gibbs
Choose the virtual hard disk file type

The next screen will ask you to choose the virtual hard disk file type. Unless you plan to work with other VM platforms, leave the default as “VDI” and click on “Continue”. The next screen asks if you want the virtual hard drive to be dynamically allocated on the host’s physical hard drive or be pre-allocated to a fixed size. I always choose the dynamic option.

install debian linux 8.1 virtual machine 8
Credit: Mark Gibbs
Final setup step

The final setup step is to select the name of the virtual hard drive, its location, and the maximum size of the virtual hard drive (the recommended drive size will be pre-set). Clicking “Create” creates the virtual hard drive and initializes it. Now, with the new virtual machine, “Debian-1”, selected in the left-hand menu, click the green “Start” arrow and your new virtual machine will start.

install debian linux 8.1 virtual machine 9
Credit: Mark Gibbs
Access the live CD

It needs to access the live CD so click on the folder icon and find and select the disk image you downloaded and click on “OK”. Note the text at the bottom right of this window that reads “Left Command-Key” (in Windows this would be “Right Ctrl”): This is the key to “release” the cursor from the VM’s window,. If you click in this window the cursor will be trapped until you press the correct key. We’ll cover how to fix this annoyance later on …

install debian linux 8.1 virtual machine 10
Credit: Mark Gibbs
Graphical Install

Installation will start and we’ll select “Graphical Install”. The defaults offered for language, keyboard, etc., will work fine. You’ll be asked to select a host name (I have boringly set it to “Debian-1”), and a domain name (for testing, I use “.local”)

install debian linux 8.1 virtual machine 11
Credit: Mark Gibbs
Don’t forget the root password

I probably don’t need to mention this but I will anyway … don’t forget the root password after you set it. Next, you’ll be asked to set up a non-administrative user account; just follow the prompts. Next comes timezone setup then disk setup. For the latter select “Guided - use entire disk” and choose the default option for the disk partition. For the partitioning scheme, select “All files one partition…” and then “Continue”. When you get to the “Partition disks” screen select “Yes” and then click on “Continue”.

install debian linux 8.1 virtual machine 12
Credit: Mark Gibbs
Select your time zone

Next, you’ll be asked to select your time zone after which …

install debian linux 8.1 virtual machine 13
Credit: Mark Gibbs
Partitioning

…you’re on to partitioning the disks. Select “Guided partitioning”.

install debian linux 8.1 virtual machine 14
Credit: Mark Gibbs
Guided

On the next screen select “Guided - use entire disk”.

install debian linux 8.1 virtual machine 15
Credit: Mark Gibbs
Select the disk to partition

The next screen allows you to select the disk to partition and you can just click on “Continue”.

install debian linux 8.1 virtual machine 16
Credit: Mark Gibbs
Single partition

As this screen suggests, sticking with a single partition is the easiest option.

install debian linux 8.1 virtual machine 17
Credit: Mark Gibbs
Partitioning scheme

Now it’s time to commit to our partitioning scheme; click “Continue”.

install debian linux 8.1 virtual machine 18
Credit: Mark Gibbs
Make sure you mean it

Just to make sure you mean it, you have to select “Yes”…I suggest doing so, then “Continue”.

install debian linux 8.1 virtual machine 19
Credit: Mark Gibbs
Network mirrors

Network mirrors are copies of the Debian archives that, as the screen says, supplement the software on the CD. Select “Yes” unless you have a poor Internet connectivity then, on the next screen, select your country and on the one after that, select a mirror. You’ll also be asked if a proxy needs to be used; if you don’t know then you probably shouldn’t be attempting this installation. The package manager will now be configured.

install debian linux 8.1 virtual machine 20
Credit: Mark Gibbs
Boot loader

You need a boot loader, select “Yes”and click “Continue”.

install debian linux 8.1 virtual machine 21
Credit: Mark Gibbs
Select the one device shown

This is not the time to get fancy: Select the one device shown and click “Continue”.

install debian linux 8.1 virtual machine 22
Credit: Mark Gibbs
Installation is complete

And we’re there! Installation is complete! The Live CD has been ejected so click “Continue” to see the Debian goodness …

install debian linux 8.1 virtual machine 23
Credit: Mark Gibbs
Ready to go

…Houston, we have lift-off! You‘ll see the login screen and, once you’ve logged in…

install debian linux 8.1 virtual machine 24
Credit: Mark Gibbs
Use default config

…the desktop will appear, click on “Use default config” and …

install debian linux 8.1 virtual machine 25
Credit: Mark Gibbs
Working Debian 8.1 system

You now have a complete, working Debian 8.1 system with the Xfce 12.4 desktop manager running in a virtual machine. If you go to the VirtualBox VM “Device” option, and under both “Shared clipboard” and “Drag’n’Drop” you select “Bidirectional”, you’ll enable shared clipboards and dragging and dropping of files between the virtual machine and the host. But there’s even more integration you can achieve between the host and the guest virtual machine if you install the VirtualBox Guest Additions …which will be the subject of a future piece.

RELATED: 7 command line tools for monitoring your Linux system