Howto enter VMware ESXi license key after it has expired

Posted by & filed under Virtualization.

vmware-esxi-5-license-has-expired“Disable VMware ESX” is the warning message that is displayed when you open your VMware vSphere Client after the 60-day evaluation period has expired without typing in a new license key for your free VMware vSphere Hypervisor 5 install. You cannot type in the license key in the vSphere Client after the evaluation period has expired. If you do not type in the key before it expires you will not be able to power on VMs after they have been powered down.

This is a short howto describing how you can type in the license key for you free VMware Hypervisor after it has expired, since you cannot use the vSphere Client.
This requires that you have enabled the SSH service on your host before it expired and you can access it using your favourite SSH client to your ESXi host.
The file should look something like this if you have not entered any license information 00000-00000-00000-00000-00000.
This key should be replaced with the key you have gotten from VMware http://www.vmware.com/products/vsphere-hypervisor/ when you downloaded the installer file.

This is a step by step description of how you can update the license file

  1. Start a SSH session to your ESXi host using your favourite SSH client like Putty
  2. Log in with the username root (unless you have changed it to something else)
  3. Open the file /etc/vmware/vmware.lic using the vi editor
    ~# vi /etc/vmware/vmware.lic
    vmware-esxi-5-license-has-expired
  4. Delete the old license key with the dd command
    vmware-esxi-5-license-has-expired-putty02
  5. Insert a new license key by with the i command
    vmware-esxi-5-license-has-expired-putty03
    vmware-esxi-5-license-has-expired-putty04
  6. Save the file using the write command w
    vmware-esxi-5-license-has-expired-putty05
  7. Now you can open a new vSphere Client window and see if the license warning windows appears again. If it does not, then you have successfully updated the license key. If not, then you need to check if the license key is typed in correctly.

All this can be done without a reboot of the ESXi host.

Disable Windows super key in Ubuntu

Posted by & filed under Linux, Windows.

I am running a virtualized Windows 8 installation on VMware Worlstation in Ubuntu 12.10 and this can be confusing since the window manager uses the same key as my Windows machine to open the launcher. Therefore I use to disable the super key in Ubuntu so that only my Windows machine responds to the key.

This is one way to disable the super key from a console window as the user you are logged in with:

# dconf write /org/compiz/profiles/unity/plugins/unityshell/show-launcher '""'

This command does not require a logoff or restart so you can test the behaviour of the Windows super key immediately.

Howto mount UDF ISO-13346 ISO file in Ubuntu

Posted by & filed under Linux.

This is just a short note on how you can mount a UDF ISO-file in a Ubuntu console window.

# sudo mount -t udf,iso13346 -o loop ISO-filename.iso mountpoint

Remember to create the mountpoint folder before you try to mount the ISO file.

Script to delete files listed in a file

Posted by & filed under Linux, Scripting.

This is a short one liner bash script to delete files in a file.
The script also handles filenames with space in them.

# while read file; do rm "$file"; done < filename.txt

To generate a filename.txt file by searching for a specific pattern you can use the following command

# find / -type f -name "filname*" > filename.txt

Rotate and rename images according to their EXIF info

Posted by & filed under Linux, Photo etc, Scripting.

This is my short script to rotate and rename image files accoring to date captured based on their EXIF info.
You need jhead and exiv2 to run this. These two programs are also available in Windows and only require you to make small changes to work there as well.

#!/bin/bash -x
echo Rotating JPEG file(s)
jhead -ft -autorot D*.JPG

echo Rename(ing) file(s)
exiv2 -r '%Y%m%d-%H%M_:basename:' rename $(ls D*)

The files are then named like this (YYYYMMDD-HHDD_OriginalFileName.extension)

20120924-1320_DSC1234.JPG
20120924-1320_DSC1234.NEF
...

This script has been tested on Nikon D80 and D7000 image files.