Showing posts with label esxi. Show all posts
Showing posts with label esxi. Show all posts

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.

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.

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.

Saturday, June 26, 2010

Quickly create VMware ESXi 4 LiveUSB

I recently discovered that it's possible to create a VMware ESXi 4 install USB using nothing but UNetbootin and official VMware ESXi 4 ISO file. Why would I want to do that? So I can install ESXi on servers without CD/DVD drives, they have become quite common lately. USB install is much faster than installing from optical media, and you save environment by not wasting a blank CD on a software version that will become outdated in three months or so.

In the past I have used a great little Bash script by Varazir that allows you to not only make a bootable USB with ESXi on it, but can also customize and merge various drivers into the install image. However, if all you need is a vanilla install, UNetbootin makes it a lot easier and works on both Windows and Linux platforms.

Just choose the "Diskimage" option and browse to your VMware ISO and you'll have a installation USB drive in no time.

unetbootin

Friday, May 7, 2010

Some VMware gotchas

Had to troubleshoot a couple of VMware ESXi related errors at work this week, noting them here for my future self or anyone else looking for solution.

First problem occurred when I was moving a a 64bit SLES 9 virtual machine to a newly provisioned ESXi test host. The server in question was HP ProLiant DL360 G5 with Intel Xeon 5150 CPU. The CPU supports 64bit and VT, but when I started the virtual machine I got the following error:

Your CPU does not support long mode. Use a 32bit distribution.

Apparently the Virtualization Technology (VT) feature was not enabled in BIOS and ESXi could not run a 64bit guest OS without it. Pretty simple fix: reboot and reconfigure the BIOS settings to enable CPU's VT feature.

Next problem occurred when I upgraded one of the virtual machines. This VM was running 32bit Ubuntu 8.04 Hardy JeOS with VMware Tools Operating System Specific Package (OSP). I uninstalled the OSP using apt-get, upgraded the kernel and then attempted to re-install VMware Tools using .tgz package, but was greeted with the following error:

VMware Tools cannot be installed, since they have already been installed using
a package-based mechanism (rpm or deb) on this system. If you wish to continue,
you must first remove the currently installed VMware Tools using the
appropriate packaged-based mechanism, and then restart this installer

Execution aborted.

I double and triple checked, all VMware packages were removed, so what's the deal? After looking into the installation script vmware-install.pl, I saw that it checks for existence of DSP marker file /usr/lib/vmware-tools/dsp and displays the above message if file exists. I found that file being the sole resident of the /usr/lib/vmware-tools directory so I simply removed the file and the directory. Not sure why this file was left behind, but after that I was able to proceed with installation.

Monday, April 19, 2010

Import virtual appliance without vSphere client

ovftool-150

Since I don't have a Windows or even a non-Mac GUI machine at home, I have been looking for an easy way to import/export VMs and virtual appliances to/from my Whitebox ESXi server without VMware vSphere/Virtual Infrastructure (VI) client or Standalone Converter.

The solution came in the form of VMware Open Virtualization Format Tool, ovftool for short. This command line utility comes in Windows or Linux flavours and allows you to quickly probe, convert, compress, export and import virtual machines. Here are some of its feature highlights:

  • Supports both import and generation of OVA packages
  • Directly converts between any VI, VMX, or OVF source format to any VI, VMX, or OVF target format
  • Accesses OVF sources using HTTP, HTTPS, or FTP, or from a local file
  • Deploys and exports vApp configurations on vSphere 4 targets
  • Provides options to power on a VM after deployment, and to power off a virtual machine before exporting
  • Show information about the content of any source in probe mode
  • Provides context sensitive error messages for vSphere sources and targets, showing possible completions for common errors, such as an incomplete vCenter inventory path or missing datastore and network mappings
  • Provides an optional output format to support scripting when another program calls OVF Tool

Exactly what I need. I downloaded and installed Linux version to my headless Ubuntu server and was able to quickly deploy a sample virtual appliance to my ESXi server with the following command:

$ ovftool /path/to/test.ova vi://root@esxi.lan

For a slightly more interesting test I renamed the VM and told it to power on after import:

$ ovftool –-name=NewNameForVM –-powerOn /path/to/test.ova vi://root@esxi.lan

Now to power off a VM and export it as a Virtual Appliance:

$ ovftool –-powerOffSource vi://root@esxi.lan/ResourcePoolA/someVM01 /path/to/template.ova

For more documentation see VMware site.

Saturday, April 17, 2010

Installing ESXi 4 on P6T SE whitebox

esxi-server-150

I think VMware ESXi server is something marvellous. Being able to create multiple virtual machines with different operating systems, apps and configurations, simulate multiple networks, routers and switches, and all in one single server – pure awesomeness! And best part is – it's free.

After putting together acquiring my new whitebox server it was time to reward it with a spanking new OS. Some prior research indicated that not all onboard components were supported by ESXi 4 and some geeky tweaking would be required. Luckily I was armed with a pretty good resource on how to get ESXi working on my server. Huge thanks goes to vm-help.com and its community.

After checking the Whitebox HCL, I knew I might have some problems with my onboard Realtek NIC (have seen that before) and possibly JMicron IDE controller. But there is a way to load precompiled drivers before or, if you are lucky, after the install. This can be achieved by creating a custom oem.tgz package that should contain your device drivers and file to tell OS what those devices are by mapping their PCI IDs to drivers.

First step is to get the PCI IDs of my hardware. Once again vm-help.com had it covered for me. I booted my server with Ubuntu Live USB, never leave your house without it, and ran this command:

$ lspci -nn

Here's how the devices in question show up, the [10ec:8168] and [197b:2363] are the PCI IDs I was looking for:

04:00.0 IDE interface Mass storage controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller [197b:2363]
06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 02)

Next step is to create custom oem.tgz package and, in my case, merge it with installation image, since ESXi would refuse to install after failing to detect the Realtek NIC. It's quite a bit of pain to do by hand, so I decided to try a very neat little automation script by Varazir that can bundle it all for you nicely plus gives you a ton of additional features to choose from. In particular, things like:

  • enabling SSH, FTP and Rsync on your server
  • merging your custom oem.tgz file into installation ISO
  • creating a live or installation USB image

All I needed was the original ESXi ISO image, a custom oem.tgz file with drivers for my hardware, large enough USB stick and that script. I already had three out of four, just need those drivers. I must have been lucky, because the first community package I tried worked. It already had both JMicron and Realtek drivers and with the Varazir's script I had the installation USB with my drivers and extra features in minutes. I only had to do a small tweak to oem.tgz file to update the simple.map file with PCI IDs for my system.

I am now a proud owner of a Whitebox ESXi 4 Server!