ndavie
Contributor
Contributor

VM Workstation 16.1->16.2.1 on Ubuntu 21.10 broke everything

Ubuntu 21.10

I was annoyed to find shared VMs gone in 16, I was able to limp along and everything was fine until I "upgraded" and now I can't even create a VM.  

VMware Workstation unrecoverable error: (mks)
ISBRendererComm: Lost connection to mksSandbox (2878)
A log file is available in "/home/ndavie/Documents/vmware/AME 21H1/vmware.log".
You can request support.

To collect data to submit to VMware support, choose "Collect Support Data" from the Help menu.
You can also run the "vm-support" script in the Workstation folder directly.
We will respond on the basis of your support entitlement.

 

 

Labels (2)
59 Replies
robertmglynn
Contributor
Contributor

@tomarmisteadthat's what I get for rushing. Your fix seems to be working now. Running Windows 10 guest in PopOS 21.10 host, VMWare Workstation Pro 16.2.1. Networking and shared clipboard work, in addition to the guest generally running fine so far. Thanks again; I certainly owe you!

tomarmistead
Contributor
Contributor

@robertmglynn I tried to attach vmmon-only/include/vm_asm_x86.h , but this wouldn't let me.   Here is a pasted copy with my change;

----

/*********************************************************
* Copyright (C) 1998-2014,2016-2020 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*********************************************************/

/*
* vm_asm_x86.h
*
* IA32 asm macros
*/

#ifndef _VM_ASM_X86_H_
#define _VM_ASM_X86_H_


#define INCLUDE_ALLOW_MODULE
#define INCLUDE_ALLOW_VMMON
#define INCLUDE_ALLOW_VMK_MODULE
#define INCLUDE_ALLOW_VMKERNEL
#define INCLUDE_ALLOW_DISTRIBUTE
#define INCLUDE_ALLOW_VMCORE
#define INCLUDE_ALLOW_USERLEVEL
#include "includeCheck.h"

#include "cpu_types.h"
#include "x86desc.h"
#include "x86sel.h"
#include "x86_basic_defs.h"
#include "x86msr.h"

#ifdef VM_X86_64
#define _GETSET_DTR_TYPE DTR64
#else
#define _GETSET_DTR_TYPE DTR32
#endif

#ifdef __GNUC__

/* ASSERT_ON_COMPILE_SELECTOR_SIZE:
*
* - Selector must be 16-bits.
* - If a constant is used, it better be only 16-bits.
* - If it's not a constant, it must be Selector-sized. or less.
*
* Although aesthetically the following looks nicer, gcc is unable
* to produce a constant expression for it:
*
* ASSERT_ON_COMPILE(sizeof(Selector) == 2 && \
* ((__builtin_constant_p(expr) ? ((expr) >> 16) == 0) \
* : sizeof(expr) <= 2)
*/
//#ifndef USE_UBSAN
//#define ASSERT_ON_COMPILE_SELECTOR_SIZE(expr) \
// ASSERT_ON_COMPILE(sizeof(Selector) == 2 && \
// ((__builtin_constant_p(expr) && ((expr) >> 16) == 0) || \
// sizeof(expr) <= 2))
//#else
#define ASSERT_ON_COMPILE_SELECTOR_SIZE(expr)
//#endif


/* Checked against the Intel manual and GCC --hpreg */
static INLINE void
_Set_GDT(_GETSET_DTR_TYPE *dtr)
{
__asm__(
"lgdt %0"
:
: "m" (*dtr)
);
}

/* Checked against the Intel manual and GCC --hpreg */
static INLINE void
_Set_IDT(_GETSET_DTR_TYPE *dtr)
{
__asm__(
"lidt %0"
:
: "m" (*dtr)
);
}

/*
* Checked against the Intel manual and GCC --hpreg
* volatile because there's a hidden input (the [IG]DTR) that can change
* without the compiler knowing it.
*/
static INLINE void
_Get_GDT(_GETSET_DTR_TYPE *dtr)
{
__asm__ __volatile__(
"sgdt %0"
: "=m" (*dtr)
);
}

