Skip to content

Instantly share code, notes, and snippets.

@mhtsai1010
Created August 29, 2016 02:46
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mhtsai1010/e6f3442cefc34ae7069dc2b5e690577c to your computer and use it in GitHub Desktop.
Enable promiscuous mode of vmware on a Linux Host
Ref: https://bbs.archlinux.org/viewtopic.php?id=65508
1/ Method 1
# First, create a new Linux group which has permission to use promiscuous mode, and add yourself to the group.
$ groupadd promiscuous
$ usermod -a -G promiscuous <your_user_id>
# Update the group ownership and access permission of /dev/vmnet*
$ chgrp promiscuous /dev/vmnet*
$ chmod g+rw /dev/vmnet*
2/ Method 2
To allow all users (instead of a specific user) to set the virtual adapter to promiscuous mode, run the following command on host machine.
$ chmod a+rw /dev/vmnet*
Above setting is a temporary solution as the reboot will delete changes.
==To make it permanent at each reboot==
# For Method 1 (assuming that you already created a Linux group called "promiscuous" as described earlier):
Find the line vmwareStartVmnet in /etc/init.d/vmware
vmwareStartVmnet() {
vmwareLoadModule $vnet
"$BINDIR"/vmware-networks --start >> $VNETLIB_LOG 2>&1
chgrp promiscuous /dev/vmnet*
chmod g+rw /dev/vmnet*
}
# For Method 2 :
Find the line vmwareStartVmnet in /etc/init.d/vmware, and put the chmod as below :
vmwareStartVmnet()
vmwareLoadModule $vnet
"$BINDIR"/vmware-networks --start >> $VNETLIB_LOG 2>&1
chmod a+rw /dev/vmnet*
}
@izznogooood
Copy link

izznogooood commented Apr 24, 2018

Thanks, this does not work in vmware 14 as it does not use init.d

I made a simple script:

#!/bin/bash
chown root:<username> /dev/vmnet*
chmod 660 /dev/vmnet*

saved in "/opt/scripts/enable_vmware_promiscuous"
edit /etc/systemd/system/multi-user.target.wants/vmware-networks.service
add:

ExecStartPre=/opt/scripts/enable_vmware_promiscuous

@joeyglands
Copy link

joeyglands commented May 4, 2019

Worked like a charm!

Thanks @izznogooood

UPDATE: not sure what happened but your solution doesn't work

I'm using VMware Workstation 14.0 and @mhtsai1010 solution is working instead

Thanks @mhtsai1010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment