VMware

Probably you’ll use the Virtual Infrastructure Client most of the time to manage your ESX Servers, but in some cases you need/want to perform some actions from within the service console. In this post I will sum up some useful commands (just for a reference).  This post will be edited throughout time

How to determine the Linux build of VMware Virtual Infrastructure:

  • cat /etc/redhat-release

Show how much free space there is left on local disk space & attached LUN’s:

  • vdf -h

Enable remote shell access for root account

  • Edit the file /etc/sshd/sshd_config with your editor of choice
  • Search for the text PermitRootLogin no and change this to PermitRootLogin yes
  • Save the file
  • Restart the sshd service (service sshd restart)

Restart the vmware management agent:

  • service mgmt-vmware restart

Sometimes you have to alter files from within the service console, but hey there’s no notepad, so you have to use one of the available editors.

 

vi very unfriendly editor, but available on every *nix version.

I must say, when starting working with VMware this was my first encounter with this editor and although I still find it very unfriendly it’s always the one that I personally use when editing files in the ServiceConsole. Why? Old habits die hard.

image

Positioning the cursor

  Move cursor one space right
  Move cursor one space left
  Move cursor up one line
  Move cursor down one line
  ctrl+F Move forward one screen
  ctrl+B Move backward one screen
  $ Move cursor to end of line
  ^ Move cursor to beginning of line
  :1 Move to first line of file
  :$ Move to last line of file
  / Search of a character string
  ? Reverse search for a character string
  x Delete the character at the cursor position
  dd Delete the current line
  p Paste data that was cut with x or dd commands
  u Undo

 

Entering input mode

  a Add text after the cursor
  i Insert text before the cursor
  R Replace text starting at the cursor
  o Insert a new line after the current one

 

Entering command mode

  esc Switch from input mode to command mode

 

Exiting or saving your file

  :w Save the file, don’t exit the editor
  ZZ Save the file and exit
  :q! Quit without saving

 

Nano, easy to use (available on VMware ESX)

As you can see in the screenshot below nano has some commands which can be called with CTRL+LETTER (i.e. CTRL+X calls the Exit command)

 image

I always recommend this editor to customers, because of it’s user friendliness. This way I avoid explaining how to use the VI editor which is very handy because I can’t!! (maybe through this post)