/*
* Checked against the Intel manual and GCC --hpreg
* volatile because the [IG]DT can change without the compiler knowing it
* (when we use l[ig]dt).
*/
static INLINE void
_Get_IDT(_GETSET_DTR_TYPE *dtr)
{
__asm__ __volatile__(
"sidt %0"
: "=m" (*dtr)
);
}


#define SET_LDT(expr) \
do { \
const Selector _set_ldt_sel = (Selector)(expr); \
ASSERT_ON_COMPILE_SELECTOR_SIZE(expr); \
/* lldt reads from the GDT; don't sink any writes. */ \
COMPILER_MEM_BARRIER(); \
/* Checked against the Intel manual and GCC --hpreg */ \
__asm__("lldt %0" \
: \
: "rm" (_set_ldt_sel)); \
} while (0)


/* Checked against the Intel manual and GCC --hpreg
*
* volatile because the LDT can change without the compiler knowing it
* (when we use lldt).
*/
static INLINE void
_GET_LDT(Selector * const result)
{
__asm__ __volatile__("sldt %0"
: "=rm" (*result));
}


#define GET_LDT(var) \
do { \
_GET_LDT(&(var)); \
} while (0)


#define _BUILD_SET_R(func, reg) \
static INLINE void \
func(uintptr_t r) \
{ \
__asm__("mov %0, %%" #reg \
: /* no outputs */ \
: "r" (r) \
: "memory"); \
}

/*
* The inline asm is marked 'volatile' because CRs and DRs can change
* without the compiler knowing it (when there is a page fault, when a
* breakpoint occurs, and moreover it seems there is no way to teach
* gcc that smsw clobbers cr0 for example).
*/
#define _BUILD_GET_R(func, reg) \
static INLINE uintptr_t \
func(void) \
{ \
uintptr_t result; \
__asm__ __volatile__("mov %%" #reg ", %0" \
: "=r" (result)); \
return result; \
}

_BUILD_SET_R(_SET_CR0, cr0)
_BUILD_SET_R(_SET_CR2, cr2)
_BUILD_SET_R(_SET_CR3, cr3)
_BUILD_SET_R(_SET_CR4, cr4)
_BUILD_SET_R(_SET_CR8, cr8)

_BUILD_GET_R(_GET_CR0, cr0)
_BUILD_GET_R(_GET_CR2, cr2)
_BUILD_GET_R(_GET_CR3, cr3)
_BUILD_GET_R(_GET_CR4, cr4)
_BUILD_GET_R(_GET_CR8, cr8)

_BUILD_SET_R(_SET_DR0, dr0)
_BUILD_SET_R(_SET_DR1, dr1)
_BUILD_SET_R(_SET_DR2, dr2)
_BUILD_SET_R(_SET_DR3, dr3)
_BUILD_SET_R(_SET_DR6, dr6)
_BUILD_SET_R(_SET_DR7, dr7)

_BUILD_GET_R(_GET_DR0, dr0)
_BUILD_GET_R(_GET_DR1, dr1)
_BUILD_GET_R(_GET_DR2, dr2)
_BUILD_GET_R(_GET_DR3, dr3)
_BUILD_GET_R(_GET_DR6, dr6)
_BUILD_GET_R(_GET_DR7, dr7)

#define SET_CR2(expr) SET_CR_DR(CR, 2, expr)

#define SET_SEGREG(reg, expr) \
do { \
const Selector _set_segreg_sel = (Selector)(expr); \
ASSERT_ON_COMPILE_SELECTOR_SIZE(expr); \
/* mov to Sreg reads from the [GL]DT; don't sink any writes. */ \
COMPILER_MEM_BARRIER(); \
/* Checked against the Intel manual and GCC --hpreg */ \
__asm__("movw %0, %%" #reg \
: \
: "rm" (_set_segreg_sel)); \
} while (0)

