Tuesday, 24 November 2009

VMware ESX 4: Install From USB



This took a bit of searching and a fair bit of trial and error, but here it is, how to install VMware ESX from a USB stick.









Requirements
  1. A copy of VMware ESX 4.  Download an evaluation copy from here (free VMware logon required)
  2. A copy of UNetbootin from here. UNetbootin allows you to create bootable Live USB drives for a variety of Linux distributions including VMware ESX 4.
  3. A USB stick.  Nothing special is required here, for example I've got a couple of really cheap 1Gb sticks that work just fine.

How To
  1. Format your USB stick using Windows format.  FAT32 file system is fine:

  2. Once format is complete, leave USB stick plugged in and start UNetbootin:

  3. Select "Diskimage" and locate your ESX 4 iso file.
  4. Select your USB drive.
  5. Click OK and let UNetbootin extract and copy the ESX 4 installation and boot sector files on the USB
  6. Close UNetbootin and open USB stick in Windows Explorer
  7. Open the file syslinux.cfg (located in the root of the USB) with Wordpad - NOT Notepad
  8. Add askmedia to the end of each text section.  For example:
label ubnentry0
menu label Install ESX in graphical mode
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet

becomes:

label ubnentry0
menu label Install ESX in graphical mode
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet askmedia

Or alternatively replace the complete contents of syslinux.cfg with this:

default vesamenu.c32
prompt 0
menu title CH ESX4 Update 1 USB
timeout 100

label unetbootindefault
menu label Install ESX in graphical mode
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M quiet askmedia

label ubnentry0
menu label Install ESX in text mode
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M text quiet askmedia

label ubnentry1
menu label ESX Scripted Install using USB ks.cfg
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=usb quiet

label ubnentry2
menu label ESX Scripted Install to first disk
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=file:///usr/lib/vmware/weasel/examples/ks-first-safe.cfg quiet

label ubnentry3
menu label ESX Scripted Install to first disk (overwrite VMFS)
kernel /isolinux/vmlinuz
append initrd=/isolinux/initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=file:///usr/lib/vmware/weasel/examples/ks-first.cfg quiet

label ubnentry4
menu label ^Boot from first hard disk
kernel /ubnkern
append initrd=/ubninit

As you can see from the above, I've tweaked the boot menu to A) remove the "Default" entry B) Add a personalised boot menu title.

Save syslinux.cfg file back onto the USB and eject.

Easy and ESX installation is a lot quicker too!

- Chris

Tuesday, 17 November 2009

VMware ESX Trouble Shooting

Just recently I've had cause to analyse some VMware ESX logs in a bid to understand what was going on with a problematic ESX server and just what could be done to remedy the situation.

Up until now I hadn't given ESX logging much thought, mainly easing my conscience by thinking "Yea I'm sure ESX keeps a log of everything somewhere. It's Linux after all..!"

Well as I've discovered, its no longer time to keep parts of me buried in the sand, it's time to get looking at these logs.  After all they are there to help (I think) and with a bit of prior knowledge you too can start to understand "ESX log speak".

The first thing to realise with ESX logs is that there aren't just three (like Windows) there are in fact twelve!

Obtaining ESX Log Bundles
Rather than go delving around on a live ESX server, lets get the copies of the logs downloaded locally so that we can analyse them at our leisure.

Using the Virtual Infrastructure (VI) Client this is quite a simple thing to do:
  1. Logon to your Virtual Center or your ESX host directly
  2. File - Export - Export Diagnostic Data
  3. Select your ESX host, whether you wish to include Virtual Center Server and VI Client Logs and where you wish to download the logs to
Now just sit back and wait - it can take a while for the logs to be generated and downloaded.

Viewing the ESX Log Bundles
Now I'm sure that there are other ways to do this, but the method I find easiest is to use WinRAR.  Two reasons:
  1. WinRAR can open .tgz compressed files
  2. WinRAR's view function properly displays the log files are in a readable format.  - The only other to way view the log files in Windows is to open the files with Wordpad 
I don't normally bother extracting the .tgz bundle file, I just use the view function in WinRAR to show me the contents of the log files.

Which Log is Which?
OK on to the 'meat and potatoes' of this post.  Here is a break down of what is logged in each ESX log file.

