Sunday, March 4, 2012

Install Ubuntu Server in Oracle VirtualBox

Sunday, March 04, 2012 Posted by Andre Broers , , , , 11 comments
Download the ubuntu server iso from http://www.ubuntu.com/download/server/download
I downloaded version 11.10-64bit. You need a 64bit machine which supports 64bit guest operating systems as a VM.
Install and open Oracle VirtualBox.

Click on the New button to create a new Virtual Machine.
Click Next on the Welcome screen.
On the next screen you can give your VM a name. I choose ubuntu. Select Linux as the Operating System and Ubuntu (64 bit) as the Version.

Click Next.
Select the amount of memory you want your VM to have. I choose 512 MB (enough for a light ubuntu server install).
Click Next.
In the next screen select the virtual harddisk for your server. Leave the default and click Next.


In the next screen select the virtual harddisk type. Leave the default (VDI) and click Next.
In the next screen select the virtual harddisk storage type. I choose the Dynamically allocation, so the disk won’t eat up space as long as I not fill it up from within the virtual machine.
Click Next.
In this screen you can choose the virtual harddisk location and size. The defaults are good (location ubuntu and a 8 gig size) so click Next.
VirtualBox gives you a summary. If everything is ok click Create.


Now the new virtual machine is created and added to the list of virtual machines. Select this new virtual machine and click the Settings button.
Now select Storage and click on the Empty CD under IDE controller. Click on the disk with the minus to remove this device. Click Ok to remove it. Now click on the cd with plus after the IDE controller to add a new CD device.
Now click on choose disk select the downloaded ubuntu iso file. Select the ubuntu-11.10-server-amd64.iso file and click on open.
I also add an LSI scsi controller. This is necessary because the virtual server kernel doesn’t have a device driver for sata. After I added the LSI scsi controller I remove the SATA controller. Than I add the existing ubuntu.vdi harddisk image to the SCSI controller.

I always disable audio and sub in my vm’s because I won’t need it for my servers.
In the System tab I disable the boot from floppy and I disable the option Enable absolute pointing device.

After this click OK.
Now it is time to power the system up.
Click the Start button.

Select the langauge English.

Now press the F4 key and select Install a minimal virtual machine.

After this select Install Ubuntu Server.
Now select the language (English – English).
Now select the country (Netherlands in my case).
Now select the country to base the locale on (United States – en_US.UTF-8).
Detect keyboard layout (No).
Configure the keyboard (English (US)).
and again Configure the keyboard (English (US)).
wait for some time.
Please enter the hostname for the system Default (is ubuntu) is OK.
Select the timezone (Europe/Amsterdam).
Partition disks. I choose Guided – user entire disk and set up LVM. In this case I have the most freedom to alter my partition sizes because of LVM and Virtual Box’s virtual harddisks.
Select the partition SCSI3 (0,0,0) (sda) – 8.6 GB ATA VBOX HARDDISK.
Select Yes to write the partition to disk.
Amount of volume group to use for guided partitioning: 8.3 GB.
Write changes to disk. Yes.
wait for some time.
Now it is time to create a user for the server. Enter the full name for the user. I use Me Myself and select Continue.
Enter the username for the account: me and select Continue.
Now type the password twice.
Next question is to encrypt your home directory. I choose No.
Next select a proxy (in my case I leave this empty).
Next question is if you want to automatically manage upgrades on this system. I always choose Install security updates automatically.
Now the system asks which software packages to install. I mostly only choose Basic Ubuntu Server and OpenSSH server. The rest can easily be installed later with apt-get. Select these and select Continue.
wait for some time.
Now the installer asks to Install the GRUB boot loader to the master boot record. Choose Yes.
Now the installation is complete. Select Continue to reboot your new linux ubuntu server.

Now you can login with your username and password.
We have Ubuntu Server running now. Now it is time to install a static IP and the VirtualBox Guest Additions.
See the next blog posts how to install these in Ubuntu Server.

11 comments:

  1. [...] on March 15, 2012 by broersa In a previous post I explained how to install ubuntu server in a virtualbox vm and cloned the ubuntu to an ubuntu01 image in this post. In the following post I will explain how [...]

    ReplyDelete
  2. [...] in the solution map copy this to our Linux Ubuntu Server which is like the one we installed in this blog post. In this blog post I configured port forwarding of port 2222 and port 8888 to our virtual linux [...]

    ReplyDelete