mechboxes / mech

Easy command line virtual machines for VMWare
https://mechboxes.github.io/mech/
MIT License
311 stars 49 forks source link

(linux) vmrun has not attribute "Provider" #10

Closed Techienaut closed 7 years ago

Techienaut commented 7 years ago

(note: this might be vmware workstation's end where "vmrun" doesn't give a provider?) I'm getting an error: AttributeError: Vmrun instance has no attribute 'provider'

Error message:

Traceback (most recent call last):
  File "/home/vagrant/.local/bin/mech", line 11, in <module>
    load_entry_point('mech==0.4.1', 'console_scripts', 'mech')()
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/__main__.py", line 92, in main
    operation(op='start', name=name, options={'gui':gui})
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/__main__.py", line 49, in operation
    method()
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/mech.py", line 47, in start
    vm.start()
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/vmrun.py", line 98, in start
    return self.vmrun( 'start', 'nogui' )
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/vmrun.py", line 47, in vmrun
    output = self.execute( self.VMRUN_PATH, *cmd )
  File "/home/vagrant/.local/lib/python2.7/site-packages/mech/vmrun.py", line 32, in execute
    cmds[0] = "-T {} -gu {} -gp {} {}".format(self.provider, self.VM_ADMIN, self.VM_PASS, cmds[0])
AttributeError: Vmrun instance has no attribute 'provider'
ColdHeat commented 7 years ago

Unfortunately I've really never tested mech outside of OSX but I'll work on this when I get a chance. Seems like it needs another provider for linux:

https://github.com/ColdHeat/mech/blob/master/mech/vmrun.py#L28

ColdHeat commented 7 years ago

@RiseAgainst9192 I changed things to set a provider for linux. Can you pull and try it? Reopen if you're still having issues.