Just a blog to share my tricks, code snippets

Showing posts with label VMWare. Show all posts
Showing posts with label VMWare. Show all posts

Thursday, June 15, 2017

Enable SSH service for ESXi server



  • Login to the server using vShphere client
  • Select the host --> Configuration tab --> Security Profile --> Properties in the Services part



  • In the Services Properties dialog, select SSH and then click to Options



  • In SSH (TSM-SSH) Options dialog, select "Start and stop with host" and then press Start button



  • That is for starting SSH server. You may also need to start SSH client. Again, in the Security Profile, select Properties in the Firewall part



  • Select SSH client


Friday, June 2, 2017

Copy/paste between virtual remote console of vShphere client and the system


1. Login vShphere client and power off the VM
2. Right click the VM and select Edit Settings
3. Navigate to Options > Advanced > General and click Configuration Parameters.

4. Add 2 new rows as below:
isolation.tools.copy.disable FALSE
isolation.tools.paste.disable FALSE

5. Click OK and power on the VM

Friday, March 3, 2017

How to copy an ESXi VM from a different host without vCenter


With vCenter, cloning and moving a VM from a host to a different host is really easy. It just takes a few clicks and then everything is done. Copying a VM from a host to different host without vCenter, however, is a bit more challenging. Belows are steps to copy a VM to different host without vCenter.

1. Locate where your source VM is on the host:
- Login VMware vSphere Client on your host --> right click to the VM you want to locate --> Edit Setting --> Select Options tab
- Note down the path of Virtual Machine Configuration File. In this case, it is [datastore0] Mac-Appium04/Mac-Appium.vmx.
- SSH to the host, the VM location is /vmfs/volumes/datastore0/Mac-Appium04  (datastore0/Mac-Appium04 is what we refer from the path of Virtual Machine Configuration File and /vmfs/volumes/ is where ESXi puts VMs by default)


2. Copy the VM folder to the different host with scp command:

scp -r robin@10.10.2.20:/vmfs/volumes/datastore0/Mac-Appium04 /vmfs/volumes/datastore/

Note: robin is the username to ssh to the host. /vmfs/volumes/datastore/ is where I want to put VM on the destination host.

3. Add the VM on VMware vSphere Client
- Login the destination host using vSphere Client
- Open datastore browser
- Find the VM, right click on the .vmx file and select 'Add to Inventory'
- Once you finish above steps, the VM is shown in vSphere client