VMware Communities
baileymegan
Contributor
Contributor

VMware Workstation in a Ubuntu container

I'm trying to use packer to build a vmware machine in an Ubuntu container that is on a Red Hat Linux Host. I am able to do other virtualization builds in the container so the ability to do virtualization is not the issue. Packer reports that it is a VMWare error.

   vmware-iso: vnc://127.0.0.1:5909
==> vmware-iso: Error starting VM: VMware error: Error: The operation was canceled
==> vmware-iso: Waiting 3.263432499s to give VMware time to clean up...
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored after 4 minutes 27 seconds: Error starting VM: VMware error: Error: The operation was canceled
==> Wait completed after 4 minutes 27 seconds
==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Error starting VM: VMware error: Error: The operation was canceled
==> Builds finished but no artifacts were created.

 Printing out /tmp/vmware-root/vmware-*.log gives kernel & GCC errors.

2021-07-02T20:30:19.622Z| modconfig| I005: Failed to find /lib/modules/4.18.0-
240.10.1.el8_3.x86_64/build/include/linux/version.h
2021-07-02T20:30:19.622Z| modconfig| I005: /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/linux/version.h not found, looking for generated/uapi/linux/version.h instead.
2021-07-02T20:30:19.622Z| modconfig| I005: Failed to find /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h
2021-07-02T20:30:19.622Z| modconfig| I005: Failed version test: /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h not found.
2021-07-02T20:30:19.777Z| modconfig| I005: No file with symbol versions found for kernel 4.18.0-240.10.1.el8_3.x86_64
2021-07-02T20:30:19.777Z| modconfig| I005: Reading in info for the vmmon module.
2021-07-02T20:30:19.778Z| modconfig| I005: Reading in info for the vmnet module.
2021-07-02T20:30:19.778Z| modconfig| I005: Trying to find a suitable PBM set for kernel "4.18.0-240.10.1.el8_3.x86_64".
2021-07-02T20:30:19.778Z| modconfig| I005: No matching PBM set was found for kernel "4.18.0-240.10.1.el8_3.x86_64".
2021-07-02T20:30:19.779Z| modconfig| I005: Found compiler at "/usr/bin/gcc"
2021-07-02T20:30:19.789Z| modconfig| I005: Got gcc version "9".
2021-07-02T20:30:19.790Z| modconfig| I005: GCC major version 9 does not match Kernel GCC major version 8.
2021-07-02T20:30:19.790Z| modconfig| I005: No usable gcc found.  Can't find a valid compiler despite our best efforts.

 The container has the volume /lib/modules mounted so it should be able to access the host files. Looking a bit deeper I noticed that the host does not have a version.h in the path but it does have a iversion.h. Any help or recommendation would be greatly appreciated

0 Kudos
9 Replies
ajgringo619
Hot Shot
Hot Shot

The only thing that stands out is the message about the version of gcc it needs. Can you install gcc-8 and try again?

0 Kudos
baileymegan
Contributor
Contributor

Hi,

So I added gcc-8 as a package during the container building process and that seemed to resolve the compiler issue, but its still doesnt like the header path. This is the vmware-*.log

Screen Shot 2021-07-08 at 9.21.24 AM.png

On the packer-side it looks like its just networking issues?

Screen Shot 2021-07-08 at 9.20.39 AM.png

0 Kudos
ajgringo619
Hot Shot
Hot Shot

I got your reply, but I can't see/respond to it. Every $%^& forum topic, every link I'm sent only shows the OP and nothing else. Hopefully I can get this resolved soon.
0 Kudos
baileymegan
Contributor
Contributor

Ok, I appreciate your help thus far! here is a little bit more information:

Screen Shot 2021-07-08 at 9.34.07 AM.png

I added /lib/modules as a volume to the container but peeking in it doesn't look like it has all the files. The kernel-devel package is installed on the Red Hat host and linux-headers-generic & build-essential is installed on the container. 

0 Kudos
baileymegan
Contributor
Contributor

Still vmware unable to find header file even though /lib/modules/.../generated/uapi/linux/version.h exists in the path

