Wednesday, November 16, 2011

SSH into ESXi 5 host using public key

Just a little follow up on my previous post.

If you want to enable OpenSSH Public Key Authentication on your ESXi 5 host, append contents of your public key to /etc/ssh/keys-USERNAME/authorized_keys file instead of usual ~/.ssh/authorized_keys file.

For example, to enable public key logins as root user, do the following:
cat ~/.ssh/id_rsa.pub | ssh root@esxi.machine.com 'cat >> /etc/ssh/keys-root/authorized_keys'

Obviously, SSH server needs to be enabled on the ESXi host before you can do that. As I mentioned in my ESXi 5 installation write up, starting with vSphere 5 vSphere 4.1 you can easily enable SSH via ESXi's Direct Console User Interface (DCUI) or vSphere Client.

Friday, November 11, 2011

OpenSSH Public Key Authentication

Secure SHell is awesome. I think it is one of the most valuable, yet taken for granted tools in Sysadmin's arsenal. This post is about Public Key Authentication, a feature that makes remote access of multiple systems not only faster, but also more secure.

I won't talk about how public keys work. If you don't know it yet, you could learn more here. The point is, I use Public Key Authentication (PKA) very often, on all types of OS, to connect to a large variety of hosts. So here are my preferred ways to set it up.

Wednesday, November 9, 2011

Installing ESXi 5 on Intel DX58SO2 whitebox

Now that the parts have been assembled, vSphere 5 installer copied to USB thumb drive and BIOS updated, it's time for installation.

But first, a few BIOS tweaks. It appears that ESXi 5 installer refuses to run from my USB flash drive unless UEFI option in BIOS is enabled. To do that:
  • go to your BIOS Setup (press F2 during boot)
  • go to "Boot" menu
  • change "UEFI boot" option to "Enabled"
While we're here, make sure USB boot is enabled as well. Then go to "Security" and enable all options related to Virtualization. Plug your USB drive, save and exit.

By the way, there are two main reasons I went with this particular board. First, it's got two Gigabit network interfaces, meaning I can use it as firewall and/or router. Second, all components, including network and storage controller (except Intel's firmware RAID, a.k.a. Matrix Storage Technology), are supported out of the box. Once again big thanks to vm-help.com for maintaining their Whitebox HCL and forum. With no drivers to worry about, installation just takes care of itself.

While you're at the console, set your root password, configure your management interface and, a nice little addition to version 5, enable SSH and ESXi Shell.

It's almost too easy, compared to my last install.

Updating BIOS of Intel DX58SO2

Now that my new server is assembled I'd like to update BIOS to the latest version. Since I don't have Windows installed, I can't use the easy "Express BIOS Update" way. Luckily, Intel provides a way to do that without having OS installed at all. Thanks Intel, your commitment to making non-Windows user life easy will be rewarded with future purchases.

Here are the instructions from DX58SO2 manual:

Tuesday, November 8, 2011

Make VMware ESXi 5 LiveUSB installer on Mac OS X

I have used UNetbootin in the past to move VMware ESXi 4.0 installer to USB flash drive, since then, however, this great tool now also works on Mac OS X (in addition to Linux and Windows). Since my MacBook Pro is the only other computer I own at the moment, this is a great new development. Now let's do the same thing with ESXi 5!

One little note: UNetbootin won't see your USB drive if it's formatted as Mac OS Extended (Journaled) with GUID Partition Table. That's easy to fix with Disk Utility:
  1. select your USB drive from the list of devices on the left
  2. click on the "Erase" tab on the right
  3. choose "MS-DOS (FAT)" format
  4. click "Erase" button

Now on to create the LiveUSB VMware vSphere 5 installer. Open UNetbotin, enter your Mac administrator password and then:
  1. select "Diskimage" option
  2. browse to and select your previously downloaded VMware ESXi 5 Installer iso
  3. make sure your installing onto correct USB drive
  4. click "OK" and wait for wizard to complete

When wizard asks whether you want to overwrite menu.c32 file, answer "No". This will allow you to boot directly into ESXi installer and bypass Syslinux default blue boot menu.


Finish, eject and you're ready to install your sparkling new Hypervisor.

Update: as you can see in comments below, it seems these steps are not quite sufficient to boot ESXi installer. I also had to enable UEFI boot option in BIOS, while Raul added a kickstart configuration.