#define SET_DS(expr) SET_SEGREG(ds, expr)
#define SET_ES(expr) SET_SEGREG(es, expr)
#define SET_FS(expr) SET_SEGREG(fs, expr)
#define SET_GS(expr) SET_SEGREG(gs, expr)
#define SET_SS(expr) SET_SEGREG(ss, expr)

/* Checked against the Intel manual and GCC --hpreg
*
* volatile because the content of CS can change without the compiler
* knowing it (when we use call gates).
*
* XXX: The segment register getter functions have not been updated to
* have stricter type checking like many other functions in this
* file because they return a value, rather than taking an
* argument. Perhaps sometime in the future, a willing soul will
* change these accessors to take an argument and at the same
* time install better type checking.
*/
#define _BUILD_GET_SEG(func, reg) \
static INLINE Selector \
func(void) \
{ \
Selector result; \
__asm__ __volatile__("movw %%" #reg ", %0" \
: "=rm" (result)); \
return result; \
}

_BUILD_GET_SEG(GET_CS, cs)
_BUILD_GET_SEG(GET_DS, ds)
_BUILD_GET_SEG(GET_ES, es)
_BUILD_GET_SEG(GET_FS, fs)
_BUILD_GET_SEG(GET_GS, gs)
_BUILD_GET_SEG(GET_SS, ss)


#define SET_TR(expr) \
do { \
const Selector _set_tr_sel = (Selector)(expr); \
ASSERT_ON_COMPILE_SELECTOR_SIZE(expr); \
/* ltr reads from the GDT; don't sink any writes. */ \
COMPILER_MEM_BARRIER(); \
/* Checked against the Intel manual and GCC --hpreg */ \
__asm__ __volatile__("ltr %0" \
: \
: "rm" (_set_tr_sel) : "memory"); \
} while (0)

/* Checked against the Intel manual and GCC --hpreg

volatile because the content of TR can change without the compiler knowing
it (when we use task gates). */
static INLINE void
_GET_TR(Selector * const result)
{
__asm__ __volatile__("str %0"
: "=rm" (*result));
}

#define GET_TR(var) \
do { \
_GET_TR(&(var)); \
} while (0)


/* Checked against the Intel manual and GCC --hpreg

We use this to restore interrupts, so this cannot be reordered around
by gcc */
static INLINE void
_Set_flags(uintptr_t f)
{
__asm__ __volatile__(
"push %0" "\n\t"
"popf"
:
: "g" (f)
: "memory", "cc"
);
}

 

/* Checked against the Intel manual and GCC --hpreg

volatile because gcc 2.7.2.3 doesn't know when eflags are modified (it
seems to ignore the "cc" clobber). gcc 2.95.2 is ok: it optimize 2
successive calls only if there is no instructions in between. */
static INLINE uintptr_t
_Get_flags(void)
{
uintptr_t result;

__asm__ __volatile__(
"pushf" "\n\t"
"pop %0"
: "=rm" (result)
:
: "memory"
);

return result;
}

#define SAVE_FLAGS(var) do { \
var = _Get_flags(); \
} while (0)

static INLINE Bool
HwInterruptsEnabled(uint32 eflags)
{
return (eflags & EFLAGS_IF) != 0;
}

static INLINE void
HwInterruptsDisable(uint64 *rflags)
{
*rflags &= ~EFLAGS_IF;
}

/* Checked against the Intel manual and GCC --hpreg */
static INLINE void
CLTS(void)
{
__asm__ __volatile__ ("clts");
}


/* Beginning of the section whose correctness has NOT been checked */
#define FNCLEX() __asm__("fnclex" ::);

/* TLB_INVALIDATE_PAGE is not checked yet */
#define TLB_INVALIDATE_PAGE(_addr) do { \
__asm__ __volatile__("invlpg %0": :"m" (*(char *) (_addr)):"memory"); \
} while (0)

#define RESTORE_FLAGS _Set_flags
#define ENABLE_INTERRUPTS() __asm__ __volatile__ ("sti": : :"memory")
#define CLEAR_INTERRUPTS() __asm__ __volatile__ ("cli": : :"memory")
#define RAISE_INTERRUPT(_x) __asm__ __volatile__("int %0" :: "g" (_x))
#define RETURN_FROM_INT() __asm__ __volatile__("iret" :: )

