Discussion:
FreeBSD on Virtualbox: No network access
Weihang Wang
2010-12-03 02:03:42 UTC
Permalink
Hi all,

I am running FreeBSD 8.1 in Virtualbox OSE as a guest OS on Ubuntu. Now the guest OS does not have network access. When using ifconfig, the virtual ethernet card le0 (when using PCI II) or pcn0 (when using PCnet FAST III) has no IP address. I have configured ifconfig_le0/pcn0="DHCP" in /etc/rc.conf. But it still has no network access. In the virtualbox, I choose the networking mode "Bridged" or "NAT", they don't work, either. I found in the virtualbox the name of this virtual network interface is eth0. But when i use ifconfig, there is no eth0 in this operating system. I am a little mass and struggling in this problem several days and could not find a solution from the Internet.
Hope who have ideas about this could give me some possible solutions.
Thanks in advance.

Best,
W.W. _______________________________________________
freebsd-***@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-***@freebsd.org"
Martes G Wigglesworth
2010-12-03 04:55:48 UTC
Permalink
Post by Weihang Wang
Now the guest OS does not have network access. When using ifconfig, the virtual ethernet card le0 (when using PCI II) or pcn0 (when using PCnet FAST III) has no IP address.
Have you attempted to select different available network interfaces?

I have a similar issue when I first started using virtualbox, and it was
due to not having the correct interface drop-down option from within the
Settings tab on the VirtualBox Gui. (Where all the VMs are listed.)
--
Respectfully,


Martes G Wigglesworth
M. G. Wigglesworth Holdings, LLC
www.mgwigglesworth.net
Weihang Wang
2010-12-03 05:33:12 UTC
Permalink
Hi Martes,

I have tried the first two interfaces which are said to be supported by FreeBSD, they do not work. Surprisingly, now I choose the option "Intel PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!

Best,
W.W.
Post by Martes G Wigglesworth
Post by Weihang Wang
Now the guest OS does not have network access. When using ifconfig, the virtual ethernet card le0 (when using PCI II) or pcn0 (when using PCnet FAST III) has no IP address.
Have you attempted to select different available network interfaces?
I have a similar issue when I first started using virtualbox, and it was due to not having the correct interface drop-down option from within the Settings tab on the VirtualBox Gui. (Where all the VMs are listed.)
--
Respectfully,
Martes G Wigglesworth
M. G. Wigglesworth Holdings, LLC
www.mgwigglesworth.net
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
Timm Wimmers
2010-12-03 09:25:54 UTC
Permalink
Post by Weihang Wang
Hi Martes,
I have tried the first two interfaces which are said to be supported by FreeBSD, they do not work. Surprisingly, now I choose the option "Intel PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!
In most cases it is better to use bridge mode. In NAT mode your VM get a
private subnet and other devices in your network can't find your VM,
because the VM is behind (or encapsulated in) your HOST (as like as your
HOST is behind your router to the internet). This can work if you define
routes, but bridging is mostly easier.

In Bridge mode your VM acts like any other machine in your network and
will get an IP-Adress from your DHCP server (if you use DHCP).
--
Timm

[1] HSOT = your Ubuntu Workstation
Matthew Seaman
2010-12-04 13:32:08 UTC
Permalink
Post by Timm Wimmers
Post by Weihang Wang
Hi Martes,
I have tried the first two interfaces which are said to be supported by FreeBSD, they do not work. Surprisingly, now I choose the option "Intel PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!
In most cases it is better to use bridge mode. In NAT mode your VM get a
private subnet and other devices in your network can't find your VM,
because the VM is behind (or encapsulated in) your HOST (as like as your
HOST is behind your router to the internet). This can work if you define
routes, but bridging is mostly easier.
In Bridge mode your VM acts like any other machine in your network and
will get an IP-Adress from your DHCP server (if you use DHCP).
Hmmm.... I don't know about bridge mode being appropriate in "most"
cases. NAT and bridge modes are useful in different circumstances

* NAT mode means that your VMs are not exposed to incoming
connections on the net.
* Bridge mode means that the VMs can run network services
for users on other machines.

