# virtual box and host only adapter



## fluca1978 (Dec 7, 2011)

Hi all,
I'm running virtual box 4.0.12 on FreeBSD 9 rc-1. A machine I'm running as guest has two attached network cards, one in nat and one host-only-adapter that is used to connect back from the host to the guest using a fixed ip address. Everything seems to work fine until my pc gets the screensaver or is manually locked (I'm running KDE as desktop). When I unlock the pc the virtual machine has lost the connection with the host-only-adapter, the interface is still there on the host:


```
$ ifconfig vboxnet0
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 0a:00:27:00:00:00
        inet6 fe80::800:27ff:fe00:0%vboxnet0 prefixlen 64 scopeid 0xc 
        inet 192.168.200.1 netmask 0xffffff00 broadcast 192.168.200.255
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

but both sides are not able to talk each other. I've tried accessing the virtual box logs, and they report the following (up to the shutdown of the machine):


```
00:03:32.647 PATM: patmR3RefreshPatch: succeeded to refresh patch at c01dd180 
00:03:32.696 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0359cf0 
00:03:32.709 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0359b10 
00:03:32.817 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0174d70 
00:03:32.822 PATM: patmR3RefreshPatch: succeeded to refresh patch at c01353a0 
00:03:33.758 PATM: Disabling IDT 35 patch handler c0103260
00:03:33.759 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0103260 
00:03:38.464 PATM: Disabling IDT e patch handler c05c972c
00:03:38.464 PATM: patmR3RefreshPatch: succeeded to refresh patch at c05c972c 
00:03:40.344 PATM: Disabling IDT 39 patch handler c0103270
00:03:40.345 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0103270 
00:03:40.477 PATM: Disabling IDT 3a patch handler c0103274
00:03:40.478 PATM: patmR3RefreshPatch: succeeded to refresh patch at c0103274 
00:03:40.747 NAT: DHCP offered IP address 10.0.3.15
00:03:40.748 NAT: DHCP offered IP address 10.0.3.15
00:04:42.557 AsyncCompletion: Task 0x00000810912e80 completed after 12 seconds
00:04:42.557 AsyncCompletion: Task 0x00000810912080 completed after 12 seconds
00:04:42.557 AsyncCompletion: Task 0x000008109120c0 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912100 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912e40 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912e00 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912dc0 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912d80 completed after 12 seconds
00:04:42.558 AsyncCompletion: Task 0x00000810912d40 completed after 12 seconds
00:04:42.559 AsyncCompletion: Task 0x00000810912d00 completed after 12 seconds
00:05:09.588 AsyncCompletion: Task 0x00000810912f80 completed after 12 seconds
00:05:22.059 AsyncCompletion: Task 0x00000810912f80 completed after 10 seconds
00:56:54.893 NAT: DHCP released IP address 10.0.3.15
00:57:07.313 AsyncCompletion: Task 0x00000810912f80 completed after 11 seconds
00:57:09.341 OHCI: USB Reset
00:57:09.360 Entering S5 power state (power down)
```

but I cannot see any useful hint. Any idea?


----------



## akil (Dec 8, 2011)

I have noticed similar issue, with regard to host only adapter. Interface vboxnet0 comes from kernel module vboxnet, you may look to /usr/local/etc/rc.d/vboxnet. In my case, my virtual machine crashed always during startup. I have only host-only-adapter attached to it, and I can't figure out why that is not working. I haven't yet tried latest version 4.0.14, because i still have 4.0.12 from some reasons.

Another answer for you could be that you can't ping from outside to the 10.0.3.0/24, but from of course you can.

Check your /etc/rc.conf for 
	
	



```
gateway_enable="YES"
```
 and also you could think about NAT. I would prefer pf to make some rules for forwarding, but that depends on you.

Please check also your chipset in your virtual machine settings. I also noticed that ICH9 doesn't work well on CPU which doesn't have instructions for virtualization.


----------

