LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   HOW TO : Host Interface Networking setup in VirtualBox (https://www.linuxquestions.org/questions/suse-opensuse-60/how-to-host-interface-networking-setup-in-virtualbox-636690/)

simjii 04-20-2008 08:53 PM

HOW TO : Host Interface Networking setup in VirtualBox
 
I just installed VirtualBox 1.5.2 and spent almost entire day to figure out for setup of Host Interface Networking (HIN) in VirtualBox. The problem is that if the firewall is running the guest cannot get access to the network. To figure out it took me a while. Anyway following is the step by step for setting up HIN.

System: openSuese 10.3 with a lot of patches.
VirtualBox binary version from http://www.virtualbox.org/wiki/Downloads

Assumption: 1. eth0 is already setup and running.
2. There is no firewall running on the host. If the firewall is running, better turn it off before you pull your hairs out of your head like me. :( If the firewall is running guest cannot get network access. Don't know why.

Host netowrking setup for VirtualBox
1. Check if bridge-utils and uml-utilities packages are installed.
2. Create 'eth1' without any device attached using a YaST or just create
/etc/sysconfig/network/ifcfg-eth1 with contents shwn below. 'eth1' will be the bridge device.
If eth1 device is created with YaST the last two lines in ifcfg-eth1 have to be added and NETMASK has to be setup properly.

#### contents of ifcfg-eth1 after bridge setup
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK='255.255.255.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
### Following two lines are added manually.
BRIDGE='yes'
BRIDGE_PORTS='eth0'

3. Change the IPADDR line in /etc/sysconfig/netowrk/ifcfg-eth0 to
IPADDR='0.0.0.0/24' and BOOTPROTO to BOOTPROTO='static'.

Contents of 'ifcfg-eth0'after bridge setup

BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='0.0.0.0/24'
MTU=''
NAME='Giga-byte RTL8111/8168B PCI Express Gigabit Ethernet controller'
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
PREFIXLEN=''

4. Run the following command to make 'vbox0' permanent.
/usr/sbin/VBoxAddIF vbox0 <user> eth1
Replace <user>> with the name of the user who is supposed to be able to use the new interface. vbox0 is the ethernet interface for HIN in VirtualBox

5. Finally, one can bring up the new interface, eth1 by executing
ifup eth1

shogun1234 08-01-2008 09:35 PM

Quote:

Originally Posted by simjii (Post 3127477)
...
4. Run the following command to make 'vbox0' permanent.
/usr/sbin/VBoxAddIF vbox0 <user> eth1
Replace <user>> with the name of the user who is supposed to be able to use the new interface. vbox0 is the ethernet interface for HIN in VirtualBox

When trying step 4, I got the following error:
Code:

/usr/bin/VBoxAddIF vbox0 <user_name> eth1
VirtualBox host networking interface creation utility, version _VERSION_
(C) 2005-2007 innotek GmbH
All rights reserved.

Creating the permanent host networking interface "vbox0" for user <user_name>.

Failed to add the interface "vbox0" to the bridge "eth1".
Make sure that the bridge exists and that you currently have sufficient
permissions to do this.

Either using sudo or directly creating vbox0 by root; none of those commands work. It always returns insufficient permissions. How to solve this problem?

The way how I do it only differs in that I replace eth0 with wlan because I only have wireless card (iwl4965agn). So I copy ifcfg-eth0 as ifcfg-eth1; and add values (which should be added to eth1 in howto) to wlan0. The ifcfg-eth1 looks as follow:
Code:

## bridge device
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK='255.255.255.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
BRIDGE='yes'
BRIDGE_PORTS='eth0'

and ifcfg-wlan
Code:

#BOOTPROTO='dhcp'
BOOTPROTO='static'
STARTMODE='auto'
NAME='PRO/Wireless 4965 AG or AGN Network Connection'
IPADDR='0.0.0.0/24'

The environment I use is SUSE 11.0/ kernel 2.6.25-1.1-default/ virtualbox 1.5.6/ nc6910p

Many thanks,


How can I solve this problem?


All times are GMT -5. The time now is 04:56 PM.