Page 1 of 1
Bridged mode networking notworking
Posted: 20. Dec 2017, 10:32
by timothylegg
I have two Ubuntu/Debian VMs that need to run simultaneously, and they must be able to transact data using netcat on arbitrary port numbers. I do not want the wireless router to assign IP addresses because I do not have authority over the wireless hardware's port forwarding/blocking settings. I would rather have them locally assigned IP addresses by an emulated router that I can access via ssh from my host system. When they start in NAT mode, they both have the same IP address, but at least their MAC addresses are unique. It would be nice for them to have access to the external internet occasionally for tools such as apt-get or wget, but it isn't a requirement.
I read the documentation, some very well written documentation that was refreshingly clear, concise and readable.
https://www.virtualbox.org/manual/ch06. ... rkingmodes (I wasn't allowed to post URLs)
I decided Bridged Mode was the most useful choice. It had everything I needed. It was to good to be true because when I started the machine, there was no network service available.
"A start job is running for Raise network interfaces"
which also has a highly annoying punishment by penalizing the user with a 300+ second wait for a login for attempting such a senseless act on an Ubuntu Server. Fortunately, the stop-switch signal is heard and the user can decide that the VM isn't worth the wait.
I've tried bridged mode with wlp3s0 , enp0s25 and wwp0s29u1u4i6 (which warned me wasn't working, but was still included as a choice anyway). I also tried Internal Network. Selecting Host Only Adapter and Generic Driver didn't even allow me to click on the OK button.
Is what I'm needing to do possible with VirtualBox or should I use a different VM software? If NAT is the only mode that is presently functional, does it support my assigning static IP's of 10.0.2.15 and 10.0.2.14 and still have a reliable configuration?
Re: Bridged mode networking notworking
Posted: 20. Dec 2017, 11:24
by timothylegg
The VM host software is VirtualBox Graphical User Interface Version 5.1.22_Ubuntu r115126 on Ubuntu 17.10 Zesty
Re: Bridged mode networking notworking
Posted: 20. Dec 2017, 11:36
by socratis
Excellent start by reading the appropriate section in the User Manual! Not too many do!
However you focused on the single network card option. Remember that you can have more than one network card to serve whatever scenario you're interested in.
Let's review what you did, and why it didn't work. You selected Bridged, an excellent choice, with one caveat; Bridged and wireless don't always play nice. Bridged networking is outside the WLAN specification. It may or may not work. Some combinations of Routers/Access Points, WLAN cards and drivers work, some don't. See:
Bridging & Wifi - Supported hardware and add your experience. So, see if Bridged-over-Ethernet (wired) can work for you.
Another option that has been mentioned, but I have never tried personally, is to assign a static IP address to your guests. Here's the rather technical in depth explanation:
vushakov in ticket [url=https://www.virtualbox.org/ticket/10019#comment:18]10019:18[/url] wrote:
Many wifi routers now try to use unicast link-level destination for broadcast/multicast IP destination. The reasons are explained in
http://tools.ietf.org/html/draft-vyncke ... ficient-01 - that is in context of IPv6, but the same logic applies to IPv4 (IPv6 is hit harder since it relies more on multicast). Behavior varies between wifi routers, so you may get bridged setup working with some and not working with others.
If the wifi router that is not working for you just uses unicast delivery for multicast, then 4.3.16 should help (a typical packet capture can be seen in #12207). In this case the host was receiving DHCP replies intended for the guest (broadcast IP, but unicast to host MAC), but was not rewriting MAC address correctly, so the guest was not receiving the packet. If you plug another computer into the wired port of the router to capture DHCP exchange as seen on the wired side, you would see the same DHCP replies sent to ethernet broadcast on the wired connection. So this is just an optimization for wifi that some routers do.
Unfortunately - and this is orthogonal to multicast/unicast issue above - some routers will send DHCP replies to broadcast IP, but to the unicast client MAC address (i.e. guest MAC in this case) fetched from the DHCP request. These packets will never be even seen by the host. I'm afraid the packet captures in comment:14 is an example of that. In the ethernet capture you can see DHCP replies unicast to guest and in the wireless capture you don't see any replies at all. I have one router like this (though it at least uses ethernet broadcast for its DHCP NAKs, so you can see something in the wireless capture

.
This latter kind of routers has problems with DHCP, but usually you can work around it by not using DHCP and using static IP instead. E.g. I cannot connect to that router of mine with DHCP, but if I use static IP in the guest then I get normal connectivity. Yes, this is suboptimal

, but better than no connectivity if you must use bridged for some reason.
You then selected "NAT". If you check the Overview table at the end of the chapter that you linked, you'll see that "NAT" does *not* allow VM-to-VM communication. There are however three other options that do, and aren't the Bridged one; NATservice
(I hate the "NAT Network" name), Internal and HostOnly. All of these also allow inter-VM communications. Internal is isolated, HostOnly is like Internal with the host as well, while NATservice allows for Internet access as well, but without the host being able to communicate with the VMs.
timothylegg wrote: Selecting Host Only Adapter and Generic Driver didn't even allow me to click on the OK button.
Because you need to create the HostOnly network first. If you're on VirtualBox 5.2.x, then it's under Global Tools, the top-right "screwdriver" icon, just click on the downwards pointing arrow and select "Host Only Manager". If you're using a VirtualBox version prior to 5.2.x, that setting is in VirtualBox Preferences » Network.
Mind you that you have to do the same with the NATservice setup; you have to create one before assigning a network card to the network. I would change the default 10.0.2.nnn/24 if I were you to 10.0.20.nnn/24, just to avoid the confusion between the NAT and the NAT service.
Edit:
You posted as I was writing. It looks like you're using the Ubuntu's fork version of VirtualBox (that "_Ubuntu" after the version). You can either ask in their forums for help, or completely remove/uninstall/delete/purge their version and install the official version from the Downloads section of VirtualBox (https://www.virtualbox.org/wiki/Downloads). You can still use "apt-get" to get that one, as long as you follow the Debian-based instructions. |
Re: Bridged mode networking notworking
Posted: 20. Dec 2017, 14:54
by timothylegg
Thank you very much for the detailed information. I read through it several times to fully grasp the choices laid out to me.
The opportunity to have multiple network devices wasn't something I considered. My mind tends to reside in the paradigm of having not enough 3Com 509 cards on hand to fulfill my fantasies.
I totally did not anticipate that the method of internet connectivity that my laptop has would have ramifications on my virtual machine. From what I have learned, Internal Network is the best model for what I need. It is also attractive in that my data transactions will not cause any overhead on the network the host system is attached to. I can switch to NAT on a case-by-case basis only for installing additional DEB files.
I used the default 'intnet' under Internal Network. My Ubuntu VM still has an issue with that. I still get "A start job is running for Raise network interfaces" which is a hint-via-sledgehammer that Ubuntu does not understand the kind of network that it is plugged into. I waited the full 300 seconds and verified that I in fact don't have an IP address. Is this Ubuntu Server acting up, or is there something more obscure that I have to enable on the VirtualBox side of the configuration? I've made no significant change to the default system other than installing the vim package (as a necessary first step after logging in the first time)
On your reply about the Ubuntu VirtualBox package, I'm hesitant to un-re-install already installed software due to bad experiences in the early 2000's where remnant configurations got left behind and re-installations interacting poorly with those files. However, if doing such a process will lead me to success and have these issues rapidly resolved, my speed of performing those steps will be limited only by my ability to type 'sudo apt-get' quickly enough.
Re: Bridged mode networking notworking
Posted: 21. Dec 2017, 08:53
by socratis
timothylegg wrote:My mind tends to reside in the paradigm of having not enough 3Com 509 cards on hand to fulfill my fantasies.
It's a virtual world! You can do
(almost) whatever you want. The GUI allows for 4 active network cards, the default PIIX3 chipset allows for 8 active network cards
(you have to configure them from the command line although), and if you change the chipset to ICH9
(not recommended) you can have up to 32 network cards!
timothylegg wrote: I can switch to NAT on a case-by-case basis only for installing additional DEB files.
What you could also do is to have 2 network cards; one internal, one NAT. Then whenever you want internet access, simply connect/disconnect the cable, either from the menu Devices » Network » (enable/disable the adapter), or from the network icon on the bottom-right corner of your VM window. That way you simply save on the constant reconfiguration of the guest.
timothylegg wrote:I used the default 'intnet' under Internal Network... and verified that I in fact don't have an IP address.
The Internal network option does not have a DHCP server enabled by default. You have to either configure manually your guest's IPs
(after switching from DHCP to manual configuration in your guest), or create a DHCP server for your Internal network. See ch.
8.38 VBoxManage dhcpserver in the User Manual for more details...
timothylegg wrote:I'm hesitant to un-re-install already installed software... However, if doing such a process will lead me to success
It's not a matter of success or not, that will happen. It's a matter of where you seek help from. If you take the
Ubuntu option, you should ask the Ubuntu people. If you take the
VirtualBox option, you could be asking here for anything VirtualBox related.
[color=#BF4000]Morpheus™[/color] wrote:You take the blue pill, the story ends. You wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes.™
Re: Bridged mode networking notworking
Posted: 21. Dec 2017, 12:59
by timothylegg
Okay, I took the red pill. I apt-get removed virtualbox, I apt-get purged virtualbox, I dkp -i Virtualbox-5.2_5.2.4-119785~Ubuntu~zesty_amd64.deb
My VMs are broken.
RTR3InitEx failed with (rc=-1912)
I was suggested to run /sbin/vboxconfig. I did that. Nothing changed. Every step returned without error.
The virtual machine 'Ubuntu' has terminated unexpectedly during startup with exit code 1 (0x1)
Result Code: NS_ERROR_FAILURE (0x80004005)
Component MachineWrap
Interface: IMachine {85cd948e-a71f-4289-281e-0ca7ad48cd89}
Now, can you get me the hell out of this rabbit hole before the bottom of it comes to me? I'm not opposed to deleting the two VMs and starting clean if its a versioning issue. It's a fresh install with nothing on it, it just takes 30 minutes of babysitting the computer waiting for occasional keypresses.
Re: Bridged mode networking notworking
Posted: 21. Dec 2017, 15:43
by timothylegg
Whilst falling down the rabbit hole, I spotted in a bookshelf labeled /var/cache/apt/ in which I found a book called virtualbox-dkms, which I promptly 'defaced' with my apt-get aspergillum using the 'remove' curse
Order arrives from the chaos.
I am here with two virtual machines, named Ben and Jerry, both siblings of the Ubuntu Server lineage. They are both configured to static IP's of 10.0.2.10 and 10.0.2.20 respectively. Ben can ssh to Ben and Jerry can ssh to Jerry. Localhost can ssh to localhost. But Ben cannot ssh to Jerry, and likewise, Jerry cannot ssh to Ben. Both are connected as 'Internal Network'
I have not yet found the tiny golden key to get these two VMs to communicate with each other, much less, drinking from the bottle labled 'PING ME'.
By the way, thanks for getting me to revisit the Lewis Carroll. The insanity of the real world in the past 24 hours has the side effect of Alice's Adventures in Wonderland making perfect sense. For some reason, I developed an appetite for ice cream though...
Re: Bridged mode networking notworking
Posted: 22. Dec 2017, 00:19
by socratis
timothylegg wrote:They are both configured to static IP's of 10.0.2.10 and 10.0.2.20 respectively.
Why did you choose the same network range as the built-in NAT? Is it everybody's favorite these days?

You know that there are more addresses to pick from, right?
In any event, I'll need to see the complete configuration of the NICs. IPs, masks, DNS, the whole nine yards... Output of the "ifconfig -a" for both please...
timothylegg wrote:The insanity of the real world in the past 24 hours has the side effect of Alice's Adventures in Wonderland making perfect sense.
That was really nice! Enjoy your ice cream...
