# "No route to host" FreeBSD-10.1 on VirtualBox



## dsocol (Nov 19, 2014)

Hello,

I installed FreeBSD-10.1-RELEASE-amd64 on VirtualBox 4.3.4. On VirtualBox the network is set on set to "Bridged Adapter". Outputs: ifconfig.png; nestat.png; rc.conf.png. When trying to fetch pkg or any other gets: no route to host. Also tried settingVbox to NAT, same result.

Please help.
Thank you


----------



## SirDice (Nov 19, 2014)

Something that has bitten me once or twice before. I had a VM bridged on my host's wireless interface. This won't work if the host is connected to a wired network, you will get similar error messages. So make sure you are actually bridging the active interface. It does not switch automatically.

Also verify that the host's firewall (if applicable) allows the traffic from/to the guests.


----------



## wblock@ (Nov 19, 2014)

The network mask shown by ifconfig(8) does not match the commented setting in /etc/rc.conf.  What is the default route on the host?


----------



## dsocol (Nov 19, 2014)

Thank you for your replies. I changed the netmask. It is connected to the proper network device. There is no firewall.

The error is slightly different now: error_fetching.png.


----------



## SirDice (Nov 19, 2014)

"No address record" indicates your DNS isn't correctly configured. If you've used static addresses make sure you edit /etc/resolv.conf accordingly.


----------



## dsocol (Nov 20, 2014)

Hi guys,

Thanks for replies. I did not sort it out. It is very very frustrating, maybe I'm too noob for this stuff. Not sure what and how to do next.

Thanks


----------



## wblock@ (Nov 20, 2014)

I recommend setting the VM networking to NAT in VirtualBox and using

```
ifconfig_em0="SYNCDHCP"
```


----------



## dsocol (Nov 20, 2014)

Something has changed, now pkg simply hangs, might be because on the host they use an automatic script, something like http://wpad/wpad.dat?


----------



## wblock@ (Nov 20, 2014)

You still must have valid DNS servers.  It might be that your DHCP server is not handing out the correct ones.

If you don't mind Google tracking every place you go on the net, enter

```
nameserver 8.8.8.8
```
 in /etc/resolv.conf.

That will be overwritten by DHCP if you restart the VM.


----------

