VMware Communities
bokinet
Contributor
Contributor

Start VM wich has encryption password via terminal on Mac OS

Hi,

I'm having problem to start on MAC OS 10.9.3 VM file which is Windows 7 OS machine and applied VM encryption password .

VM encryption password is: john@workvm

I'm using next command via terminal to do that but without lucky.

ver. 1

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T  -vp "john@workvm" -ws start /Users/John/Documents/etc/john_work.vmwarevm

Error: Unrecognized command: john@workvm

ver. 2

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T -ws start /Users/John/Documents/etc/john_work.vmwarevm -vp "john@workvm"

Error: Cannot open VM: ... A password is required for this operation

If I use same command line without -vp and password, I can run any VM which is not encrypted and has password enabled from terminal.

Is there any working sample and explanation where I'm making error?

Thanks

16 Replies
WoodyZ
Immortal
Immortal

The proper syntax is: vmrun $flags $command $parameters

Example: vmrun -T fusion -vp $Encrypted_Password start $FQP_To_VMX_File

vmrun -T fusion -vp password start /Users/WKZ/Documents/Virtual\ Machines.localized/Windows\ 7.vmwarevm/Windows\ 7.vmx

However in the documentation vix112_vmrun_command.pdf it states "As of the VIX 1.10 release, you no longer need to specify a guest user name and password, or an encryption password. If vmrun needs authentication information, it prompts for it.", so one would not necessarily need to use -vp $password_for_encrypted_virtual_machine and would be prompted for it.  Although if running from a script then using -vp would be the preferred method.

That said, in order to start an encrypted Virtual Machine via vmrun it must be preceded by sudo.

Example:

sudo vmrun -T fusion -vp password start /Users/WKZ/Documents/Virtual\ Machines.localized/Windows\ 7.vmwarevm/Windows\ 7.vmx

Note:  When prompted for the password when using sudo it's the Host's Admin User Account password not the encrypted Virtual Machine password.  The latter is a separate prompt if not provided on the command line.  Also if the FQP to the VMX File has spaces either escape the spaces with a "\" or quote the "$FQP_To_VMX_File"

Reply
0 Kudos
bokinet
Contributor
Contributor

Hi there,

Thanks for your reply.

I tried suggested but no lucky.

I'm getting error 'The operation is not supported'

I tested with and without sudo.

Smiley Sad

Reply
0 Kudos
WoodyZ
Immortal
Immortal

Okay I went back a did some additional testing and for some reason while I selected to encrypt a VM and test with it nonetheless it didn't actually properly encrypt the VM.  The exact details at this point are irrelevant because when I removed the encryption and replied it it would no longer start using sudo.  So VMware will need to address this issue as to whether or not vmrun under OS X truly supports actions on encrypted VM's.

Reply
0 Kudos
bokinet
Contributor
Contributor

Hello,

Well encrypted VM is working fine for me on my Mac.

I only have a problem when I want to start encrypted VM from terminal.

I used your command tips and mine as well.

Actually I tried a dozen combination so far and it's not working.

File location: /Users/john/Documents/etc/john.vmwarevm

VM encryption password: mypassword@vms

One of the latest commands:

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion -vp mypassword@vms start /Users/john/Documents/etc/john.vmwarevm

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion -vp "mypassword@vms" start /Users/john/Documents/etc/john.vmwarevm

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T ws -vp mypassword@vms start /Users/john/Documents/etc/john.vmwarevm

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T ws -vp "mypassword@vms" start /Users/john/Documents/etc/john.vmwarevm

Thanks again.

p.s. I also thinking that or they didn't integrate this part or it's bug. Really stupid Smiley Sad

Reply
0 Kudos
JessieZhang
VMware Employee
VMware Employee

vmrun does not support powering-on an encrypted VM in GUI mode, please try to power on your vm in nogui using below command:

/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion -vp mypassword@vms start /Users/john/Documents/etc/john.vmwarevm/john.vmx nogui

Reply
0 Kudos
bokinet
Contributor
Contributor

Thanks for tip.

It's working without GUI (using nogui).

Anyway, why I should use nogui when I need to have gui in my case.

It's funny.

Smiley Sad

RadMeen
Contributor
Contributor

Having the exact same problem in 2023 in with M1-Macos-Host and W11-Arm64-Guest

When will this problem get fixed or is there any alternative to vmrun?

Reply
0 Kudos
Technogeezer
Immortal
Immortal

Assuming you have the VM configured to remember the password in the keychain, try this in the Terminal:

open full-path-to-vm.vmwarevm

This should not only start Fusion (it doesn't display the Virtual Machine Library) but open and power-on the VM.

For example, I have a windows 11 ARM VM in the volume "Virtual Machines" named "Windows 11 ARM". The following will start Fusion if it isn't already running, and open it without asking for a password:

open /Volumes/Virtual\ Machines/Windows\ 11\ ARM.vmwarevm

 

- Paul (Technogeezer)
Editor of the Unofficial Fusion Companion Guides
ndmax
Contributor
Contributor

On Workstation for a Linux host, the open command does start the encrypted machine, but prompts for a password every time (and there doesn't seem to be a way to save it).

Reply
0 Kudos
ColoradoMarmot
Champion
Champion

This is a fusion forum, so can't speak to workstation.  But on a mac with Fusion, if you've saved the password via the GUI to the keychain it will pick that up and auto-decrypt.   Is there a similar GUI option on Workstation?

Reply
0 Kudos
Technogeezer
Immortal
Immortal

Just goes to show you that Workstation and Fusion are similar but not identical. I have found where Workstation can save a password in a local password vault, but not that it will auto-unlock a encrypted VM. I’m going to keep looking, though. 

- Paul (Technogeezer)
Editor of the Unofficial Fusion Companion Guides
Reply
0 Kudos
ndmax
Contributor
Contributor

Thanks @Technogeezer.  If you find any working method, I'd be grateful to know.  I can't seem to find any working method.  It does seem silly (or at least arbitrary) that it's possible to point and click your way to a running an encrypted VM with no password prompt, but it's impossible from a command line.

Reply
0 Kudos
RDPetruska
Leadership
Leadership

Have you tried vmrun with the current Workstation?  This thread is from 2014, so the statement made from the VMware employee about vmrun not supporting an encrypted VM might not be true any longer.

Reply
0 Kudos
ndmax
Contributor
Contributor

I thought the same thing.  I still feel like there must be something I'm missing.  In any case, I've tried a hundred permutations a dozen times each.  Attempting to start from the command line prompts for a password: 

vmrun start /path/to/virtual/machine.vmx
Encrypted virtual machine password: 

There doesn't seem to be any interface to supply the password to vmrun as an argument.  At the moment, I'm trying to use expect/autoexpect to send the password after after the prompt, but I can't get it to work ("Operation not supported.")

Reply
0 Kudos
Johannes34
Contributor
Contributor

the solution is to use nogui instead of gui, this worked for me

Reply
0 Kudos
ndmax
Contributor
Contributor

(See above.)

The -nogui option isn't a viable solution if the purpose of running the VM is to interact with the VM's graphical interface (i.e. if a GUI is required). 

For example, when someone is using a Linux desktop host and occasionally needs to use a Windows 11 guest for work.

Reply
0 Kudos