Log File Name Details
/var/log/vmkernel Vmkernel Records activities related to the virtual machines and ESX host [1]
/var/log/vmkwarning Vmkernel Warnings A copy of everything marked as a warning or higher severity from vmkernel log. Easier to look through than vmkernel log [1]
/var/log/vmksummary Vmkernel Summary Used for avaialability and uptime statistics. Human-readable summary in vmksummary.txt
/var/log/vmware/hostd.log Host Agent Log Contains information on the agent that manages and configures the ESX host and its virtual machines
/var/log/vmware/vpx VirtualCenter Agent Contains information on the agent that communicates with VirtualCenter
/var/log/messages Service Console Log from the Linux kernel. Useful for underlying Linux issues. The kernel has no awareness of VMs running on the VMkernel [2]
/var/log/vmware/esxcfg-boot.log ESX Boot Log ESX Boot log, logs all ESX boot events [2]
/var/log/vmware/webAccess Web Access Records information on Web-based access to ESX Server
/var/log/secure Authentication Log Contains records of connections that require authentication, such as VMware daemons and actions initiated by the xinetd daemon
/var/log/vmware/esxcfg-firewall.log ESX Firewall Log Contains all firewall rule events [1]
/var/log/vmware/aam High Availability Log Contains information related to the High Availability (HA) service
/var/log/vmware/esxupdate.log ESX Update Log Logs all updates completed using the esxupdate tool

NOTES:
[1] Logs rotated by logrotate, see KB3402740. Rotated with a numeric extension, current log has no extension and the next newest one has a .1 extension.
[2] Log is symbollically linked to the current real file. Run an 'ls -l logname.log' to see the link.

What to Look For
This really depends on the error you are trying to troubleshoot!

A good starter for ten is to search for the text "error" in any of the logs ;o)

Further Information
Additional Reading:
  • VI3 Advanced Log Analysis - Powerpoint
  • Troubleshooting VMware ESX Server 3and VMware VirtualCenter 2 - PDF
  • Tips for Troubleshooting VMware ESX Server Faults - PDF
  • ESX Server 3 Log Map - link
  • Which ESX Log File - link
VMware Lab Presentation Videos:
  • Tips for Troubleshooting ESX Server 3.x Faults - Presentation (free VMworld login required to view
  • Troubleshooting VI3 - Presentation (free VMworld login required to view)
Conclusion
It's not possible to cover every eventuality in just one blog post. Hopefully the information provided here will at the very least set you on the right road to resolving ESX issues for yourself.

One final thought - All of the ESX issues I've come up against have a logical cause and hence a totally logical solution.  There are no smoke and mirrors here.  With that in mind, have fun.

- Chris

Sunday, 15 November 2009

Windows 7: All in One (32 & 64 bit) DVD - How To

Confused by the plethora of Windows 7 versions available?

Not sure what the difference is between Windows 7 Home Premium and Windows 7 Professional?

You want to encrypt the file system using Windows BitLocker but don't know which version to buy?

Let me assure you, you're not the only one.  All in all there are six 32bit and five 64bit versions available. 

Of all the Windows 7 version feature comparion charts I've seen, Wikipedia's chart is the best.

Still confused which DVD to get?  Don't be.  Have ALL ELEVEN versions on one DVD!

This method was originally posted here.

All In One - How To
1.  Requirements
Base Images / DVDs
As cited by Microsoft here: A closer look at the Windows 7 SKUs
2. Customers wanted upgrading to a different SKU to be easier.  So…for Windows 7, we are using a single image for all SKUs. This means the bits for all the editions are already on your computer if you are running Windows 7.  With Windows Anytime Upgrade, users can unlock and upgrade to a different SKU much easier than before.

So we are only going to need to get hold of two DVD's to make the all in one DVD (four if we are going to also add Windows 7 Enterprise):
  • Windows 7 Ultimate 32bit
  • Windows 7 Ultimate 64bit
  • Windows 7 Enterprise 32bit (Optional)
  • Windows 7 Enterprise 64bit (Optional)
I'm not going to tell you where to get these from.  Just remember Google is your friend.

ImageX
This is the main tool we will be using to create the DVD.
You will need the version to match the architecture of your current windows install.  ImageX can be downloaded from:

ISO File Manipulation Tool
I suggest something like MagicISO

2. Method
Once you have copies your original media, a copy of ImageX and MagicISO installed we are ready to start.

A) Create the following Folder structure from the root of C:\ :


B) Extract the Base Images / DVDs as follows:
  • Ultimate 64bit - to C:\Win7\64bit
  • Ultimate 32bit - to C:\Win7\Allbit
  • (Optional) Enterprise 64bit - to C:\Win7\E64
  • (Optional) Enterprise 32bit - to C:\Win7\E86
  • ImageX download extracted to C:\Win7\Imagex
C) Open a command prompt (Run as administrator if using Vista / Win 7) and copy and paste the in following one line at a time:

C:\Win7\ImageX\Imagex.exe /export C:\Win7\Allbit\Sources\install.wim 3 C:\Win7\Allbit\Sources\install.wim "Windows 7 HOMEPREMIUM"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\Allbit\Sources\install.wim 4 C:\Win7\Allbit\Sources\install.wim "Windows 7 PROFESSIONAL"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\64bit\Sources\install.wim 1 C:\Win7\Allbit\Sources\install.wim "Windows 7 HOMEBASIC x64"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\64bit\Sources\install.wim 2 C:\Win7\Allbit\Sources\install.wim "Windows 7 HOMEPREMIUM x64"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\64bit\Sources\install.wim 3 C:\Win7\Allbit\Sources\install.wim "Windows 7 PROFESSIONAL x64"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\64bit\Sources\install.wim 4 C:\Win7\Allbit\Sources\install.wim "Windows 7 ULTIMATE x64"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\E86\Sources\install.wim 1 C:\Win7\Allbit\Sources\install.wim "Windows 7 ENTERPRISE"

C:\Win7\ImageX\Imagex.exe /export C:\Win7\E64\Sources\install.wim 1 C:\Win7\Allbit\Sources\install.wim "Windows 7 ENTERPRISE x64"
Just leave out any the lines for any versions you don't want to include on your All In One DVD.

D) Open C:\Win7\Allbit\sources and delete the following files:
  • ei.cfg
  • install_Windows 7 STARTER.clg
  • install_Windows 7 HOMEBASIC.clg
  • install_Windows 7 HOMEPREMIUM.clg
  • install_Windows 7 PROFESSIONAL.clg
  • install_Windows 7 ULTIMATE.clg
E) If you used DVD media in step B), create an ISO image of Ultimate 32bit and save it to C:\Win7 folder.  Call the ISO "Win 7 All-In-One.iso"
If you used an ISO image, then create another copy of Ultimate 32bit and save it to C:\Win7 folder.  Call the ISO "Win 7 All-In-One.iso" 

F) Open "Win 7 All-In-One.iso" created in E) above in MagicISO:


Delete all files and folders from the image:


Add all files and folders from the C:\Win7\Allbit folder:


Observant readers will also notice I've added a Versions.txt and a Comparison.jpg to my ISO image.  These list the versions included in the image / DVD and detail the differences between versions respectively.

My complete DVD (including both Enterprise versions) weighed in at 3.9 GB.  Not bad.

Test
Save ISO and test in VMware / Virtual PC etc.  Burn using your favourite DVD burning program.

Ahh - now that's freed up some space in my DVD case!

- Chris

Monday, 9 November 2009

Slimbox2 Blogger Integration

Click on any image in this blog and you will see that it opens in a 'floating dialogue' above the current web page.  Perhaps Wikipedia describes it better:

On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of the image using a gliding animation.

This is achieved using a Java script called Lightbox, or it's clone (as I've used here) Slimbox.

So, the question is; how do you incorporate this into a Blogger / Blogspot blog?

Unfortunately the answer is not quite so straight forward.  The installation process can be broken down into four steps:

Step 1 - Obtaining The Script
This is the simple bit.
Download the Slimbox 2.02 script from here
You will also need JQuery 1.3.2 'minified' version from here
Rename this file from jquery-1.3.2.min.js to jquery-1.3.2.js


Step 2 - Modifying Script to work with Blogger Hosted Images
Here is the bit that took me ages to work through and understand. Hover over a couple of the images on this blog and you will notice that most of the images are hosted on http://*.bp.blogger.com/XXX

* being any number between 1 and 4
/XXX being some random url of letters and numbers

Unfortunately Slimbox2.2 script doesn't understand this random jumble of nunbers and letters and hence doesn't load when images hosted on bp.blogger.com are clicked.

The workaround is to open slimbox2.js (from the js folder in the downloaded slimbox-2.02.zip) with Wordpad.

