Executing yum/rpm commands using VMWare tools facility ("vmrun") fails in error when packages have scriptlets

Solution Verified - Updated -

Issue

  • When executing a yum command using the VMWare tools facility vmrun, the command fails
  • AVCs related to transition are seen in the audit log

    type=PATH msg=audit([...]): item=0 name="/bin/sh" [...] obj=system_u:object_r:shell_exec_t:s0 [...]
    type=CWD msg=audit([...]): cwd="/"
    type=SYSCALL msg=audit([...]): arch=c000003e syscall=59 success=no exit=-13 [...] comm="yum" exe="/usr/libexec/platform-python3.6" subj=system_u:system_r:vmtools_unconfined_t:s0 key=(null)
    type=AVC msg=audit([...]): avc:  denied  { transition } for  pid=XXX comm="yum" path="/usr/bin/bash" dev="dm-0" ino=XXX scontext=system_u:system_r:vmtools_unconfined_t:s0 tcontext=system_u:system_r:rpm_script_t:s0 tclass=process permissive=0
    
  • The output of the yum command shows Permission denies while executing scriptlets

    [...]: Running transaction
    [...]:   Preparing        :                                                        1/1
    [...]:   Reinstalling     : cronie-1.5.2-4.el8.x86_64                              1/2
    [...]:   Running scriptlet: cronie-1.5.2-4.el8.x86_64                              1/2
    [...]: error: failed to exec scriptlet interpreter /bin/sh: Permission denied
    [...]: warning: %post(cronie-1.5.2-4.el8.x86_64) scriptlet failed, exit status 127
    [...]: Error in POSTIN scriptlet in rpm package cronie
    [...]: error: failed to exec scriptlet interpreter /bin/sh: Permission denied
    [...]: warning: %triggerin(cronie-1.5.2-4.el8.x86_64) scriptlet failed, exit status 127
    [...]: Error in <unknown> scriptlet in rpm package cronie
    [...]:   Running scriptlet: cronie-1.5.2-4.el8.x86_64                              2/2
    [...]
    

Environment

  • Red Hat Enterprise Linux 8.
  • Red Hat Enterprise Linux 7.

    • open-vm-tools
  • VMWare

    • vmrun
    • vRealize Orchestrator Run program in guest

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content