Linux and VirtualBox

Running Linux Operating Systems with VirtualBox

What is Oracle VM VirtualBox?


Oracle VM VirtualBox is a software package that allows you to run another operating system from your host system. VirtualBox software is installed on what is known as the host operating system, then from this software you can install additional Guest Operating systems (Guest OS). Each Guest Os runs in its very own environment. Each running Guest OS shares the main hosts resources. CPU, Memory, peripherals, storage and network are all shared. VirtualBox can be installed on many host systems such as Linux, Mac OS X, Windows XP, Windows 7, Windows 8 plus many other operating systems.

The advantage of running a different OS in a virtualised environment allows you to run software for different platforms without having to reboot your PC. You can try out different operating systems without having to configure your system as a multi boot device. Many vendors now ship pre-built images that run software that is dedicated to a specific function such as an email server. You can also use the virtualised environment for developing and testing Disaster Recovery procedures (Business Continuity) without having to touch any live production environment.

To download the VirtualBox software for your Operating System, visit the Oracle Vm VirtualBox website: Oracle VM VirtualBox

The official Oracle VM VirtualBox manual can be downloaded from the following location: Oracle VM VirtualBox Manual






Oracle VM VirtualBox Start Screen


Assuming you have installed the software for your operating system, you will be presented with a screen similar to the screen shot below. It is from this screen that you can Start or pause your Guest Operating systems. System resources from the host operating systems are defined from the various menu options available. Here you can add additional disk to a system, increase or reduce resources such as memory or CPU. In the example below you can see that I have multiple versions of various Linux operating systems installed. These can literally be started by highlighting the chosen system and clicking on the "start" icon from the upper menu.

Linux VirtualBox Software





Example of Adding a New Guest Operating System


To create a new Guest Operating system you first need to have downloaded an "iso" image for your relevant operating system or have a CD or DVD that contains the necessary operating installation media. The majority of Linux operating systems can be downloaded from the internet for free or for evaluation purposes. Assuming that you have your installation media ready we can now start the procedure for creating our Guest OS.

Step 01 - Creating a name for your VM (Virtual Machine)


Our first task is to click on the "New" icon located in the upper left hand corner of the menu. After pressing new you will be displayed a Welcome Message saying "Welcome to the New Virtual Machine Wizard!". At this welcome screen click the "Next" button to continue.

You will now be asked to provide details about the Operating System you are about to install. You will need to specify the OS type (Linux, Windows etc..). You need to provide a new for your system. In the example I have used "MyNewVM", selected that we are going to create a Linux virtual machine based around the Red hat operating system.

Linux VirtualBox Software



Step 02 - Allocate Memory Resources


In this step we simply have to allocate some of our hosts memory to our Guest OS. How much memory you allocate does depend on the Operating System you are planning to install and more importantly how much available memory your host system as available. In the example I have only assigned 512MB, however, you may need more depending on the system you are installing. Most operating systems recommend a minimum amount of memory that should be need to run their OS. This information is normally available on most vendors websites.

Linux VirtualBox Software



Step 03 - Creating a New Virtual Hard Disk


At this menu, you are asked to either create or use an existing disk as your boot disk. In most cases, you will be creating a new virtual hard disk. The recommended size of a boot disk is 8GB, however, this does depend on what operating system you are installing and what software you wish to install on this new Guest OS. In the example, I have chosen to go with a smaller size of 4GB as the OS I intend to install is quite small in size. Again most vendors will have a recommended size for an installation.

Step 04 - Select Hard Disk Storage Type


From this menu you must choose which type of storage to use for your installation. The two available options are:

Dynamically Expanding Storage


Dynamically Expanding Storage initially occupies a very small amount of space on your Physical Hard Disk. It will grow dynamically (up to the size specified) as the Guest OS claims disk space. In most cases this option can be used as it initially uses less space and is faster to setup.

Fixed Size Storage


Fixed Size Storage does not grow. It is stored in a file of approximately the same size as the size of the virtual hard disk you select. The creation of a Fixed Size storage may take a long time depending on the storage size and the write performance of your host's hard disk.

Linux VirtualBox Software



Step 05 - Virtual Disk Location and Size


From this menu you need to specify where your storage file will be located and what name you would like to use to identify the file. From this menu you are also required to specify the size of the Virtual Disk that you are about to create. In this example I have gone with a smaller size of 4GB (8GB is the default Value).

Linux VirtualBox Software



Summary


A summary of your Virtual Hard Disk is now displayed with its size and location:

Type: Dynamically expanding storage
Location: /home/john/VirtualBox VMs/MyNewVM/MyNewVM.vdi
Size: 4.00 GB (4294967296 B)

Linux VirtualBox Software



Additional summary information is displayed on the next screen containing the following information:

You are going to create a new virtual machine with the following parameters:

Name: MyNewVM
OS Type: Red Hat
Base Memory: 512 MB
Boot Hard Disk: MyNewVM.vdi (Normal, 4.00 GB)


If you are happy with these settings, you must now click on "Finish". These settings may be altered at later time through the main menu screen.



Step 05 - Defining System Resources


Now that we have created our virtual disk and allocated our memory we can now configure some of our other settings.

From the main screen we can see that on the right hand side there are various sections that can be accessed. These allow us to modify any of our systems settings with ease.

General


This section is fairly self explanatory as it contains general information regarding our newly created Guest OS. To access the options available simply click on the word "General" next to the small icon.

From this menu we can modify any of the following sections: "System, Display, Storage, Audio, Network, Serial Ports, USB and Shared Folders"

Linux VirtualBox Software



System


From the system menu we can modify the boot order of our system. "Boot first from CD/DVD then hard disk etc..", you can also alter the base memory settings and increase the allocated CPU resources providing your host system has the capacity.

Display


This section allows you to allocate how much video memory your system can use. The amount you allocate will depend on how much capacity your host system has available. In this example I have allocated 64MB of memory. Here you can also enable "3D Video Acceleration". Many newer operating systems will need this option to be checked.

Storage


This section shows an overview of your current allocated storage resources. You can also add additional virtual disks from this menu. This can be useful if you wish to experiment with Linux's LVM storage system.

Audio


This section deals with the audio settings for your current configuration. In most cases this area will be populated automatically with the relevant information.

Network


This next section is important as this will define how our Guest Operating system is going to communicate on your network and access the internet. The most common options are "NAT" and "Bridged Adapter".

NAT


Network Address Translation (NAT). NAT is the default option. If you only want to browse the internet, download files and view your email inside the Guest OS, then using NAT should be more than adequate for your needs.

Bridged Adapter


Bridged networking is generally for more advanced networking situations. When this option is chosen, VirtualBox will connect to one of your installed Network Interface Cards and exchanges network packets directly. If you are using a router with DHCP, you will be leased an IP address in the same range as your host's IP address. This functionality is very useful as it allows you to communicate with other devices/systems on the same network. (My personal preference is to use a bridged connection.)

Internal Network


Internal network can be used to create a software based network which is visible to selected Virtual Machines, but not to applications running on the host or to the outside world.

Host only Network


This option is used to create a network containing the host and a set of Virtual Machines, without the need for the host’s physical network interface. Instead, a virtual network interface (similar to a loopback interface) is created on the host, providing connectivity among virtual machines and the host.

Not attached


In this mode, VirtualBox reports to the guest that a network card is present, but that there is no connection.

Step 06 - Starting your Installation


Now that that you have defined your system resources and network settings it is time to start the installation process. For this part of the setup process we will be using the "iso" image you have downloaded or an image that you have available on a CD or DVD.

Highlight you Guest OS. In this example this will be the entry called "MyNewVM". Next click on the "Start" icon from the upper menu of the main screen. (The Green arrow).

You will now see a welcome screen with the message "Welcome to the First Run Wizard". From this menu click next to continue with the installation process.

Step 07 - Select Installation Media


From this menu you are required to select the media to be used with your installation. From the media source icon, locate the directory or device where your media is located and then click "Next" to continue with the installation.

Linux VirtualBox Software



Step 08 - Summary of Media Selected for Installation


Before the installation start, you will be given a summary of the media you have selected. In this example the following information will be displayed:

Type: CD/DVD-ROM Device
Source: CentOS-6.4-i386-minimal.iso (300.89 MB)

From this summary screen you need to select "Finish" start the installation process.

Step 09 - Follow the Installation Instructions


From this point onwards, you will need to follow the on screen instructions that are specific to the Guest OS you are installing. In most installations you will be asked to provide your location for setting the time zone, your keyboard type, supply the name for a new user of the system. Once the installation has completed, you normally have to restart (reboot) the Guest OS. If all has gone well you should now be able to access your new Guest OS. For an overview of installing various Linux distributions,
click on the following Link: Linux Installation Guides

To start your Guest OS after installation, simply highlight the Guest OS and then click on start

Linux VirtualBox Software