VMware Enable SSH (vSphere ESX)

 

VMware Enable SSH KB ID 0000299 

Problem

Should you wish to get SSH (remote secure console) access to your ESX  hosts, you need to do the following.

ESX Version 8 and Newer

ESX Version 6.5 and Newer

ESX version 5 and Newer

ESX version 4.1.0

ESX version 4.0.0 and earlier

ESX version 4.0.0 and earlier

Solution

VMware Enable SSH ESX 8.0

Directly on an ESX Host: If you have a stand-alone ESX Server running version 8.x, Log in via the web console >  Select ‘Host’ > Actions > Services > Enable Secure Shell (SSH).

Via vSphere/vCenter: If you want to enable SSH on an ESX host through the vCenter Web client then, from the ‘hosts and datacentres’ view > Select the Host  > Configure > Services > Locate SSH > Start.

Enable SSH Permanently: Some people don’t want this enabled for security reasons, and in production that makes sense, but on my test network I always have SSH enabled. from the same screen as above with SSH selected > Edit Start-up Policy > Select ‘Start an stop with host” > OK.

VMware Enable SSH 6.5

If you have a stand-alone ESX Server running version 6.5, it’s a lot easier to enable ESX access. Select ‘Host’ > Actions > Service > Enable Secure Shell (SSH). Note: You can also enable the direct console access here.

If you want to enable SSH on an ESX host through the vCenter Web client then, from the ‘hosts and datacenters’ view > Select the Host  > Configure > Security Profile > Scroll down to ‘Services’ > Edit.

Locate ‘SSH > Start > OK.

Once enabled you will see the following warning on the hosts summary page, however, in version 6.5 you can suppress this error.

VMware Enable SSH ESX 5

ESX 5 has a built in firewall, which can have SSH opened in the VI clients, or just as with version 4.1.0 you can enable SSH Locally from the console from troubleshooting options.

Enable Remotely

1. Log into the host with the VI client > Select the host > Configuration > Security Profile > Properties.

2. Locate SSH Server > Tick it > Options > You can either manually start it or set it to start automatically.

3. You will see the following warning to “retrieve” the firewall settings (because you have just changed them) > Select Yes.

Note: Having it running will still cause the “Configuration Issues – SSH for the host has been enabled” nag screen on the summary tab of the host.

VMware Enable SSH ESX 4.0.1

Starting with version 4.0.1 you can enable SSH access from the server console.

1. Go to the normal ESX console > Press F2 > Log in >Troubleshooting Options.

2. Select “Enable Remote Tech support” toggle on and off with {enter} if you want to SSH in the server remotely using PuTTy for example > If you want to log on directly at the console choose “Enable Local Tech Support”.

3. Note: Having it running will still cause the “Configuration Issues – Remote Tech support Mode (SSH) for the host {hostname} has been enabled” nag screen on the summary tab of the host.

Grant SSH Access to ESX 4.0.0 and earlier

1. Go to the normal ESXi console.

2. Press ALT+F1 > the screen will change > Type unsupported {enter} > Note: Nothing will appear on the screen till you hit {enter} > Type in the root password and press {enter}.

3. You now need to edit a config file, the only editor we have is vi (sorry) issue the following command,

[box]vi /etc/inetd.conf[/box]

4. The vi editor will open the file, use the arrow keys to move down to the line that says,

[box]#ssh stream tcp nowait root…[/box]

Press I on the keyboard (that puts the vi editor into insert mode) and delete the hash “#” mark from the beginning of the line.

5 Then, to save the changes press {Esc} > type in :wq {Enter} (that’s write the changes and quit if you’re interested).

6. Enter the following command.

[box]

cat /var/run/inetd.pid

[/box]

It will provide you with a number, (in the example below its 4983, yours will be different).

7. Issue the following command.

[box]

kill -HUP {the number you got from above}

[/box]

8. To get back to the usual ESXi screen and exit command line press ALT+F2.

9. You can now connect with an SSH client like Putty.

 

Related Articles, References, Credits, or External Links

Original Article written: 07/12/11

ESX4 – Grant Root User SSH Access

Thanks to Dave Corrasa for the feedback.

VMware vSphere – How to Import and Export OVF and OVA Files

KB ID 0000562

Problem

I prefer to think of OVF Templates as “Zip” files for Virtual Machines and Virtual Appliances. Where as the OVA file is the complete appliance pre packaged. There are two things you will want to do with an OVF Template;

1. Export a VM to an OVF Template

2. Import an OVF Template (Note: VMware call this “Deploy an OVF Template”)

