VMware Communities
jipete
Contributor
Contributor
Jump to solution

Vmware workstation remove a virtual machine from the command line

Hello, I am on windows 10 with vmware workstation 12.5.

I can create / clone vm command line like this for example:

vmrun -T ws clone C:\mavm.vmx D:\mavm2.vmx linked -cloneName="clone_de_vm"

Then I start it like this:

vmrun start D:\mavm2.vmx

But I do not find in the doc how to remove it? Delete the vm files (the vmx file and the others) but also remove it from the vm list in vmware workstation.

Is it possible to do it? thank you in advance for your help.

1 Solution

Accepted Solutions
wila
Immortal
Immortal
Jump to solution

Hi,

If you start a VM via vmrun then it will run, but it won't be in the GUI.

You can however start a VM via vmware player (vmplayer)

As for not finding the vminventory.vmls, my fault, turned out my notes on that had a problem.

Here's the correct locations:

VM Library configuration file location

Windows host - %APPDATA%\VMware\inventory.vmls

Linux Host - ~/.vmware/inventory.vmls

Windows host - shared is at:

    %PROGRAMDATA%\VMware\hostd\vmInventory.xml

where

%PROGRAMDATA% is C:\ProgramData\ on windows 8

%APPDATA% is C:\Users\<username>\AppData\Roaming on windows 8

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva

View solution in original post

0 Kudos
9 Replies
a_p_
Leadership
Leadership
Jump to solution

Welcome to the Community,

the available options (including "deleteVM") will show up using vmrun /?.

André

0 Kudos
jipete
Contributor
Contributor
Jump to solution

deleteVM remove all file of vm but in the gui of vmware workstation, the VM has not disappeared. When i click to this vm i have error message "could not open virtual machine"


My question is : can i remove the link of my vm in vmware automatically or update (in command line) vm list ?

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I can't reproduce this at the moment, but if deleteVM doesn't remove the link (that's what I actually thought it would do), you may need to call vmrun the unregister option first, and then the deleteVM.

André

0 Kudos
jipete
Contributor
Contributor
Jump to solution

I can not register/unregister vmx file, i have this error :

"register VM not supported for the specified host type"

0 Kudos
wila
Immortal
Immortal
Jump to solution

Hi,

The answer to your question is quite simple (and disappointing) ... it's not supported.

There's no vmrun command to register (or unregister) a VM from the virtual machine library.

If you have a need for this then you would have to adjust the config files by hand (ugh!)

For Workstation / Player you would be looking at the following files and locations:

Windows host - %PROGRAMDATA%\VMware\inventory.vmls

Linux Host - ~/.vmware/inventory.vmls

--

Wil

edit: crossed out the wrong location

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
jipete
Contributor
Contributor
Jump to solution

ok, but can i start vm with vmrun without save my vm in Workstation gui ?

edit: I can not found the file "inventory.vmls"

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

For Windows it's:

%APPDATA%\VMware\inventory.vmls

André

wila
Immortal
Immortal
Jump to solution

Hi,

If you start a VM via vmrun then it will run, but it won't be in the GUI.

You can however start a VM via vmware player (vmplayer)

As for not finding the vminventory.vmls, my fault, turned out my notes on that had a problem.

Here's the correct locations:

VM Library configuration file location

Windows host - %APPDATA%\VMware\inventory.vmls

Linux Host - ~/.vmware/inventory.vmls

Windows host - shared is at:

    %PROGRAMDATA%\VMware\hostd\vmInventory.xml

where

%PROGRAMDATA% is C:\ProgramData\ on windows 8

%APPDATA% is C:\Users\<username>\AppData\Roaming on windows 8

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
jipete
Contributor
Contributor
Jump to solution

thanks you your solution.

If i use vmplayer, i have same problem, vmplayer save vm...

Actually my only solution is : I remove the file "inventory.vmls" for clean my vm list, it's work.

0 Kudos