I had a difficult time getting network connectivity to work on FreeBSD 7.2 as a guest OS on Windows XP using Microsoft Virtual PC 2007 (MVPC), so I thought I would post how I got it working, and hear your feedback.
My home network consists of a Westell DSL modem (in Bridged Ethernet mode) connected to a Linksys router (192.168.2.1). The Linksys router is running a DHCP server. I have 4 Windows machines, one of which is running XP and MVPC, and that's the one I installed FreeBSD 7.2 on:
{Internet}->[DSL Modem]->[Linksys Router, DHCP]->[XP and FreeBSD inside MVPC]
I followed the handbook instructions and set FreeBSD for DHCP: ifconfig_de0="DHCP". For MVPC, I wasn't sure how to set up Networking, so I selected NAT for Adapter 1 (the picture in the handbook shows NAT selected, but the accompanying text just says "set the type of networking").
While booting, FreeBSD can not obtain an IP address:
After logging in, ifconfig shows no IP address assigned to de0 (MVPC provides a virtual network adapter used by the de(4) driver). I rebooted multiple times, and I never seem to be able to get an IP address. Does anyone know why this doesn't work? I assume it is a problem with MVPC.
If I restart the network manually
With this IP address I can get to the Internet (ping google.com works), and I can ping my host PC (running Windows XP) at 192.168.2.16, which is the IP address XP received from the DHCP server running on the Linksys router. Progress...
One problem though: from XP, I can't ping (or ssh to) my virtual FreeBSD. I looked on my Linksys router, and it doesn't seem to know anything about the FreeBSD machine... (neither does Norton Internet Security running on XP).
Is my problem here that I'm double NATing?
I decided to try and use the DHCP server on the Linksys router (and hopefully avoid what I think is a double NATing problem). For MVPC Networking, Adapter 1, I selected Intel PRO Network Connection (instead of NAT) this time. After a reboot of FreeBSD, it still can't get an IP address while booting (bummer). After bootup, and after manually restarting the network, FreeBSD gets IP address 192.168.2.23. Hurray, I'm on the same subnet as XP now! I can ping from XP to FreeBSD and FreeBSD to XP. FreeBSD can also ping out to the Internet. Everything is working.
I have not been able to solve the "can't get an IP address during bootup" problem, so I ended up assigning a static IP address, 192.168.2.100 (an address the Linksys DHCP server won't give out) to FreeBSD. My FreeBSD /etc/rc.conf now contains:
/etc/resolv.conf was updated while DHCP was on, but for reference, it contains:
I can now run Putty on XP to ssh into my FreeBSD virtual server. This is a very good thing, since the console that comes with MVPC can't be resized.
After reading a few posts in this forum, I think I'm also going to try VMWare Server 2.0 (in place of MVPC). One nice thing about MVPC though is that it only consumes 35MB of disk space, compared to 507MB size of the VMWare Server 2.0 download. After I install it, I'm sure it will eat up even more.
My home network consists of a Westell DSL modem (in Bridged Ethernet mode) connected to a Linksys router (192.168.2.1). The Linksys router is running a DHCP server. I have 4 Windows machines, one of which is running XP and MVPC, and that's the one I installed FreeBSD 7.2 on:
{Internet}->[DSL Modem]->[Linksys Router, DHCP]->[XP and FreeBSD inside MVPC]
I followed the handbook instructions and set FreeBSD for DHCP: ifconfig_de0="DHCP". For MVPC, I wasn't sure how to set up Networking, so I selected NAT for Adapter 1 (the picture in the handbook shows NAT selected, but the accompanying text just says "set the type of networking").
While booting, FreeBSD can not obtain an IP address:
Code:
DHCPREQUEST on de0 to 255.255.255.255 port 67
DHCPREQUEST on de0 to 255.255.255.255 port 67
DHCPDISCOVER on de0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on de0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on de0 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on de0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on de0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
If I restart the network manually
Code:
$ /etc/rc.d/netif restart
then FreeBSD can obtain an IP address from, I assume, a DHCP server running inside MVPC:
DHCPREQUEST on de0 to 255.255.255.255 port 67
DHCPACK from 192.168.131.254
bound to 192.168.131.65
With this IP address I can get to the Internet (ping google.com works), and I can ping my host PC (running Windows XP) at 192.168.2.16, which is the IP address XP received from the DHCP server running on the Linksys router. Progress...
One problem though: from XP, I can't ping (or ssh to) my virtual FreeBSD. I looked on my Linksys router, and it doesn't seem to know anything about the FreeBSD machine... (neither does Norton Internet Security running on XP).
Is my problem here that I'm double NATing?
I decided to try and use the DHCP server on the Linksys router (and hopefully avoid what I think is a double NATing problem). For MVPC Networking, Adapter 1, I selected Intel PRO Network Connection (instead of NAT) this time. After a reboot of FreeBSD, it still can't get an IP address while booting (bummer). After bootup, and after manually restarting the network, FreeBSD gets IP address 192.168.2.23. Hurray, I'm on the same subnet as XP now! I can ping from XP to FreeBSD and FreeBSD to XP. FreeBSD can also ping out to the Internet. Everything is working.
I have not been able to solve the "can't get an IP address during bootup" problem, so I ended up assigning a static IP address, 192.168.2.100 (an address the Linksys DHCP server won't give out) to FreeBSD. My FreeBSD /etc/rc.conf now contains:
Code:
#ifconfig_de0="DHCP"
ifconfig_de0="inet 192.168.2.100 netmask 255.255.255.0"
defaultrouter="192.168.2.1"
sshd_enable="YES"
Code:
search dsl.verizon.net
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 72.250.0.12
I can now run Putty on XP to ssh into my FreeBSD virtual server. This is a very good thing, since the console that comes with MVPC can't be resized.
After reading a few posts in this forum, I think I'm also going to try VMWare Server 2.0 (in place of MVPC). One nice thing about MVPC though is that it only consumes 35MB of disk space, compared to 507MB size of the VMWare Server 2.0 download. After I install it, I'm sure it will eat up even more.