Bridging between Fedora 7 and Windows 2000 VM

Discussions related to using VirtualBox on Linux hosts.
Post Reply
tonym
Posts: 16
Joined: 18. Aug 2007, 23:07
Location: Newport, Wales

Bridging between Fedora 7 and Windows 2000 VM

Post by tonym »

In previous postings I have described how I managed to create a VirtualBox VM running Windows 2000 from an upgrade CD.

What I didn't explain was that my reason for doing this is to upgrade my programming skills from Oracle 8i Server and Oracle Forms 6i to Oracle Server 10g and JDeveloper/ADF 10g.

My goal is therefore to install Oracle Server 10g running under Fedora 7, with JDeveloper etc clients running under the Windows 2000 VM and able to access the 10g Database.

To do this I have spent the last few weeks reading the VirtualBox manuals and How Tos, other postings on these forums, and other resources on the web, experimenting and trying to make sense of it all.

My conclusion is that there is a great deal of confusion about, especially for Fedora 7 users, so I hope that this posting will give others a little light at the end of their particular tunnel. Note: I am not a newbie, but I am not a networking expert either, so if this not the most elegant way to do this, please post and tell me and others why not. Please only do so if you know so from experience and have seenit work, NOT because you read it in a book somewhere.

In my particular setup the PC running Fedora 7 is connected via ethernet cable to one of the four LAN ports on my Linksys WRT54GS Wireless Router. The WRT54GS INTERNET port is connected via ethernet cable to the cable modem provided by my ISP, and so to the internet at large.

I have the DHCP functionality in the WRT54GS set to hand out IP addresses from 192.168.1.100 upwards, but I prefer to use fixed IP addresses and so the Fedora 7 eth0 interface is normally set to 192.168.1.10, with the WRT54GS address of 192.168.1.1 set as the Gateway address, and the DNS addresses of my ISP also set up manually. This is all set up via the System => Administration => Network menu and tested to be working correctly before proceeding (ie browsing the web via Firefox works OK).

My IP address allocation plan is that VirtualBox VMs will be 192.168.1.50 and up.

As the root user, add the following 9 lines to the /etc/rc.local script (as is usual for Unix, case IS important), and then reboot Fedora 7.

# For VirtualBox Host Interface Networking
/sbin/modprobe tun
/usr/sbin/brctl addbr br0
/sbin/ifconfig eth0 0.0.0.0 promisc
/usr/sbin/brctl addif br0 eth0
/sbin/ifconfig br0 192.168.1.10 netmask 255.255.255.0
/usr/bin/VBoxAddIF vbox0 oracle br0
/sbin/ifconfig vbox0 192.168.1.50 netmask 255.255.255.0
/sbin/service network restart

This will create a network bridge in software (named br0) and connect the existing eth0 interface to it, giving the bridge the 192.168.1.10 address previously held by interface eth0.

It then creates a new interface, in software, named vbox0, gives it an address of 192.168.1.50, and attaches it to bridge br0. The networking subsystem is then restarted to pick up the changes (hmmm, perhaps this isn't actually necessary, I'll investigate again later).

Once Fedora 7 has rebooted, login (eg as user oracle) and check that normal internet browsing via Firefox etc is OK.

Now start the VirtualBox VM Manager, click on "Settings", and select "Network" in the Panel on the Left Hand Side. In the Tab for "Adapter 0", ensure the "Enable Network Adapter" and "Cable Connected" checkboxes are set, and that a 12 character MAC Address is present. If not, press "Generate" to create one. Set the "Attached To" dropdown list to "Host Interface" and enter vbox0 (the software interface created earlier and attached to bridge br0) as the "Interface Name".

Now start the VM. I am going to assume a Windows 2000 VM as that is what I have. Adapt the following instructions accordingly.

Once the VM has started, login to Windows 2000 as Administrator. If I then click on "Start" => "Run" and enter "cmd" to start a Command shell, and enter "ipconfig /all", I find that the virtual ethernet adapter provided by VirtualBox has picked up an IP address of 192.168.1.100 via DHCP from the WRT54GS Router. It's important to think of this adapter as though it was a real one connected by ethernet cable to the vbox0 interface on bridge br0.

As I want my Windows 2000 VM to have a fixed IP address, I go to "Start" => "Settings" => "Network and Dial-Up Connections", right click on "Local Area Connection", and select "Properties". Then select "Internet Protocol (TCP/IP) and "Properties". In the resulting dialog I can then set the specific IP address info I require, so I set the IP address to be one higher than that of vbox0 at the other end of my virtual ethernet cable, so I set it as 192.168.1.51, set the subnet mask to 255.255.255.0, and set the Default Gateway to the IP address of the WRT54GS, ie 192.168.1.1. I then set the DNS Addresses to the values specified by my ISP.

If I then shutdown the Windows 2000 VM, restart it, login and open a command shell again and enter "ipconfig /all", I should see that the fixed IP address I specified has been set. I should also be able to ping the Fedora 7 address of 192.168.1.10 and get a reply, and opening Internet Explorer should let me browse the web OK.

Hope this is of use to someone.

Tony M
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Hi Tony,
thank you very much for your work. It is very helpful.
tonym
Posts: 16
Joined: 18. Aug 2007, 23:07
Location: Newport, Wales

Post by tonym »

Glad to be of some help.

Just in case someone didn't notice, in the following line from the /etc/rc.local script additions above:

/usr/bin/VBoxAddIF vbox0 oracle br0

the reference to oracle is because the user I intended to login as to run a VM and use the interface is named - oracle. Obvious, once you know.

I also should have recommended that the posting be read in conjunction with a couple of read throughs of the VirtualBox User Guide.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

But I'm not really shure it is required to set eth0 to promiscuous mode. I haven't found any advices to it.
tonym
Posts: 16
Joined: 18. Aug 2007, 23:07
Location: Newport, Wales

Post by tonym »

I made eth0 promiscuous because I saw it in one of the postings I managed to find on the web (probably this one http://samiux.wordpress.com/ ). I have now changed the additions to /etc/rc.local to be as follows, and it obviously still works as I can still browse the web using Firefox on fedora 7, and I'm posting this from IE6 running on a Windows 2000 VM. :D

# For VirtualBox Host Interface Networking
/sbin/modprobe tun
/usr/sbin/brctl addbr br0
/sbin/ifconfig eth0 0.0.0.0
/usr/sbin/brctl addif br0 eth0
/sbin/ifconfig br0 192.168.1.10 netmask 255.255.255.0
/usr/bin/VBoxAddIF vbox0 oracle br0
/sbin/ifconfig vbox0 192.168.1.50 netmask 255.255.255.0

Have fun :D

Tony M
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

OK, I haven't thougt about it. The interface eth0 has to set to promiscuous mode because it has to fetch ANY package going thru the bridge...
Post Reply