Edit: Added a use case for CIFS
- Host: Windows 7 SP2 64bit
- Guest: Ubuntu 12.04.3 LTS 64bit (on VirtualBox 4.3.0)
- The host laptop has a 2 network adapters:
- A USB-pluggable WiFi module
- An 1Gbps ethernet port
When working at the office, the USB WiFi module is connected to the host. The Ubuntu guest needs connectivity with a fixed IP configuration (A fixed IP on the 192.168.1.x network, DNS is 188.8.131.52)
When working at home, the USB Wifi module is absent, and the Ethernet port on the host is used. The network at home has a DHCP server (my home router) which I want to use in order to assign IP configuration for the Ubuntu guest.
In both cases, I want the Ubuntu guest to work in "Bridged" mode (bridge the virtual eth0 and/or eth1 to the host's currently-used physical network adapter).
I need the host the guest to communicate over CIFS (samba) which I think prevents me from using NAT (?)
Unfortunately, I noticed that when the USB WiFi is disconnected from the host, VirtualBox automatically switches the physical device used for "virtual network interface 1" to the Ethernet port.
When working either at home or at the office (that is: either with the USB WiFi connected and the Ethernet disconnected, or the other way around), I want to have Internet connectivity on the VirtualBox, without the need to manually change the configuration every time.
What configuration should I use in VirtualBox?
What configuration should I use in the guest? Specifically, in
Also, does the guest need any specific IP routing rules so that traffic is routed through the (always single) available guest interface?
Does a specific configuration of bridging host interfaces (Use Windows to bridge the Wifi and Ethernet adapters) help in any way? What are the VirtualBox and guest configurations in this case?