/* End of the section whose correctness has NOT been checked */

#elif defined _MSC_VER /* !__GNUC__ */

#define _BUILD_SET_DR(func, reg) \
static INLINE void \
func(uintptr_t r) \
{ \
__writedr(reg, r); \
}

#define _BUILD_GET_DR(func, reg) \
static INLINE uintptr_t \
func(void) \
{ \
return __readdr(reg); \
}

#define _BUILD_SET_CR(func, reg) \
static INLINE void \
func(uintptr_t r) \
{ \
__writecr##reg(r); \
}

#define _BUILD_GET_CR(func, reg) \
static INLINE uintptr_t \
func(void) \
{ \
return __readcr##reg(); \
}

_BUILD_SET_DR(_SET_DR0, 0)
_BUILD_SET_DR(_SET_DR1, 1)
_BUILD_SET_DR(_SET_DR2, 2)
_BUILD_SET_DR(_SET_DR3, 3)
_BUILD_SET_DR(_SET_DR6, 6)
_BUILD_SET_DR(_SET_DR7, 7)

_BUILD_GET_DR(_GET_DR0, 0)
_BUILD_GET_DR(_GET_DR1, 1)
_BUILD_GET_DR(_GET_DR2, 2)
_BUILD_GET_DR(_GET_DR3, 3)
_BUILD_GET_DR(_GET_DR6, 6)
_BUILD_GET_DR(_GET_DR7, 7)

_BUILD_SET_CR(_SET_CR0, 0);
_BUILD_SET_CR(_SET_CR3, 3);
_BUILD_SET_CR(_SET_CR4, 4);
_BUILD_SET_CR(_SET_CR8, 8);

_BUILD_GET_CR(_GET_CR0, 0);
_BUILD_GET_CR(_GET_CR2, 2);
_BUILD_GET_CR(_GET_CR3, 3);
_BUILD_GET_CR(_GET_CR4, 4);
_BUILD_GET_CR(_GET_CR8, 8);

static INLINE void
_Set_GDT(_GETSET_DTR_TYPE *dtr)
{
_lgdt(dtr);
}

static INLINE void
_Get_GDT(_GETSET_DTR_TYPE *dtr)
{
_sgdt(dtr);
}

static INLINE void
_Set_IDT(_GETSET_DTR_TYPE *dtr)
{
__lidt(dtr);
}

static INLINE void
_Get_IDT(_GETSET_DTR_TYPE *dtr)
{
__sidt(dtr);
}


#define ENABLE_INTERRUPTS() _enable()
#define CLEAR_INTERRUPTS() _disable()

#define SAVE_FLAGS(x) do { \
(x) = __readeflags(); \
} while (0)

#define RESTORE_FLAGS(x) __writeeflags(x)

#endif /* !__GNUC__ && !_MSC_VER */


#define SET_CR_DR(regType, regNum, expr) \
do { \
/* Ensure no implicit truncation of 'expr' */ \
ASSERT_ON_COMPILE(sizeof(expr) <= sizeof(uintptr_t)); \
_SET_##regType##regNum(expr); \
} while (0)

#define GET_CR_DR(regType, regNum, var) \
do { \
var = _GET_##regType##regNum(); \
} while (0)

#define SET_DR0(expr) SET_CR_DR(DR, 0, expr)
#define SET_DR1(expr) SET_CR_DR(DR, 1, expr)
#define SET_DR2(expr) SET_CR_DR(DR, 2, expr)
#define SET_DR3(expr) SET_CR_DR(DR, 3, expr)
#define SET_DR6(expr) SET_CR_DR(DR, 6, expr)
#define SET_DR7(expr) SET_CR_DR(DR, 7, expr)

