Friday, July 4, 2008

VMware workstation with vmnet devices

I found vmware workstation on udev based linux kernel host, that I had to run vmware-config.pl every reboot. That is because udev being a dynamic system, nodes are wiped and recreated in /dev every system rebooted. That is quite annoying when we need guest OS run as the service starts.

Add the following just under the start) line in /etc/init.d/vmware

====================================================
start)
# Start insert
if [ ! -e "/dev/vmmon" ]; then
mknod /dev/vmmon c 10 165
chmod 600 /dev/vmmon
fi
for a in `seq 0 9`; do
if [ ! -e "/dev/vmnet$a" ]; then
mknod /dev/vmnet$a c 119 $a
chmod 600 /dev/vmnet$a
fi
done
# End insert
if [ -e "$vmware_etc_dir"/not_configured ]; then
====================================================

Which recreates the nodes that are required. Remember need to re-run vmware-config.pl after a kernel upgrade.

Lastly, run vmware-netifup -d /var/run/vmnet$a /dev/vmnet$a vmnet$a to start vmnet network interface

No comments: