diff options
author | silby <silby@FreeBSD.org> | 2004-07-08 08:26:34 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2004-07-08 08:26:34 +0000 |
commit | ab90248ffdd82422f5a2a80cf6b68f3536757a32 (patch) | |
tree | cb23c273a39d29d34e3f3c16c6c7ef6283a9882f | |
parent | 7e141665a3bc55a534ba9c3ae80ec39302b050d0 (diff) | |
download | FreeBSD-ports-ab90248ffdd82422f5a2a80cf6b68f3536757a32.zip FreeBSD-ports-ab90248ffdd82422f5a2a80cf6b68f3536757a32.tar.gz |
Latest update from Orlando Bassotto, includes better
network support.
-rw-r--r-- | emulators/vmware3/Makefile | 27 | ||||
-rw-r--r-- | emulators/vmware3/distinfo | 8 | ||||
-rw-r--r-- | emulators/vmware3/files/001.vmware.sh | 112 | ||||
-rw-r--r-- | emulators/vmware3/files/ChangeLog.FreeBSD | 92 | ||||
-rw-r--r-- | emulators/vmware3/files/MultipleInstances.FreeBSD | 222 | ||||
-rw-r--r-- | emulators/vmware3/files/config | 2 | ||||
-rw-r--r-- | emulators/vmware3/files/freebsd4.patch | 13 | ||||
-rw-r--r-- | emulators/vmware3/files/patch-aa | 12 | ||||
-rw-r--r-- | emulators/vmware3/files/patch-ab | 74 | ||||
-rw-r--r-- | emulators/vmware3/pkg-descr | 13 | ||||
-rw-r--r-- | emulators/vmware3/pkg-message | 9 | ||||
-rw-r--r-- | emulators/vmware3/pkg-plist | 4 | ||||
-rw-r--r-- | emulators/vmware3/scripts/configure | 24 |
13 files changed, 473 insertions, 139 deletions
diff --git a/emulators/vmware3/Makefile b/emulators/vmware3/Makefile index f440506..f2fa6e4 100644 --- a/emulators/vmware3/Makefile +++ b/emulators/vmware3/Makefile @@ -7,19 +7,19 @@ PORTNAME= vmware3 PORTVERSION= 3.2.1.2242 -PORTREVISION= 7 +PORTREVISION= 8 PORTEPOCH= 1 CATEGORIES= emulators linux MASTER_SITES= http://www4.vmware.com/software/ \ ${FREEBSD_MODULE_SITES} \ ${VMWARE_MIRROR_SITES} DISTFILES= VMware-workstation-${PORTVERSION:R}-${PORTVERSION:E}${EXTRACT_SUFX}:vmware \ - vmmon-only-${PORTVERSION:R}-20031118${EXTRACT_SUFX}:patch \ - vmnet-only-${PORTVERSION:R}-20030412${EXTRACT_SUFX}:patch + vmmon-only-${PORTVERSION:R}-20040705${EXTRACT_SUFX}:patch \ + vmnet-only-${PORTVERSION:R}-20040705${EXTRACT_SUFX}:patch # Feel free to post your questions/reports/suggestions on this port to # freebsd-emulation mailing list with the following maintainer address CC'ed. -MAINTAINER= orlando.bassotto@ieo-research.it +MAINTAINER= orlando@break.net COMMENT= A virtual machine emulator - a full PC in a window RUN_DEPENDS= ${PORTSDIR}/emulators/rtc @@ -33,7 +33,7 @@ VMWARE_MIRROR_SITES= \ http://vmware.wespe.de/software/:vmware \ ftp://vmware.wespe.de/pub/software:vmware FREEBSD_MODULE_SITES= \ - http://bag.ieo-research.it/~nextie/vmware3/:patch \ + http://www.break.net/orlando/vmware3/:patch \ USE_SUBMAKE= yes USE_LINUX= yes @@ -107,7 +107,7 @@ pre-patch: @${MKDIR} ${WRKSRC}/vmmon-only/freebsd @${MKDIR} ${WRKSRC}/vmmon-only/netbsd @cd ${WRKSRC}/vmmon-only && ${PATCH} -p1 < ${WRKDIR}/vmmon-only.diff - @cd ${WRKSRC} && ${PATCH} < ${WRKDIR}/vmnet-only.diff + @cd ${WRKSRC}/vmnet-only && ${PATCH} -p1 < ${WRKDIR}/vmnet-only.diff .if exists(/sys/compat/linux/linux_ioctl.h) ${PERL} -i -pe 's,i386(/linux/linux_ioctl\.h),compat$$1,' \ @@ -134,6 +134,8 @@ post-patch: setoptions: ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ + -e 's;@@BRIDGED@@;${VMNET_BRIDGED};' \ + -e 's;@@BRIDGE_INTF@@;${VMNET_BRIDGED_INTERFACE};' \ -e 's;@@HOST_IP@@;${VMNET_HOST_IP};' \ -e 's;@@NETMASK@@;${VMNET_NETMASK};' \ ${FILESDIR}/config > ${WRKDIR}/config @@ -141,8 +143,7 @@ setoptions: ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ -e 's;@@LINUXBASE@@;${LINUXBASE};' \ -e 's;@@NETWORKING@@;${VMNET_NETWORKING};' \ - -e 's;@@BRIDGED@@;${VMNET_BRIDGED};' \ - -e 's;@@BRIDGE_INTF@@;${VMNET_BRIDGED_INTERFACE};' \ + -e 's;@@VMNET1_MINOR@@;${VMNET1_MINOR};' \ ${FILESDIR}/001.vmware.sh > ${WRKDIR}/001.vmware.sh ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ @@ -154,7 +155,11 @@ pre-install: setoptions ${MKDIR} ${VMDIR}/modules ${MKDIR} ${PREFIX}/etc/vmware - ${INSTALL_DATA} ${WRKDIR}/config ${PREFIX}/etc/vmware +.if exists(${PREFIX}/etc/vmware/config) + @echo "====> Preserving your previous configuration." +.else + ${INSTALL_DATA} ${WRKDIR}/config ${PREFIX}/etc/vmware +.endif ${INSTALL_SCRIPT} ${WRKDIR}/001.vmware.sh ${PREFIX}/etc/rc.d @@ -186,7 +191,7 @@ pre-install: setoptions ${MKDIR} ${VMDIR}/licenses/site ${MKDIR} ${VMDIR}/licenses/user - ${INSTALL_DATA} -m 4555 ${WRKSRC}/lib/licenses/user/license.ws.3.0 \ + ${INSTALL_DATA} -m 644 ${WRKSRC}/lib/licenses/user/license.ws.3.0 \ ${VMDIR}/licenses/user ${INSTALL_SCRIPT} -m 4555 ${WRKSRC}/bin/vmware ${VMDIR}/bin ${INSTALL_SCRIPT} ${WRKDIR}/vmware ${PREFIX}/bin @@ -209,7 +214,7 @@ pre-install: setoptions .if !defined(NOPORTDOCS) ${MKDIR} ${PREFIX}/share/doc/vmware ${INSTALL_DATA} ${WRKSRC}/doc/* ${PREFIX}/share/doc/vmware -.for f in README.FreeBSD Hints.FreeBSD +.for f in README.FreeBSD Hints.FreeBSD MultipleInstances.FreeBSD ChangeLog.FreeBSD ${INSTALL_DATA} ${FILESDIR}/${f} ${PREFIX}/share/doc/vmware .endfor .endif diff --git a/emulators/vmware3/distinfo b/emulators/vmware3/distinfo index ce6a38b..ab30d91 100644 --- a/emulators/vmware3/distinfo +++ b/emulators/vmware3/distinfo @@ -1,6 +1,6 @@ MD5 (VMware-workstation-3.2.1-2242.tar.gz) = 56dccf022582a374cf2eac06796115cf SIZE (VMware-workstation-3.2.1-2242.tar.gz) = 12577292 -MD5 (vmmon-only-3.2.1-20031118.tar.gz) = b75a2979edc95f807db456ee979b5829 -SIZE (vmmon-only-3.2.1-20031118.tar.gz) = 52092 -MD5 (vmnet-only-3.2.1-20030412.tar.gz) = 70549315476d893cf9cb67c914382dda -SIZE (vmnet-only-3.2.1-20030412.tar.gz) = 25962 +MD5 (vmmon-only-3.2.1-20040705.tar.gz) = 1a6ab5032ec01bcdeaa1a0c3e9267940 +SIZE (vmmon-only-3.2.1-20040705.tar.gz) = 60394 +MD5 (vmnet-only-3.2.1-20040705.tar.gz) = a11022f353315b78ba5a782ce8c14e67 +SIZE (vmnet-only-3.2.1-20040705.tar.gz) = 7480 diff --git a/emulators/vmware3/files/001.vmware.sh b/emulators/vmware3/files/001.vmware.sh index e305330..381f8b4 100644 --- a/emulators/vmware3/files/001.vmware.sh +++ b/emulators/vmware3/files/001.vmware.sh @@ -2,7 +2,7 @@ # # Start or stop vmware # -# $FreeBSD: /tmp/pcvs/ports/emulators/vmware3/files/Attic/001.vmware.sh,v 1.1 2004-06-11 23:35:29 edwin Exp $ +# $FreeBSD: /tmp/pcvs/ports/emulators/vmware3/files/Attic/001.vmware.sh,v 1.2 2004-07-08 08:26:34 silby Exp $ vmware_config_file=@@PREFIX@@/etc/vmware/config @@ -24,11 +24,8 @@ vmware_config() { vmware=`vmware_config vmware.fullpath` vmware_libdir=`vmware_config libdir` networking=@@NETWORKING@@ -bridged=@@BRIDGED@@ -bridge_interface=@@BRIDGE_INTF@@ -host_ip=`vmware_config vmnet1.HostOnlyAddress` -netmask=`vmware_config vmnet1.HostOnlyNetMask` dev_vmnet1=/dev/vmnet1 +vmnet1_minor=@@VMNET1_MINOR@@ if [ ! -x $vmware ]; then echo "$vmware does not exist!" >&2 @@ -54,22 +51,58 @@ start) echo "Your VMware installation seems broken. Please reinstall VMware port." >&2 exit 255 fi - (echo -n > $dev_vmnet1) 2>/dev/null || \ - echo -n > /dev/vmnet1 2>&1 - ifconfig vmnet1 $host_ip netmask $netmask - if [ X$bridged = XYES ]; then - kldstat -v | grep netgraph >/dev/null || kldload netgraph.ko - kldstat -v | grep ng_ether >/dev/null || kldload ng_ether.ko - kldstat -v | grep ng_bridge >/dev/null || kldload ng_bridge.ko - ngctl mkpeer vmnet1: bridge lower link0 - ngctl name vmnet1:lower vmnet_bridge - ngctl connect vmnet_bridge: ${bridge_interface}: link1 lower - ngctl connect vmnet_bridge: ${bridge_interface}: link2 upper - ngctl msg ${bridge_interface}: setautosrc 0 - ngctl msg ${bridge_interface}: setpromisc 1 - ngctl msg vmnet1: setautosrc 0 - ngctl msg vmnet1: setpromisc 1 - fi + case $vmnet1_minor in + 0x*) vmnet1_minor=`(echo ibase=16; + echo $vmnet1_minor | sed 's/^0x//' | tr a-f A-F) | bc` ;; + esac + vmnet_no=1 + bridge_no=1 + while true; do + vmnet=vmnet$vmnet_no + vmnet_no=`expr $vmnet_no + 1` + bridged=`vmware_config $vmnet.Bridged` + case $bridged in + '') break ;; + '""') continue ;; + esac + host_ip=`vmware_config $vmnet.HostOnlyAddress` + netmask=`vmware_config $vmnet.HostOnlyNetMask` + if [ ! -c /dev/$vmnet ]; then + rm -f /dev/$vmnet + minor=`echo $vmnet1_minor $vmnet_no | \ + awk '{ printf "0x%x", $1 - 1 + $2 - 1 }'` + mknod /dev/$vmnet c 149 $minor + fi + echo -n > /dev/$vmnet 2>&1 + ifconfig $vmnet $host_ip netmask $netmask + if [ X$bridged = XYES ]; then + if [ X$host_ip = X0.0.0.0 ]; then + # XXX Still need to configure + delete to make it RUNNING + ifconfig $vmnet delete $host_ip + fi + bridge_interface=`vmware_config $vmnet.BridgeInterface` + eval vmnet_bridge=\$vmnet_bridge_$bridge_interface + if [ X$vmnet_bridge = X ]; then + kldstat -v | grep netgraph >/dev/null || kldload netgraph.ko + kldstat -v | grep ng_ether >/dev/null || kldload ng_ether.ko + kldstat -v | grep ng_bridge >/dev/null || kldload ng_bridge.ko + vmnet_bridge=vmnet_bridge$bridge_no + bridge_no=`expr $bridge_no + 1` + eval vmnet_bridge_$bridge_interface=$vmnet_bridge + ngctl mkpeer ${bridge_interface}: bridge lower link0 + ngctl name ${bridge_interface}:lower ${vmnet_bridge} + ngctl connect ${vmnet_bridge}: ${bridge_interface}: link1 upper + ngctl msg ${bridge_interface}: setautosrc 0 + ngctl msg ${bridge_interface}: setpromisc 1 + eval ${vmnet_bridge}_linkno=2 + fi + eval linkno=\$${vmnet_bridge}_linkno + eval ${vmnet_bridge}_linkno=`expr $linkno + 1` + ngctl connect ${vmnet_bridge}: ${vmnet}: link$linkno lower + ngctl msg ${vmnet}: setautosrc 0 + ngctl msg ${vmnet}: setpromisc 1 + fi + done fi echo -n " VMware" >&2 ;; @@ -77,13 +110,36 @@ start) stop) kldunload vmmon_${suffix} if [ $networking -eq 1 ]; then - ifconfig vmnet1 down - ifconfig vmnet1 delete $host_ip - if [ X$bridged = XYES ]; then - ngctl shutdown vmnet_bridge: - ngctl msg ${bridge_interface}: setautosrc 1 - ngctl msg ${bridge_interface}: setpromisc 0 - fi + vmnet_no=1 + bridge_no=1 + while true; do + vmnet=vmnet$vmnet_no + vmnet_no=`expr $vmnet_no + 1` + bridged=`vmware_config $vmnet.Bridged` + case $bridged in + '') break ;; + '""') continue ;; + esac + host_ip=`vmware_config $vmnet.HostOnlyAddress` + ifconfig $vmnet down + if [ X$bridged = XYES ]; then + if [ X$host_ip != X0.0.0.0 ]; then + ifconfig $vmnet delete $host_ip + fi + bridge_interface=`vmware_config $vmnet.BridgeInterface` + eval vmnet_bridge=\$vmnet_bridge_$bridge_interface + if [ X$vmnet_bridge = X ]; then + vmnet_bridge=vmnet_bridge$bridge_no + bridge_no=`expr $bridge_no + 1` + eval vmnet_bridge_$bridge_interface=$vmnet_bridge + ngctl msg ${bridge_interface}: setautosrc 1 + ngctl msg ${bridge_interface}: setpromisc 0 + ngctl shutdown ${vmnet_bridge}: + fi + else + ifconfig $vmnet delete $host_ip + fi + done kldunload vmnet.ko fi ;; diff --git a/emulators/vmware3/files/ChangeLog.FreeBSD b/emulators/vmware3/files/ChangeLog.FreeBSD new file mode 100644 index 0000000..535828d --- /dev/null +++ b/emulators/vmware3/files/ChangeLog.FreeBSD @@ -0,0 +1,92 @@ + +0000-00-00 Orlando Bassotto + + This is a list of changes on hold: + + o Creation and use of M_VMWARE malloc zone + for allocations. + o Mutex usage fix. + + This is a list of changes that need to be done + or to be discussed: + + o Cleanup the vmmon module of all those #ifdef's ... + o ... as a consequence, merge FreeBSD 4.x and FreeBSD + 5.x patches. + o Create a new configuration script for setting up + multiple vmnets. + o Revert the vmnet module back to the original (?) + o Finish and correct this ChangeLog :-) + +2004-07-05 Orlando Bassotto <orlando@break.net> + + o Merged cdev typedef patch. + o Merged fdrop patch. + o Added missing DEV_MODULE and dependency to linux + module in vmnet_linux.c. + Thanks for pointing out to Ogawa Takaya. + o Fixed install script to preserve your previous + configuration, if already present. + o Added in post-installation setup a screen to skip + over the vmnet configuration, this will set networking=1 + in the rc.d script. + o Merged Per Hedeland patches for the new rc.d script + to allow multiple instance of VMware use a network + device. Added MultipleInstances.FreeBSD in the + documentation directory. + +2004-02-27 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Added d_version field to the vmmon cdevsw. + o Merged contigmalloc patch. + +2003-11-18 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Disabled SMP support from FreeBSD 5.2, the new SMP + subsystem is sostantially different and cannot cope + with the requirements of the vmmon module, at least + at the moment of this writing. + +2003-10-09 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Added support for multiple instances. + o Undef of APIC_XXX defines to avoid warnings on + compile. + o Fixing a problem on closing the driver which + caused kernel panic, low pages did get freed + even when not allocated. + +2003-05-14 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Merged with more recent vmmon sources. + o Update to VMware 3.2.1-2241. + +2003-04-15 Martin Blapp + + o Fixed broken installation script. + +2003-04-13 Martin Blapp + + o VMware 3.x enters the FreeBSD ports tree. + +2004-04-12 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Minor fixes in order to run VMware 3.2.1. + +2003-03-29 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o First public release. + o Added missing bits in order to run VMware 3.2.0. + o Merged changes for low page allocation support from the + NetBSD driver. + +2003-03-26 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o Merged changes from Mark Santrcroos vmmon module for + VMware 3.1.0. + +2002-10-02 Orlando Bassotto <orlando.bassotto@ieo-research.it> + + o First version for VMware 3.0, never released. + o Fork of the VMware 2.0 vmmon module by Vladimir N. Silyaev. + diff --git a/emulators/vmware3/files/MultipleInstances.FreeBSD b/emulators/vmware3/files/MultipleInstances.FreeBSD new file mode 100644 index 0000000..21d04fd --- /dev/null +++ b/emulators/vmware3/files/MultipleInstances.FreeBSD @@ -0,0 +1,222 @@ + Running multiple networked instances of VMware on FreeBSD + ========================================================= + +The only currently-known (assuming VMware version 3) problem with this +is that each VMware instance needs its own vmnet interface - the vmnet +driver is "exclusive open" on the VMware side (and substantial +modifications would probably be needed for it to be able to handle +multiple VMwares). This leads to some limitations and some clutter of +your 'ifconfig' output, but nothing insurmountable if you really need/ +want this. + +The gory details of creating and configuring those vmnet interfaces are +handled by the rc script (normally installed in /usr/local/etc/rc.d), +based on the config file (normally /usr/local/etc/vmware/config). The +port build/install will create an initial version of the config file +based on your responses in the configuration dialogue - this will cover +at most one vmnet interface, and you will need to extend it by editing +the file for multiple vmnet interfaces / VMware instances. It's a good +idea to keep a backup of the config file, since de/reinstalling the +VMware port (e.g. on upgrade) may delete/overwrite it. + +The other thing that needs some manual tweaking is the VMware config +itself - the "Host Only" mode is hardwired to use vmnet1 (on Linux this +can be used by multiple VMware instances), and so can only be used on at +most one of the concurrently-running instances. For the others, you need +to choose "Custom" as the "Connection Type" for the Ethernet Adapter, +and specify /dev/vmnetN as "VMnet", where N = 2,3,... (actually you may +want to do this for vmnet1 too when using bridged mode, see below). You +can of course have multiple VMware configs with the same vmnet interface +- as long as you never want to run them simultaneously. + +The rc script will do setup when given the argument 'start', and +teardown when given the argument 'stop' (no surprise there). It assumes +an unconfigured system when doing setup, and a system configured +according to the config file when doing teardown. This works fine with a +fixed config and boot/halt/reboot etc of course (setup with an already +configured system or teardown with an unconfigured should be fine too, +but may yield some error messages). + +There may however be "surprises" if you violate these conditions when +changing the config file. To avoid that, this is the "safe" procedure +for any config file change: + +1. Stop/suspend/exit any VMwares currently running. +2. Run '/usr/local/etc/rc.d/001.vmware.sh stop'. +3. Do the config changes. +4. Run '/usr/local/etc/rc.d/001.vmware.sh start'. +5. Start the VMwares (optional). + +If you forget (or ignore:-) this sequence, things *may* work out right +anyway depending on what changes you did. If they don't, and your vmnet +setup ends up in a mess, a reboot will of course fix things, but +avoiding that and cleaning it up manually is of course preferable. If +you make sure that a) no IP addresses are configured on vmnet interfaces +and b) (assuming you used or are going to use bridging) no vmnet_bridgeN +netgraph bridges are configured (use the 'ngctl' command), running the +script with 'start' should probably succeed with the setup. + +A general note on the config file contents: The rc script assumes that +the vmnet interfaces you are using are in a numerically consecutive +sequence starting with vmnet1. I.e. you can't have "holes" as in using +vmnet1, vmnet2, and vmnet4 only - the actual order in the file doesn't +matter though. This is because the script runs a loop looking for the +vmnet1.Bridged, vmnet2.Bridged, etc, settings - and if it doesn't find a +YES or NO setting, it assumes that there are no more vmnets configured +and it's done. Also, there are some pathnames defined in the config file +- this text doesn't concern them in any way, but they must be preserved +when changing the file, of course. + +Below are the details of what needs to be in the config file for the +respective modes. Note that you can mix and match freely, i.e. have some +VMwares in non-bridged and some in bridged mode (and even have multiple +bridges with different "real" interfaces), and the vmnet interfaces can +be in any order (e.g. vmnet1 and vmnet3 bridged to your "real" interface +and vmnet2 non-bridged), as long as you fulfill the requirement above +("hybrid" mode has an additional requirement, see below). + + + Non-bridged mode + ---------------- + +In this mode, each vmnet interface is effectively (from the FreeBSD host +perspective) connected to its own little subnet, and the rules and +restrictions that apply are exactly the same as when having multiple +"real" interfaces connected to different subnets. E.g. the vmnet +interface must be configured with an IP address and netmask that define +the subnet and differ from other subnets, the subnet must contain also +the IP address(es) used by the VMware guests that are configured to use +that vmnet interface, etc. An initial config from the port build/install +may look like: + +vmnet1.Bridged = "NO" +vmnet1.BridgeInterface = "" +vmnet1.HostOnlyAddress = "192.168.32.1" +vmnet1.HostOnlyNetMask = "255.255.255.0" + +All you need to do is more of the same, e.g. replicate for vmnet2, +ensuring that vmnet2.Bridged = "NO" and using a different +vmnet2.HostOnlyAddress that falls in a different subnet - e.g. add: + +vmnet2.Bridged = "NO" +vmnet2.BridgeInterface = "" +vmnet2.HostOnlyAddress = "192.168.33.1" +vmnet2.HostOnlyNetMask = "255.255.255.0" + +As you can see this may eat up a lot of network address space, which may +or may not matter depending on your environment (there's plenty of +"private" IP address space, but it may be used elsewhere on your +intranet). You can of course use smaller subnets - the longest netmask +possible is 255.255.255.252, giving four-address subnets, to cover the +requirements above - and then act as a gateway for the "aggregate" as +far as other hosts are concerned. Another alternative is to use the +"hybrid" mode described below - and if you really need to have the +VMware guests be in the same subnet for other reasons (e.g. you may need +to have broadcast work between them), that's the way to go. + + + Bridged mode + ------------ + +In this mode, the VMware guests are effectively connected to the same +subnet as the FreeBSD host (on the "real" interface that you specify). +For all practical intents and purposes, the bridge is an "internal +Ethernet switch". An initial config from the port build/install may look +like: + +vmnet1.Bridged = "YES" +vmnet1.BridgeInterface = "fxp0" +vmnet1.HostOnlyAddress = "192.168.0.1" +vmnet1.HostOnlyNetMask = "255.255.255.0" + +The "192.168.0.1" may come as a surprise, since you never gave that +address in the configuration dialogue - and if you're familiar with +bridging, you may rightly wonder why the vmnet1 interface needs an IP +address at all. The answer is that it doesn't (and shouldn't really have +one), and that this may actually cause problems (e.g. if 192.168.0/24 is +used elsewhere on your network, you can't reach it anymore) - but VMware +needs it (sort of). + +To go into the gory details, this comes from the fact that the FreeBSD +port "plays tricks" with VMware - you are supposed to configure the +VMware Ethernet Adapter as "Host Only" even when using bridging, and +when configured like that, VMware requires that vmnet1 has an IP address +configured. However as noted above, the "Host Only" config can only be +used for vmnet1 - for the others you need the "Custom" + "/dev/vmnetN" +config - and this does *not* require an IP address on the vmnet +interface. So, to get rid of this "ugly" IP address, you may want to use +"Custom" + "/dev/vmnet1" on the vmnet1-using VMware(s). + +In any case, the rc script will leave the vmnet interface without an IP +address if and only if the vmnetN.HostOnlyAddress is given as "0.0.0.0". +This is recommended at least for your vmnet2 and above bridged +interfaces, since otherwise you have to come up with a new "dummy" +address/netmask for each one - even though they aren't actually used for +anything, FreeBSD doesn't allow you to configure the same address/subnet +on multiple interfaces. So, for another bridged interface on the same +"real" interface, add: + +vmnet2.Bridged = "YES" +vmnet2.BridgeInterface = "fxp0" +vmnet2.HostOnlyAddress = "0.0.0.0" +vmnet2.HostOnlyNetMask = "255.255.255.0" + +And so on. The HostOnlyNetMask setting doesn't really matter when +HostOnlyAddress = "0.0.0.0", but it still has to be a valid netmask - +"255.255.255.0" is fine. + + + "Hybrid" mode + ------------- + +This is really non-bridged mode with a twist (and arguably better), but +since it includes a bridge it may be confusing to call it "non- +bridged".:-) I.e. functionally it is equivalent to non-bridged insofar +as the VMwares live in an "internal" subnet different from the "real" +one(s) the FreeBSD host is connected to - it just allows for multiple +simultaneous VMwares in a single such subnet. + +The way to do this is simply to connect the vmnet interfaces together +with a bridge - but *not* connect this bridge to any of the "real" +interfaces, and instead have just one of the bridged vmnet interfaces +configured as in the non-bridged case, and acting as the FreeBSD host's +interface to this subnet. Such a subnet for 3 vmnets/VMwares could look +like this in the config file (starting off with the original non-bridged +vmnet1 from above): + +vmnet1.Bridged = "NO" +vmnet1.BridgeInterface = "" +vmnet1.HostOnlyAddress = "192.168.32.1" +vmnet1.HostOnlyNetMask = "255.255.255.0" +vmnet2.Bridged = "YES" +vmnet2.BridgeInterface = "vmnet1" +vmnet2.HostOnlyAddress = "0.0.0.0" +vmnet2.HostOnlyNetMask = "255.255.255.0" +vmnet3.Bridged = "YES" +vmnet3.BridgeInterface = "vmnet1" +vmnet3.HostOnlyAddress = "0.0.0.0" +vmnet3.HostOnlyNetMask = "255.255.255.0" + +I.e. all the vmnets except the first one have Bridged = "YES" and point +BridgeInterface to the first *vmnet* interface. And in this case, the +vmnet interface with Bridged = "NO" *must* be numerically *before* the +others (it doesn't have to be vmnet1 in particular, of course). + +With this setup, the VMware guests configured for vmnet1/2/3 can use +whatever IP addresses in the 192.168.32.0/24 subnet they want (except +for .1 and .255, of course), in any combination. It's of course possible +to have a smaller subnet than /24 here too, as long as it is big enough +to "cover" the desired IP addresses (obviously the abovementioned +255.255.255.252 would not be enough). + +You can also have multiple separate subnets like this, if you should +need it - the rules are the same for each, the (numerically) first vmnet +with Bridged = "NO" and the others with Bridged = "YES" and pointing +BridgeInterface to the first one. And like in the "original" non-bridged +mode, each "first" vmnet interface must be configured with an IP address +and netmask that define the subnet and differ from other subnets. + +-- +This document and the supplied patches have been made available by +Per Hedeland. + diff --git a/emulators/vmware3/files/config b/emulators/vmware3/files/config index 98cf7ee..ae7c158 100644 --- a/emulators/vmware3/files/config +++ b/emulators/vmware3/files/config @@ -3,5 +3,7 @@ wizard.fullpath = "@@PREFIX@@/lib/vmware/bin/vmware-wizard" dhcpd.fullpath = "@@PREFIX@@/lib/vmware/bin/vmnet-dhcpd" loop.fullpath = "@@PREFIX@@/lib/vmware/bin/vmware-loop" libdir = "@@PREFIX@@/lib/vmware" +vmnet1.Bridged = "@@BRIDGED@@" +vmnet1.BridgeInterface = "@@BRIDGE_INTF@@" vmnet1.HostOnlyAddress = "@@HOST_IP@@" vmnet1.HostOnlyNetMask = "@@NETMASK@@" diff --git a/emulators/vmware3/files/freebsd4.patch b/emulators/vmware3/files/freebsd4.patch index a927f14..c48a2a5 100644 --- a/emulators/vmware3/files/freebsd4.patch +++ b/emulators/vmware3/files/freebsd4.patch @@ -719,3 +719,16 @@ } DEB(printf(__FUNCTION__ ": return %d\n", error)); return error; +--- vmnet-only/vnet.h.orig Wed Jul 23 23:43:38 2003 ++++ vmnet-only/vnet.h Tue Jul 6 07:55:44 2004 +@@ -10,8 +10,8 @@ + #define INCLUDE_ALLOW_MODULE + #include "includeCheck.h" + +-#define SIOCSKEEP 0x89F0 // not used +-#define SIOCGKEEP 0x89F1 // not used ++#define SIOCSKEEP 0x89F0 /* not used */ ++#define SIOCGKEEP 0x89F1 /* not used */ + #define SIOCSLADRF 0x89F2 + #define SIOCPORT 0x89F3 + #define SIOCBRIDGE 0x89F4 diff --git a/emulators/vmware3/files/patch-aa b/emulators/vmware3/files/patch-aa deleted file mode 100644 index 7701507..0000000 --- a/emulators/vmware3/files/patch-aa +++ /dev/null @@ -1,12 +0,0 @@ ---- vmmon-only/freebsd/driver.c.old Wed Jan 21 16:14:24 2004 -+++ vmmon-only/freebsd/driver.c Wed Jan 21 16:16:44 2004 -@@ -1328,7 +1328,8 @@ - */ - VMDEBUG("vmmon_alloc_low_pages: vm_page_alloc_contig: sz %lu hi %u\n", - numPages * PAGE_SIZE, high); -- va = vm_page_alloc_contig(numPages * PAGE_SIZE, 0, high, PAGE_SIZE); -+ va = (vm_offset_t)contigmalloc(numPages * PAGE_SIZE, M_DEVBUF, M_NOWAIT, -+ 0, high, PAGE_SIZE, 0); - if (!va) { - VMDEBUG("vmmon_alloc_low_pages: vm_page_alloc_contig failed\n"); - goto bad; diff --git a/emulators/vmware3/files/patch-ab b/emulators/vmware3/files/patch-ab deleted file mode 100644 index 31395f2..0000000 --- a/emulators/vmware3/files/patch-ab +++ /dev/null @@ -1,74 +0,0 @@ ---- vmmon-only/freebsd/driver.c.orig Wed Jun 23 22:11:40 2004 -+++ vmmon-only/freebsd/driver.c Wed Jun 23 22:14:46 2004 -@@ -50,6 +50,7 @@ - #include <sys/filedesc.h> - #include <sys/fcntl.h> - #include <sys/malloc.h> -+#include <sys/module.h> - #include <sys/proc.h> - #include <sys/ioccom.h> - #include <sys/syslog.h> -@@ -163,9 +164,14 @@ - - static struct cdevsw vmmon_cdevsw = { - #if __FreeBSD_version >= 500104 -+#if __FreeBSD_version >= 502103 -+ .d_version = D_VERSION, -+ .d_flags = D_NEEDGIANT, -+#else -+ .d_maj = CDEV_MAJOR, -+#endif - .d_open = FreeBSD_Driver_Open, - .d_name = DEVICE_NAME, -- .d_maj = CDEV_MAJOR - #else - /* open */ FreeBSD_Driver_Open, - /* close */ noclose, -@@ -224,7 +230,11 @@ - *---------------------------------------------------------------------- - */ - -+#if __FreeBSD_version >= 502017 -+static struct cdev *vmmon_dev; -+#else - static dev_t vmmon_dev; -+#endif - - static int - init_module(void) -@@ -364,7 +374,11 @@ - * Based on dev/streams/streams.c - */ - static int -+#if __FreeBSD_version >= 502017 -+vmmon_clone(struct cdev *dev, int flags, void *data, struct thread *td) -+#else - vmmon_clone(dev_t dev, int flags, void *data, struct thread *td) -+#endif - { - int fd, error; - struct file *fp; -@@ -391,6 +405,11 @@ - fp->f_type = DTYPE_VNODE; - FILEDESC_UNLOCK(p->p_fd); - -+#if __FreeBSD_version >= 501111 -+ /* falloc now returns TWO references to the file, not one. */ -+ fdrop(fp, td); -+#endif -+ - PROC_LOCK(p); - td->td_dupfd = fd; - PROC_UNLOCK(p); -@@ -415,7 +434,11 @@ - *---------------------------------------------------------------------- - */ - static int -+#if __FreeBSD_version >= 502017 -+FreeBSD_Driver_Open(struct cdev *dev, int oflag, int devtype, struct thread *td) -+#else - FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td) -+#endif - { - VMFreeBSD *vmFreeBSD; - diff --git a/emulators/vmware3/pkg-descr b/emulators/vmware3/pkg-descr index 400a2f0..a8f969f 100644 --- a/emulators/vmware3/pkg-descr +++ b/emulators/vmware3/pkg-descr @@ -1,14 +1,15 @@ This is the Linux version of the VMware virtual machine emulator made to run on FreeBSD using the Linux compatibility mode. VMware can be -used to run Microsoft MS-DOS, Windows 95/98/NT/2000, Linux, FreeBSD, -or any other operating system that runs on the i486. +used to run Microsoft MS-DOS, Windows 95/98/NT/2000/XP/2K3, Linux, +FreeBSD, Netware or any other operating system that runs on the +Intel IA32. Official VMware, Inc. web site: WWW: http://www.vmware.com/ +The vmmon/vmnet modules have been ported originally by Vladimir N. +Silyaev, later adapted for VMware 3.x by Orlando Bassotto. Have a +look at his page for the latest information: -We all are thankful to Vladimir N. Silyaev for porting vmmon/vmnet -modules to FreeBSD. Have a look at his page for the latest -information: + http://www.break.net/orlando/vmware3/ - http://www.mindspring.com/~vsilyaev/vmware/ diff --git a/emulators/vmware3/pkg-message b/emulators/vmware3/pkg-message index a1db8b7..b2b9a37 100644 --- a/emulators/vmware3/pkg-message +++ b/emulators/vmware3/pkg-message @@ -5,6 +5,9 @@ Get Linux procfs ready and initialize vmmon/vmnet as follows: then you'll be ready to start vmware. +If you experience freezes on power on, be sure that the +ACPI module is not loaded. + Don't forget to load the kernel module aio.ko, or options VFS_AIO in the kernel. Otherwise expect problems. @@ -25,4 +28,10 @@ kern.ipc.shm_allow_removed=1 Don't miss the documents installed: vmware(1) ${PREFIX}/share/doc/vmware/* + +If you want to learn more on how to configure vmnet +interfaces for multiple instances of VMware, please refer to + + ${PREFIX}/share/doc/vmware/MultipleInstances.FreeBSD + ************************************************************ diff --git a/emulators/vmware3/pkg-plist b/emulators/vmware3/pkg-plist index 7dfb765..03c70e3 100644 --- a/emulators/vmware3/pkg-plist +++ b/emulators/vmware3/pkg-plist @@ -1,6 +1,5 @@ bin/vmware etc/rc.d/001.vmware.sh -etc/vmware/config lib/vmware/modules/vmmon_smp.ko %%FREEBSD5%%lib/vmware/modules/linker.hints lib/vmware/modules/vmmon_up.ko @@ -304,6 +303,8 @@ lib/vmware/smb/codepages/codepage.932 lib/vmware/smb/codepages/codepage.936 lib/vmware/smb/codepages/codepage.949 lib/vmware/smb/codepages/codepage.950 +share/doc/vmware/ChangeLog.FreeBSD +share/doc/vmware/MultipleInstances.FreeBSD share/doc/vmware/Hints.FreeBSD share/doc/vmware/README.FreeBSD share/doc/vmware/open_source_licenses.txt @@ -318,7 +319,6 @@ share/doc/vmware/README @exec ln -sf %D/etc/vmware %%LINUXBASE%%/etc/ @exec rm -f %%LINUXBASE%%/dev/vmmon %%LINUXBASE%%/dev/vmnet1 %%LINUXBASE%%/dev/null @unexec rm -f %%LINUXBASE%%/etc/vmware %%LINUXBASE%%/bin/df %%LINUXBASE%%/dev/tty[0-9]* %%LINUXBASE%%/dev/hd? -@dirrm etc/vmware @dirrm lib/vmware/bin @dirrm lib/vmware/help @dirrm lib/vmware/modules diff --git a/emulators/vmware3/scripts/configure b/emulators/vmware3/scripts/configure index 4b00cb1..1ae7d2f 100644 --- a/emulators/vmware3/scripts/configure +++ b/emulators/vmware3/scripts/configure @@ -5,7 +5,9 @@ host_ip=$VMNET_HOST_IP netmask=$VMNET_NETMASK -title="VMware network options" +title="VMware network setup" + + get_network_settings() { bridged="NO" @@ -119,9 +121,27 @@ do_network() { done } +guided_setup() { + /usr/bin/dialog --title "$title" --clear --yesno \ +"\n"\ +"Do you want to configure vmnet interface?\n"\ + 10 50 + if [ $? -eq 0 ]; then + do_network + else + /usr/bin/dialog --title "$title" --msgbox \ +"\n"\ +"Please, refer to $PREFIX/share/doc/vmware/MultipleInstances.FreeeBSD\n"\ +"for further information on setting up your vmnet interfaces.\n"\ + 8 70 + networking=1 + return 1 + fi +} + networking=0 if [ _$BATCH = _ ]; then - do_network + guided_setup if [ $? -eq 0 ]; then networking=1 |