Wednesday 31 January 2018

Posting Code to my blogs

For my own reference to add code to my blogs and not have it edited




Copy the code you want to display in the post

Open Simplecode 

Paste the code in the box and click on enter

Copy the resulting the code and you are done. Just paste the code in blog post to display the code as expected



Sample 1

Straight Paste

3
false
sound
Sound Card
sound
7
ensoniq1371
35 

From Simplecode

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>


Its adding the following
A tag called < code >
the < is replaced with & l t ;

Item

The  > is replaced with & g t ;
And a  < br  / >  added to the end of each line for a new line.



Convert a Virtual Box OVA to VMware OVF and deploy



Back in college and trying to deploy the demo lab machines. Images I got were Virtual Box OVA files that would not deploy direct to ESXi. Trying to import an Virtual Box OVA file into ESXi and I got errors. Disk was incorrect, wrong hardware, didn't know disk size and a few other errors.

Found a few sites describing the methods, but never had a full set of instructions.

Tried for a few hours and came up with the below.


Download the VMware OVFTools, login is needed to access the download (correct link on 31/1/2018)

https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL350&productId=352


Run OVFtool in Administrator mode and point it at your old
C:\Program Files\VMware\VMware OVF Tool>ovftool.exe E:\Downloads\Malware\Sniffer\Sniffer.ova E:\Downloads\Malware\SnifferOVF\sniffer.ovf


Open up the folder you converted to
Delete the mf file (Sniffer.mf) and edit the ovf file as follows

Then use a text editor to change the following sections in the .ovf file

Change the hardware to ESX suitable hardware



<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>

to

<vssd:VirtualSystemType>vmx-08</vssd:VirtualSystemType&gt;




Edit the Drive Type from SATA to a SCSI to suit VMware



<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>

to

<rasd:Address>0</rasd:Address>
<rasd:Caption>SCSIController</rasd:Caption>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSIController</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>




Delete the following section for the Sound Card (approx. line 100)

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>
</Item>



Then deploy your VM using vCenter/ vSphere Client. This will also deploy the vmdk for you as well.

KCCO