Note: There are tools for OVF templates for other VMware virtualisation products, this is just for vSphere / ESX.

Tech Note: I find it a lot simpler to do this from PowerCLI now, see the article below;

VMware: Export a VM to OVA With PowerCLI

Solution

Export a Virtual Machine to OVF (vSphere v6)

Note: Machine must be Powered Off and have No Snapshots!

Select the VM > Templates > Export OVF Template.

Change the name, annotation as required > OK.

Your files will be downloaded, (the location will depend on your browser settings!)

 

Export a Virtual Machine to OVF (vSphere v3, v4 and v5)

Note: Machine must be Powered Off and have No Snapshots!

1. Connect to your host with the VI client > With your virtual machine powered off > Select it > File > Export > Export to OVF Template.

2. Select a location to save the files to > OK.

3. Depending on the size of the VM this can take a while.

4. It will give you the following message when it’s finished.

5. Here are the files that it has created.

Import / Deploy an OVF Template to a Virtual Machine

HTML5 Web Client: You can select Deploy OVF Template from either the Cluster or Host Level.

Flash Web Client: If importing OVA or OVF files into vSphere via the vSphere Web client, you can import them at the vCenter, Host, or Cluster Level.

 

From this point forward: The procedure is the same for both Flash and HTML5 clients, Ill show the process using the HTML5 client.

Choose Files > Navigate to and select ALL the applicable files > Next.

  

Give the new VM a name, and, (if applicable) select a folder to put it into > Next > Select a host to deploy to > Next.

Review details > Next > Choose the storage, (and optionally disk format) > Next.

Select the Port Group you want to connect the new VM to > Next > Again review the details > Finish.

 

Import / Deploy an OVF Template to a Virtual Machine (vSphere v3, v4 and v5)

1. To create a VM from an OVF template, connect to your host with the VI client > File > Deploy OVF Template.

2. Browse to the location that the .ovf file is stored > Next.

3. Read the details > Next.

4. Give the new VM a name > Next.

5. Select the disk format (Thick or Thin) you want the new VM to use.

What does Lazy Zeroed and Eager Zeroed Mean?

Data on disks is stored as a 1 (one) or a 0 (zero), so if all the blocks on the disk are set to zero, when you put data on the disk, it only has half the work to do (i.e. write the ones). Eager Zeroed, puts zeros on all the blocks on the disks straight away, Lazy Zeroed puts all zeroes in a block the first time the block is read.

6. Read the summary, and if you want to power on the VM on completion, tick the box > Finish.

7. Depending upon the amount of data this can take a while.

8. It will give you the following message when it’s finished.

9. And here is your VM, imported, powered up, and working.

Related Articles, References, Credits, or External Links

Original Article Written 26/01/12

Firefox: Cannot Open vCenter Web Client

KB ID 0001482

Problem

I wonder how many hours Ive lost trying to get browsers to connect to things, and the browser has not been happy? This week I needed to connect to a vCenter (6.5) web console with Firefox and was greeted with this.

Your connection is not secure
The owner of {site} has configured their web site improperly. To protect information being stolen, Firefox has not connected to this website.
Error Code: , SEC_ERROR_UNKNOWN_ISSUER

Normally I use Firefox, because if there’s a problem I can simply add an exception and all is well, but this time there was no way to connect at all.

Solution

Browse to about:config, and then search for security.enterprise, set it to true.

Now it will work

Related Articles, References, Credits, or External Links

NA

VMware vSphere: Adding NFS Storage

KB ID 0001408

Problem

If you have some NFS storage, and you want to use it as a Datastore in your VMware environment, this is the procedure to follow.

Pre-Requisites

I’m assuming you already have a network connection between your ESX servers and the NAS box, (i.e you have a VM Kernel NIC) on the same network. I’m also assuming you have the NFS setup correctly, in this example I’m using  a Buffalo NAS box.

But you can also use a Windows NFS Share, see the follow article;

Solution

In Datastore View > Datastore > Add Datastore.

Next > NFS v3 > Next.

Enter your NFS mount details and IP address > Next > Select the Host(s) that will use the NFS storage > Next.

Finish

Related Articles, References, Credits, or External Links

VMware ESXi 6.5 – Setting up ESX Time Sync via Web Client

KB ID 0001274 

Another guest post from Daniel Newton

Problem

Now that we have the web console instead of the VI client, and don’t have a windows machine anymore, it would be better to use the web console.