#define GET_DR0(var) GET_CR_DR(DR, 0, var)
#define GET_DR1(var) GET_CR_DR(DR, 1, var)
#define GET_DR2(var) GET_CR_DR(DR, 2, var)
#define GET_DR3(var) GET_CR_DR(DR, 3, var)
#define GET_DR6(var) GET_CR_DR(DR, 6, var)
#define GET_DR7(var) GET_CR_DR(DR, 7, var)

/* Undefine GET_CR0; it is defined in mach_asm.h for SLES cross-compile */
#undef GET_CR0
#define GET_CR0(var) GET_CR_DR(CR, 0, var)
#define GET_CR2(var) GET_CR_DR(CR, 2, var)
#define GET_CR3(var) GET_CR_DR(CR, 3, var)
#define GET_CR4(var) GET_CR_DR(CR, 4, var)
#define GET_CR8(var) GET_CR_DR(CR, 8, var)

#define SET_CR0(expr) SET_CR_DR(CR, 0, expr)
#define SET_CR3(expr) SET_CR_DR(CR, 3, expr)
#define SET_CR4(expr) SET_CR_DR(CR, 4, expr)
#define SET_CR8(expr) SET_CR_DR(CR, 8, expr)

static INLINE Bool
INTERRUPTS_ENABLED(void)
{
#if !defined(USERLEVEL)
uintptr_t flags;
SAVE_FLAGS(flags);
return ((flags & EFLAGS_IF) != 0);
#else
/* At userlevel interrupts are always enabled. */
return TRUE;
#endif
}


/*
* [GS]ET_[GI]DT() are defined as macros wrapping a function
* so we can pass the argument implicitly by reference (requires
* a macro) and get type checking too (requires a function).
*/

#define SET_GDT(_gdt) _Set_GDT(&(_gdt))
#define GET_GDT(_gdt) _Get_GDT(&(_gdt))

#define SET_IDT(_idt) _Set_IDT(&(_idt))
#define GET_IDT(_idt) _Get_IDT(&(_idt))

#if !defined(VMKERNEL)
#define NO_INTERRUPTS_BEGIN() do { \
uintptr_t _flags; \
SAVE_FLAGS(_flags); \
CLEAR_INTERRUPTS();

#define NO_INTERRUPTS_END() RESTORE_FLAGS(_flags); \
} while(0)
#endif


#if defined (__GNUC__)
static INLINE unsigned
CURRENT_CPL(void)
{
return SELECTOR_RPL(GET_CS());
}
#endif


static INLINE uint64
RDPMC(int counter)
{
#ifdef __GNUC__
#ifdef VM_X86_64
uint64 pmcLow;
uint64 pmcHigh;

__asm__ __volatile__(
"rdpmc"
: "=a" (pmcLow), "=d" (pmcHigh)
: "c" (counter)
);

return pmcHigh << 32 | pmcLow;
#else
uint64 pmc;

__asm__ __volatile__(
"rdpmc"
: "=A" (pmc)
: "c" (counter)
);

return pmc;
#endif
#elif defined _MSC_VER
return __readpmc(counter);
#endif
}


#if defined(VMM) || defined(VMKERNEL) || defined(FROBOS) || defined (ULM)
static INLINE uint64
__XGETBV(int cx)
{
#ifdef __GNUC__
#ifdef VM_X86_64
uint64 lowval, hival;
__asm__ __volatile__(
"xgetbv"
: "=a" (lowval), "=d" (hival)
: "c" (cx)
);
return hival << 32 | lowval;
#else
uint64 val;
__asm__ __volatile__(
"xgetbv"
: "=A" (val)
: "c" (cx)
);
return val;
#endif
#elif defined _MSC_VER
return _xgetbv((unsigned)cx);
#endif
}

static INLINE void
__XSETBV(int cx, uint64 val)
{
#ifdef __GNUC__
__asm__ __volatile__(
"xsetbv"
: /* no outputs */
: "a" ((uint32)val), "d" ((uint32)(val >> 32)), "c" (cx)
);
#elif defined _MSC_VER
_xsetbv((unsigned)cx, val);
#endif
}

