Virtual machine cannot be powered on because its working directory is not valid
search cancel

Virtual machine cannot be powered on because its working directory is not valid

book

Article ID: 332525

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Rebooting the virtual machine after migrating it fails.
  • You see the error:

    A virtual machine cannot be powered on because its working directory is not valid

  • Cannot power on a virtual machine with spaces in the virtual machine disk's name.
  • Cannot power on a virtual machine if the working directory location is no longer accessible.


Environment

VMware ESXi 4.0.x Embedded
VMware ESX 4.1.x
VMware ESXi 4.0.x Installable
VMware ESXi 3.5.x Installable
VMware ESXi 4.1.x Embedded
VMware ESX Server 3.5.x
VMware ESX Server 3.0.x
VMware ESXi 4.1.x Installable
VMware ESXi 3.5.x Embedded
VMware ESX 4.0.x

Resolution

Note: To check the working directory, select the virtual machine and click on Edit Settings > Options > General Options. If the Virtual Machine Working Location is invalid, proceed to Step 9 below.

To resolve this issue, rename the directory so that there are no spaces in it.

To rename the directory:
  1. Connect to the ESX host using the Virtual Infrastructure Client.
  2. Log in as a user with administrative privileges on the ESX host.
  3. Right-click on the virtual machine and click Remove from Inventory.
  4. Use the datastore browser from the VI Client to rename the directory.

    Notes:
    • If you are able to rename the directory, proceed to Step 9.
    • If the virtual machine has disks spread across other datastores, be sure to rename all associated directories.

  5. Connect to the Service Console of the ESX host using an SSH client.
  6. Log in as a user with administrative privileges on the ESX host.
  7. Browse to the virtual machine directory under the VMFS volume.
  8. To rename the directory, run a command similar to:

    mv "/vmfs/volumes/storage1/Sample_Directory" "/vmfs/volumes/storage1/SampleDirectory"

    Notes:
    • Ensure to use quotes to enclose the full directory path. This removes the space from the directory name.
    • You can also clone the virtual machine and rename it during the clone process.
    • If the virtual machine has disks spread across other datastores, be sure to rename all associated directories.

  9. Edit the virtual machine configuration (.vmx) file and rename the displayname parameter without spaces.
  10. Change the current working directory location of the virtual machine in the virtual machine configuration (.vmx) file. For more information, see Creating snapshots in a different location than default virtual machine directory (1002929).
  11. Using the VI Client, navigate to the newly renamed directory in the Datastore browser to find the virtual machine.
  12. Right-click the .vmx file and click Add to Inventory.
  13. Complete the wizard.

Note: To rename the virtual machine disk, see Renaming a virtual machine disk (VMDK) via the vSphere Management Assistant (vMA) or vSphere CLI (vCLI) (1002491).

Additional Information

For translated versions of this article, see: