DaveP
Commander
Commander

Scripts to manage Fusion network settings

VM@Work Tokamak 1.0.0

Well I have finally found time to finish the scripts to manage the virtual network settings for VMware Fusion. Real world work got in the way of me finishing it for a few weeks. I have been using this for about a month now, and have not seen any ill effects from it. There is a preliminary document describing the functionality of the script, called VM@Work Tokamak. (Yes cheesy pun on Fusion!). The scripts bring the functionality of the VMware Workstation 6 for Linux product to Mac OS X. It allows you to define new networks, modify existing settings, change bridged etc. In this version I have limited the number of configurable vmnets to 10, but if more is needed it can be quickly altered.

The work has been released after VMware gave me permission to re-distribute their code. I would ask that you respect this and don't repost. It will be available here using the new document feature and at my web site, once I have had time to update it. In the meantime, please feel free to post comments here, PM me or use my private email address. All feedback gladly accepted.

My thanks to Pat Lee, Product Manger for VMware Fusion for helping get permission to modify the code and re-distribute.

Dave

Message was edited by: DaveP

There is an issue with the scripts when adding new vmnets. Unfortunately as I am on vacation I can't fix it as no access to Mac. Will fix and upload next week.

0 Kudos
176 Replies
MacUnixGuy
Contributor
Contributor

For those new to this thread, here are a couple of documents that should be helpful (see attached).

To configure VMware Fusion 2.x, follow the instruction in "VMware Fusion Network Settings - Part 1.pdf". (by Dave Parsons)

To configure VMware Fusion 3.x, follow the instruction in "VMware Fusion 3.x Virtual Network Configuration Instructions.pdf".

These documents give instructions on how to manually configure the IP address ranges for the VMware Fusion host-only (vmnet1) and NAT (vmnet8) virtual networks.

If this is all you need to do, then you don't need to use any of the third-party scripts mentioned in this thread. If you do, however, need to make other changes, then you need to use the scripts created by Dave Parsons that are discussed in this thread.

0 Kudos
DaveP
Commander
Commander

Actually locations is now deprecated and you use the networking file. There is much more you can add to it such as modifying specific entries in DHCP and NAT configuration files. Your solution will work for now, but will be best to migrate to the newer way of doing things. Be patient I'll get there with the documentation. (To be honest as it is becoming pretty easy to do this stuff manually now and will we need the scripts longer term, but will continue to do so for now.)

0 Kudos
DaveP
Commander
Commander

Donovan

Here are the scripts s I left them for Fusion 2. I have decided that I will concentrate on Fusion 3 for now but wanted you to have the last version I was using. it should allow:

1. Setting host virtual NIC address directly

2. Setting vnet NAT address directly

3. Profile support

Just run the tokamak.sh script without parameters to see the options. I'll fix up any simple errors if you find them.

Dave

0 Kudos
DonovanBrooke
Contributor
Contributor

Thanks Dave,

Makes sense.. we'll give it a whirl over the weekend.

Donovan

0 Kudos
fusionnotfissio
Contributor
Contributor

Excellent thread, read thru it all...everyone here is talking about modifying the IP addresses of their vmnet8 or vmnet1 interfaces....what if I just want to blow them completely away, so they don't exist anymore? I am not going to use anything but Bridged and need to get these interfaces off my MAC! I am running SL server as a host, and Open Directory doth not like extranneous interfaces...would I just want to totally delete my locations file? Hmmmm....help please?

0 Kudos
rcardona2k
Immortal
Immortal

Excellent thread, read thru it all...everyone here is talking about modifying the IP addresses of their vmnet8 or vmnet1 interfaces....what if I just want to blow them completely away, so they don't exist anymore? I am not going to use anything but Bridged and need to get these interfaces off my MAC! I am running SL server as a host, and Open Directory doth not like extranneous interfaces...would I just want to totally delete my locations file? Hmmmm....help please?

I don't know if this will help but i was able to disable my vmnet1 and vmnet8 interfaces with:

sudo ifconfig vmnet1 down

sudo ifconfig vmnet1 delete

sudo ifconfig vmnet8 down

sudo ifconfig vmnet8 delete

where vmnet-cli --status shows:

Bridge networking on vmnet0 is running

DHCP service on vmnet1 is running

Hostonly virtual adapter on vmnet1 is disabled

DHCP service on vmnet8 is running

NAT service on vmnet8 is running

Hostonly virtual adapter on vmnet8 is disabled

Some/All of the configured services are not running

ifconfig still shows vmnet1 and vmnet8 but the interfaces are down and have no IP addresses assigned to them. You could modify boot.sh to leave those interfaces down and IP-less.

0 Kudos
fusionnotfissio
Contributor
Contributor

Thanks, but I think you went around the problem not right at it...i ended up fixing the problem by simply modifying the new networking file, not the locations file as noted earlier. The networking file is even more straightforward, and as DaveP mentions earlier, is the bee's knees now in 3.0. I basically wiped the entire contents of that small networking file away, leaving only the version info at the top of the file, and after restarting the mac, the interfaces are gone! ifconfig doesn't even mention them anymore, not down, not up, just totally gone! Woooohoooo! Fusion seems happy with this as well now, but more testing will be needed of course.

Not sure that my process was 100% the Right Way(TM) to accomplish this task, but without further clarity on the subject it seemed the best approach. I did of course take a backup of the networking file in case what I did has other bad effects somewhere in Fusion.