static INLINE uint64
GET_XCR0(void)
{
return __XGETBV(0);
}

#define SET_XCR0(val) __XSETBV(0, val)

static INLINE void
SET_XCR0_IF_NEEDED(uint64 newVal, uint64 oldVal)
{
#ifndef VMM_BOOTSTRAP
ASSERT(oldVal == GET_XCR0());
if (newVal != oldVal) {
SET_XCR0(newVal);
}
#endif
}
#endif


static INLINE uint32
RDTSCP_AuxOnly(void)
{
#ifdef __GNUC__
uint32 tscLow, tscHigh, tscAux;

__asm__ __volatile__(
"rdtscp"
: "=a" (tscLow), "=d" (tscHigh), "=c" (tscAux)
);

return tscAux;
#elif defined _MSC_VER
uint32 tscAux;

__rdtscp(&tscAux);

return tscAux;
#endif
}


static INLINE uint64
RDTSCP(void)
{
#ifdef __GNUC__
uint32 tscLow, tscHigh, tscAux;

__asm__ __volatile__(
"rdtscp"
:"=a" (tscLow), "=d" (tscHigh), "=c" (tscAux)
);

return QWORD(tscHigh, tscLow);
#elif defined _MSC_VER
uint32 tscAux;

return __rdtscp(&tscAux);
#endif
}

#endif

DeathCamel57
Contributor
Contributor

I thought I'd chime in that this seems to be a common error for me. The solution that I've found is to use the vmware host module patches that are constantly updated here: https://github.com/mkubecek/vmware-host-modules

These patches have worked consistently after vmware updates. My workflow to update vmware is as follows:

  1. Update VMWare Workstation Pro
  2. Checkout correct branch (`workstation-16.2.1` in my case).
  3. In source of patches run:
    1. `make`
    2. `sudo make install`
  4. Launch VMware Workstation Pro
If my comments are helpful, I'd really appreciate some kudos.
ehfl
Contributor
Contributor

This doesn't work. 

make results in the following error messages:

make -C vmmon-only
make[1]: *** vmmon-only: No such file or directory. Stop.
make: *** [Makefile:21: vmmon-only] Error 2

sudo make install results in the following error message:

make: *** No rule to make target 'vmmon-only/vmmon.ko', needed by 'install'. Stop.

 

0 Kudos
vodkanaut
Contributor
Contributor

wow having the same issue going to try this today thanks for the post. 

0 Kudos
vodkanaut
Contributor
Contributor

awesome thanks for this - using the above steps and this mod on pop0S 20.10   with vmware-workstation 16.2.1 build-18811642 i was able to get it running 

sabennett
Contributor
Contributor

I'm not a developer or a big Github "user" if you will ... I think the method mentioned in this post to pull from Github only works if you've cloned the repository.

There is an INSTALL guide in the link provided by @DeathCamel57 that provides other install alternatives, including the setup procedures required to Build and Install the modules directly.

Clicky here for RAW format of INSTALL directions 

DeathCamel57's link to Git repo 

I've performed the "Second Method" under the first section labeled "0. Quick guide for impatient" in that file.

It worked perfectly for me.

I recommend you read the entire file and decide for yourself how to proceed.

The following is copied from the INSTALL file (Credit to @mkubecek )

NOTE: You need to update the version from the install file from 14.1.1 to 16.2.1 for the wget address AND make sure to do the last two commands with sudo

Second method (replace original tarballs):

  wget https://github.com/mkubecek/vmware-host-modules/archive/workstation-16.2.1.tar.gz
  tar -xzf workstation-16.2.1.tar.gz
  cd vmware-host-modules-workstation-16.2.1
  tar -cf vmmon.tar vmmon-only
  tar -cf vmnet.tar vmnet-only
  cp -v vmmon.tar vmnet.tar /usr/lib/vmware/modules/source/
  vmware-modconfig --console --install-all

In this case, last two commands require root privileges.

I've also attached the INSTALL as a text file.

masterpier
Contributor
Contributor

