VirtualBox Settings for Dual Network Cards?

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

VirtualBox Settings for Dual Network Cards?

Postby codetricity » 18 Feb 2016, 03:23

I have ethernet and WiFi on my host computer. The WiFi is connected to the THETA. The ethernet is connected to the Internet. With this system, I can connect to both the Internet and the THETA S at the same time, but only from my host OS. The host machine is Windows 10.

I am running Ubuntu 15.10 as a guest OS in VirtualBox. How can I configure VirtualBox so that I can access the THETA S and the Internet simultaneously? I have created two virtual interfaces using both bridged adapter and NAT. I don't know how to assign a virtual network interface to a physical network interface. For example, I don't know how to assign Adapter 1 in virtualbox to my ethernet on Windows 10 and Adapter 2 in virtualbox to my WiFi dongle that is connected to Windows 10.

Once I get the adapters assigned, I can probably configure the rest in Linux. I have two network interfaces appearing in my guest OS, but it looks like both are connected to the primary ethernet connected to my host OS.

I saw someone with this setup working at the hackathon, but they were using Parallels with Linux guest OS. They had both Internet and THETA connectivity from within the guest OS.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56

Re: VirtualBox Settings for Dual Network Cards?

Postby mbirth » 18 Feb 2016, 20:07

The problem is, VirtualBox simulates a normal Ethernet card (PCnet or Intel PRO/1000), i.e. one with a cable. If you connect it to your WiFi, it will still appear as a cabled network card in your guest OS. However, it should be connected to the same WiFi that your host system is connected to.

Have you tried using one single "NAT" adapter in VirtualBox? This way the guest OS should be able to reach everything your host system can reach. It's only a problem when you try it the other way around - because of NAT.

Another way would be to use an USB WiFi dongle and route that to the guest OS using the USB2.0-passthrough. This way you would be able to control everything from the guest OS.
mbirth
 
Posts: 122
Joined: 30 Apr 2015, 13:53

Re: VirtualBox Settings for Dual Network Cards?

Postby codetricity » 18 Feb 2016, 23:29

Thanks! It works. So simple once you generously gave me the basic idea.

I am writing this from within a Linux VM while I am connected to the THETA. Now, I can set up different developer environments and access the THETA and the Internet at the same time.

In each VM, I can install whatever software and libraries I want and not mess up my host OS. Great.

I am using a single virtual network interface with NAT. I should have thought of this before, but was going down the path of two virtual interfaces.

Thanks!!

Update: as this is a common question, I've updated our Unofficial API Guide with a new network section that has this information so other people can benefit from it.

http://codetricity.github.io/theta-s/#_network
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56


Return to Development



All times are UTC