Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Patches to allow running multiple vmware3 instances

1 view
Skip to first unread message

p...@hedeland.org

unread,
Jun 30, 2004, 7:43:41 PM6/30/04
to
Hi,

I just send-pr'ed some patches to allow running of multiple networked
vmware3 instances:

http://www.freebsd.org/cgi/query-pr.cgi?pr=68532

The scheme isn't very elegant, since it uses one vmnet interface per
vmware instance, but if your needs aren't very "dynamic", I think it's
OK. Only tested on 5.2.1-RELEASE, see the pr for some possible issues on
other versions (it should be possible to create the vmnet devices
manually on non-devfs systems - *before* running the start script...).

--Per Hedeland
p...@hedeland.org


_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "freebsd-emulat...@freebsd.org"

Sean_...@alum.wofford.org

unread,
Jul 1, 2004, 9:52:49 AM7/1/04
to
Ah. Aparently I don't understand netmasks well enough. ;-) I
missed that they were on different subnets.

That resolves my issue! Now I can do some network programming.

Sean

On Thu, Jul 01, 2004 at 03:23:43PM +0200, Per Hedeland wrote:
> Sean Welch wrote:
> >
> >I added in your patches and recompiled. I do indeed get multiple
> >vmnet interfaces but I don't seem able to configure them as you show
> >in your example. Specifically, I cannot configure the interfaces to
> >be on the same subnet with the same netmask.
>
> That's right - FreeBSD doesn't allow this AFAIK (it doesn't "make sense"
> from a routing perspective). So that's a limitation that follows from
> the use of one vmnet interface per vmware instance: Each vmware instance
> must be in its own subnet. Unless you use bridged mode, of course...
>
> > Your example file suggests you used this
> >(snip):
> >
> >vmnet1.Bridged = "NO"
> >vmnet1.BridgeInterface = ""
> >vmnet1.HostOnlyAddress = "172.31.254.1"
> >vmnet1.HostOnlyNetMask = "255.255.255.240"
> >vmnet2.Bridged = "NO"
> >vmnet2.BridgeInterface = ""
> >vmnet2.HostOnlyAddress = "172.31.254.17"
> >vmnet2.HostOnlyNetMask = "255.255.255.240"
>
> Yes - note that those are two different subnets, .1-.15 and .17-.31,
> given the netmask.
>
> >My config file looks like this:
> >
> >vmware.fullpath = "/usr/local/lib/vmware/bin/vmware"
> >wizard.fullpath = "/usr/local/lib/vmware/bin/vmware-wizard"
> >dhcpd.fullpath = "/usr/local/lib/vmware/bin/vmnet-dhcpd"
> >loop.fullpath = "/usr/local/lib/vmware/bin/vmware-loop"
> >libdir = "/usr/local/lib/vmware"
> >vmnet1.Bridged = "NO"
> >vmnet1.BridgeInterface = ""
> >vmnet1.HostOnlyAddress = "172.19.20.40"
> >vmnet1.HostOnlyNetMask = "255.255.255.0"
> >vmnet2.Bridged = "NO"
> >vmnet2.BridgeInterface = ""
> >vmnet2.HostOnlyAddress = "172.19.20.41"
> >vmnet2.HostOnlyNetMask = "255.255.255.0"
>
> And that won't work. As to why, lets say that your vmware instance has
> the IP address 172.19.20.42 - how can the FreeBSD stack know whether
> packets for it should be sent via the vmnet1 or the vmnet2 interface?
> So it's simply not allowed - the interface configs are considered
> conflicting.

p...@hedeland.org

unread,
Jul 1, 2004, 7:37:26 PM7/1/04
to
I wrote:
>
>Sean Welch wrote:
>>
>>I added in your patches and recompiled. I do indeed get multiple
>>vmnet interfaces but I don't seem able to configure them as you show
>>in your example. Specifically, I cannot configure the interfaces to
>>be on the same subnet with the same netmask.
>
>That's right - FreeBSD doesn't allow this AFAIK (it doesn't "make sense"
>from a routing perspective). So that's a limitation that follows from
>the use of one vmnet interface per vmware instance: Each vmware instance
>must be in its own subnet. Unless you use bridged mode, of course...

But it occurred to me that this limitation can be removed with a
moderate amount of trickery - and best of all, trickery limited to the
config file, the (patched) start script is all set to deal with it.

The trick is to use a sort of "hybrid" mode (the "Unless..." is actually
half the answer): If you want multiple instances to be in the same
subnet, you just bridge the corresponding *vmnet* devices together, but
*not* together with any "real" interface. I.e. in the config file Sean's
case would look like:

vmnet1.Bridged = "NO"
vmnet1.BridgeInterface = ""
vmnet1.HostOnlyAddress = "172.19.20.40"
vmnet1.HostOnlyNetMask = "255.255.255.0"

vmnet2.Bridged = "YES"
vmnet2.BridgeInterface = "vmnet1"
vmnet2.HostOnlyAddress = "192.168.0.1"
vmnet2.HostOnlyNetMask = "255.255.255.0"

(Using the "default bridge-interface IP address" for vmnet2...) And it's
possible to add more vmnets like this of course, as long as they're all
specified as bridged to vmnet1 (or whichever you chose to be the
"non-bridged" one - it has to be before the others numerically
though). Actually you can have multiple such "non-bridged bridges"
too... With this setup, you can have the vmwares be e.g. 172.19.20.42
and 172.19.20.43, and everyone using 255.255.255.0 as netmask.

0 new messages