this did not work for me, when I tried running make got the following error:

root@neon-lnx:/usr/lib/vmware/modules/source/vmmon-only# make VM_UNAME='5.15.11-051511-generic'
Using kernel build system.
make -C /lib/modules/5.15.11-051511-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
 MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.11-051511-generic'
 CC [M]  /usr/lib/vmware/modules/source/vmmon-only/common/task.o
In file included from /usr/lib/vmware/modules/source/vmmon-only/./include/vm_asm.h:44,
                from /usr/lib/vmware/modules/source/vmmon-only/common/task.c:52:
/usr/lib/vmware/modules/source/vmmon-only/./include/vm_asm_x86.h:66:1: warning: multi-line comment [-Wcomment]
  66 | //#define ASSERT_ON_COMPILE_SELECTOR_SIZE(expr)                                \
     | ^
In file included from /usr/lib/vmware/modules/source/vmmon-only/./include/vm_asm.h:44,
                from /usr/lib/vmware/modules/source/vmmon-only/common/task.c:52:
/usr/lib/vmware/modules/source/vmmon-only/common/task.c: In function ‘TaskRestoreHostGDTTRLDT’:
/usr/lib/vmware/modules/source/vmmon-only/./include/vm_asm_x86.h:263:7: error: implicit declaration of function ‘AS
SERT_ON_COMPILE_SELECTOR_SIZE’ [-Werror=implicit-function-declaration]
 263 |       ASSERT_ON_COMPILE_SELECTOR_SIZE(expr);                            \
     |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/vmware/modules/source/vmmon-only/common/task.c:724:7: note: in expansion of macro ‘SET_TR’
 724 |       SET_TR(tr);
     |       ^~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: /usr/lib/vmware/modules/source/vmmon-only/common/task.o] Error 1
make[1]: *** [Makefile:1874: /usr/lib/vmware/modules/source/vmmon-only] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.11-051511-generic'
make: *** [Makefile:117: vmmon.ko] Error 2

0 Kudos
vodkanaut
Contributor
Contributor

looks like you commented out  | //#define ASSERT_ON_COMPILE_SELECTOR_SIZE(expr)  as well ; this line has to remain uncommented (at least in popos from my testing)    i had the same problem the 1st time I tired it and took me a few tires to see it.   ill attach a sample screen shot of the code section from modified vm_asm_x86.h file 

 

vodkanaut_0-1640902471664.png

 

sabennett
Contributor
Contributor

I updated my post  hopefully to make more clear that line 71 is NOT to be commented out.

 

0 Kudos
KrunkerBear
Contributor
Contributor

If anyone else has issues running 

 

17. sudo cp vmmon.o /lib/modules/`uname -r`/kernel/drivers/misc/vmmon.ko


18. sudo cp vmnet.o /lib/modules/`uname -r`/kernel/drivers/misc/vmnet.ko

 

I found running sudo su before running them fixes it 🙂

shibu_nyc
Enthusiast
Enthusiast

Thank you so much sabennett

Just got VMware WS Pro 16.2.1 working for the first time in nearly a month!

It will be a long time before I upgrade to the next linux kernal. Maybe I'll get a second popOS system just to verify that WS Pro will work with any new kernal before upgrading on my production machine in the future.

I gave you a Kudo, If I could support you on patreon or something for your time I would.

Great detailed tutorial that a 5yo could understand - which is exactly what I needed.

BTW, even though I need things spelled out I prefer the command line over the graphic interface. I just don't know all of the commands but when you spell out all the lines verbatim it is much easier to cp and paste than It is to look for different settings in windows.

yrona
Contributor
Contributor

sabennet, 

 

Your fix worked like a charm!  Thank you so much!

 

In my case vmnet compiled without any problems.   For those unsure how to make the fix, I am enclosing a screenshot of what it should look like in gedit
.Screenshot from 2022-02-01 09-49-34.png

Note that Line 71 of vm_asm_x86.h is not commented out.

cschance
Contributor
Contributor

