Little Girl's Mostly Linux Blog

VirtualBoxUbuntuServer

Installing Ubuntu Server in VirtualBox

This page was last updated on June 12, 2009.

Introduction

  • Having trouble installing Ubuntu Server 8.04 in VirtualBox? Not a problem. You’re only 50 easy steps from complete success!
  • Below are all the steps with screenshots and descriptions of each.
  • Although this install was done in Kubuntu Gutsy Gibbon, the instructions will work for any variant of Ubuntu.
  • Apologies in advance for the rather wild color-scheme. The author likes working in a vivid environment!
  • Important: Ubuntu has created JeOS, a variant of their server edition which is configured specifically for virtual appliances. JeOS can be used instead of Ubuntu Server 8.04, and will install into VirtualBox flawlessly. If you choose to install JeOS instead of Ubuntu Server 8.04, you can still use this guide, but skip steps 37 through 42.

Acknowledgements

A million thanks go to Frank Pirrone whose inspiration, education, endless patience and willingness to suffer through countless experiments made this page possible!

Step 01

This screenshot contains some virtual machines already in place, including Ubuntu Hardy Heron LTS Desktop Edition. Hopefully that won’t cause any confusion. If you’ve just installed VirtualBox, the left side of this window will be empty and the right side will contain a welcome message.

To begin, left-click the New button on the upper left.

Step 02

You will be greeted by the wizard.

To continue, left-click the Next button on the bottom right.

Step 03

Give your virtual machine a name. Left-click inside the Name box and type it in. I’ve chosen “Ubuntu Hardy Heron 8.04 LTS Server Edition” as the name for this virtual machine.

Also, choose an OS type from the selection box by left-clicking the arrow to the right of it.

Ubuntu Server uses the 2.6 kernel, so you would choose Linux 2.6 here.

Once finished, left-click the Next button on the bottom right.

Step 04

Assign the amount of RAM you’d like to give the virtual machine.

You can either place the mouse over the indicator on the Base Memory Size slider and hold down the left mouse button while sliding the indicator to the desired position, or you can type the number in the box next to MB on the right side of the window.

The recommended size here is 256 MB, but since there’s plenty of RAM on the host machine, I’m giving it 512 MB. Ubuntu Server will run fine with 256 MB. You’ll want 384 MB or more if you plan on running Ubuntu Server with a GUI.

Once finished, left-click the Next button on the bottom right.

Step 05

Choose whether to use an existing hard disk or to create a new one. In this example I’m creating a new drive. Left-click the New button on the bottom left.

Step 06

Left-click the Next button on the bottom right.

Step 07

Choose whether the hard disk will be dynamically expanding or fixed-size (see the screenshot at the left for a detailed explanation of each) by left-clicking the radio button next to your choice.

In this example, I’m choosing a dynamically expanding hard disk.

Once you’ve made a choice, left-click the Next button on the bottom right.

Step 08

Give the hard disk a name. VirtualBox will automatically insert the name you gave the virtual machine. If you’d like to use a different name, delete the contents of the Image File Name box and type in a new name.

To the right of the Image File Name box is a little icon you can left-click to select a location to store the hard disk in. VirtualBox will store hard disk images in ~/.VirtualBox/VDI (a hidden directory in your home directory) if you don’t choose another location.

Another thing you can do is change the starting size of the hard disk image by placing the mouse pointer over the indicator on the Image Size slider in the bottom portion of the window. Hold down the left mouse button while sliding the indicator back and forth to the desired size. Release the left mouse button when satisfied with the size of the drive.

VirtualBox assigned 8 GB to this virtual machine by default. Ubuntu recommends 500 MB as the default minimum size, stating that the size of the installation will depend on the services you install during setup. For the purposes of this walk-through, I’m leaving it at VirtualBox’s default setting.

Once finished, left-click the Next button on the bottom right.

Step 09

Review the choices you’ve made. If you’re not happy with any of them, left-click the Back button on the bottom right and make the necessary changes.

Once you’re happy with your choices, left-click the Finish button on the bottom right.

Step 10

VirtualBox will have inserted the hard disk information you just chose into the Boot Hard Disk (Primary Master) box for you. Left-click the Next button on the bottom right.

Step 11

Review the choices you’ve made. If you’re not happy with any of them, left-click the Back button on the bottom right and make the necessary changes.

Once you’re happy with your choices, left-click the Finish button on the bottom right.

Step 12

Your Ubuntu Server virtual machine has been created. You’ll now be back in the VirtualBox opening window with the new virtual machine highlighted.

To set up the virtual machine, left-click the Settings button in the upper left.

Step 13

