Archive for Scripts and Utiliites

As most of you know that read my blogs or twitter posts, I work with more than one virtualization vendor’s products. VMware has a huge library of virtual appliances, but it’s a bit of a hassle to convert them to other platforms.

Recently I’ve been working on upgrading our training and demo kits.  Part of our upgrade is to have the setups self documented by using a dedicated internal wiki on the kits themselves. I looked at several options including doing a fresh build from scratch.

Eventually, I found Turnkey Linux appliances. I like them because they aren’t already built appliances for one vendor;  instead, they are Ubuntu server .iso files with the software already installed and configured. That way you can install on pretty much any virtualization vendor that supports Ubuntu or Debian as a guest OS. Then it’s just a matter of installing the tools.

I installed a Mediawiki appliance on ESX  (New Virtual Machine>Ubuntu 32-bit, defaults on CPU and RAM and whatever size disk you want) and here are the post install steps to get the  VMware tools installed.

Refresh to the latest repositories.

  • apt-get update

Install the missing packages:

  • apt-get install gcc
  • apt-get install make
  • apt-get install linux-headers-2.6.24-23-generic (check your version of the kernel and match it)

Insert virtual CD ROM image by selecting  ”install vmware tools”  from the VM’s Edit  menu.
mount /dev/cdrom /media/cdrom
cp /media/cdrom/VMwareTools-xxxx.xxx…tar.gz  /tmp
cd /tmp
tar -zxvf VMwareTools-xxxxx.xxx….tar.gz
cd vmware-tools-distrib/
./vmware-install.pl

Select the defaults, you may have to tell it to use a newer version of gcc on one of the questions.

You should have the VMWare tools installed at this point.

Upgrade the system

  • apt-get upgrade

Start wikiing.

For those of us that prefer to script our installs instead of creating hand crafted environments, you’ll be thrilled to see that VMware has addressed a pretty annoying bug that has existed in 3.5 regarding vSwitch creation. No more jumping through hoops to make vmnics active. From the release notes :

Network adapters lose bonding during scripted installation
The esxcfg-vswitch -L command now works as expected and with the same functionality as in 3.0.x.

During a scripted installation, the following two commands did not result in a bonded pair of active network adapters on virtual switch VS_VM1. Instead, vmnic3 became the active adapter and vmnic4 became the standby adapter.
esxcfg-vswitch -L vmnic3 VS_VM1
esxcfg-vswitch -L vmnic4 VS_VM1

I am a VMware Certified Instructor, who teaches several classes, including the Install and Configure class, Deploy Secure Analyze class, and the FastTrack class.  I teach 50% of the time and perform Professional Services the other 50%.  In my opinion, I think the Install and Configure class should include some additional material that I typically find necessary, whenever implementing VI 3.5 for a new customer.  So, to accommodate my students, I like to provide a stanadard set of supplemental documents.  Some of these are created by New Age Technologies and some by VMware.   Take a look and let us know what you think.  I plan to update these documents continuously.

http://virtualizationinformation.com/docs/Supplemental_Documents.htm

- john a. davis

Between Windows-centric projects, I usually forget how to get a vbscript to read a text file with a list of servers and perform some action on them. So, I’m posting this one for that functionality mainly. This one happens to look for Network Adapter speeds. The MSDN site is a great resource to see all the Win32 Classes.

This isn’t necessarily pretty and I’m sure there’s better examples, but it gets the job done discovering necessary hardware information for virtualization planning.

This is from http://wyae.de/docs/img_dd.php. I wanted to copy it in case the site went away.
I have used this to P2V (Physical to Virtual) and V2P (Virtual to Physical) SuSE machines successfully and it worked great.

How to duplicate a complete PC via network

Imagine you get the task to quickly set up a number of identical workstations. Unfortunately either the available removable media (e.g. CD) is too small, or the imaging tool you use insists on not recognizing your favourite file system type (esp. Ext3, XFS, JFS, Reiser), or the duplication won’t work with your bizarre multiboot configuration. Here’s how to do with on-board tools. Read More→

Jan
10

Nessus on Virtual Machines

Posted by: ssnowden | Comments View Comments

The following is a copy of an article I wrote for Techrepublic.com about how I used Nessus on openSUSE virtual machines to scan enterprise networks.

Takeaway: Nessus is the de facto standard of vulnerability scanners. It’s free, runs on free operating systems, requires few hardware resources–and gets the job done.

The Need

Vulnerability assessments are one of the key tools that information security professionals use to learn about their network environment. With the increasing quantity of threat agents and government regulations that carry harsh penalties, businesses have to know where their security vulnerabilities exist and now to mitigate them.

Read More→