A recent update to Pop!_OS has broken VMware again.  This time, the solution proposed by @sabennett is not working.  The new error:

Using kernel build system.
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
You are using: gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
In file included from /usr/lib/vmware/modules/source/vmmon-only/linux/driverLog.h:33,
from /usr/lib/vmware/modules/source/vmmon-only/linux/driverLog.c:31:
/usr/lib/vmware/modules/source/vmmon-only/./include/vm_assert.h:43:10: fatal error: stdarg.h: No such file or directory
43 | #include <stdarg.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /usr/lib/vmware/modules/source/vmmon-only/linux/driverLog.o] Error 1
make[1]: *** [Makefile:1852: /usr/lib/vmware/modules/source/vmmon-only] Error 2
make: *** [Makefile:117: vmmon.ko] Error 2

0 Kudos
masterpier
Contributor
Contributor

Which Kernel are you using?

0 Kudos
cschance
Contributor
Contributor

I am using 5.16.11-76051611-generic.  I have tried to build against the previous kernel following instructions linked to above, but I receive a "Staring VMware service: Virtual machine monitor: failed" message when I run 'vmware-modconfig --console --install-all'.

The Workstation application will start, but I get an error message "Could not open /dev/vmmon: No such file or directory" when I try to get start a virtual machine.

0 Kudos
cschance
Contributor
Contributor

I did not find a solution to my problem.  I ended up using kernelstub to boot to an older version of the kernel, then rebuilt the modules for that version.

0 Kudos
hadojae
Contributor
Contributor

I ran into this issue this morning and it seems like the system is unable to locate stdarg.h and stddef.h. 

if you do

$ locate stdarg.h

you'll see that there are probably a bunch of copies on your machine. 

if you symlink these missing files from current active kernel (for me right now) /usr/src/linux-headers-5.16.11-76051611/include/linux/

such as

s76@s76:/usr/lib/vmware/modules/source/vmmon-only/include$ sudo ln -s /usr/src/linux-headers-5.16.11-76051611/include/linux/stdarg.h stdarg.h
s76@s76:/usr/lib/vmware/modules/source/vmmon-only/include$ sudo ln -s /usr/src/linux-headers-5.16.11-76051611/include/linux/stddef.h stddef.h

s76@s76:/usr/lib/vmware/modules/source/vmnet-only$ sudo ln -s /usr/src/linux-headers-5.16.11-76051611/include/linux/stddef.h stddef.h
s76@s76:/usr/lib/vmware/modules/source/vmnet-only$ sudo ln -s /usr/src/linux-headers-5.16.11-76051611/include/linux/stdarg.h stdarg.h

into both the vmmon-only and vmnet-only prior to your 'sudo make' it will find these files and things should start up ok following @sabennett's previous instructions.

im sure theres a more elegant way to tell the makefile where to look or something, but i just needed to get it working 🙂

mkubecek
Hot Shot
Hot Shot

Just include <linux/stdarg.h> and <linux/stddef.h> instead, like commits 9a6a17fe0bc6 and 4232f780eb11 do. Kernel code is not supposed to include userspace headers which is what existing include directives used to do.

davidhartleyllc
Contributor
Contributor

My fix summarized - Note I am running Rocky Linux 8 but the fix should work on other distros.
Edits to .h files were only needed if I downloaded the wrong version from github.

The instructions on the github site were not super clear.
The example referenced was vmware 14.x, so if you download that and and you are running a different version of Vmware Workstation such as 16.x, the fix will not work.
I downloaded the correct version as shown below for workstation 16.2.1 and I was able to compile it without any edits:

(I ran as root so I did not have to sudo, and I have only shown the commands I ran below without any output)

# wget https://github.com/mkubecek/vmware-host-modules/archive/workstation-16.2.1.tar.gz
# tar xvf workstation-16.2.1.tar.gz
# cd vmware-host-modules-workstation-16.2.1/
# make
# make install
# vmware
(one vmware is running you are prompted for a license etc, and once installed you can run it as root or as a user)

Hope that helps!