Fusion

 View Only
Expand all | Collapse all

Start VM wich has encryption password via terminal on Mac OS

  • 1.  Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 13, 2014 12:37 PM

    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



  • 2.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 13, 2014 03:04 PM

    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"



  • 3.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 13, 2014 06:40 PM

    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.

    :smileysad:



  • 4.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 13, 2014 10:20 PM

    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.



  • 5.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 14, 2014 06:58 AM

    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 :smileysad:



  • 6.  RE: Start VM wich has encryption password via terminal on Mac OS

    Broadcom Employee
    Posted Jun 17, 2014 07:49 AM

    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



  • 7.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 17, 2014 01:04 PM

    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.

    :smileysad:



  • 8.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 08, 2023 06:49 PM

    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?



  • 9.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 08, 2023 09:40 PM

    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

     



  • 10.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 10, 2023 10:34 PM

    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).



  • 11.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 10, 2023 11:25 PM

    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?



  • 12.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 10, 2023 11:39 PM

    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. 



  • 13.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 11, 2023 12:22 PM

    Thanks .  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.



  • 14.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 11, 2023 12:47 PM

    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.



  • 15.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted May 12, 2023 01:24 PM

    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.")



  • 16.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jun 29, 2023 01:55 PM

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



  • 17.  RE: Start VM wich has encryption password via terminal on Mac OS

    Posted Jul 01, 2023 05:32 PM

    (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.