Page 1 of 1

VirtualBox v1.6 on Solaris 10 5/08 AMD64 with tap

Posted: 27. May 2008, 08:38
by half12
Hi,

While I have been running VirtualBox beta and now VirtualBox v1.6 for a while I had been unable to get host direct connection working, the problem being the missing functionality from Solaris 10 included in OpenSolaris.
Previously I had tried to compile the tuntap driver, tunctl and brdgadm functionality from http://www.whiteboard.ne.jp/~admin2/tuntap/

With Solaris 10 5/08 I have managed to compile the 64bit code and placed the binaries here

ftp://ftp@ftp.flomerics.co.uk/pub/tunta ... r.bz2[code]# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
nge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.2.110 netmask ffffff00 broadcast 192.168.2.255
ether 0:30:48:5f:12:ca
# tunctl -t tap0 -b
tap0
# ifconfig tap0 plumb
# ifconfig tap0 192.168.2.111
# ifconfig tap0 up
# brdgadm -a nge0
nge0 successfully added.
# brdgadm -a tap0
tap0 successfully added.
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
nge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.2.110 netmask ffffff00 broadcast 192.168.2.255
ether 0:30:48:5f:12:ca
tap0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.168.2.111 netmask ffffff00 broadcast 192.168.2.255
ether a:0:20:e0:9b:44

When I snoop the interface it appears to be receiving traffic, however VirtualBox v1.6 generates an
error when attempting to use it.

Failed to open VNIC "tap0" in raw mode.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).


Result Code:
0x80004005
Component:
Console
Interface:
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}
[/code]
Is there a correct way of getting VirtualBox v1.6 to work with tap?

Posted: 27. May 2008, 16:01
by jfcurran
Didn't someone say that the tap interface needed to be down before you booted the guest O/S ?

Jim

VirtualBox v1.6 on Solaris 10 5/08 AMD64 with tap

Posted: 27. May 2008, 18:41
by half12
Hi,

When you start VirtualBox it complains if the tap0 interface is up, down or not present.
The problem appears to be VirtualBox and how it tries to access the tap0 interface.

Code: Select all

Failed to open VNIC "tap0" in raw mode.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).

Result Code: 
0x80004005
Component: 
Console
Interface: 
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}
The error certainly indicates a problem with intialising tap0

Using information from previous forum posting

Posted: 27. May 2008, 18:51
by half12
PostPosted: Sun Mar 16, 2008 11:23 pm Post subject: Reply with quote
Hi there,

Code: Select all

primary_if = eth0
host_ip = 192.168.1.100
guest_ip = 192.168.1.101

// create your TAP device
# tunctl -t tap0

// plumb it in and configure
# ifconfig tap0 plumb
# ifconfig tap0 $guest_ip destination $host_ip netmask xxx.xxx.xxx.xxx up

//create your bridge
# brdgadm -a eth0
# brdgadm -a tap0
Now, in VB, select Host Interface Networking, and give "tap0" as your interface, and configure the $guest_ip on you guest OS. And that's all that's to it.

Tell me how you get on.

Cheers,
JackSA

Tried the above on Solaris 10 5/08 AMD64 and get the same error Failed to open VNIC "tap0" in raw mode.

Code: Select all

VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).

Result Code:
0x80004005
Component:
Console
Interface:
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}

Re: VirtualBox v1.6 on Solaris 10 5/08 AMD64 with tap

Posted: 28. May 2008, 14:13
by erwannc
Hi Half12,
half12 wrote:Hi,

When you start VirtualBox it complains if the tap0 interface is up, down or not present.
The problem appears to be VirtualBox and how it tries to access the tap0 interface.

Failed to open VNIC "tap0" in raw mode.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).


Result Code:
0x80004005
Component:
Console
Interface:
IConsole {d5a1cbda-f5d7-4824-9afe-d640c94c7dcf}

The error certainly indicates a problem with intialising tap0
Are you running VBox as a non root ? If so you might need to give the VBox process
the privilege net_rawaccess

Code: Select all

ppriv -s AEI+net_rawaccess <pid of VirtualBox>

VirtualBox v1.6 and Tap0 direct host connection working!!

Posted: 28. May 2008, 20:10
by half12
Hi,

In order to eliminate the error I was getting you must run VirtualBox as root.
I wrote two scripts to automate the creation and deletion of the tap0 interface by
VirtualBox. (see below).

I used the Intel 82540EM network adapter, configured for Host Connect, interface tap0 and the scripts vnic_start.sh and vnic_stop.sh. You will need to modify the scripts to reflect your own primary internet interface (in my case nge0) and the IP address used by VirtualBox (my host ip is 192.168.2.110, virtualbox client is 192.168.2.111).

Code: Select all

# vnic_start.sh
# = = = = = = =
#!/bin/sh
tunctl -t tap0
ifconfig tap0 plumb
ifconfig tap0 192.168.2.111    
brdgadm -a nge0
brdgadm -a tap0
ifconfig tap0 up

Code: Select all

vnic_stop.sh
= = = = = = =
#!/bin/sh
ifconfig tap0 down
brdgadm -d tap0
brdgadm -d nge0
ifconfig tap0 unplumb
tunctl -d tap0
This is working with Checkpoint's SecureClient.

Amended Entry -- vnic_start.sh should that below. Using the script above will cause duplicate ip address errors.

Code: Select all

# vnic_start.sh
# = = = = = = =
#!/bin/sh
tunctl -t tap0
ifconfig tap0 plumb
brdgadm -a nge0
brdgadm -a tap0
ifconfig tap0 up
Hope that helps.

VirtualBox v1.6 and Tap0 direct host connection working!!

Posted: 28. May 2008, 23:12
by aribi
A minor comment on your script:

vnic_start.sh
= = = = = = =
#!/bin/sh
tunctl -t tap0
ifconfig tap0 plumb
ifconfig tap0 192.168.2.111
brdgadm -a nge0
brdgadm -a tap0
ifconfig tap0 up
AFAIK the line "ifconfig tap0 192.168.2.111" is not nescassary. The following "brdgadm -a tap0" puts the interface in promiscuous mode anyway. The same goes for the line "ifconfig tap0 up".

And remember, this will not facilitate network traffic between the host and the guest!

kind regards, Arie Bikker

VirtualBox v1.6 and Tap0 direct host connection working!!

Posted: 29. May 2008, 18:53
by half12
Hi,

My requirement was for a Host connection to allow me to run Checkpoint SecureClient which would not work with the NAT configuration, otherwise I would have been happy to use NAT.

Getting VirtualBox to work on Solaris

Posted: 30. May 2008, 09:43
by half12
Hi,

In order to get VirtualBox working on Solaris 10 8/07 and then Solaris 10 5/08 I followed the instructions here

http://unixsadm.blogspot.com/2008/02/vi ... ation.html

After downloading the library mentioned in the instructions above, a copy has
been placed here as the later versions do not work.

ftp://ftp@ftp.flomerics.co.uk/pub/sunwc ... s-i386.deb