Skip to content

[Vmware] Automatically re-create vmnet devices on startup – mkvmnet script

  1. # Every time I reboot and run VMWare, I have to manually run vmware-config.pl to create again vmnet devices (/dev/vmnetX)
  2. # This scrit fix this problem. Add it to the init.d directory and run it on startup (rcX.d)
  3. vim /etc/init.d/mkvmnet
  4. #! /bin/sh -e
  5. #Create device nodes for vmnet
  6. sync
  7. `/bin/mknodmode=600 /dev/vmnet0 c 119 0`
  8. `/bin/mknodmode=600 /dev/vmnet1 c 119 1`
  9. `/bin/mknodmode=600 /dev/vmnet2 c 119 2`
  10. `/bin/mknodmode=600 /dev/vmnet3 c 119 3`
  11. `/bin/mknodmode=600 /dev/vmnet4 c 119 4`
  12. `/bin/mknodmode=600 /dev/vmnet5 c 119 5`
  13. `/bin/mknodmode=600 /dev/vmnet6 c 119 6`
  14. `/bin/mknodmode=600 /dev/vmnet7 c 119 7`
  15. `/bin/mknodmode=600 /dev/vmnet8 c 119 8`
  16. `/bin/mknodmode=600 /dev/vmnet9 c 119 9`
  17. sync
  18. exit 0
  19. # To execute the script on startup
  20. cp -s /etc/init.d/mkvmnet /etc/rc3.d/S02mkvmnet
  21. chmod 755 /etc/init.d/mkvmnet