Packer: Build fails using vmware player in headless mode

Created on 23 Jul 2015  ยท  18Comments  ยท  Source: hashicorp/packer

Hi,
I'm using the 'vmware-iso' builder on a Linux machine, with VMware Player and VMware-VIX and struggling with a problem similar to this:
https://communities.vmware.com/thread/422132

Looks like vmrun with "nogui" (headless: true) doesn't understand the 'OS_PowerOn' command, and thus never starts the VM, which leads to an idle timeout.
In fact, using "gui" (headless: false), I'm able to complete the build but this is definitely a NO-OPTION on our CI build server withoust X11 installed.

Anyway, the build stops also in "gui" mode at the end of kickstart and I need to manually power-on VM using vmplayer! Since it, it complete successfully.

Any help?

bug buildevmware

Most helpful comment

Hi @mwhooker does this help?

https://github.com/ksclarke/packer-vmware-headless/

HEADLESS=false packer build test.json works for me

HEADLESS=true packer build test.json doesn't work for me

  • UbuntuGnome: 16.10
  • packer: 0.12.2
  • vmware-player: 12.5.1.4542065
  • vmware-vix: 1.11.2.591240

All 18 comments

Thanks for the report! VMware player not working on a linux desktop environment is likely a bug. For running headlessly on a server, though, I'd recommend looking at ESXi instead.

For the linux desktop case, can you provide the version of packer, player, and linux distro you're using?

I noticed that "vmware-iso" building on a remote ESXi host is quite "primitive", using SSH instead of VMware API. Plan on this?

packer 0.8.2
Red Hat Enterprise Linux Server release 7.1 (Maipo)
VMware-Player-7.1.2-2780323.x86_64
VMware-VIX-1.11.2-591240.x86_64

Thanks for providing your versions.

I noticed that "vmware-iso" building on a remote ESXi host is quite "primitive", using SSH instead of VMware API. Plan on this?

SSH is fairly easy for us to support, both because we can use native Go with cross-compilation and because it's conceptually similar to other code paths in packer. To build with VIX we would need platform-specific build toolchains which is a lot more complicated for us and for contributors. SSH with ESXi also doesn't require any special licensing.

I understand but using VMware Player/Workstation + SSH + ESXi is perceived too little as "enterprise level".

packer: 0.10.0
vmware-ovftool 4.1.0.3018522
vmware-player 12.1.0.3272444
vmware-vix 1.14.0.2306114

'nogui' seems to work fine on VMware Fusion but not on VMware player. Annoyingly, the generated VMX is removed so attempting to debug the problem is cumbersom.e

I can confirm still the issue with Packer 0.11 and VMware player 12.5.1.

In headless mode, the build cannot be performed under Linux, only when headless is set to true.

Can also confirm with Packer 0.12.2 and VMWare player 12.5.1.

Can anyone post a json that reproduces this issue?

Hi @mwhooker does this help?

https://github.com/ksclarke/packer-vmware-headless/

HEADLESS=false packer build test.json works for me

HEADLESS=true packer build test.json doesn't work for me

  • UbuntuGnome: 16.10
  • packer: 0.12.2
  • vmware-player: 12.5.1.4542065
  • vmware-vix: 1.11.2.591240

+1
packer: 0.12.2
esxi: 5.1

+1

@ksclarke I used your test project.

  • HEADLESS=false works
  • HEADLESS=true fails:
[root@imagebuilder packer-vmware-headless]# HEADLESS=true packer build test.json
vmware-centos6 output will be in this color.

==> vmware-centos6: Downloading or copying ISO
    ...
==> vmware-centos6: Creating virtual machine disk
==> vmware-centos6: Building and writing VMX file
==> vmware-centos6: Starting HTTP server on port 8663
==> vmware-centos6: Starting virtual machine...
    vmware-centos6: The VM will be run headless, without a GUI. If you want to
    vmware-centos6: view the screen of the VM, connect via VNC with the password "SA4HHGgw" to
    vmware-centos6: vnc://127.0.0.1:5979
==> vmware-centos6: Error starting VM: VMware error: Error: Unknown error
==> vmware-centos6: 
==> vmware-centos6: Packer detected a VMware 'Unknown Error'. Unfortunately VMware
==> vmware-centos6: often has extremely vague error messages such as this and Packer
==> vmware-centos6: itself can't do much about that. Please check the vmware.log files
==> vmware-centos6: created by VMware when a VM is started (in the directory of the
==> vmware-centos6: vmx file), which often contains more detailed error information.
==> vmware-centos6: Deleting output directory...
Build 'vmware-centos6' errored: Error starting VM: VMware error: Error: Unknown error

Packer detected a VMware 'Unknown Error'. Unfortunately VMware
often has extremely vague error messages such as this and Packer
itself can't do much about that. Please check the vmware.log files
created by VMware when a VM is started (in the directory of the
vmx file), which often contains more detailed error information.

Centos: 7.3.1611
Packer: 1.0.4
vmware-player: 12.5.7-5813279
vmware-vix: 1.15.0-2985596

Hi all,
I upgraded vmware-vix to 1.15.7-5115892 and its all working now.

Not sure on the root cause.

I was trying this same test on Windows Host and it doesn't work.
VNC is not starting on WMware Player :(

Closing this issue since it looks like it was solved via a vmware-vix upgrade. Since the majority of posters were facing this on a linux machine, I think the final comment is unrelated.

I am also facing same issue:
Packer version : 1.3.4
root@test#vmware-installer -l
Product Name Product Version
==================== ====================
vmware-ovftool 4.3.0.10104578
vmware-player 15.0.2.10952284
vmware-vix 1.15.7.5115892

The issue is still present:

Packer: 1.4.1
vmware-player 15.1.0.13591040
vmware-vix 1.17.0.6661328

I have the same issue with VMware-Workstation-Full-15.1.0-13591040.x86_64.bundle.
Any help ?

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings