You are on page 1of 12

How to install Kubuntu Linux in a virtual box virtual machine

http://www.virtualbox.org/wiki/Downloads

http://www.kubuntu.org/

First steps

Over the years as an IT professional I have had many situations when having Linux available has been
extremely helpful. Things from password decryption on windows hosts when someone accidental
changed the password on the only account, or needing to do vulnerability testing has been made easier
by using Linux. But having to either have a dedicated machine or a machine dual booted makes it difficult
when you have limited assets.

So a simple solution to this problem is to use a host based virtualization application like virtual box.
Essentially what virtual box allows you to do is run an operating system from within an operating system.
Both operating systems share the host pc hardware and can see each other while running.

As there is a ton a different Linux distributions out there I have decided to use Kubuntu. Kubuntu uses
KDE 4.3 as its desktop manager which is very similar to windows so the learning curve should not be as
high as trying to use GNOME (another desktop manager).

What we are going to use to make all this happen is the free open source virtualization package called
virtual box which we can get from here: http://www.virtualbox.org/wiki/Downloads. Virtual box will allow
you to install many guest operating systems including emulating 64 bit hardware. This is very handy when
your host pc is running on 32 bit hardware as some operating systems will require you to have 64 bit
hardware (IE: Windows Server 2008 R2 which I will cover in a different guide).

After you download virtual box it is a fairly straightforward installation which at the end it will launch and
you will be presented with the following screen: (Please note you will lose your network connection during
the install as virtual box installs some additional network drivers.)

From here you can manage your vms as needed which include creating, deleting, and other things we
will cover a little more as we create our vm.
So to create a vm you would click the new button which will launch the wizard. Using the wizard you will
be asked questions like the name of the vm and the operating system as seen here:

From here you would click the pull down buttons and select Linux for the operating system and Ubuntu
Linux for the version (Kubuntu is a KDE version of Ubuntu). When youre done it should look like this:
More settings

So after hitting next you will be asked about base memory for the vm. The more ram you can give to the
guest the better it will run just like a physical PC. Since I have 4GB of ram in this particular host I am
going to give it 1GB.

After clicking next you will be asked to create a virtual disk which is a special file used by the VM to create
a hard drive. Since we dont have a disk created we are going to make one, clicking next will bring you to
the virtual disk wizard and you will be asked if you would like to make a static or fixed sized disk or a
dynamically expanding storage.
They both have tradeoffs as there may be a performance hit as virtual box expands the virtual disk file
when the guest operating system starts to add a lot of data but it will be smaller than the allocated size.
Fixed disk creates the virtual disk at full size so if you have a 20GB virtual disk the file is going to be
20GB. But in certain cases the fixed disk might be more responsive than a dynamic. I normally use a
dynamic file as it does not use a lot of hard drive space and I dont mind a minor performance hit.

Let's keep on going

After you complete the virtual hard disk wizard you will be ready to install the operating system on to the
virtual machine. But first we need to change a few things on the vm such as the networking and the
display adapter. That can be done by highlighting the machine you want to configure (Kubuntu for this
discussion) and make the changes.
From the above image you can see you have motherboard, processor and acceleration. For this guide we
will be using a single processor and enable the virtualization support if youre CPU supports it.

For display properties we can leave the defaults selected and leave 3d acceleration unselected for now.
In the storage tab you can change the ide controller type and see what disks are attached. I normally use
SATA for the obvious reasons of performance for the guest. One thing you cant do with virtual box is use
the SATA controller for CD-ROM drives so you will have to have one PATA controller installed. The
following picture is how I configured the vm.

Audio, ports etc

In the audio tab you choose whether or not enable audio support for the vm. I normally leave it with the
defaults unless I need to change it.
Virtual box will allow you to have 4 NICS installed using either NAT, bridged to the host, internal or no
network. I normally use a bridged as it is easier that way and the virtual NIC will have a unique MAC
address so there should be no problem.
For the serial port and USB tabs I would just use the defaults for now which has serial ports disabled and
USB enabled.

After all that all we need mount our ISO file for installing Kubuntu from the virtual media manager which is
launched from the file table of the main menu or by hitting control-d.
Go to the cd/dvd images tab and hit the add button and browse to the ISO file. Hit ok and then go click on
the storage tab to mount the ISO file in the CD-ROM drive.

Finally we can start the vm and install the guest operating system. To do this hit the start button for the vm
you want to start. When you start the vm your mouse pointer maybe grabbed by the vm and you will need
to release it by hitting the right control button (called the host key). This is what you should see when the
vm is finally running and booted from the ISO.

Time to install the OS


At this point we have two options which are either run this like a live cd and then install from inside the
mounted operating system (which takes longer) or install it to the virtual hard drive. I am going to install
the o/s so I will select Install Kubuntu.

At this point we will walk through the installer which is really pretty straight forward. Choose your
language you wish to use. You will then get asked for your time zone and if you have network access the
installer will try to reach a NTP server for to synchronize the time. After you select your time zone go
ahead and hit forward.

Then you will be asked for a keyboard layout and the installer will show a representation of your current
keyboard configuration like this.
If it looks like your keyboard go ahead and click forward to go on with the rest of the installation.

Final steps

For your disk setup I would let Kubuntu use the whole disk so go ahead and hit forward .You will then fill
out your user name. One thing to note is that you will not need to a root password as the Ubuntu
distributions use the sudo command to elevate your user privileges. So just fill in your
Name and desired username as well a password and a computer name. It should look something like
this:
Once you click forward you will get a summary of the configuration and drive layout. We will then go
ahead and click forward and let the installer commence. The installer will then format the file systems and
copy the binaries and setup the system. This may take 30 to 40 minutes depending on your host pcs
CPU speed and how many CPU'S are available which all play into the performance of the vm.

After the install is you will get a pop up saying to restart now, go ahead and click that. You should then get
a console window saying to remove the disc and hit enter. Right click on the cd image in the right corner
of vm window and un-mount the CD-ROM and hit enter.

After a few minutes you should be at the Kubuntu login screen ready to finish the installation at this point.
The next thing we will have to do is install the virtual box additions that will bring mouse pointer integration
to the vm. To do this right click on the cd image and mount the vboxaddtions ISO and login to the host.

Once logged in you need to update your installation and there are many different ways to do this. I prefer
to do this from the console. You can get to that by running the application konsole from the start menu.
When you have the console open enter the following commands:

Sudo apt-get update

And when that is done then use sudo apt-get dist-upgrade and the updates should take about 20 to 30
minutes on your connection speed. This will get you the most up to date packages for your installation
which will make loading the virtual box additions that much easier
Once apt has finished doing the update go ahead and reboot the vm and login to the vm. Open up the
console again and mount the CD-ROM drive with this command:

Sudo Mount /dev/scd0 /media/cdrom 0


Then:
cd /media/cdrom0/
And then finally:
sudo ./VboxLinuxAdditions-x86.run
And that should start to install the virtual box extensions which will take a few minutes and then once its
done a quick reboot and we shall finally be done.

Every time the kernel is updated you will have to repeat this process as the modules are specific to the
kernel.

Once the virtual machine is rebooted you will notice that you can now move the mouse pointer between
the host machine and the vm without using the host key to release the mouse pointer. And this is what
you should see when the machine finally reboots.

In our next guide we will go over what we can do with a Linux on a windows network and how to go about
doing them.

You might also like