Using VirtualBox to Generate a Compatible VM Template
Introduction
VirtualBox is a hypervisor developed by Sun Microsystems (now Oracle) that is designed for desktop virtualization. VirtualBox is a desktop solution for building new VM templates for use in Abiquo. This document describes how to create a new OVF virtual appliance with VirtualBox.
This tutorial will show how to install an OS distributed as an ISO image. In this example we will use a very simple Linux distribution, ArchLinux. This distribution is perfect for cloud environments because of its minimalist approach. You can download the ISO image from the download page.
Create a New Virtual Machine
This VM will mount the ISO or other install disk. To guarantee compatibility across different hypervisors, configure it with the specified virtual devices.
To create a new VM:
- Click the New button on the main screen.
The Create New Virtual Machine Wizard will open. - Enter a Name for the virtual machine, archlinux, for example.
Select Linux as the Operating System
Select Arch Linux as the Version.
Click Next to continue. - Select the amount of memory needed by the operating system. 512 MB should be enough. Click Next to continue.
- Select Create a virtual hard drive now and click Create
- Select a hard disk format that is compatible with your hypervisors. See Template Compatibility Table.
For example, for KVM hypervisors, you could select QCOW; for VMware hypervisors, you could select VMDK; and for Hyper-V, you could select VHD. - If required, select dynamic or fixed disk.
- Fixed Size will convert to other hypervisor formats more quickly than dynamically allocated.
- Dynamically allocated will produce a smaller disk file when the disk is not very full.
- Click Next to continue.
- Enter the Name of the virtual disk, archlinux would be a good name (VirtualBox will add an extension). You can also change the default path by clicking on the icon to the right of the text box.
This disk will be the disk the Operating System will use. - We will now create a Virtual Disk of 2 GB; this is enough for basic tasks in an operating system. If you need to perform more complex tasks, do not hesitate to create bigger disks. Remember that disks of more than 2 GB will be broken into multiple parts by the browser upload in the UI. If you use manual upload for a larger disk, then you will need to create an OVF file for your disk.
Enter 2.00 GB. Click Create to continue.
A VM summary may display. - If required, click Create to continue.
Modify the VM for maximum hypervisor compatibility
You must now modify the VM so that it will work for several hypervisors. To modify the VM, follow these steps:
- Select the archlinux virtual machine from the list in the left pane and click Settings.
- Set the Boot Order
- In the left pane click System.
- In Boot Order, disable Floppy and Network.
- Enable the SCSI Controller
- In the left pane click Hard Disks.
- Check Enable Additional Controller and select SCSI (LsiLogic).
- Mount the ISO
- Below Hard Disks in the left pane click on CD/DVD ROM.
- Select the Mount CD/DVD Drive checkbox and select ISO Image File.
- Select the ISO image downloaded at the beginning of the process in the combo box.
- Optionally Disable Audio
- If you do not require audio, click Audio
- Unselect Enable Audio
- Add Bridged Adapter
- Click Network and then on the Adapter 1 tab:
- Select Enable Network Adapter,
- Select the Adapter Type from the combo: choose *Intel PRO/1000 MT Server (82545EM)
- Abiquo also supports more network adapters, such as VIRTIO on KVM
- Change Attached to from its current value to Bridged Adapter
- Verify that Name points to an existing and valid Network Adapter Type in this host.
- Now go to Adapter 2 tab and REPEAT the same steps. You can choose the same Name for the Network Adapter Type.
- Click Network and then on the Adapter 1 tab:
- Optionally disable USB
- Optionally go to USB and deselect Enable USB Controller. For valid settings choose a non-USB pointing device on the System tab.
- Click OK to finish.
Install the operating system
Now install the operating system. To ensure the best performance in Abiquo:
- Configure the network to get all the configuration from DHCP. Remember to remove the MAC address from network scripts.
- Install openssh daemons. Users will probably not have console access to the OS.
- Do not install XWindows. Install the OS to run in text mode.
Template Upload Methods
You can upload your template to the cloud platform:
- Using the UI:
- select a VM disk, and completing the template details, such as CPU, RAM and disk capacity
- select an OVA file
- select an ISO file and reinstalling your VM with the operating system from the ISO
- Manually, as a VM disk with an OVF file containing the template details required by Abiquo
Export an OVA file
To export an OVA file:
- In the main menu go to File > Export Appliance and select your appliance (In this example, archlinux).
- Click Next to continue.
- Enter the name of the File and path where VirtualBox will store the OVA
- Click Next
- Click Export
Export an OVF file
For manual upload to Abiquo, we will use a separate OVF descriptor.
To export an OVF file and compressed virtual disk:
- In the main menu go to File > Export Appliance and select your appliance (In this example, archlinux).
- Click Next to continue.
- Enter the name of the File and path where VirtualBox will store the OVF
- Change the file extension from .ova to .ovf.
- Do not select the options to Write Legacy OVF 0.9 or Write manifest file.
- Click Next to continue.
- Enter the virtual machine details
- If you are using manual template upload, then you should complete at least the Description.
- If possible, you should complete the other Product details too.
- Click Export to start the conversion. The process can take several minutes, so please be patient.
Edit the OVF File
Edit the OVF file to ensure that it contains useful information to display your template.
For details of Abiquo OVF support, see OVF Reference. Abiquo supports OVF files with multiple virtual machine disks
To prepare the OVF file for use by the Abiquo platform:
- Edit the .ovf file created by VirtualBox in the previous step
- Search for the ProductSection
- For Abiquo, the ProductSection holds the information about the template for display in the Apps library. It must contain:
- Info
- Product
- Icon
- ovf:fileRef: URL of the icon file
- ovf:mimeType: jpeg, png or gif
- ovf:width: pixels
- ovf:height: pixels
The ProductSection should be similar to the following example. Check the details of your VM template and add the Icon details in the product section. The Icon URL must include a publicly visible IP address or domain name (not 127.0.0.1 or localhost).
<ProductSection> <Info>Abiquo - server machine</Info> <Product>Abiquo - server machine</Product> <Icon ovf:fileRef="https://rs.bcn.abiquo.com:443/public/icons/q.png" ovf:mimeType="image/jpeg" ovf:width="32" ovf:height="32" /> </ProductSection>
Add the VM Template to the Catalog
You can now add the VM template to the catalog of the multi-cloud platform. See Adding VM Templates to the Appliance Library
Or you can add the VM template to a Template Repository, to enable users to download it to the catalog. See Template-Repository Documentation
Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved