mechboxes / mech

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

Cannot Open VM .vmx File #20

Closed miketweaver closed 7 years ago

miketweaver commented 7 years ago

I used packer-windows to create a vagrant file.

I then am trying to use it here to add it to VMWare Fusion on Mac OSX

$ mech init packer-windows/windows_2008_r2_vmware.box --name=luke
Initializing mech
Checking box integrity...
Extracting...
What username would you like to save? [mech] mike
Saving /Users/miketweaver/.mech/luke/mechfile
Finished.
Saving ./mechfile
Finished.

$ mech up luke
Getting IP address...
VM started on Error: Cannot open VM: /Users/miketweaver/.mech/luke/packer-vmware-iso.vmx, Cannot read the virtual machine configuration file
Sharing current folder...
VM started on Error: Cannot open VM: /Users/miketweaver/.mech/luke/packer-vmware-iso.vmx, Cannot read the virtual machine configuration file

/Users/miketweaver/.mech/luke/packer-vmware-iso.vmx

.encoding = "UTF-8"
bios.bootorder = "hdd,CDROM"
checkpoint.vmstate = ""
cleanshutdown = "TRUE"
config.version = "8"
displayname = "packer-vmware-iso"
ehci.pcislotnumber = "-1"
ehci.present = "FALSE"
ethernet0.addresstype = "generated"
ethernet0.bsdname = "en0"
ethernet0.connectiontype = "nat"
ethernet0.displayname = "Ethernet"
ethernet0.linkstatepropagation.enable = "FALSE"
ethernet0.pcislotnumber = "33"
ethernet0.present = "TRUE"
ethernet0.virtualdev = "e1000"
ethernet0.wakeonpcktrcv = "FALSE"
extendedconfigfile = "packer-vmware-iso.vmxf"
floppy0.present = "FALSE"
guestos = "windows7srv-64"
gui.fullscreenatpoweron = "FALSE"
gui.viewmodeatpoweron = "windowed"
hgfs.linkrootshare = "TRUE"
hgfs.maprootshare = "TRUE"
ide1:0.clientdevice = "TRUE"
ide1:0.devicetype = "cdrom-raw"
ide1:0.filename = "auto detect"
ide1:0.present = "TRUE"
isolation.tools.hgfs.disable = "FALSE"
memsize = "2048"
migrate.hostlog = "./packer-vmware-iso-4f7ac82b.hlog"
monitor.phys_bits_used = "40"
msg.autoanswer = "true"
numa.autosize.cookie = "20001"
numa.autosize.vcpu.maxpervirtualnode = "2"
numvcpus = "2"
nvram = "packer-vmware-iso.nvram"
pcibridge0.pcislotnumber = "17"
pcibridge0.present = "TRUE"
pcibridge4.functions = "8"
pcibridge4.pcislotnumber = "21"
pcibridge4.present = "TRUE"
pcibridge4.virtualdev = "pcieRootPort"
pcibridge5.functions = "8"
pcibridge5.pcislotnumber = "22"
pcibridge5.present = "TRUE"
pcibridge5.virtualdev = "pcieRootPort"
pcibridge6.functions = "8"
pcibridge6.pcislotnumber = "23"
pcibridge6.present = "TRUE"
pcibridge6.virtualdev = "pcieRootPort"
pcibridge7.functions = "8"
pcibridge7.pcislotnumber = "24"
pcibridge7.present = "TRUE"
pcibridge7.virtualdev = "pcieRootPort"
powertype.poweroff = "soft"
powertype.poweron = "soft"
powertype.reset = "soft"
powertype.suspend = "soft"
proxyapps.publishtohost = "FALSE"
remotedisplay.vnc.enabled = "FALSE"
remotedisplay.vnc.ip = "127.0.0.1"
remotedisplay.vnc.key = "REDACTED"
remotedisplay.vnc.password = "REDACTED"
remotedisplay.vnc.port = "5939"
replay.filename = ""
replay.supported = "FALSE"
scsi0.pcislotnumber = "160"
scsi0.present = "TRUE"
scsi0.saswwid = "50 05 05 6f 90 ae 79 b0"
scsi0.virtualdev = "lsisas1068"
scsi0:0.filename = "disk.vmdk"
scsi0:0.present = "TRUE"
scsi0:0.redo = ""
softpoweroff = "TRUE"
sound.startconnected = "FALSE"
tools.synctime = "TRUE"
tools.upgrade.policy = "upgradeAtPowerCycle"
usb.pcislotnumber = "-1"
usb.present = "FALSE"
uuid.action = "create"
uuid.bios = "56 4d 1d 1f 90 ae 79 bc-9f e1 6a 3d 0d d0 29 53"
uuid.location = "56 4d 1d 1f 90 ae 79 bc-9f e1 6a 3d 0d d0 29 53"
virtualhw.productcompatibility = "hosted"
virtualhw.version = "9"
vmci0.id = "1861462627"
vmci0.pcislotnumber = "35"
vmci0.present = "TRUE"
vmotion.checkpointfbsize = "134217728"
ethernet0.addresstype=generated
ethernet0.bsdname=en0
ethernet0.connectiontype=nat
ethernet0.displayname=Ethernet
ethernet0.linkstatepropagation.enable=FALSE
ethernet0.pcislotnumber=32
ethernet0.present=TRUE
ethernet0.virtualdev=e1000
ethernet0.wakeonpcktrcv=FALSE

Any suggestions on what could be going wrong here?

miketweaver commented 7 years ago

Looks like this is an issue with VMRun/packer-windows not mech.

ColdHeat commented 7 years ago

I would agree, but maybe you can share your VMWare version?

Perhaps there is a config that's not understood?

miketweaver commented 7 years ago

VMWare Fusion 10.0.1

It appears that pulling out:

ethernet0.addresstype=generated
ethernet0.bsdname=en0
ethernet0.connectiontype=nat
ethernet0.displayname=Ethernet
ethernet0.linkstatepropagation.enable=FALSE
ethernet0.pcislotnumber=32
ethernet0.present=TRUE
ethernet0.virtualdev=e1000
ethernet0.wakeonpcktrcv=FALSE

Is allowing VMRun to read it.

ColdHeat commented 7 years ago

This may actually be an issue in mech because I believe mech writes that to guarantee there's an interface there.

Can you try adding spaces between the ='s and see if that fixes it?

miketweaver commented 7 years ago
ethernet0.addresstype = generated
ethernet0.bsdname = en0
ethernet0.connectiontype = nat
ethernet0.displayname = Ethernet
ethernet0.linkstatepropagation.enable = FALSE
ethernet0.pcislotnumber = 32
ethernet0.present = TRUE
ethernet0.virtualdev = e1000
ethernet0.wakeonpcktrcv = FALSE

Did not work. I'll continue playing with it as I see what you're talking about.

miketweaver commented 7 years ago

Ok. Switching it to

ethernet1.addresstype=generated
ethernet1.bsdname=en0
ethernet1.connectiontype=nat
ethernet1.displayname=Ethernet
ethernet1.linkstatepropagation.enable=FALSE
ethernet1.pcislotnumber=32
ethernet1.present=TRUE
ethernet1.virtualdev=e1000
ethernet1.wakeonpcktrcv=FALSE

Fixed it as I already had ethernet0 items in my .vmx file.

ColdHeat commented 7 years ago

Okay excellent! I imagine we shouldn't overwrite any values if we see that there is any ethernet interface.

ColdHeat commented 7 years ago

This should be closed by ed10e6f792cbf2dc147df2464c411cc347f0e38b.

Thanks for using mech!