How to manage an ESXi host from OSX

If you need to manage ESXi hosts using your MAC, with “ESXi Embedded Host Client” you can manage it through the browser!
Simply, SSH into your ESXi host and run the following commands, no need to reboot:

esxcli software vib install -v http://download3.vmware.com/software/vmw-tools/esxui/esxui-signed-4493986.vib

esxcli software vib install -v http://download3.vmware.com/software/vmw-tools/esxui/VMware-Remote-Console-9.0.0-MacOS.vib

Reference:
https://labs.vmware.com/flings/esxi-embedded-host-client

Upgrade to ESXi 6.0 Update 2

While upgrading to ESXi 6.0 Update 2 you receive:

VIB VMware_bootbank_esx-base_6.0.0-2.34.3620759 requires vsan >= 6.0.0-2.34, but the requirement cannot be satisfied within the ImageProfile.

Run:

esxcli software profile update -p ESXi-6.0.0-20160302001-standard -d /vmfs/volumes/datastore1/updates/update-from-esxi6.0-6.0_update02.zip

Determine the build number and the latest update applied by running the command:

vmware -vl

Reference:
https://my.vmware.com/group/vmware/patch#search
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2144595

AWS SSH Tricks

Here some simple steps for creating an additional user and copying their public ssh key:

Download private key, secure file:
chmod 600 myPrivateKey.pem

Publish .pem private key to OSX keychain:
ssh-add -K myPrivateKey.pem

Copy publickey to server
scp myPublicKey.pub user@ip:~

Create user, move key to
sudo adduser [new user] sudo
sudo mv myPublicKey.pub /home/[new user]/

Switch to su [new user]
mkdir ~/.ssh
chmod 700 ~/.ssh
sudo cat myPublicKey.pub >> ~/.ssh/authorized_keys

If errors you may need to take ownership:
sudo chown -R [new user]:[new user] /home/[new user]/.ssh/authorized_keys

Check key and logon:
cat authorized_keys
ssh [~.amazonaws.com]

Secure files:
chmod 600 ~/.ssh/authorized_keys

Copy files and directorys to AWS server:
scp -r * [ip]:~/temp/

Also use this to add pub direct:
cat myPublicKey.pub | ssh user@[ip] “cat >> ~/.ssh/authorized_keys”

Reference:
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys–2
http://blogs.aws.amazon.com/security/post/Tx3N8GFK85UN1G6/Securely-connect-to-Linux-instances-running-in-a-private-Amazon-VPC

Upgrade ESXi 5.x to 6

How to update ESXi 5.x to the latest build of 6

Sign into VMware and start the trial for VMware vSphere:
https://my.vmware.com/group/vmware/evalcenter?p=vsphere6

Use VMware Software Manager to download VMware-ESXi-6.0.0-2494585-depot.zip
http://www.vmware.com/products/software-manager/

Using vSphere Client upload to local datastore, enable SSH, enter maintenance mode and run the following command:

esxcli software profile update -d /vmfs/volumes/datastore1/updates/VMware-ESXi-6.0.0-2494585-depot.zip -p ESXi-6.0.0-2494585-standard

Reboot and verify version 6.0.0, 2494585

vmware -vl

Download and apply latest patches:
https://www.vmware.com/patchmgr/findPatch.portal

esxcli software vib update -d /vmfs/volumes/datastore1/updates/ESXi600-201504001.zip

Reboot and verify version 6.0.0, 2615704

Reference:

http://www.vladan.fr/easily-upgrade-esxi-5-x-to-the-latest-esxi-5-5-update-1-via-cli/
http://www.v-front.de/2015/03/vsphere-6-is-ga-ultimate-guide-to.html

Cisco ASDM “Unable to launch device manager”

Seems every time theres a Java update ASDM breaks…

A simple fix is to access via Firefox https://(your IP) and run the ASDM through the browser. Once you successfully connect you will have a new shortcut on the desktop for the ASDM, fixed!

If for some reason you don’t have the shortcut, open Control Panel->Java Control Panel and under Temporary Internet Files select View, click ASDM and on the top toolbar there a button to create a shortcut on your desktop.

Note: don’t bother with IE11 as the quantity of hoops you need to jump through to get it to work will just drive you nuts.

Reference:
https://supportforums.cisco.com/discussion/12077481/unable-launch-device-manager-asdm-issue

Upgrading Ubuntu to 14.04 “not enough free disk space” on ‘/boot’

While upgrading Ubuntu to 14.04 you receive the error “not enough free disk space” on ‘/boot’ you need at least 57m free.

Check your space:

fdisk -l &&df -h

List unused images:

dpkg -l | grep linux-image

The fix, this removes all unused kernels:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.*)-([^0-9]+)/1/")"'/d;s/^[^ ]* [^ ]* ([^ ]*).*/1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Check space, reboot and rerun upgrade:

fdisk -l &&df -h

References:
Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers
Can’t upgrade due to low disk space on /boot

Enable Copy and Paste within vSphere Client

To enable the copy and paste option for all virtual machines in the ESXi host:

  1. Log in to the ESX/ESXi host as a root user.
  2. Take a backup of the /etc/vmware/config file.
  3. Open the /etc/vmware/config file using a text editor.
  4. Add these entries to the file:

    vmx.fullpath = “/bin/vmx”
    isolation.tools.copy.disable="FALSE"
    isolation.tools.paste.disable="FALSE"

  5. Save and close the file.

The Copy and Paste options are only enabled when the virtual machines restarts, and you must have vmware tools installed.

Unable to manage a VM with version 10 with the vsphere client

If your using VMware’s Hypervisor V5.5 you may come up with the error where you cannot manage your VM using the vSphere Client due to the VM version being 10 which can only be managed through the CLI or the webclient, the fix is to downgrade using the vCenter Converter Standalone, located here:
Download  VMware vCenter Converter Standalone

Now you’ll be able to convert from version 10 to 9 and manage your VM.

Install VMware Tools for Linux Distros

icon-linuxWhen you goto install VMware Tools for Linux on a vSphere Hypervisor 5.5 virtual machine you receive this error:

vix error code = 21001
Unable to install VMware Tools. An error occurred while trying to access image file “/usr/lib/vmware/isoimages/linux.iso” needed to install VMware Tools

Here’s the fix:

Download the “VMware Tools CD image for Linux Guest Oses” from:  https://my.vmware.com/group/vmware/evalcenter?lp=default&p=free-esxi5
Rename this to linux.iso
Access your local-datastore via the Datastore Browser within vSphere Client and navigate to .locker/packages
Create directories /5.5.0/vmtools
Upload linux.iso into .locker/packages/5.5.0/vmtools
Retry thats it!

Background

symbolic link exists for /usr/lib/vmware/isoimages -> /productLocker/vmtools
symbolic link broken for /productLocker -> /locker/packages/5.5.0

References:

https://my.vmware.com/group/vmware/evalcenter?lp=default&p=free-esxi5
https://www.vmware.com/support/developer/vix-api/vix110_reference/errors/errors.html

Installing VMware Tools in a Kali VM

icon-kali

While installing VMware tools on a Kali Linux 64 Bit v1.0.5 virtual machine you’ll receive these errors:

The path “” is not a valid path to the 3.7-trunk-amd64 kernel headers.
Would you like to change it? [yes]
Enter the path to the kernel header files for the 3.7-trunk-amd64 kernel?

The header files are missing, here’s the fix:

Complete the install, paste the below code and rerun the installer.
echo cups enabled >> /usr/sbin/update-rc.d
echo vmware-tools enabled >> /usr/sbin/update-rc.d
apt-get install gcc make linux-headers-$(uname -r)
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/

Notes:

Use the following commands to copy/extract/install:
cp VMwareTools-*.tar.gz /tmp/
tar zxpf VMwareTools-*.tar.gz
sudo ./vmware-install.pl -d

References:

https://www.vmware.com/support/ws55/doc/ws_newguest_tools_linux.html