Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Wednesday, January 2, 2019

Build a VM using an OVA Template

On a previous post we have gone through a basic Windows 10 VM setup. A lot of steps involved, where we had to specify the RAM, CPU, Disk space etc. It would be nice if there was a template that can do that for us. Actualy there is.We can use OVA or OVF templates and actually extract that information to our Virtual Box. 

We can use 7zip and open any OVA file. For example the VyOS OVA was mentioned on another post



We can see that this file contains:
- OVF: An XML file that has various settings/options, for example CPU, RAM, HDD etc. 


We can see that this specific VM will use Linux - Debian x64 OS. 

  <OperatingSystemSection ovf:id="96" ovf:version="6" vmw:osType="debian6_64Guest">
      <Info>The operating system installed</Info>
      <Description>Debian GNU/Linux 6 (64-bit)</Description>
  </OperatingSystemSection>

- VMDK (Virtual Machine Disk) file
- Cert - A certificate that the OVA file is signed and needs to be trusted by our HyperVisor. 
- MF - Manifest file used for integrity checks. The MF file contains the SHA-1 hash of all files except the .mf (itself) and the .cert file, ovf and vmdk in our example. 

SHA1(VyOS-1.1.8-amd64.ovf)= 89cac831437d96ca728917e73227e895fd70e9eb
SHA1(VyOS-1.1.8-amd64-disk1.vmdk)= 21a7cdf0f47fa32ca148017f459c6d1ea59d777b 

As we can see the disk size is around 250MB and actually it does contain the installed OS. 



In other OVA files, for example the Cisco CSR 1000V we can see that the disk is a few kb (almost empty), so there is no OS installed. But we can also see that this OVA file includes the ISO image that we can use to install the Cisco Virtual Router. 



The manifest file is shown 

SHA1(csr1000v-universalk9.16.09.02-vga.ovf)= c7c2e4c299f055c841e061550392b0a43e1ecfc1
SHA1(csr1000v_harddisk.vmdk)= 94bdfb796ae9635b188e75efb52f5b895eca8340
SHA1(bdeo.sh)= aac24513098ec6c2f0be5d595cd585f6a3bd9868
SHA1(README-OVF.txt)= c5bb6a9c5e8455b8698f49a489af3082c1d9e0a9
SHA1(README-BDEO.txt)= 39bcf8ed259e5a9c9f1b5671f738fb904d73f635
SHA1(cot.tgz)= a305b8a9bc67e1f00d5b6ab8ac0c076f2af9f495
SHA1(csr1000v-universalk9.16.09.02-vga.iso)= 86400b573a6bcab7509aef22008b21db2d39c3f0



Cisco (CUCM) Call Manager 12.0.(1) OVA file: The last example doesn't contain any ISO files and the disks do not have an OS installed. Why should we use it? Some vendors, like Cisco have strict specifications when you create VMs. If you ignore the specific VM Requirements that are contained on the OVA file, then Cisco may not be able to offer you technical support, until you adjust your system to the correct settings. So we can use the OVA file to create the VM Settings and then download the ISO file and install the OS. 


Let's see how we can create a new VM using the OVA file

File > Import Appliance...



Load the OVA file

 
We are getting a Certificate warning (expired) but we can skip that, press Yes




Below we can see all the settings that the OVA file will select for us - we will only change the location Folder and press Import



Our VM has been automagically created and we can Power it on.


Or we can further Edit the VM. 





Sunday, December 30, 2018

Troubleshooting - VyOS - Failed to Start VM - VirtualBox

I exported the VyOS Application from the (VMWare) OVA Template provided on their Website
The installation was successful, I was able to login to the console and run the basic commands. The problem was that when I was putting the VM on pause state , I was not able to Start it again. 




Failed to open a session for the virtual machine VyOS-1.1.8.

Failed to load unit 'lsilogicscsi' (VERR_SSM_LOADED_TOO_LITTLE).

Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

I believe this was because I used the OVA Template that was provided by VyOS, instead of the ISO image. The OVA Template was optimised for a VMWare machine and I am using VirtualBox.

Let's see what the OVA file contains. We will open the file with 7zip 





