Sometimes you have to work with qemu and VMware virtual machines at the same time. Moreover you want these machines be visible to each other over the network.
To set up shared network environment for qemu and vmware you should prepare kernel to support TUN/TAP interfaces and bridge interfaces:
Enable TUN/TAP support:
Device Drivers --->Ensure that you have /dev/net/tun char device and it's writable and readable for qemu user.
Networking support --->
<*> Universal TUN/TAP device driver support
Networking --->
Networking options --->
<*> 802.1d Ethernet Bridging #NOTE : at least for 2.6.20 series
Start vmnet(usually vmnet8) interface.
Set vmnet8 in promisc mode:
ifconfig vmnet8 promiscSetup bridge interface:
brctl addbr br0Add vmnet8 interface to the bridge:
brctl addif br0 vmnet8Run vmware VM.
Create file /etc/qemu-ifup with:
#!/bin/shCreate file /etc/qemu-ifup-sudo with:
sudo /etc/qemu-ifup-sudo $@
#!/bin/shMake them executable and add qemu user to /etc/sudoers to run /etc/qemu-ifup-sudo in proper way.
/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addif br0 $1
Run qemu VM:
qemu -hda linux.img -net nic,macaddr=52:54:00:12:34:57 -net tapFor every new qemu VM instance you must set different macaddr!
No comments:
Post a Comment