Which one of those you prefer depends very much on how you're using the
VMs. Eg. for a dev playground and for local testing, NAT looks like a
better idea.

Now, I run VirtualBox on my Mac with FreeBSD (inter alia) as a guest OS.
Your setup may differ, but I find NAT mode to be the best choice.
In addition to the considerations above, I also see:

* In NAT mode, the FreeBSD guest is insulated from how the Mac
connects to the network. Switching between wired or wireless
networking, or even using a 3G dongle "just works" as far as
the FreeBSD guest is concerned.
* Similarly if the MAC gets a new IP when switching between
different networks and DHCP servers, the guest OS just doesn't
care.

You don't need to worry about configuring routing and so forth in the
guests: just use DHCP for the i/f, and it all works automagically.

Actually, I generally enable two network interfaces for unixoid guests
(ie. capable of running sshd) -- set to NAT and vboxnet0. This means I
can ssh into local guest OSes from a Terminal.app session, which I find
more convenient than logging in via the console. Again, it's all
configured effortlessly with DHCP.

My only complaint is that IPv6 doesn't work in these modes, but I can
live with that.

Cheers,

Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: ***@infracaninophile.co.uk Kent, CT11 9PW
Weihang Wang
2010-12-04 22:21:33 UTC
Permalink
Hi,

Thank you so much for your advices. I am using NAT mode now. Just as you said, there is no need to configure DHCP in /etc/rc.conf. I just choose the Intel PRO/1000 T Server as my virtual network interface. It works well.
Thank you very much. : )

Best,
W.W.
Post by Matthew Seaman
Post by Timm Wimmers
Post by Weihang Wang
Hi Martes,
I have tried the first two interfaces which are said to be supported by FreeBSD, they do not work. Surprisingly, now I choose the option "Intel PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!
In most cases it is better to use bridge mode. In NAT mode your VM get a
private subnet and other devices in your network can't find your VM,
because the VM is behind (or encapsulated in) your HOST (as like as your
HOST is behind your router to the internet). This can work if you define
routes, but bridging is mostly easier.
In Bridge mode your VM acts like any other machine in your network and
will get an IP-Adress from your DHCP server (if you use DHCP).
Hmmm.... I don't know about bridge mode being appropriate in "most"
cases. NAT and bridge modes are useful in different circumstances
* NAT mode means that your VMs are not exposed to incoming
connections on the net.
* Bridge mode means that the VMs can run network services
for users on other machines.
Which one of those you prefer depends very much on how you're using the
VMs. Eg. for a dev playground and for local testing, NAT looks like a
better idea.
Now, I run VirtualBox on my Mac with FreeBSD (inter alia) as a guest OS.
Your setup may differ, but I find NAT mode to be the best choice.
* In NAT mode, the FreeBSD guest is insulated from how the Mac
connects to the network. Switching between wired or wireless
networking, or even using a 3G dongle "just works" as far as
the FreeBSD guest is concerned.
* Similarly if the MAC gets a new IP when switching between
different networks and DHCP servers, the guest OS just doesn't
care.
You don't need to worry about configuring routing and so forth in the
guests: just use DHCP for the i/f, and it all works automagically.
Actually, I generally enable two network interfaces for unixoid guests
(ie. capable of running sshd) -- set to NAT and vboxnet0. This means I
can ssh into local guest OSes from a Terminal.app session, which I find
more convenient than logging in via the console. Again, it's all
configured effortlessly with DHCP.
My only complaint is that IPv6 doesn't work in these modes, but I can
live with that.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Weihang Wang
2010-12-09 04:34:22 UTC
Permalink
Post by Timm Wimmers
Post by Weihang Wang
Hi Martes,
I have tried the first two interfaces which are said to be supported by FreeBSD, they do not work. Surprisingly, now I choose the option "Intel PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!
In most cases it is better to use bridge mode. In NAT mode your VM get a
private subnet and other devices in your network can't find your VM,
because the VM is behind (or encapsulated in) your HOST (as like as your
HOST is behind your router to the internet). This can work if you define
routes, but bridging is mostly easier.
In Bridge mode your VM acts like any other machine in your network and
will get an IP-Adress from your DHCP server (if you use DHCP).
--
Timm
[1] HSOT = your Ubuntu Workstation
Hi,