Add the following to the bottom of the file:
jQuery(function($) {
$("a[href^='http://1.bp.blogspot.com'] > img:first-child[src]").parent().slimbox({}, function(el) {
return [el.firstChild.src.replace(/\/s\d+(?:\-c)?\/([^\/]+)$/, "/s512/$1"),
(el.title || el.firstChild.alt) + '
'];
});
});
Add the above three more times into slimbox2.js, each time incrementing the [href^='http://1.bp.blogspot.com']by one, so that you have separate code blocks for 1, 2, 3 and 4 .bp.blogspot.com

If anyone knows of a wildcard character to use here, I would be much obliged!


Step 3 - Hosting The Script
OK, so you have the script.
Next problem: Blogger doesn't have the facility to host java scripts.

OK, no issue. If you have a blogger account, then you have a google account and through you google account you can create websites using sites.google.com. These sites can be used to host java scripts.

Create you site and create a page at the top level.  Ensure that the page is a 'File Cabinet':

I called my page scripts.

Select the newly created scripts page and create two more file cabinet pages inside of scripts called css and js.

Your site map should now look like this:


Open the slimbox-2.02.zip downloaded in step 1 and upload the files
  • closelabel.gif
  • loading.gif
  • nextlabel.gif
  • prevlabel.gif
  • slimbox2.css
into the css folder.
Similarly upload the files:
  • slimbox2.js (the modified from step 2)
  • jquery-1.3.2.js
to the js folder created above.


Step 4 - Modify Blog Template
Log onto blogger, select your blog and then select Layout - Edit HTML.
Add the following three lines to the section of the target blog:
< link href='http://sites.google.com/site/XXX/scripts/css/slimbox2.css' media='screen' rel='stylesheet' type='text/css'/ >

< script src='http://sites.google.com/site/XXX/scripts/js/jquery-1.3.2.js' type='text/javascript'/ >

< script src='http://sites.google.com/site/XXX/scripts/js/slimbox2.js' type='text/javascript'/ >
Replace "XXX" with your google sitename.

Here's how it looks for me:



Testing
.bp.blogspot.com  Hosted Images
Because of the additional lines of code we inserted into slimbox2.js in step 2, you should just be able to click any image hosted .bp.blogspot.com and the slimbox script should launch and show the image.

Images Hosted Elsewhere
When linking to images hosted elsewhere on the web, add rel="lightbox" to display image in slimbox.

For example:
href="http://YOURHOST.com/YOUR_IMAGE.jpg" rel="lightbox" title="IMAGE_TITLE"

Job Done
So, as I say, not all that straight forward but hey, we've learnt a little about java scripting and how blogger host images!

- Chris

Monday, 2 November 2009

Ubuntu 9.10 - CH Installation Guide

Regular readers will have noticed that one of the countdown timers on this blog (they are gone now) was to the latest Ubuntu release - version 9.10 aka "Karmic Koala".

The Ubuntu developer team deliver two releases of Ubuntu per year.  One release in April (the year.04 release) and one in October (the year.10 release).  This makes the version released on 27 October version 9.10.

As you can probably guess, I'm a bit of a Linux fan.  It all started with Ubuntu. 

If you are a "Linux Virgin" and are completely baffled as to which of the seeming endless Linux distributions is for you then I whole heartedly recommend you start with Ubuntu.

I've been using Ubuntu on and off since 2007 and upon installation (on the same laptops each time), each release has had something that has caused me some level of head scratching and some degree of Ubuntu forum bashing.  Whilst this is fine for someone like me who wants to understand the workings of Linux, this doesn't make it all that suitable for the average user who wants to 'install and go'.

For example the 2007 releases had problems with my Wireless cards (mainly my fault), one of the 2008 releases had a problem with sound, last years October release had problems with video - specifically Intel display drivers.

However - at the risk of sounding like a gushy Linux convert (I'm not) - there was none of that post installation troubleshooting with Ubuntu version 9.10.  This latest version really is the easiest install I've ever done.

If you are interested in Linux, I whole heartedly recommend you try Ubuntu 9.10!


So, here goes with my own personal guide to installing Ubuntu.  What makes this different from the other 1001 Ubuntu installation guides out there?  Well to be honest, nothing.  My motivation here is to:
  1. Pull together my installation notes into one place 
  2. Make this available to all on-line.  If this helps you too then you are more than welcome!
So lets crack on.

CD Download and Burning
I'm not going to cover old ground here.  Instead here are some links detailing my recommendations.  I strongly advise you follow all the steps in this section as it is guaranteed to save you problems later on.
  1. Download CD ISO image from here.  Whilst there are several versions available (netbook remix etc), I go for the 32bit Ubuntu Desktop version.
  2. Once the download is complete, verify that the image has not got corrupted on route by checking the md5sum.  This page will help. 
  3. Boot the CD and select "Check CD for Defects".  I know this might seem overkill but I seem to make more 'coasters' when burning Ubuntu CD's than when burning almost anything else. 
Installation
So you've got the CD, it's verified a good 'un and your ready to go.
OK, here is what I recommend you do next:
  1. Connect the PC / Laptop you are installing Ubuntu on to your network using a NETWORK CABLE.  The installation will go off and connect to the internet to check for newer software packages during the install, so for ease use a cable.
  2. Boot the CD and choose "Try Ubuntu without any change to your computer".  This way we can verify that Ubuntu runs on our PC / Laptop before we commit to installing it.
  3. The rest of the install is detailed quite nicely in this video:


Notes from the video:
  • Step 4 (Prepare disk space) - I always erase and use entire disk
  • Step 5 (Who are you?) - Use first name only in all lower-case in the "What is your name" [the top] box.  To my eyes this makes the Ubuntu log on screen look tidier. 
Post Installation Add-ons
So you've got your Ubuntu installed and it's [hopefully] looking good.

As you can see, Ubuntu installs lots and lots of software 'off the bat'; Open Office, Firefox, Evolution email, Empathy instant messenger to name just a few.

Lets get on with real 'meat and potatoes' of this post, the post installation tasks.

Quick Note - Installing packages:
Linux applications are sometimes referred to as packages.  In my experience, when it comes to Linux software, the two terms are interchangeable.

There are three ways to install packages in Ubuntu:
  • Command Line:  Don't be afraid of the command line - it's really not worth it!  Using command line here makes it easier for me to post and for you to cut and paste into a terminal window.
  • Synaptic Package Manager: (System - Administration - Synaptic Package Manager). A nice GUI tool for installing applications. 

  • Firefox apt: Links: Where possible I've created links that when clicked from within firefox running on Ubuntu will achieve the same result as running the command line.  If you are using the links below and are prompted by Firefox as to which application to launch, select 'apturl' and 'Remember my choice for apt links':
 

Updates
The Ubuntu developer team are releasing updates all the time, so before we do anything else, lets get fully up to date. Open a terminal window (Applications - Accessories - Terminal) and paste in the following command:
sudo apt-get update
Once you are returned to the $ prompt, run:
sudo apt-get upgrade
and answer 'Y' to the install question.

Now that's done, we can move on to installing some additional applications.  

Restricted Extras
Put simply, this is a load of additional software Ubuntu aren't allowed to include in the distribution iso file we downloaded earlier.

See here for details of what's included.
sudo apt-get install ubuntu-restricted-extras
Or click here to install ubuntu-restricted-extras.

Clipboard Manager - Parcellite

Ubuntu has an annoying habit of clearing the native clipboard if the source window is closed before you complete the paste part of a cut and paste operation.

Luckily we can use a replacement clipboard manager to get around this issue.
sudo apt-get install parcellite
Or click here to install parcellite.

Launch from Applications - Accessories -  Parcellite

Media Player - VLC

Simply the best open source media player there is.  Will play virtually any kind of media you can throw at it.  Especially good when it comes to Internet Radio.
sudo apt-get install vlc
Or click here to install VLC.

Launch from Applications - Sound and Video - VLC Media Player

Firewall Control - Uncomplicated Firewall

Not strictly needed, but worth having anyway.

The simplest Firewall application I've found is the Uncomplicated Firewall GUI.  A nice easy to use GUI interface to the very complex Linux firewall.
sudo apt-get install gufw
Or click here to install the Uncomplicated Firewall GUI.

Launch from System - Administration - Firewall Configuration.


Backup - Back In Time

Backups. We miss them when we don't have them!  For simplicity again, I recommend Back In Time.

Install or use the following command:
sudo apt-get install backintime-gnome
Or click here to install Back In Time backup.

Launch from Applications - System Tools - Back In Time

FireFox Add-ons

OK, strictly not just for Ubuntu, but here is the list anyway:

- Addblock Plus and Filters
- British English Dictionary
- Custom Download Manager
- Vacuum Places Improved
- ProCon Latte Parental Control If the machine is going to be used by the kids.

I'm sure the there are more, but that's enough to be getting on with!

Star Gazing - Stellarium

Ever wondered what that bright star is in the sky?  How about trying to spot the Milky Way?  Then Stellarium is for you.

Install using the following command:
sudo apt-get install stellarium
Or click here to install Stellarium.

Launch from Applications - Science - Stellarium

Games

Highly recommend the playdeb website

Just browse games and install from there. Simple!





That's about it.

Now it's over to you to start using and customising your install further.  The Linux world is you oyster!

Other packages to look out for are:

  • Cisco VPN [details] - I've had this working, not tried in 9.10 yet.
  • FileZilla FTP [details] - File transfer
  • PDFEdit [details] - Edit PDF files

If you are really stuck, then try 100 of the best (useful) Opensource Applications

Looking at the Synaptic package manager as I write this, it has a total of 28,835 packages available for install.  That should keep you entertained for a while....
 
- Chris

Sunday, 1 November 2009

Religion. Decide yours now

The old religion chestnut cracked once and for all:

Follow the flow!

lol. Love the first three questions.

Via ffffound.com

- Chris

Newer Posts Older Posts Home