Here you can change some of the settings you made during the install of the virtual machine.

NOTE: You can only change these settings when the virtual machine isn’t running.

You’ll want to tell VirtualBox where the CD or ISO file is located so that VirtualBox can boot from it. Left-click CD/DVD-ROM on the upper left.

Step 14

Left-click the little box next to Mount CD/DVD Drive at the top to place an X in the box.

Step 15

Choose whether to use the host CD/DVD drive or an ISO image file on your hard disk.

In this example we’re using an ISO image file on the Desktop. The little icon to the right of the ISO Image File selection box will let you browse to and add the ISO to VirtualBox. When you’re finished, left-click the OK button on the bottom right.

Step 16

Now you’re back at the starting window with the Ubuntu Server virtual machine highlighted automatically. Left-click the Start button at the top.

Step 17

You’ll see the Innotek splash screen and then boot into the Ubuntu Server CD install procedure.

The first thing to do is choose your language.

Use the arrow keys to select the language you’d like to use and press the Enter key when finished.

step 18

You will be offered a selection of choices with Install Ubuntu Server being highlighted by default. Use the arrow keys to navigate through the choices. With Install Ubuntu Server highlighted, press the Enter key.

Step 19

Choose the language used during the installation process by using your arrow keys. Then press the Enter key.

Step 20

Choose your country or region by using your arrow keys. Then press the Enter key.

Step 21

In this next screen you can have the install process detect your keyboard layout by pressing the Enter key and going through the wizard. For the purposes of this demonstration I have used the arrow keys to select No and pressed the Enter key.

Step 22

The installer then auto-detects the origin of the keyboard, but if this is incorrect, you can use the arrow keys to choose the correct one. Once finished, press the Enter key.

Step 23

Choose the layout of your keyboard by using the arrow keys. Then press the Enter key.

Step 24

After detecting hardware and loading components, the install routine asks you to choose a hostname. It offers ubuntu as the default choice.

To remove the default name and type a new one, press the Backspace key until ubuntu is gone. Then type in a new name. To add to the default name, just begin typing.

For the purposes of this walk-through, I chose ubuntuserver as the hostname for this virtual machine.

Once you’ve chosen a hotsname, press the Enter key.

Step 25

Choose your time zone using the arrow keys. Then press the Enter key.

Step 26

Now it’s time to partition the virtual hard disk you’ll be using for Ubuntu Server. The default choice is Guided – use entire disk. If you’d like to make a different choice, use the arrow keys to select the one you like.

NOTE: The partitioner will only affect the virtual drive you created for this virtual machine, which exists as a file on your host machine’s hard drive. Your host machine’s hard drive will not be partitioned during this step.

For the purposes of this walk-through I’m choosing Guided – use entire disk.

Press the Enter key to continue.

Step 27

Select the disk to be partitioned.

I’ve only ever seen one disk at this screen, but I suppose if you had made a different choice in Step 26, you’d be offered more than one disk here, which you could select by using the arrow keys. Since I chose Guided – use entire disk, I have only this disk to choose from.

Once you’ve chosen the disk to partition, press the Enter key to continue.

Step 28

You will now be given one last chance to change the choices you’ve made before the disk gets partitioned. The default answer here is No for your protection.

If you’re unhappy or unsure of the choices you’ve made, use the arrow keys to select Back and press the Enter key to change them.

Otherwise, use the arrow keys to select Yes. Then press the Enter key to continue.

The install routine will now format and create the partitions. This part should happen very quickly (too quickly for me to capture!).

NOTE: Remember that since this is a virtual machine, the formatting and partitioning is being done to a file on your host machine’s hard drive – not to your host machine’s entire drive.

Next, the install routine will install the base system, as seen in this screenshot. This may take a while.

Step 29

Provide the full name of the new user (you!). To enter your name, just begin typing.

For the purposes of this walk-through, I chose Snow White as my full name.

When finished, press the Enter key to continue.

Step 30

Choose the username for your account. By default, the install routine will have inserted the first name you typed in the previous step. In this screenshot, the install routine has automatically inserted snow as my username.

NOTE: Instructions for how to choose a username are provided.

To replace the default username, press the Backspace key until it’s gone and type in a new name. To add to the default username, just begin typing. To accept the default username, do nothing.

When satisfied with the username you’ve chosen, press the Enter key to continue.

Step 31

Choose a password for the new user. To do this, just begin typing. Your keystrokes will be shown as asterisks. Press the Enter key to continue.

Step 32

Re-enter the password to verify that you typed it correctly. To do this, just begin typing. Your keystrokes will be shown as asterisks. Press the Enter key to continue.

Step 33

Configure access to the outside world if you use a proxy. To do so, type in the information.

I don’t use a proxy, so following the instructions provided by the install routine, I make no changes here.

Press the Enter key to continue.

The install routine will configure the package manager.

Step 34

The install routine will now offer you some of the more common predefined collections of software. This step is optional, since you can add software at any time once the installation is complete.

To choose some of these software collections, use the arrow keys to change between the selections and press the Spacebar key to select (or de-select) them.

For the purposes of this walk-through, I’m installing a LAMP server and an OpenSSH server.

Once you’ve made your selections, press the Enter key to continue.

Step 35

If you chose a LAMP server in Step 34, choose a password for the MySQL administrative “root” user. To do this, just begin typing. Your keystrokes will be shown as asterisks. Press the Enter key to continue.

Re-enter the password to verify that you typed it correctly. To do this, just begin typing. Your keystrokes will be shown as asterisks. Press the Enter key to continue.

Step 36

If you chose to install any of the predefined collections in Step 34, the install routine will now install the software you chose. This may take a while.

Step 37

The installation is complete.

BUT DON’T PRESS THE ENTER KEY JUST YET!

Virtualbox doesn’t support kernels with PAE enabled, and since Ubuntu Server comes with one of those kernels, you won’t be able to boot with it until you replace the kernel.

Press the Alt and F2 keys at the same time to enter a BusyBox shell.

Step 38

You are now in the BusyBox shell. Press the Enter key to continue.

You are now at a BusyBox shell prompt, represented by ~# with a blinking cursor to the right of it.

Step 39

Type chroot /target and press the Enter key.

You’ll be back at the BusyBox shell prompt (which will from now on just be # with a blinking cursor to the right of it), as in this example.

Step 40

Type apt-get install linux-virtual and press the Enter key.

Step 41

The BusyBox shell will display information about the package and ask if you wish to continue. Type Y and press the Enter key to continue.

Step 42

The package manager will now install linux-virtual. This will take a while.

NOTE: “Done” will be displayed numerous times throughout the install. This does not mean the install is complete.

Once the install is complete (when you see # with a blinking cursor to the right of it at the bottom of the screen), press the Alt and F1 keys at the same time to exit the BusyBox shell and return to the Ubuntu Server install routine.

Step 43

The installation is complete!

Press the Enter key to boot into Ubuntu Server!

Step 44

Ubuntu Server has booted successfully!

At the prompt, type in your username and press the Enter key. At the next prompt, type in your password (which will not show as you type it) and press the Enter key.

You’re now logged in (with a LAMP server and an OpenSSH server installed, if you made the same selections I did in Step 34).

At this point the server can access the internet, but you cannot yet access the server from the host machine or over a local or remote network. A guide that shows how to connect to the server and work with some of its software is mentioned in Step 50 below, but please complete Steps 45 through 50 first.

Step 45

To log out of the server, type logout and press the Enter key.

Step 46

You will be back at a login prompt. If your mouse has been “captured” by the virtual machine so that you cannot use it in the host machine, press the Ctrl key on the right side of your keyboard to free it.

To shut down the Ubuntu Server virtual machine, left-click the X in the upper right corner of the window.

You’ll have the choice to save the machine state or power off the machine. For the purposes of this walk-through, left-click the radio button next to Power off the machine and left-click the OK button.

Step 47

You’ll be back at the main VirtualBox window with the Ubuntu Server virtual machine highlighted.

You’ll now want to tell VirtualBox not to use the install CD when launching Ubuntu Server.

Left-click the Settings button in the upper left.

Step 48

You’ll find yourself back in the settings for Ubuntu Server (as you were in Step 13). Left-click CD/DVD-ROM in the upper left.

Step 49

Uncheck the box next to Mount CD/DVD Drive at the top of the window by left-clicking it.

Step 50

Left-click the OK button on the bottom right.

Done!

You will now be able to highlight the Ubuntu Server entry in Virtual box and left-click the Start button at the top of the window to launch the Ubuntu Server virtual machine.

For suggestions and a walk-through on how to use your new virtual Ubuntu Server, see this page.



Obligatory Happy Ending

And they all lived happily ever after. The end.

2 Comments »

  1. I agree with most of what is said here.

    Comment by JeffP24 — June 1, 2010 @ 8:13 pm

    • I’m glad to hear it! If there’s anything specific you don’t agree with, let me know, and if I’ve got it wrong, I’ll happily fix it. :)

      Comment by mostlylinux — July 14, 2010 @ 1:42 pm


RSS feed for comments on this post. TrackBack URI

Comment:

Create a free website or blog at WordPress.com.