Originally Posted by dc_eros
I installed VirtualBox on Slackware 13.0 32 bit (VB from slackbuilds.org). After installing Windows XP as a guest, I tried connecting the slackware host to the winXP guest. I set up static ip for both OS.
xxx.xxx.xxx.130 - for the slack
xxx.xxx.xxx.131 - for XP
however, I cannot ping from both directions.
I noticed that vboxnet0 was not alive in ifconfig
Out of curiosity, (since I have no internet at home) I tried to UP it up.
I tried bridged connections, NAT, internal network, host only (network settings in virtualbox) yet it nothing happens.
To further worsen the situation, I tried:
ifconfig vboxnet0 xxx.xxx.xxx.131
But I regret from doing so and I cannot revert back the changes.
the output of:
ifconfig -a returns eth0, wan0, lo, a vmware device (since I attempted to install VMWare before I realized VirtualBox is what I need).
"vboxnet0" is only used for the option "Host Only Network". For NAT or Bridged mode VirtualBox communicates directly into the IP stack, "eth0" or "wlan0" device driver.
Ping between a guest and host did not work on older versions of VirtualBox when using VirtualBox NAT. VirtualBox NAT always uses a 10.0.xxx prefix and the "xxx" part depends on the virtual machine network adapter number. You must set the Windows XP network interface to use "10.0.xxx.yyy" (or better yet, DHCP). You can find more information about NAT on the VirtualBox site. I don't know if ping works with NAT in the current version.
Ping should work for bridged mode if you put the IP addresses in the same IP network. In addition to the address prefix (the xxx.xxx.xxx part) being the same for Slackware and XP, you must make sure that the network masks are set for the correct number of bits (255.255.255.0).
In Windows XP you configure that in the Network Connections folder, and right click on the Local Area Connection. Then click "Properties" and double click on the TCP/IP protocol. Set the IP address and network manually and DO NOT select "Obtain IP address automatically". Double check the configuration by running "ipconfig /all" from a Windows command prompt. NOTE: To use VirtualBox NAT you should normally select "Obtain IP address automatically". For "Host Only" you should usually select "Obtain IP address automatically" and use DHCP for the "vboxnet0" interface in Linux.
In Slackware you edit the "/etc/rc.d/rc.inet1.conf" file for the correct IP address and network mask on "eth0" (or ). Make sure that the DHCP option is either "" or "no". When using VirtualBox NAT the address for "eth0" does not matter, as this has no effect on the address seen by the virtual machine (it's always 10.0.xxx.zzz). For "Host Only" mode you must specify an interface name, plus IP address or DHCP to make "vboxnet0" communicate. In "Host Only" mode the address for "eth0" does not matter as the virtual machine sees the address for "vboxnet0".
Example of lines in "rc.inet1.conf" for "vboxnet0".
# Config information for vboxnet0:
- or -
# Config information for vboxnet0:
Replace "" with an available entry number that is not already used for some other interface. Also, make sure that Windows XP and Linux both agree on the IP address, or both use DHCP (DHCP is provided by the VirtualBox software for host and guest).
Also look at "/etc/udev/rules.d/70-persistent-net.rules". That assigns the Ethernet device names based on the MAC address. If the correct interface is not being assigned "eth0" then you may have to edit the file. Otherwise you might find that your Ethernet adapter is being called "eth1" or something else. Use "ifconfig -a" to see all the network interfaces. If you see "eth1" or other things besides "eth0" then you might have to change the rules file.
If you're using a really old version of VirtualBox then you must use "brctl" in Linux to get a bridged virtual network adapter. The current version of VirtualBox (2.0 and above) does not require using "brctl". I encourage you to use the most recent version of VirtualBox since the network setup is much simpler.
NOTE: You can use "brctl" if you want to bridge the "vboxnet0" interface on the current version of VirtualBox. Set the virtual network interface to use "Host Only" mode and then bridge the "vboxnet0" interface. That is only needed for unusual network bridges (such as two host adapters bridged with one virtual adapter). In that case the IP address of "vboxnet0" is set for the bridge device (EX: "br0") and not in "rc.inet1.conf". This is possible but not usually required.
NAT Virtual Network Interface
10.0.xxx.yyy (can change with "vboxmanage")
does not matter
10.0.xxx.zzz use DHCP (provided by VirtualBox)
NOTE: Not sure if ping between host and guest works.
Bridged Virtual Network Interface
depends on selected Linux device (EX: eth0)
use to set Linux device IP (EX: eth0 IP address)
set manually or use DHCP (provided by your LAN or Linux)
Host Only Virtual Network Interface
depends on Linux settings for "vboxnet0" interface (or "vboxmanage" to set VirtualBox DHCP address)
add "vboxnet0" with manual IP or DHCP (provided by VirtualBox)
set manually or use DHCP (provided by VirtualBox)
NOTE: Default VirtualBox DHCP address is probably 192.168.56.nnn
It is usually better to have both the host and guest use DHCP, or both use a manually set address. Do not have one using DHCP and the other not using DHCP since it's harder to make sure that the network addresses are the same. When you're using the VirtualBox DHCP server (NAT or Host Only) you can change the network address using "vboxmanage". For Bridged mode you have to provide the DHCP server (Linux or your LAN) if you want one.