The zip file contains a Disk (*.vmdk file). We will create a new VM from scratch and mount that extracted file.  

We will also extract (7zip) and then open the VyOS-1.1.8-amd64.ovf file using Notepad++ 

From there we can find all the necessary settings required, in order to create the VM, for example x1 vCPU, 512MB RAM etc.  






OS = Debian x64

 <OperatingSystemSection ovf:id="96" ovf:version="6" vmw:osType="debian6_64Guest">
      <Info>The operating system installed</Info>
      <Description>Debian GNU/Linux 6 (64-bit)</Description>

    </OperatingSystemSection>









Select "Use an existing Virtual Disk" and add the VyOS-1.1.8-amd64-disk1.vmdk file we extracted from the OVA file earlier. After that we can press create. The VM is now ready, so we can start it. 


We can now put the VM on pause state.


Thursday, December 27, 2018

Network Setup for your Virtual Environment

Once we have installed our Hypervisor, we can start implementing and inteconnecting various VMs.The VM adapter can run on different modes


  • NAT (Network Adress Translation) - Default Option
  • Bridged Adapter
  • Internal networking
  • Host-only networking
  • NAT with Port Forwarding
  • Not attached (No NIC)
NAT is a cool technlogy, but because I want to keep networking under my control, I avoid using it. For example, I want to give my VM Hosts specific IPs, I may want the internet traffic to path through a specific Router etc. 

With the NAT setup, each VM can get an IP Address from the Hypervisor, which also acts as a gateway in order the VMs to be able to access outside networks. 

You can setup the NAT networking, by simply going to File > Preferences...




Network TAB and Add new NAT network.




But as I mentioned I will not use any type of NAT networks on any of my Labs. My typical options are:
  • Internal networking - This is my option when I want to create a network that doesn't  have to communicate with the outside world.
  • Bridged Adapter  - This is my default option. The virtual NIC is bridged to one of the Phycial NICs of your Host. This is the easiest way to connect a VM to your physical network, and to the Internet. 
  • Host-only networking - I use this option when I want to connect my VMs with GNS3






Wednesday, December 26, 2018

Initial setup for your Virtual Environment (Oracle VirtualBox)

To test real life scenarios we will need different applications to run and work together, for example an Email, a (DS) Directory Services, a Domain Name System (DNS) , an NTP (Network Time Protocol) Server, a Router etc. Some applications can co-exist on the same “box”, for example a DS and DNS,  but in most cases we will need more than one servers.

So how can we run multiple servers on one physical entity. The answer is simple – Virtualization. We will need a HyperVisor, “a proccess that can create and run Virtual Machines”. (https://www.vmware.com/topics/glossary/content/hypervisor)

There are two different paths that we can choose.

1. Install a Type-2 Hypervisor on top of our Operating System (OS) such as
VMWare Workstation Pro: https://www.vmware.com/uk/products/workstation-pro.html
Oracle Virtual Box: https://www.virtualbox.org/wiki/Downloads

2. Install a Type-1 (Bare Metal) Hypervisor, for example
VMWare ESXi: https://www.vmware.com/uk/products/esxi-and-esx.html
Microsoft Hyper-V: https://www.microsoft.com/en-us/evalcenter/evaluate-hyper-v-server-2019

The Oracle Virtual Box Hypervisor will be my choice, since it is free to use and also VirtualBox is a Type-2 Hypervisor, so the Application runs inside the Operating System. This means that we won’t need another Computer to connect and administer our environment, our (Virtual Machines) VMs.

The installation is very simple. We will use Windows 7 OS.  I think Windows 7 is a very stable OS, it runs much faster and uses less resourses than any newer Windows version. In addition, I have disabled most Visual Effects, to improve performance. I want my OS to use minimum resources, since most of CPU, RAM and Disk will be consumed by my Virtual Environment.  If my OS is taking up a lot of resources, then my VMs will suffer.

The current Virtual Box release (2018-12-26) is VirtualBox-6.0.0-127566-Win
You can also find a beta version that may support more features









Okta Workflows - Send Customised Email

Simiar to the previous flows, where we sent a Slack message to users assigned to a new app, we can send a Welcome Email message. This mess...