Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware Workstation 16 does not generate netmap.conf during installation #10009

Closed
clong opened this issue Sep 28, 2020 · 14 comments
Closed

VMware Workstation 16 does not generate netmap.conf during installation #10009

clong opened this issue Sep 28, 2020 · 14 comments

Comments

@clong
Copy link

clong commented Sep 28, 2020

Overview of the Issue

While not a bug with Packer specifically, Packer relies on this file to build vmware-iso boxes successfully. Beginning with VMware Workstation 16 for Linux, a netmap.conf file is not generated during the installation of VMware

Reproduction Steps

  1. Launch Ubuntu 18.04 server
  2. Install VMware Workstation 16 for Linux
  3. Attempt to build a box using Packer vmware-iso provisioner
  4. Encounter Could not find netmap conf file: /etc/vmware/netmap.conf error message

Packer version

1.6.3

Simplified Packer Buildfile

https://github.com/clong/DetectionLab/blob/master/Packer/windows_2016.json

Operating system and Environment details

Ubuntu 18.04, x64

Log Fragments and crash.log files

vmware-iso: output will be in this color.

==> vmware-iso: Retrieving ISO
==> vmware-iso: Trying https://software-download.microsoft.com/download/pr/18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso
==> vmware-iso: Trying https://software-download.microsoft.com/download/pr/18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso?checksum=sha256%3A9ef81b6a101afd57b2dbfa44d5c8f7bc94ff45b51b82c5a1f9267ce2e63e9f53
    vmware-iso: 18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso 4.56 GiB / 4.56 GiB [==========================================================================] 100.00% 1m17s
==> vmware-iso: https://software-download.microsoft.com/download/pr/18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso?checksum=sha256%3A9ef81b6a101afd57b2dbfa44d5c8f7bc94ff45b51b82c5a1f9267ce2e63e9f53 => /tmp/Packer/packer_cache/fbe860439e10a6d50766c5ec20ebd394160a1b61.iso
==> vmware-iso: Configuring output and export directories...
==> vmware-iso: Creating floppy disk...
    vmware-iso: Copying files flatly from floppy_files
    vmware-iso: Copying file: ./answer_files/10/Autounattend.xml
    vmware-iso: Copying file: ./floppy/WindowsPowershell.lnk
    vmware-iso: Copying file: ./floppy/PinTo10.exe
    vmware-iso: Copying file: ./scripts/fixnetwork.ps1
    vmware-iso: Copying file: ./scripts/rearm-windows.ps1
    vmware-iso: Copying file: ./scripts/disable-screensaver.ps1
    vmware-iso: Copying file: ./scripts/disable-winrm.ps1
    vmware-iso: Copying file: ./scripts/enable-winrm.ps1
    vmware-iso: Copying file: ./scripts/microsoft-updates.bat
    vmware-iso: Copying file: ./scripts/win-updates.ps1
    vmware-iso: Copying file: ./scripts/unattend.xml
    vmware-iso: Copying file: ./scripts/sysprep.bat
    vmware-iso: Done copying files from floppy_files
    vmware-iso: Collecting paths from floppy_dirs
    vmware-iso: Resulting paths from floppy_dirs : []
    vmware-iso: Done copying paths from floppy_dirs
==> vmware-iso: Creating required virtual machine disks
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Could not find netmap conf file: /etc/vmware/netmap.conf
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored after 1 minute 27 seconds: Could not find netmap conf file: /etc/vmware/netmap.conf

==> Wait completed after 1 minute 27 seconds
@sylviamoss
Copy link
Member

Hello, thanks for reaching out! We will take a look once we get a chance.
Could you provide a more detailed log of your build, which you can have by setting PACKER_LOG=1?

@clong
Copy link
Author

clong commented Sep 29, 2020

Hi @sylviamoss ! Since this isn't a problem with Packer directly, I'm not sure if including more verbose output would actually help here, but let me know if you think otherwise.

The problem is that the newest version of VMware Workstation on Linux (and maybe Windows - I haven't tested) doesn't generate a file that Packer requires for building a box. I'm not sure what the ideal fix would be. Maybe ask VMware why this behavior changed, or maybe Packer can somehow dynamically create this file if it doesn't exist?

@brujack
Copy link

brujack commented Oct 14, 2020

Also missing vmnetdhcp conf file as well. I tried doing a touch /etc/vmware/netmap.conf and rerunning packer, but then it complained about vmnetdhcp conf file next. I stopped at that point and reinstalled VMware Workstation 15.5.6

@azr
Copy link
Contributor

azr commented Oct 21, 2020

Hello there, thanks for opening, I could repro on ubuntu; it looks like this file has moved or no longer exists 🤔 . So yeah in the meantime I'd remain on 15.5 !

@azr
Copy link
Contributor

azr commented Oct 21, 2020

Hello again, looks like the update process did not recreate that netmap.conf file, but vmware (ui) recreated it for me when I did:

Edit > Virtual Network Editor (type password) > Save. Maybe it's a bug in the vmware installer or updater.

@azr azr added the stage/waiting-on-upstream This issue is waiting on an upstream change label Oct 22, 2020
@clong
Copy link
Author

clong commented Oct 23, 2020

@azr interesting! I wonder what the equivalent is from the CLI

@azr azr removed this from the 1.6.5 milestone Oct 27, 2020
@azr
Copy link
Contributor

azr commented Oct 27, 2020

sudo vmware-netcfg should open that window; I don't know if you can trigger a recreate from cli but I bet that vmware is going to patch this for the .1 patch version.

@brujack
Copy link

brujack commented Oct 27, 2020

Hello again, looks like the update process did not recreate that netmap.conf file, but vmware (ui) recreated it for me when I did:

Edit > Virtual Network Editor (type password) > Save. Maybe it's a bug in the vmware installer or updater.

This worked for me, and now testing on VMware Workstation 16 Pro

arizvisa added a commit to arizvisa/hashicorp-packer that referenced this issue Jan 5, 2021
…etworkmapping configuration.

Some instances of VMWare will not generate the networkmapping configuration (netmap.conf)
at the time of installation. To deal with this issue, we check for the networkmapping file
first, and then fallback to the networking file which also might exist and contain the
interface information that we require.

This fixes issue hashicorp#10009.
arizvisa added a commit to arizvisa/hashicorp-packer that referenced this issue Jan 5, 2021
…etworkmapping configuration.

Some instances of VMWare will not generate the networkmapping configuration (netmap.conf)
at the time of installation. To deal with this issue, we check for the networkmapping file
first, and then fallback to the networking file which also might exist and contain the
interface information that we require.

This fixes issue hashicorp#10009.
arizvisa added a commit to arizvisa/hashicorp-packer that referenced this issue Jan 5, 2021
…etworkmapping configuration.

Some instances of VMWare will not generate the networkmapping configuration (netmap.conf)
at the time of installation. To deal with this issue, we check for the networkmapping file
first, and then fallback to the networking file which also might exist and contain the
interface information that we require.

This fixes issue hashicorp#10009.
@arizvisa
Copy link
Contributor

arizvisa commented Jan 5, 2021

Hey, do you guys see a /etc/vmware/networking file? that looks something like:

VERSION=1,0
answer VNET_1_DHCP yes
answer VNET_1_DHCP_CFG_HASH ...
answer VNET_1_HOSTONLY_NETMASK ...
answer VNET_1_HOSTONLY_SUBNET ...
...

Also, do y'all know if the same issue exists on Windows?

@arizvisa
Copy link
Contributor

Hey @clong, @brujack, this issue should be fixed by PR #10543 which falls back to inferring the defaults from the "networking" file if "netmap.conf" isn't found. Lmk, if it still doesn't work.

@SwampDragons
Copy link
Contributor

To test @arizvisa 's fix, you can either retrieve binaries from here: https://app.circleci.com/pipelines/github/hashicorp/packer/9308/workflows/0273bfdc-bd14-4ce9-9069-2fac24ddbfe4/jobs/111047/artifacts or you can build the linked PR locally. Or you can wait until tomorrow's "nightly" release.

nywilken pushed a commit that referenced this issue Feb 26, 2021
…etworkmapping configuration.

Some instances of VMWare will not generate the networkmapping configuration (netmap.conf)
at the time of installation. To deal with this issue, we check for the networkmapping file
first, and then fallback to the networking file which also might exist and contain the
interface information that we require.

This fixes issue #10009.
@arizvisa
Copy link
Contributor

@clong, @brujack did that fix the issue? can y'all close this ticket if so?

@ghost ghost removed the stage/waiting-reply label Mar 25, 2021
@ghost
Copy link

ghost commented Apr 19, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-vmware#4 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-vmware#4.

@ghost
Copy link

ghost commented May 20, 2021

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.

@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants
@SwampDragons @azr @arizvisa @clong @brujack @sylviamoss and others