Could someone tell me how to enable Bridge mode?

I just change the network settings of my virtual machine, change it to bridged mode. I also select the eth0, which is the physical interface of my system.
Then in my virtual machine, I add one line:
ifconfig_em0="DHCP" in /etc/rc.conf file.
I have changed each of the five virtual interfaces Intel and ..., but I could not get network access.

If I use NAT mode, one of these five interfaces works fine. But now I do need the Bridged mode because one of my machine would be a server in my experiment.

Hope to hear from you. Thanks in advance.

Best,
W.W._______________________________________________
freebsd-***@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-***@freebsd.org"
Adam Vande More
2010-12-09 04:47:48 UTC
Permalink
Post by Weihang Wang
Hi,
Could someone tell me how to enable Bridge mode?
Seems like you already know how since you do it below.
Post by Weihang Wang
I just change the network settings of my virtual machine, change it to
bridged mode. I also select the eth0, which is the physical interface of my
system.
ifconfig_em0="DHCP" in /etc/rc.conf file.
I have changed each of the five virtual interfaces Intel and ..., but I
could not get network access.
ifconfig_em0="DHCP" would only work for the intel adapters, not amd ones.
Post by Weihang Wang
If I use NAT mode, one of these five interfaces works fine. But now I do
need the Bridged mode because one of my machine would be a server in my
experiment.
You do have a DHCP server correct? What happens when you do "dhclient
em0"? Does bridged networking work with a different guest OS as maybe it's
some problem with your host.
--
Adam Vande More
Weihang Wang
2010-12-09 18:48:30 UTC
Permalink
Post by Adam Vande More
Post by Weihang Wang
Hi,
Could someone tell me how to enable Bridge mode?
Seems like you already know how since you do it below.
Post by Weihang Wang
I just change the network settings of my virtual machine, change it to
bridged mode. I also select the eth0, which is the physical interface of my
system.
ifconfig_em0="DHCP" in /etc/rc.conf file.
I have changed each of the five virtual interfaces Intel and ..., but I
could not get network access.
ifconfig_em0="DHCP" would only work for the intel adapters, not amd ones.
Post by Weihang Wang
If I use NAT mode, one of these five interfaces works fine. But now I do
need the Bridged mode because one of my machine would be a server in my
experiment.
You do have a DHCP server correct? What happens when you do "dhclient
em0"? Does bridged networking work with a different guest OS as maybe it's
some problem with your host.
--
Adam Vande More
Hi,

I do not configure a DHCP server. When my FreeBSD 6.0 is booting, there are several DHCPDISCOVERY messages, finally it shows no DHCPOFFER received. Do I need to configure a DHCP server myself? If I need a DHCP server? Where it should be? Now I only have one test machine, Ubuntu as the host OS, two VMs (both are FreeBSD 6.0) on this machine. I want this two VMs communicate with each other.

Just go back to the DHCP stuff, when I use NAT mode, the guest OS FreeBSD 6.0 could get DHCPOFFER successfully. Who is the DHCP server then?

When running dhclien em0, the results are similar to the DHCPDISCOVER results during booting. No DHCPOFFERS received.


Thanks,
W.W.
Chris Brennan
2010-12-09 20:40:38 UTC
Permalink
Post by Weihang Wang
Hi,
I do not configure a DHCP server. When my FreeBSD 6.0 is booting, there are
several DHCPDISCOVERY messages, finally it shows no DHCPOFFER received. Do I
need to configure a DHCP server myself? If I need a DHCP server? Where it
should be? Now I only have one test machine, Ubuntu as the host OS, two VMs
(both are FreeBSD 6.0) on this machine. I want this two VMs communicate with
each other.
Just go back to the DHCP stuff, when I use NAT mode, the guest OS FreeBSD
6.0 could get DHCPOFFER successfully. Who is the DHCP server then?
When running dhclien em0, the results are similar to the DHCPDISCOVER
results during booting. No DHCPOFFERS received.
It would appear that Ubuntu has not correctly installed the bridging
adapter. Did you check out the links I provided on setting up a bridging
device on Ubuntu w/ vBox? They worked for me, I set up an Ubuntu VM and in
the VM setup a test VM of vBox to boot fbsd (8.1 in my case).

NOTE: I do not recoomend setting up a VM within a VM, I did it strictly as a
test to boot and get network access. Which it did.
Weihang Wang
2010-12-09 21:39:47 UTC
Permalink
Post by Chris Brennan
Post by Weihang Wang
Hi,
I do not configure a DHCP server. When my FreeBSD 6.0 is booting, there are
several DHCPDISCOVERY messages, finally it shows no DHCPOFFER received. Do I
need to configure a DHCP server myself? If I need a DHCP server? Where it
should be? Now I only have one test machine, Ubuntu as the host OS, two VMs
(both are FreeBSD 6.0) on this machine. I want this two VMs communicate with
each other.
Just go back to the DHCP stuff, when I use NAT mode, the guest OS FreeBSD
6.0 could get DHCPOFFER successfully. Who is the DHCP server then?
When running dhclien em0, the results are similar to the DHCPDISCOVER
results during booting. No DHCPOFFERS received.
It would appear that Ubuntu has not correctly installed the bridging
adapter. Did you check out the links I provided on setting up a bridging
device on Ubuntu w/ vBox? They worked for me, I set up an Ubuntu VM and in
the VM setup a test VM of vBox to boot fbsd (8.1 in my case).
NOTE: I do not recoomend setting up a VM within a VM, I did it strictly as a
test to boot and get network access. Which it did.
______________________________________________
Hi,

I am sorry I don't know which page you refer to... I am confusing now cause first, I don't know which mode could be best for my needs. What I need is two VMs on a real machine, these two VMs could communicate with each other. It seems bridged mode is suitable here. But there is no network access for bridged mode.

BTW, when I use NAT mode, two VMs get the same IP address, and they could not get to each other.

Thanks,
W.W.
Adam Vande More
2010-12-09 21:55:22 UTC
Permalink
Post by Weihang Wang
I do not configure a DHCP server. When my FreeBSD 6.0 is booting, there are
several DHCPDISCOVERY messages, finally it shows no DHCPOFFER received. Do I
need to configure a DHCP server myself? If I need a DHCP server?
Bridged networking makes the guest behave like another physical installation
with respect to networking. If your network doesn't have a DHCP server then
for DHCP to work one is required. You don't need DHCP for networking
however, you could simply assign static addresses.
Post by Weihang Wang
Where it should be? Now I only have one test machine, Ubuntu as the host
OS, two VMs (both are FreeBSD 6.0) on this machine. I want this two VMs
communicate with each other.
Why are you using such an old version of FreeBSD?

Just go back to the DHCP stuff, when I use NAT mode, the guest OS FreeBSD
Post by Weihang Wang
6.0 could get DHCPOFFER successfully. Who is the DHCP server then?
In NAT mode, VirtualBox provides it's internal DHCP server.

When running dhclien em0, the results are similar to the DHCPDISCOVER
Post by Weihang Wang
results during booting. No DHCPOFFERS received.
--
Adam Vande More
Chris Brennan
2010-12-09 22:48:21 UTC
Permalink
Clipped for brevity.

https://help.*ubuntu*.com/community/VirtualBox/Networking
https://wiki.*ubuntu*.com/VirtualBox
http://ubuntuforums.org/showthread.php?t=667952
http://www.virtualbox.org/manual/ch06.html#id2741763

Here are the links that should help you, I *suggested* you read them this
time and learn how to install, configure and use the bridging adapter.
Weihang Wang
2010-12-10 03:33:29 UTC
Permalink
Post by Chris Brennan
Clipped for brevity.
https://help.*ubuntu*.com/community/VirtualBox/Networking
https://wiki.*ubuntu*.com/VirtualBox
http://ubuntuforums.org/showthread.php?t=667952
http://www.virtualbox.org/manual/ch06.html#id2741763
Here are the links that should help you, I *suggested* you read them this
time and learn how to install, configure and use the bridging adapter.
Hi,

I do read these documents already. Anyway, I have changed the mode the internal networking mode, it works fine.Thank you so much for your help.

Best,
W.W._______________________________________________
freebsd-***@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-***@freebsd.org"
Weihang Wang
2010-12-10 03:32:04 UTC
Permalink
Post by Adam Vande More
Post by Weihang Wang
I do not configure a DHCP server. When my FreeBSD 6.0 is booting, there are
several DHCPDISCOVERY messages, finally it shows no DHCPOFFER received. Do I
need to configure a DHCP server myself? If I need a DHCP server?
Bridged networking makes the guest behave like another physical installation
with respect to networking. If your network doesn't have a DHCP server then
for DHCP to work one is required. You don't need DHCP for networking
however, you could simply assign static addresses.
Post by Weihang Wang
Where it should be? Now I only have one test machine, Ubuntu as the host
OS, two VMs (both are FreeBSD 6.0) on this machine. I want this two VMs
communicate with each other.
Why are you using such an old version of FreeBSD?
Just go back to the DHCP stuff, when I use NAT mode, the guest OS FreeBSD
Post by Weihang Wang
6.0 could get DHCPOFFER successfully. Who is the DHCP server then?
In NAT mode, VirtualBox provides it's internal DHCP server.
When running dhclien em0, the results are similar to the DHCPDISCOVER
Post by Weihang Wang
results during booting. No DHCPOFFERS received.
Hi,

I have to use FreeBSD 6.0 because the network stack I will test is only based on 6.0. BTW, I am using internal networking mode now, these two VMs could communicate with each other now. This mode seems could satisfy my needs, because my VMs only need to communicate with each other, not with the outside world.
Thank you so much for help.

Best,
W.W.
Chris Brennan
2010-12-09 04:49:06 UTC
Permalink
Post by Weihang Wang
Hi,
Could someone tell me how to enable Bridge mode?
I just change the network settings of my virtual machine, change it to
bridged mode. I also select the eth0, which is the physical interface of my
system.
ifconfig_em0="DHCP" in /etc/rc.conf file.
I have changed each of the five virtual interfaces Intel and ..., but I
could not get network access.
If I use NAT mode, one of these five interfaces works fine. But now I do
need the Bridged mode because one of my machine would be a server in my
experiment.
Hope to hear from you. Thanks in advance.
Weihang,

Basically what you want to do is select bridging in your vBox settings for
your VM. Then select your real system's ethernet adapter, expand the little
drop down below that and it will allow you to choose which vNIC you want. I
choose the Intel 82545EM device which gives me an em0 vNIC. in my FreeBSD VM
I have the following three lines pertaining to setting up my network

sshd_enable="YES"
ifconfig_em0="inet 192.168.0.20 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
hostname="freebsd-bsd.xaerolimit.net"

and of course, that hostname does resolve on my lan, but that's not what
this e-mail is about. Hope this helps.
Chris Brennan
2010-12-03 15:54:07 UTC
Permalink
Post by Weihang Wang
Hi Martes,
I have tried the first two interfaces which are said to be supported by
FreeBSD, they do not work. Surprisingly, now I choose the option "Intel
PRO/1000 T Server" and in NAT mode, it works now!!!!
Thank you so much, you do me a great favor!! Hope this also works for Chris!
Best,
W.W.
Good, glad it works for you.
Volodymyr Kostyrko
2010-12-03 21:14:48 UTC
Permalink
Post by Weihang Wang
I am running FreeBSD 8.1 in Virtualbox OSE as a guest OS on Ubuntu. Now the guest OS does not have network access. When using ifconfig, the virtual ethernet card le0 (when using PCI II) or pcn0 (when using PCnet FAST III) has no IP address. I have configured ifconfig_le0/pcn0="DHCP" in /etc/rc.conf. But it still has no network access. In the virtualbox, I choose the networking mode "Bridged" or "NAT", they don't work, either. I found in the virtualbox the name of this virtual network interface is eth0. But when i use ifconfig, there is no eth0 in this operating system. I am a little mass and struggling in this problem several days and could not find a solution from the Internet.
Hope who have ideas about this could give me some possible solutions.
Thanks in advance.
If you do use amd64 version of freebsd try not to stick to the hardware
from the ISA days.
--
Sphinx of black quartz judge my vow.
Loading...