An Introduction to Oracle's Virtual Box (VBox)

Discussion in 'Linux Other' started by DevynCJohnson, Dec 8, 2013.

  1. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,162
    Likes Received:
    989
    Trophy Points:
    113
    Many computer users have heard of a virtual machine or a virtual OS. This is special software that allows users to run an operating system inside of another. In this tutorial, I will install AnitaOS in a virtual machine on my Ubuntu system. AnitaOS would be called the guest OS and Ubuntu is the host system.

    Many virtual machines exist. I will use Oracle's VirtualBox (VBox) because it is a cross-platform software that works on most hardware. Other virtual machines (VM) require special kernel modifications or special BIOS updates. Virtual-Box is open-source and works on many systems including (but not limited to) Solaris and Windows (obviously, it works on Linux since this article originated from Linux.org).

    Download a compiled Virtual-Box:
    https://www.virtualbox.org/wiki/Downloads
    Source Code (src): https://www.virtualbox.org/browser/vbox/trunk

    Once you have downloaded VirtualBox, make sure you have your desired guest-OS installation medium. This may be an image file, like an ISO, or a physical disc. Also, make sure you have at least ten Gigabytes (or more for larger guests) on one partition. For this tutorial, I am using AnitaOS, but this will work for any guest like Solaris, *BSD, Linux, Windows, etc.

    Open VirtualBox and click "New".

    vb_01.png

    vb_02.png

    Then, name the guest. Usually, users type the name of the OS. Any name will work. For "Type", choose the general category of your guest. For operating systems like Plan 9, BeOS, Haiku, Inferno, and most Unix and Unix-like systems, place them under "Other". AnitaOS is a Linux distro that is based on Puppy Linux, so I will click "Linux". Under "Version" choose the one that best describes your system. Do not worry about choosing the "right" one. The purpose of this is for VirtualBox to make suggestions in the settings and for sorting guests operating systems in the list of detected guests.

    vb_04.png

    NOTE: You can have as many guest operating systems as you wish as long as you have the storage space to store the virtual hard-drive files.

    Next, set the amount of memory that will be reserved for the guest. Be careful not to set this too high. The host cannot use the memory that is reserved for the guest. I will set this to 512MB.

    vb_05.png

    After that, a virtual hard-drive needs to be setup. This is an image file (like an ISO). After "Create" is clicked, a list of virtual hard-drive formats are listed. Since I am using VirtualBox, I will choose "VDI" which is VirtualBox's standard/default format. Users would choose a different format if they have specific needs or plan to use the guest on various virtual machine software.

    vb_06.png

    vb_07.png

    NOTE: The virtual hard-drive file containing the guest is often referred to as a virtual appliance. Most virtual machine software allows users to import guest systems by “importing an appliance”.

    Next, the user can make a fixed or dynamic virtual hard-drive. Fixed-size sets the file's size to the specified virtual hard-drive size while dynamic expands as needed until the maximum size is met. I will choose "Fixed size".

    vb_09.png

    On the following window, set the size and location of the file. I will make this file 8GB. After clicking "Create", this may take some time.

    vb_10.png

    Once the virtual hard-drive has been created, click "Settings". A window will appear with tabs and a list on the left side. Most of the settings are self-explanatory, but I want to point out the important or difficult to understand options. In the "General" window in the "Advanced" tab, there is a drop-down titled "Shared Clipboard". With this, you can set how the clipboard's contents are shared. "Bidirectional" means both the guest's and host's clipboard are one. The most recent item on either clipboard will be copied to the other.

    vb_12.png

    vb_13.png

    Under "System > Motherboard", you can change the amount of reserved memory. Here is an important setting to remember - the "Boot Order". Change this according to your needs. The priority is set as the most important/first device on the top and the least important on the bottom. Unchecked items will be ignored. Since I still need to install AnitaOS, I will place the CD-ROM on the top.

    vb_14.png

    Under the "Processor" tab contains a setting to control how many of the processor the guest can use and the maximum execution cap. This means a user can set the guest to only use 60% of the CPU resources or what ever amount they wish.


    vb_15.png

    Under "Display > Video", the user can set how much of the guest's memory to reserve for video. I set mine to 64MB for AnitaOS. Video acceleration can also be set. Generally, video acceleration is not needed for many systems.

    vb_16.png

    Under "Storage", you can select your installation medium. Click the "Empty" disc and then the small disc icon near "CD/DVD Drive". If your installation medium is a physical disc, then choose "Host Drive". Otherwise, click the "virtual disc" and browse for your ISO file or any other accepted format.

    vb_17.png

    Audio can be enabled/disabled under "Audio".

    vb_18.png

    Under "Network", you can configure and set the networks for the guest. The "Bridged Adapter" allows the guest to use a network adapter used by the host. Yes, the guest and host can safely share and use the same network cards at the same time. So, to make the guest use my wireless card, I set the "Attached to" to "Bridged Adapter". The "Name" will then be set to "wlan0". This virtual machine can handle up to four network adapters.

    vb_19.png

    The guest can be set to use certain directories that are on the host system. Most guest systems see such shared folders as mounted drives.

    Once you have made the changes you want, click okay and then click "Start" on the main screen. Then, the guest operating system starts up. Install your system as you would on real hardware.

    vb_20.png

    Once your guest finishes installing and you shut it down, remember to go back to the boot order settings and make the hard-drive the top priority. Otherwise, your installation medium will boot first.

    Now, with this knowledge, users can experiment with other Linux distros, Unix, Unix-like systems, and what ever else they wish. Enjoy!

    Attached Files:

  2. GlennJohnson

    GlennJohnson New Member

    Messages:
    6
    Likes Received:
    9
    Trophy Points:
    3
    Remember that if you're installing a 64Bit guest you need to select 64Bit under the version dropdown in the same panel where you name the guest OS. Otherwise the guest will hang when you try to start it.

    You will see the following in the panel that says Name and operating system
    Name:
    Type:
    Version: <-- This is where you make the change.
    DevynCJohnson likes this.
  3. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,162
    Likes Received:
    989
    Trophy Points:
    113
    Yes, as long as you have plenty of resources (RAM, CPU, etc.) you can have as many active VMs as you wish. As far as VM networking, I have heard of people doing it, but I do not know how. Good questions!
  4. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,162
    Likes Received:
    989
    Trophy Points:
    113
    Thanks for sharing that important info.
  5. Simon Mitchell

    Simon Mitchell New Member

    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    3
    Great article - Thank you for posting it!
    DevynCJohnson likes this.
  6. Pravin kumar Yadav

    Pravin kumar Yadav New Member

    Messages:
    4
    Likes Received:
    4
    Trophy Points:
    3
    Such authentic description to start with oracle vm
    DevynCJohnson likes this.
  7. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,162
    Likes Received:
    989
    Trophy Points:
    113
    Thanks!

Share This Page