2021-07-08T20:29:27.553Z| modconfig| I005: Setting header path for 4.18.0-240.10.1.el8_3.x86_64 to "/lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include".
2021-07-08T20:29:27.553Z| modconfig| I005: Validating path "/lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include" for kernel release "4.18.0-240.10.1.el8_3.x86_64".
2021-07-08T20:29:27.553Z| modconfig| I005: Failed to find /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/linux/version.h
2021-07-08T20:29:27.553Z| modconfig| I005: /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/linux/version.h not found, looking for generated/uapi/linux/version.h instead.
2021-07-08T20:29:27.553Z| modconfig| I005: Failed to find /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h
2021-07-08T20:29:27.553Z| modconfig| I005: Failed version test: /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h not found.
2021-07-08T20:29:27.689Z| modconfig| I005: No file with symbol versions found for kernel 4.18.0-240.10.1.el8_3.x86_64
2021-07-08T20:29:27.689Z| modconfig| I005: Reading in info for the vmmon module.
2021-07-08T20:29:27.689Z| modconfig| I005: Reading in info for the vmnet module.
2021-07-08T20:29:27.689Z| modconfig| I005: Trying to find a suitable PBM set for kernel "4.18.0-240.10.1.el8_3.x86_64".
2021-07-08T20:29:27.689Z| modconfig| I005: No matching PBM set was found for kernel "4.18.0-240.10.1.el8_3.x86_64".
2021-07-08T20:29:27.689Z| modconfig| I005: Found compiler at "/usr/bin/gcc"
2021-07-08T20:29:27.692Z| modconfig| I005: Got gcc version "9".
2021-07-08T20:29:27.692Z| modconfig| I005: GCC major version 9 does not match Kernel GCC major version 8.
2021-07-08T20:29:27.692Z| modconfig| I005: Attempting to use a compiler at location "/usr/bin/gcc-8".
2021-07-08T20:29:27.703Z| modconfig| I005: Got gcc version "8".
2021-07-08T20:29:27.703Z| modconfig| I005: The GCC version matches the kernel GCC minor version like a glove.
2021-07-08T20:29:27.703Z| modconfig| W003: Header path "(null)" is not suitable for building.
2021-07-08T20:29:27.703Z| modconfig| I005: We are now shutdown.  Ready to die!
root@runner-nfmrtx5g-project-134-concurrent-1:/# cat /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h 
#define LINUX_VERSION_CODE 266752
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 😎 + (c))
#define RHEL_MAJOR 8
#define RHEL_MINOR 3
#define RHEL_RELEASE_VERSION(a,b) (((a) << 😎 + (b))
#define RHEL_RELEASE_CODE 2051
#define RHEL_RELEASE "240.10.1"
0 Kudos
ajgringo619
Hot Shot
Hot Shot

Are you certain that the version.h header should be in /lib/modules? I've been playing around with OracleServer 8.4 (closest I can get to RHEL) and I'm finding that file in /usr/src/kernels.

0 Kudos
baileymegan
Contributor
Contributor

No I'm not certain that where it should be, but that is where VMWare seems to be looking for it.

/lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/linux/version.h and then /lib/modules/4.18.0-240.10.1.el8_3.x86_64/build/include/generated/uapi/linux/version.h 

I checked /usr/src/kernels/4.18.0-240.10.1.el8_3.x86_64/include/linux and i only have an iversion.h there

0 Kudos
ajgringo619
Hot Shot
Hot Shot

I'm not finding anything under /lib/modules, even on my Linux Mint host. Sorry, but I have no idea why your program is looking for development headers in the modules directory. It should be looking in /usr/src.

For example, I find the file in the exact same location as you, but in the /usr/src/kernels directory:

/usr/src/kernels/5.4.17-2102.202.5.el8uek.x86_64/include/generated/uapi/linux/version.h.

Not sure where to go from here; you may want to contact the devs of packer.

0 Kudos
baileymegan
Contributor
Contributor

Alright, I should contact some devs. Thank you for your help. I'm fairly confident its vmware related rather than packer because I believe vmware produces these logs during workstation install before packer runs.

0 Kudos