# 7.2 as Guest OS on Windows XP/Microsoft Virtual PC 2007



## mraj (Sep 11, 2009)

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:

```
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.
```
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

```
$ /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:

```
#ifconfig_de0="DHCP"
ifconfig_de0="inet 192.168.2.100 netmask 255.255.255.0"
defaultrouter="192.168.2.1"
sshd_enable="YES"
```
/etc/resolv.conf was updated while DHCP was on, but for reference, it contains:

```
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.


----------



## baodad (Mar 18, 2010)

*Very helpful. Thanks!*

I really appreciate you sharing this here.  I ran into the same problems installing FreeBSD 8.0 on MS Virtual PC.  Your solution worked for me: to switch the virtual machine's networking off of NAT and just have a regular adapter and then inside BSD give de0 a static IP.

I'm running 64-bit VMWare Server on my workstation here, and it really is a beast.  I have to pull up Internet Explorer 8 everything I want to start it up (VMWare hasn't got a plugin developed for Firefox 3.6 yet) and log in first to the web GUI and then again when I start up the virtual machine.  For what I need, MS's small and light Virtual PC is better.  Not to mention the fact the my VMWare instances keep freezing up when I use the scrollbar on the right hand side of the screen (Host is 64-bit Windows 7).


----------



## baodad (Mar 19, 2010)

However, I still haven't got X running on MS virtual PC yet.  And I just learned that hald makes FreeBSD go into an endless error cycle after boot when I enabled it.  Then I had to learn how to go into single-user mode to undo that line in my rc.conf.


----------



## zvolkov (Jul 17, 2010)

I'm on Windows 7 64 bit + whatever version of Virtual PC that came with XP Mode + FreeBSD 8.0 GENERIC. Had the same problem with IP only working with static config and DHCP only working when activated manually after the boot, but not at boot time.

Fixed it by adding the following to the /etc/rc.conf:

```
synchronous_dhclient="YES"
ifconfig_de0="DHCP media 100baseTX mediaopt full-duplex"
```

The key is forcing the virtual ethernet card into full-duplex mode.


----------

