# Connecting to the Internet in a FreeBSD Virtual Machine



## okbuddy (Mar 7, 2021)

Hi, I have recently setup a virtual machine for FreeBSD. I found that I was unable to connect to the internet, I was wondering how I can configure this inside a virtual machine. Thanks!


----------



## a6h (Mar 7, 2021)

FreeBSD as a host, or guest? and which VM?

In case of FreeBSD host, you'll have near-zero problem if:
* Stick to the default NAT network setting in VMware, Hyper-V, and VirtualBox
* Use DHCP to setup NIC in the /etc/rc.conf, e.g. `ifconfig_em0="DHCP"`


----------



## Yampress (Mar 7, 2021)

FreeBSD Quickstart Guide for Linux® Users
					

This document is intended to quickly familiarize intermediate to advanced Linux® users with the basics of FreeBSD.




					docs.freebsd.org
				




+ configuration resolver /etc/resolv.conf

```
nameserver 1.1.1.1
nameserver 9.9.9.9
```


----------



## okbuddy (Mar 7, 2021)

Yampress said:


> FreeBSD Quickstart Guide for Linux® Users
> 
> 
> This document is intended to quickly familiarize intermediate to advanced Linux® users with the basics of FreeBSD.
> ...


It still doesn't work


----------



## SirDice (Mar 7, 2021)

okbuddy said:


> It still doesn't work


Use bridged networking on the host. Assuming you mean running a FreeBSD guest on a Windows Virtualbox host. If not please provide information, "it doesn't work" doesn't give us much to go on.


----------



## okbuddy (Mar 7, 2021)

SirDice said:


> Use bridged networking on the host. Assuming you mean running a FreeBSD guest on a Windows Virtualbox host. If not please provide information, "it doesn't work" doesn't give us much to go on.


I'm unable to access the internet via the FreeBSD guest virtual machine on a Windows VMware host. That good enough for ya?


----------



## a6h (Mar 8, 2021)

01. Run VMware _Virtual Network Editor _as administrator.
02. Press "Restore Defaults".
03. Wait.
04. Open VMware Workstation.
05. Create New Virtual machine.
06. Choose "NAT" as network type.
07. Install FreeBSD.
08. Choose IPv4/DHCP for network (no static , etc).
09. Finish, run and check the connection.
10. At this point, you have to have connection in FreeBSD -- even if it was {OpenBSD, NetBSD, Windows, linux}
11. If you don't have a connection, it's more likely you have a problem in the host, e.g. Firewall and/or Network Adapter.
12. If so, report back.
13. BTW, what is "*ya*"?



okbuddy said:


> That good enough for ya?


----------



## Deleted member 66267 (Mar 8, 2021)

vigole said:


> 13. BTW, what is "*ya*"?


It means "you", there are gonna, wanna and many things like that, too.


----------

