17

When I rename a virtual machine in vmware workstation, the old file names (e.g.: the hard drive file name) remains.

How do I manually rename these without messing up the virtual machine?

I'm not using the newest vmware workstation version.

7 Answers 7

10

You can rename files of VM without any VMware software. Or using bare-minimum VMware Player only.

First stop virtual machine and exit VMware Player if you do not done already.

Go to VM data folder (the one with your big VM files) and find few descriptor files alongside many virtual disk (VMDK) files. You only need to edit two files with your favorite text editor, namely:

  1. In VMX file this three properties are related:

    • scsi0:0.fileName
    • nvram
    • extendedConfigFile

    --> Just edit/change all of them with new name.

  2. In VMDK file under # Extent description section you will find sub-vmdk file names that all should be renamed, acording to your new name.

  3. Rename (manually or with renaming software) all VMDK-files on the file system, but you should remain intact (do not edit) last few (most often 5) characters, which are indexes (i.e. -s001.vmdk;-s002.vmdk, etc.)

4
  • 1
    But the VMDK is a huge binary file. How do your rename the sub-vmdk file names?
    – Avi
    Dec 18, 2015 at 11:25
  • 2
    Probably like this: vmware.com/support/ws45/doc/disks_vdiskmanager_eg_ws.html
    – Avi
    Dec 18, 2015 at 12:01
  • vmware-vdiskmanager standalone is here Jul 4, 2018 at 9:01
  • 1
    If you use split disks, the VMDK file is the hard disk hence it is a huge binary file and you cannot edit it. With split disks, the VMDK file is a text file.
    – Dennis G
    Nov 22, 2018 at 12:20
9

The vmx file that stores the virtual machine's configuration is a just a text file. You can just rename all of the vm's files and then edit the vmx to point to those files.

1
  • 1
    Note that this is trickier if the VM has snapshots or if the VM is using split disks. Georgi Hristov's answer is more complete.
    – jamesdlin
    Aug 29, 2015 at 21:05
1

I use the import option to do this. This way I can keep a base VM on a share someplace called base-XP or whatever, then when I need a new test VM, I do an import and the disks are named according to the setting I specify when going through the import wizard.

1

If you are running vmware workstation 8, you can use the cloning function (VM-> Manage -> Clone), you can then give a new name to the cloned VM.

1
  • 2
    This does not rename the VMDK (hard-drive / disk) file names. Apr 10, 2014 at 13:12
0

You can follow what @Georgi Hristov suggested, but I found that the old name also exists within those vmware-*.log and -S00.vmdk files, so I took @xyutech's suggestion and found out using the built-in clone function is the easiest way to create a new VM with a different name. Here is a screen shot clone a vm.

One caveat, all cloned files will be place under the selected folder, so you should pick an empty folder when asked.

0

I have used this procedure on both Windows 10 and Ubuntu 21.04 hosts with an Ubuntu guest. These instructions begin by copying the VM, so as to preserve a backup. These instructions use VMware Player, not Workstation, but I believe the steps are largely the same.

  • Make sure VMware is not running.
  • Copy the VM's entire folder. To copy in Ubuntu, I ran sudo nautilus (replace nautilus with your own file manager) to open Files with administrator privileges.
  • When the copying was done, I named the new folder UbuWb.
  • Inside that folder, I renamed Ubuntu.vmx to be UbuWb.vmx, and deleted all .log, .vmsd, and .vmxf files.
  • I double-clicked on UbuWb.vmx. This opened VMware Player and produced a dialog that began, "This virtual machine might have been moved or copied." Since I was renaming it, I chose "I Moved It."
  • When the VM booted inside Player, I clicked on the VM's top bar > Ctrl-D (or I could have used top bar > Player > Manage > Virtual Machine Settings) > Options tab > General > Virtual machine name > rename as UbuWb > OK (in Windows host) or Save (in Linux host).
  • I closed down the VM and took a look in the file manager (e.g., Windows File Explorer). The Ubuntu.vmdk and Ubuntu.nvram files hadn't been renamed. I renamed them manually.
  • I restarted the VM (again, by double-clicking on UbuWb.vmx). In the Ubuntu host, that produced an error: "File not found: Ubuntu.vmdk." I clicked Browse > select UbuWb.vmdk > Open, and then restarted the VM.
  • There was a long minute of just sitting there with a black screen and a dead cursor, but then (in both hosts) the VM started.

I have blogged some additional remarks. My source of guidance was Rasor (2012).

0

Why should we do all this elaborate procedure, I renamed it simply by renaming the different vm files and entries within the .vmx, .vmxf and .vmdk files 😊 it works like a charm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy