VBox Direct Host NIC Access: Linux Host, Windows Guest

Discussions related to using VirtualBox on Linux hosts.
Post Reply
MaidenFan
Posts: 33
Joined: 25. Sep 2008, 16:14
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Fedora, CentOS, Ubuntu, Windows 7
Location: London, UK
Contact:

VBox Direct Host NIC Access: Linux Host, Windows Guest

Post by MaidenFan »

I've been trying to sort a problem with VirtualBox networking for a few days without success.

Host OS is Fedora 9 32bit, guest is a network-built RM Workstation based on Windows XP SP2.

Question 1

I have two NICs configured and working on the host. One is an internal NIC (eth0) and one is a PCMCIA NIC (eth1). What I want to achieve is to give the VM direct access to the PCMCIA NIC.

Question 2

The reason why I want to give the VM direct NIC access is to rule out any bridging issues in another problem I'm having - the guest NIC isn't brought up in time for the workstation's init scripts. The guest NIC is the Intel PRO/1000 MT Desktop, all drivers have been fully loaded. The problem below still appears with the PCNet adapters. I've also fully configured a network bridge according to the instructions here.

When the guest has fully booted, I can log in perfectly with all mapped drives. However in the event log, I can see that a few services are complaining that the domain isn't available.

When I check the script logs themselves, I can see that the script tries to contact the server six times and then times out. Ergo network connectivity issue - the fact that I can log in says that the bridge is fine, but it's taking too long getting an IP. Why?

VBox version is 2.0.2, uname is:

Code: Select all

[craig@khashoggi ~]$ uname -a
Linux khashoggi 2.6.26.3-29.fc9.i686 #1 SMP Wed Sep 3 03:42:27 EDT 2008 i686 i686 i386 GNU/Linux
Edit

Some more information - should you need it. I've tried bringing down eth0 and bringing it back up with a zero'd IP and in promiscuous mode:

Code: Select all

[root@khashoggi ~]# ifconfig eth0 down
[root@khashoggi ~]# ifconfig eth0 promisc up
[root@khashoggi ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:13:77:05:81:EB  
          inet6 addr: fe80::213:77ff:fe05:81eb/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:6320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:666093 (650.4 KiB)  TX bytes:8913 (8.7 KiB)
          Memory:da800000-da820000
However when I start my VM with eth0 added as a Host Interface within the VM's Settings panel, I get:

Code: Select all

Failed to initialize Host Interface Networking.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Console
Interface: 
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}
I can still use eth1 while eth0 is down.

Any answers appreciated :)
Craig
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Answer to Q1: Not possible. PCMCIA passthrough is not possible, as oposed to USB.

Answer to Q2: You really should use a bridge if you don't want to use NAT for just internet and some network browsing. The Guest won't be accessible by the other machines on the network or the Host.
For HIF to work properly, you have to make sure that the interfaces that are part of the bridge don't have an IP address and an IP is set on the bridge itself. In the VM, you set the usual IP configuration (of course not the exact same IP as the Host).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
MaidenFan
Posts: 33
Joined: 25. Sep 2008, 16:14
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Fedora, CentOS, Ubuntu, Windows 7
Location: London, UK
Contact:

Post by MaidenFan »

Thanks for the answers,

Q1: Is a passthrough to eth0 (the internal NIC) possible if PCMCIA isnt? It doesn't really matter which NIC is attached to the VM, all I want is for one to be a dedicated VM NIC and one to be a dedicated NIC for the host (similar to VMware's device mapping.

Q2: I've checked and double-checked the setup, the bridge (br0) has a valid IP from the LAN via DHCP, the bridged NIC (I've tried eth0 and eth1 individually) and vnet0 both are blank. All IPs are set using DHCP so there's no static IPs.

The weird thing is that bridging works - the VM gets it's own IP and can be ping machines on the LAN and access network shares etc, but it seems as though it takes time for the card to initialise in Windows. I've tried shifting service dependencies in Windows as well, plus moving the VBox disk file to a Windows XP host all to no avail, which leads me to think that it's a VBox problem somewhere down the line.

Next step I guess is to install VMware and check if it happens with that, though I severely doubt I'll have the same issues. I'm actually gutted I'm having these problems with VBox - it's such a great program (when you don't have the VM attached to a corporate AD network :lol:).
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

1: there is no passthrough possible, that's why they invented the bridge ;).

2: Are you sure that there is not firewall or IP tables set that could block traffic?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
MaidenFan
Posts: 33
Joined: 25. Sep 2008, 16:14
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Fedora, CentOS, Ubuntu, Windows 7
Location: London, UK
Contact:

Post by MaidenFan »

Nope, no firewalls. I've tried with iptables both running and disabled. When iptables is running, br0, eth0 and eth1 are all trusted interfaces.
MaidenFan
Posts: 33
Joined: 25. Sep 2008, 16:14
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Fedora, CentOS, Ubuntu, Windows 7
Location: London, UK
Contact:

Post by MaidenFan »

Theoretically, is it possible to create a bridge with just one adapter attached - effectively giving the attached adapter full and unrestricted access to the NIC?

Effectively, my setup will be this:
(Host) Fedora ---> eth0 ---> Internet
(VirtualBox) VM ---> vbox0 ---> br0 ---> eth1 ---> Internet

I'll have to create an iptables rule (or maybe adjust the NIC's metric?) to make Fedora (the host OS) use eth0 and leave eth1/br0 available for the VM.

Hopefully you can see what I'm trying to achieve :lol:
* Fedora Linux User * Personal Website & Blog
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

If you want a transparent bridge, just set the IP to 0.0.0.0 on the Host. It won't use that interface to do anything. With the Guest having the proper IP config, it will work just fine. As long as it's connected properly to the modem/router.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply