PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:virtualization:vmware:workstation:enable-promiscuous-mode-generic-user-privilege-on-linux-version-vmware-workstation:enable-promiscuous-mode-generic-user-privilege-on-linux-version-vmware-workstation

VMware Workstation 16.1: Enable promiscuous mode by generic user in Linux

Abstract

Some Network Intensive Virtual Machine requires enter promiscuos mode Network Simulation(CML-P), Network Analyzer(Wireshark), OpenStack, and so on.
VMware Workstation in Windows no problem, it handles corectly.
But Linux version VMware Workstation will not work correctly by default because vmnet special device permission not allowed read/write permission.

Problem Description

The virtual machine's operating system has attempted to enable promiscuous mode on adapter 'Ethernet0'. This is not allowed for security reasons.
Please go to the Web page “http://vmware.com/info?id=161” for help enabling promiscuous mode in the virtual machine.

  1. VMware Workstation 16.1.1
  2. Ubuntu 20.04 LTS Desktop

Resolution

wnoguchi@lasthope:~$ ls -l /dev/vmnet*
crw------- 1 root root 119, 0 Apr  4 08:11 /dev/vmnet0
crw------- 1 root root 119, 1 Apr  4 08:11 /dev/vmnet1
crw------- 1 root root 119, 2 Apr  4 08:11 /dev/vmnet2
crw------- 1 root root 119, 3 Apr  4 08:11 /dev/vmnet3
crw------- 1 root root 119, 8 Apr  4 08:11 /dev/vmnet8
sudo addgroup --system vmware
sudo usermod -aG vmware wnoguchi
wnoguchi@lasthope:~$ sudo addgroup --system vmware
Adding group `vmware' (GID 136) ...
Done.
wnoguchi@lasthope:~$ id
uid=1000(wnoguchi) gid=1000(wnoguchi) groups=1000(wnoguchi),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),134(libvirt)
wnoguchi@lasthope:~$ sudo usermod -aG vmware wnoguchi

logout and login

wnoguchi@lasthope:~$ id
uid=1000(wnoguchi) gid=1000(wnoguchi) groups=1000(wnoguchi),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),134(libvirt),136(vmware)
sudo chgrp vmware /dev/vmnet*
sudo chmod g+rw /dev/vmnet*
wnoguchi@lasthope:~$ sudo chgrp vmware /dev/vmnet*
wnoguchi@lasthope:~$ sudo chmod g+rw /dev/vmnet*
wnoguchi@lasthope:~$ ls -l /dev/vmnet*
crw-rw---- 1 root vmware 119, 0 Apr  4 08:11 /dev/vmnet0
crw-rw---- 1 root vmware 119, 1 Apr  4 08:11 /dev/vmnet1
crw-rw---- 1 root vmware 119, 2 Apr  4 08:11 /dev/vmnet2
crw-rw---- 1 root vmware 119, 3 Apr  4 08:11 /dev/vmnet3
crw-rw---- 1 root vmware 119, 8 Apr  4 08:11 /dev/vmnet8
wnoguchi@lasthope:~$ 

This step is required to change vmnet special device permission every boot.

To persist setting, search vmwareStartVmnet() function in /etc/init.d/vmware and modify following BEGIN, END region.

/etc/init.d/vmware
# Start the virtual ethernet kernel service
vmwareStartVmnetP() {
   vmwareLoadModule $vnet
   "$BINDIR"/vmware-networks --start >> $VNETLIB_LOG 2>&1
   # BEGIN enable generic user promiscuos mode functionality
   chgrp vmware /dev/vmnet*
   chmod g+rw /dev/vmnet*
   # END enable generic user promiscuos mode functionality
}

After Upgrade

You need to above workaround every upgraded process.

sudo chgrp vmware /dev/vmnet*
sudo chmod g+rw /dev/vmnet*
/etc/init.d/vmware
# Start the virtual ethernet kernel service
vmwareStartVmnet() {
   vmwareLoadModule $vnet
   "$BINDIR"/vmware-networks --start >> $VNETLIB_LOG 2>&1
   # BEGIN enable generic user promiscuos mode functionality
   chgrp vmware /dev/vmnet*
   chmod g+rw /dev/vmnet*
   # END enable generic user promiscuos mode functionality
}

Not work: generate udev device correct permission

generated special device file during Virtual Network Editor, will not configured correctly, so you must change permission above manually, or create udev rules.

udevadm info -q path -n /dev/vmnet2
udevadm info --name=/dev/vmnet0 --attribute-walk
/etc/udev/rules.d/98-vmware.rules
TODO

References

tech/virtualization/vmware/workstation/enable-promiscuous-mode-generic-user-privilege-on-linux-version-vmware-workstation/enable-promiscuous-mode-generic-user-privilege-on-linux-version-vmware-workstation.txt · Last modified: 2021/05/22 09:53 by wnoguchi