You can use the vifs utility for datastore file management.

Caution

If you manipulate files directly, your vSphere setup might end up in an inconsistent state. Use the vSphere Web Client or one of the other vCLI commands to manipulate virtual machine configuration files and virtual disks.

The vifs command performs common operations such as copy, remove, get, and put on ESXi files and directories. The command is supported against ESXi hosts but not against vCenter Server systems.

Some similarities between vifs and DOS or UNIX/Linux file system management utilities exist, but there are many differences. For example, vifs does not support wildcard characters or current directories and, as a result, relative pathnames. You should use vifs only as documented.

Instead of using the vifs command, you can browse datastore contents and host files by using a Web browser. Connect to the following location.

http://ESX_host_IP_Address/host
http://ESX_host_IP_Address/folder

You can view data center and datastore directories from this root URL. The following examples demonstrate the syntax that you can use.

http://<ESXi_addr>/folder?dcPath=ha-datacenter
http://<ESXi_host_name>/folder?dcPath=ha-datacenter

The ESXi host prompts for a user name and password.

The vifs command supports different operations for the following groups of files and directories. Different operations are available for each group, and you specify locations with a different syntax. The behavior differs for vSphere 4.x and vSphere 5.0.

vSphere 4.x

vSphere 5.0

Host

Host configuration files. You must specify the file’s unique name identifier.

Specify host locations by using the /host/<path> syntax.

Host configuration files. You must specify the file’s unique name identifier.

Specify host locations by using the /host/<path> syntax.

You cannot list subdirectories of /host.

Temp

The /tmp directory and files in that directory.

Specify temp locations by using the /tmp/dir/subdir syntax.

Not supported.

Datastores

Datastore files and directories. You have two choices for specifying a datastore.

Use datastore prefix style '[ds_name] relative_path' as demonstrated in the following example.

'[myStorage1] testvms/VM1/VM1.vmx'(Linux) or "[myStorage1] testvms/VM1/VM1.vmx" (Windows)

Use URL style /folder/dir/subdir/file?dsName=<name> as demonstrated in the following example.

'/folder/testvms/VM1/VM1.vmx?dsName=myStorage1' (Linux)
"/folder/testvms/VM1/VM1.vmx?dsName=myStorage1" (Windows)

The two example paths refer to a virtual machine configuration file for the VM1 virtual machine in the testvms/VM1 directory of the myStorage1 datastore.

To avoid problems with directory names that use special characters or spaces, enclose the path in quotes for both operating systems.

When you run vifs, you can specify the operation name and argument and one of the standard connection options. Use aliases, symbolic links, or wrapper scripts to simplify the invocation syntax.

Important

The concepts of working directory and last directory or file operated on are not supported with vifs.