Otherwise, cheers!

0 Kudos
barnys
Enthusiast
Enthusiast

Dear Dave and fans,

I have been away for a few days from the threads, and after reading most of the postings from this section, I must admit that I am confused on the current state of your scripts and Fusion 3. So here I go:

1) Can your latest scripts posted in October 30th be used in Fusion 3 already?

2) If so, what is missing or what are the DONT'S ?

Thank you!!!!!!!!

0 Kudos
DaveP
Commander
Commander

No they were really for Donovan who wanted my last set for Fusion 2. Now I thought I had posted a test set of scripts here last week on 29th but I cannot find them! I will trawl through the posts again. Otherwise I have some scripts that can be tried out but I am running behind on the manual due to walking back into a bit work issues that have taken me away from writing.

0 Kudos
fusionnotfissio
Contributor
Contributor

Dave, scripts aside, can you just tell me whether my "fix" of just deleting the contents of the 'networking' file, but leaving the file itself intact, is a good solution for those of us who only use Bridged networking, and want to totally remove the vmnet1 and 8 adapters?

Thanks again!

0 Kudos
DaveP
Commander
Commander

I don't see why it shouldn't the only thing that needs special treatment is vnet0 bridged. Give it a go an see what happens, just copy the networking file some place first so you can revert back. The run

./vmnet-cli --configure

./vmnet-cli --stop

./vmnet-cli --start

from /Library/Application Support/VMware Fusion.

0 Kudos
sirozha
Contributor
Contributor

So, do we have the new scripts for Fusion 3? I have not read this thread for a few months, but I am not seeing any developments since November.

Thanks.

0 Kudos
WoodyZ
Immortal
Immortal

VM@Work Tokamak 3: (12.7 K)

Referencing post for VM@Work Tokamak 3:

0 Kudos
n0p
Contributor
Contributor

Are there any plans to add support for 'guest only' networks to the scripts? Like the vmnet2-vmnet7 networks in workstation, I would like to be able to set up separate guest only networks that aren't NAT, Bridged, or Host-Only. Changing the ethernet properties in the VM's vmx file seemed to work in Fusion 2, but in Fusion 3, the same configuration shows a Bridged configration in the network settings GUI.

0 Kudos
WoodyZ
Immortal
Immortal

VM@Work Tokamak 3: <a class="jive-link-attachment" href="http://communities.vmware.com/servlet/JiveServlet/download/2348-108167-1402568-30718/tokamak300-20091029.zip">tokamak300-20091029.zip</a> (12.7 K)


Referencing post for VM@Work Tokamak 3: Re: Scripts to manage Fusion network settings

0 Kudos
n0p
Contributor
Contributor

The only vmnet options I see when I try to create a virtual network are (bridged,hostonly,nat,none). Selecting 'none' does not create the vmnet.

0 Kudos
WoodyZ
Immortal
Immortal

The only vmnet options I see when I try to create a virtual network are (bridged,hostonly,nat,none). Selecting 'none' does not create the vmnet.

Yes selecting "none" should not create a VMnet and the only types you can create are Bridged, Host-Only and NAT that you can assign to VMnet(n) where (n) is 0 through 9 although you should not modify 0, 1 and 8 as it has been known to cause problems however one still has to manually edit the target Virtual Machine's .vmx configuration file to take advantage of the new VMnets and if you want to further customize so as to create a "Guest-Only" where literally only the Guests can talk to each other then this is nothing more then a Host-Only VMnet in which the Host's Host-Only VMnet(n) has been downed.

0 Kudos
n0p
Contributor
Contributor

Didn't know that, thanks. It seems to work - I was just put off by the way it appears as Bridged in the GUI. Does this mean that I need to manually down the vmnetn adapter on the host each time (I'm guessing once per reboot)? Thanks for the help.

0 Kudos
WoodyZ
Immortal
Immortal

It seems to work

Of course it works as I would not have said what needs to be done if it wouldn't. Smiley Wink

- I was just put off by the way it appears as Bridged in the GUI.

Here's what I do to let me know how I have it configured and in this case although different then yours nonetheless I'm using VMnet5 with a Custom NAT using the relevant parameters in the .vmx file shown below.

ethernet0.present = "TRUE"
ethernet0.connectionType = "custom"
ethernet0.vnet = "vmnet5"
ethernet0.bsdName = "vmnet5"
ethernet0.displayName = "Custom NAT VMnet5"

The first image below shows the Virtual Machine's Settings windows cropped to the Network.

The next image shows the Network setting cropped to the relevant information. Note that while it is showing "Connect directly to physical network (Bridged)" it is using "Custom NAT VM..." and in spite of that it may look like as a Bridged Network it is a Custom NAT configuration to VMnet5 as shown in the last cropped image showing the pop-up list.

Note that I do not select from this list and all modification are done manually editing the .vmx configuration file and the above image was shown for clarity.

Does this mean that I need to manually down the vmnetn adapter on the host each time (I'm guessing once per reboot)?

Yes although you could probably script it and have it run at login. Obviously you'd need to write the script to prompt for the sudo password. Also if you manually restart the VMware Network without rebooting you'd need to down the target VMnet again for your particular case use scenario.

0 Kudos
n0p
Contributor
Contributor

Perfect - thank you. :smileygrin:

0 Kudos