人类社会所让我们深思的东西有很多!和生命有关,和自由有关,和爱有关,当然更和技术有关!

VMware配置桥接、网络地址转换和Host-only

上一篇 / 下一篇  2008-03-19 15:46:21 / 个人分类:free&open software

众所周知,虚拟机的强大和未来的趋势。VMware确实是其中的翘楚,个人对虚拟化的认识处于感性阶段,Xen、 Linux-VServer、 OpenVZ等都是模棱两可的,即使是VMware也是在实际中需要学习才练习其使用。
刚搜了一下,赵珂够大名鼎鼎了吧!他的这篇linux虚拟化是很好的材料。
 下面是我的实际操作。
[root@lee ~]# vmware-config.pl
Making sure services for VMware Workstation are stopped.

Stopping VMware services:
   Virtual machine monitor                                 [  确定  ]
   Bridged networking on /dev/vmnet0                       [  确定  ]
   Bridged networking on /dev/vmnet2                       [  确定  ]
   Virtual ethernet                                        [  确定  ]

Configuring fallback GTK+ 2.4 libraries.

***
* Updating MIME database in /usr/share/mime...
***
In which directory do you want to install the mime type icons?
[/opt/mvware/workstation/icons] /opt/mvware/workstation/icons

What directory contains your desktop menu entry files? These files have a
.desktop file extension.
[/opt/mvware/workstation/applications] /opt/mvware/workstation/applications

In which directory do you want to install the application's icon?
[/opt/mvware/workstation/pixmaps] /opt/mvware/workstation/pixmaps

Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes] yse

The answer "yse" is invalid.  It must be one of "y" or "n".

None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

Your kernel was built with "gcc" version "3.4.5", while you are trying to use
"/usr/bin/gcc" version "3.4.3". This configuration is not recommended and VMware
Workstation may crash if you'll continue. Please try to use exactly same
compiler as one used for building your kernel. Do you want to go with compiler
"/usr/bin/gcc" version "3.4.3" anyway? [no] yes

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.9-34.21AX/build/include] /lib/modules/2.6.9-34.21AX/build/include

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.9-34.21AX/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-34.21AX-i686'
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/hostif.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/cpuid.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/hash.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/memtrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/phystrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/task.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/vmx86.o
  CC [M]  /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST
  CC      /tmp/vmware-config0/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.9-34.21AX-i686'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
The module loads perfectly in the running kernel.

This program previously created the file /dev/vmmon, and was about to remove it.
Somebody else apparently did it already.

You have already setup networking.

Would you like to skip networking setup and keep your old settings as they are?
(yes/no) [yes] no

Do you want networking for your virtual machines? (yes/no/help) [yes] yes

This program previously created the file /dev/vmnet1, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet3, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet4, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet5, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet6, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet7, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet8, and was about to remove
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet9, and was about to remove
it.  Somebody else apparently did it already.

Would you prefer to modify your existing networking configuration using the
wizard or the editor? (wizard/editor/help) [wizard] editor

The following virtual networks have been defined:

. vmnet0 is bridged to eth0
. vmnet2 is bridged to eth1

Do you wish to make any changes to the current virtual networks settings?
(yes/no) [no] yes

Which virtual network do you wish to configure? (0-99) 1

The network vmnet1 has been reserved for a host-only network.  You may change
it, but it is highly recommended that you use it as a host-only network.  Are
you sure you want to modify it? (yes/no) [no] yes

What type of virtual network do you wish to set vmnet1?
(bridged,hostonly,nat,none) [none] hostonly

Configuring a host-only network for vmnet1.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] yes

Probing for an unused private subnet (this can take some time)...

The subnet 172.16.186.0/255.255.255.0 appears to be unused.

This system appears to have a DHCP server configured for normal use.  Beware
that you should teach it how not to interfere with VMware Workstation's DHCP
server.  There are two ways to do this:

1) Modify the file /etc/dhcpd.conf to add something like:

subnet 172.16.186.0 netmask 255.255.255.0 {
# Note: No range is given, vmnet-dhcpd will deal with this subnet.
}

2) Start your DHCP server with an explicit list of network interfaces to deal
with (leaving out vmnet1). e.g.:

dhcpd eth0

Consult the dhcpd(8) and dhcpd.conf(5) manual pages for details.

Hit enter to continue.

The following virtual networks have been defined:

. vmnet0 is bridged to eth0
. vmnet1 is a host-only network on private subnet 172.16.186.0.
. vmnet2 is bridged to eth1

Do you wish to make additional changes to the current virtual networks settings?
(yes/no) [yes] no

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmnet-only'
make -C /lib/modules/2.6.9-34.21AX/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-34.21AX-i686'
  CC [M]  /tmp/vmware-config0/vmnet-only/driver.o
  CC [M]  /tmp/vmware-config0/vmnet-only/hub.o
  CC [M]  /tmp/vmware-config0/vmnet-only/userif.o
  CC [M]  /tmp/vmware-config0/vmnet-only/netif.o
  CC [M]  /tmp/vmware-config0/vmnet-only/bridge.o
  CC [M]  /tmp/vmware-config0/vmnet-only/procfs.o
  LD [M]  /tmp/vmware-config0/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST
  CC      /tmp/vmware-config0/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.9-34.21AX-i686'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/vmware-config0/vmnet-only'
The module loads perfectly in the running kernel.

Starting VMware services:
   Virtual machine monitor                                 [  确定  ]
   Virtual ethernet                                        [  确定  ]
   Bridged networking on /dev/vmnet0                       [  确定  ]
   Host-only networking on /dev/vmnet1 (background)        [  确定  ]
   Bridged networking on /dev/vmnet2                       [  确定  ]

The configuration of VMware Workstation 5.0.0 build-13124 for Linux for this
running kernel completed successfully.

You can now run VMware Workstation by invoking the following command:
"/usr/bin/vmware".

Enjoy,

--the VMware team
我会慢慢摆脱这种贴操作的代码,也希望自己的东西、自己的代码会多起来!

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2010-08-01  
1234567
891011121314
15161718192021
22232425262728
293031    

数据统计

  • 访问量: 1307
  • 日志数: 171
  • 建立时间: 2008-01-23
  • 更新时间: 2008-04-14

RSS订阅

Open Toolbar