# Virtualbox ose Windows7 Network



## killerkim (Jan 22, 2011)

Hello,

I installed Windows7 inside Virtualbox, and use FreeBSD 8.1 as Host system. Windows7 doesn't find any network hardware. I tried setting up natd at my host, and I want my Windows VM to use NAT to connect to the internet. I tried the following:


```
VBoxManage controlvm windows7 --nic1 nat wlan0
```

But it doesnt work...


----------



## wblock@ (Jan 22, 2011)

To share the host's interface, use bridged mode.  If you want to use NAT on the VM, it'll probably also need other settings:

```
--nic1 nat --nictype1 82540EM --cableconnected on
```
(untested, I use the GUI mostly.)


----------



## killerkim (Jan 22, 2011)

I played around with the different nictype drivers->


```
VBoxManage modifyvm windows7 --nictype1 82540EM --natnet1 "10.0/16"
```

I had to compile kernel with

```
options IPFIREWALL
options IPDIVERT
```
and configure *natd* to make NAT work and finally made it work :e

But it has a slow internet connection ( I think its because FreeBSD has to translate the internet packets through the Virtualbox Router Interface), so I switched to bridged mode. I had to compile kernel with netgraph Kernelmodule. The bridged mode internet connection performs a lot faster than the NAT mode connection.


----------



## wblock@ (Jan 22, 2011)

How old is your host OS?  I haven't made any changes to my 8.x GENERIC-based kernel for VirtualBox.

Yes, bridged is faster.  scp(1) copying of large files (>1G) likes to stall with NAT, but bridged works fine.


----------



## killerkim (Jan 23, 2011)

wblock said:
			
		

> How old is your host OS?  I haven't made any changes to my 8.x GENERIC-based kernel for VirtualBox.
> 
> Yes, bridged is faster.  scp(1) copying of large files (>1G) likes to stall with NAT, but bridged works fine.



I made a custom kernel, and nearly didn't compile any kernelmodules at all. The only kernelmodules I had were my Wireless USB and the msdos filesystem. Therefore I missed the netgraph kernelmodule, which is bundled in the GENERIC Kernel, and had to add it into my MODULES_OVERRIED section of my make.conf:


```
MODULES_OVERRIDE = netgraph runfw msdos
```


----------