Also, having your ESXi Server running the correct time/date is very important, before you follow this article I should suggest that by making sure the time is set in the ESX Servers BIOS, e.g. the internal clock is set correctly first!!! The amount of times that Windows Domains fail because the time had not been setup properly on the hosts and DC is more than you think! Last thing you want is a massive pain in the arse from your Boss!

Note: Due to the privacy of the customer, I have blurred out their information.

Solution

Note: For this to work the hosts need to be able to communicate with public time servers over NTP (UDP Port 123), ensure your firewall has this port open or time sync will fail.

Firstly, login into the ESX host itself and click on manage on the left-hand side.

Secondly, click on “Time and Date” and edit the settings.

Now, edit the boxes and dropdowns to look like the screenshot below (I am from the UK and typed in the NTP servers for my country, it will be different in other parts of the world) and then click save.

Now that we completed that, we have to start the service. So, go to Actions > NTP Service > Start.

After 30 seconds, you will have this message saying it has completed successfully.

 

Related Articles, References, Credits, or External Links

NA

VMware ESX – Enable ‘Embedded Host Client’

KB ID 0001231 

Problem

Since ESX 6.0.0 Update 2 you’ve been able to use the Embedded Host Client in ESX. Which is great if (like me) you use a Mac because I don’t have to fire up a windows box to load the ‘Fat’ VI client anymore.

What about older version of ESX?

If you are running 5.5 (update3) or newer then you can install and use the Embedded Host Client.

Why didnt you just upgrade to 6.0.0 Update 2?

Well my second host is using the custom HP build of ESX, and I didn’t want to do a remote upgrade, to find my host then had no drivers for its network cards!

 

Solution

You will need to enable SSH on the host, connect via SSH and issue the following three commands;

[box]

esxcli network firewall ruleset set -e true -r httpClient
esxcli software vib install -n esx-ui -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
esxcli network firewall ruleset set -e false -r httpClient

[/box]

Now you can connect to and manage the client via web browser, the URL will be https://{ip-adress-or-name}/ui

 

Related Articles, References, Credits, or External Links

NA

vSphere 5 – Install and Configure the Web Client

KB ID 0000551 

Problem

The ability to administer vCenter via a web browser is nothing new, vCenter has had a web console in previous versions.

vCenter vSphere 4 Web Client (Web Access)

The version with vSphere 5 is much more feature rich. Like the VMware vSphere client it talks directly to the vCenter vSphere API, but unlike previous web access, the component needs to be installed and configured before you can use it.

What the Web Client Can Do

1. Connect to a vSphere vCenter server.

2. Can be used on non Windows machines (VI Client is Windows only).

3. Deploy Virtual Machines (Including deployment from Templates).

4. Configure Virtual Machines.

5. Provide basic monitoring.

What the Web Client Can’t Do

1. Manage Hosts

2. Manage Clusters

3. Manage Networks.

4. Manage Datastores or Datastore Clusters.

5. Connect to ESX or ESXi hosts.

Solution

Step 1 Install and Configure Web Access

Prerequisite: The vCenter server needs to have Adobe Flash installing on it to access the management console.

1. From the vCenter Installer media select “VMware vSphere Web Client (Server) > Install > Follow the on screen prompts.

2. Accept all the defaults, note the secure port number we will be using that later (TCP Port 9443).

3. Once installed > On the vCenter server itself open a browser window > navigate to > https://{servername}:9443/admin-app > Select “Register vCenter Server”.

vSphere Web Client Supported Browsers: Internet Explorer (7 or newer) and Firefox (3.5 or newer), I’ve tried Chrome, it works, but some functionality is lost. (anything that requires the plug in i.e. console connections).

4. Enter the details for the vCenter server > Take note of the URL for your client to access (https://{servername}:9443/vsphere-client) > Register.

5. You will probably be using self signed certificates to tick the box and select “Ignore”.

6. That’s the server configured and ready to go.

Step 2 – Access the vCenter from web client

1. Open a browser window and navigate to https://{servername}:9443/vsphere-client> You may receive a warning about the certificate (because it’s self signed) click to continue > Enter your credentials > Login.

2. The first time you connect it launches the welcome splash screen > tick “Do not show..” and close the window. (Note you can launch it again from the help menu).

Note: If you see this error:

Connection Error
Unable to connect to vCenter Inventory Service –
https://{servername}:10443

Check on the vCenter server to make sure this service is running.

3. You should then be connected, and be able to browse your virtual infrastructure.

4. You can “console” onto your VM’s (Note: will need a plug in installing your browser will prompt you to accept/install).

 

Related Articles, References, Credits, or External Links

NA