Archive for the ‘ESX’ Category

To logoff a SSH session in Putty hit Ctrl + d

If you don’t have console access to your ESXi host but have SSH connectivity, use the following commands to restart and shutdown the host.

To shutdown type :

poweroff

The reboot command usage is as follows :
Usage: reboot [-d<delay>] [-n<nosync>] [-f<force>]

Options:

 -d delay interval for rebooting
 -n no call to sync()
 -f force reboot(don’t go through init)

EG. reboot -d 0 -f (force reboot now - no delay)

By default, SSH communications are disabled on ESXi. It can be easily enabled by accessing the service console - which is hidden on the free edition.

1. From the server’s console - Grey and Yellow screen, hit ALT + F1 to access the console.

2. Type: unsupported

You will not be able to see the input of this command. If you input the command correctly, you will see the Tech Support Mode warning and the password prompt.

3. Enter the root password

You won’t be able to see the input of this command either. If the password is entered correctly you will be dropped to the command line prompt: ~ #

4. The inetd.conf file has to be modified to enable SSH. To edit the file type:

vi /etc/inetd.conf

Use the down arrow key to scroll through the file. Look for the line that starts with “#ssh”.

5. Remove the “#” by pressing the “x” key when the cursor is on the character - #.

6. Hit ESC and type in :wq! to save the file and exit vi.

 If a mistake is made, press ESC and type in :q! to quit vi without saving the file.

7. Now that SSH has been enabled, the management services have to be restarted. To do this type :

/sbin/services.sh restart

8. Hit ALT + F2 to return to the home screen - Grey and Yellow Display screen.

I was playing around with Ubuntu on ESXi 3.5 (free edition) when I ran into some trouble installing the VM Tools package on my guest VM. After successfully installing it on Ubuntu server 9.04 - with GUI, I decided to create a new VM and install Ubuntu Server 9.10 - without the desktop GUI (X11).

After researching many forums and help files, I was able to install the package. Many thanks to all who helped me out a long the way! Now back to it.

The package to install is called open-vm-tools. It’s been released by VMware as an open source project. Unfortunately, it doesn’t include an installer so several steps have to be followed to compile and install it.

NB. All commands must be run with root level access or via sudo commands. Before attempting the below steps, make sure you have console access to the server. During the install network connectivity is lost. If a SSH session is used you won’t be able to finish the install.

After installing the server, log in and gain the necessary access, type:

sudo bash

then enter the account password.

Then type:

apt-get update

Then type:

apt-get dist-upgrade

Now that the linux kernel has been updated, the system should be rebooted. Type:

reboot

When the system comes back up, log in and gain root access as above. Then type:

apt-get install open-vm-tools

This is the point where network connectivity fails; it has to be restarted. Type:

modprobe pcnet32
/etc/init.d/networking restart

Now the installer needs to be built and installed. Type:

module-assistant prepare open-vm
module-assistant auto-install open-vm

** If the above command fails, refer to the troubleshooting section below.

Now that the package is installed, the “initramfs” file needs to be modified so the VMware accelerated NIC will be loaded at boot time. To modify the file, type:

echo vmxnet >> /etc/initramfs-tools/modules
update-initramfs -u

Now another reboot is required, type:

reboot

VM Tools is installed…
Troubleshooting:

If installing on Ubuntu 9.04, the command: module-assistant auto-install open-vm will fail. There is a patch available though. It get it type:

cd /usr/src

Then type :

wget http://launchpadlibrarian.net/25819719/vmhgfs-2008-11-18-jaunty-lenny.diff

To install the patch, type:

patch -p0 < vmhgfs-2008-11-18-jaunty-lenny.diff

Now the auto-install command can be re-run. Type:

module-assistant –not-unpack auto-install open-vm

NB. There are 2 dashes before the word not-unpack. EG. - -not-unpack (no space between dashes)

Continue on and modify the initramfs file. Reboot to complete the install.