LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 01-04-2010, 03:20 AM   #1
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Rep: Reputation: 39
Networking - Virtual Box (WinXP Guest)


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).

Last edited by dc_eros; 01-12-2010 at 05:55 PM.
 
Old 01-04-2010, 06:47 AM   #2
gezley
Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware64, NetBSD
Posts: 474

Rep: Reputation: 200Reputation: 200Reputation: 200
Not sure about Virtualbox but I do know that KVM needs the Tun/Tap kernel module loaded, and tunctl to control the TAP interface. Probably brctl to set up the bridge for host networking as well.
 
Old 01-04-2010, 01:57 PM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.13.2
Posts: 1,468
Blog Entries: 10

Rep: Reputation: 142Reputation: 142
You could try using the vmware network you accidentally installed; works for me under Slackware 12.1
 
Old 01-04-2010, 05:57 PM   #4
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
I cannot use the vmware network device I've accidentally installed. It does not appear on the list when I go to VirtualBox->Machines->Settings->Network Settings -> any networking options does not show the vmware device.

Perhaps I have to try the tunctl and brctl commands.

But how about the IP address i have setup on vboxnet0 device? I want to remove it since there is no IP address when it is first setup. I have set an IP address accidentally, thinking that it will do the trick

Last edited by dc_eros; 01-12-2010 at 05:55 PM.
 
Old 01-04-2010, 10:09 PM   #5
afreitascs
Member
 
Registered: Aug 2004
Location: Brasil
Distribution: Slackware_Cur-64_mult
Posts: 431

Rep: Reputation: 30
My English is bad, but you installed Guest Additions.He is on the menu
Machine Devices Helps, after you get the XP ...

Decices >>>> Install Guest Additions

Click in Install Guest Additions ...

Then open the Windows Explorer and go to networks

Good Luck :-)

Last edited by afreitascs; 01-04-2010 at 10:12 PM.
 
Old 01-04-2010, 10:27 PM   #6
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
Thank you for the help. I will try to install guest additions when I get home.

Last edited by dc_eros; 01-12-2010 at 05:55 PM.
 
Old 01-05-2010, 12:02 AM   #7
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
Originally Posted by dc_eros View Post
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 [0]). 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".

Code:
# Config information for vboxnet0:
IFNAME[1]="vboxnet0"
IPADDR[1]="192.168.33.11"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
- or -

Code:
# Config information for vboxnet0:
IFNAME[1]="vboxnet0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]=""
Replace "[1]" 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
Host IP: 10.0.xxx.yyy (can change with "vboxmanage")
Linux "rc.inet1.conf": does not matter
VM IP: 10.0.xxx.zzz use DHCP (provided by VirtualBox)
NOTE: Not sure if ping between host and guest works.

Bridged Virtual Network Interface
Host IP: depends on selected Linux device (EX: eth0)
Linux "rc.inet1.conf": use to set Linux device IP (EX: eth0 IP address)
VM IP: set manually or use DHCP (provided by your LAN or Linux)

Host Only Virtual Network Interface
Host IP: depends on Linux settings for "vboxnet0" interface (or "vboxmanage" to set VirtualBox DHCP address)
Linux "rc.inet1.conf": add "vboxnet0" with manual IP or DHCP (provided by VirtualBox)
VM IP: 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.
 
1 members found this post helpful.
Old 01-05-2010, 12:24 AM   #8
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
I think I'm going with the bridged mode. I see, I need to clear first the IP I've accidentally set to vboxnet0 and set it to DHCP. And I think I'm using a not so old version of VirtualBox since it is for Slackware 13.0 32 bit, from SlackBuilds.org

Got to copy this and try at home

Thank you.

By the way, this is the full details:

Host:

Slackware 13.0 32 bit
VirtualBox 3.1.2 from SlackBuilds.org
IP address for eth0: 10.xx.xxx.130
Subnet mask: 255.255.255.0

Windows XP Pro
10.xx.xxx.131
Subnet mask: 255.255.255.0

VBox network settings tried:

Bridged - eth0 used
NAT - eth0 used
Internal network - I forget already
Host only - vboxnet0 used

Reason: Need to use Internet Explorer 6, 7 and 8 for web development.

Last edited by dc_eros; 01-12-2010 at 05:56 PM.
 
Old 01-05-2010, 11:06 AM   #9
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
Originally Posted by dc_eros View Post
I think I'm going with the bridged mode. I see, I need to clear first the IP I've accidentally set to vboxnet0 and set it to DHCP. And I think I'm using a not so old version of VirtualBox since it is for Slackware 13.0 32 bit, from SlackBuilds.org

Got to copy this and try at home

Thank you.

By the way, this is the full details:

Host:

Slackware 13.0 32 bit
VirtualBox 3.1.2 from SlackBuilds.org
IP address for eth0: 10.xx.xxx.130
Subnet mask: 255.255.255.0

Windows XP Pro
10.xx.xxx.131
Subnet mask: 255.255.255.0

VBox network settings tried:

Bridged - eth0 used
NAT - eth0 used
Internal network - I forget already
Host only - vboxnet0 used

Reason: Need to use Internet Explorer 6, 7 and 8 for web development.
I recommend that you use NAT if you don't care about Microsoft Networking (file sharing) or if you have multiple network interfaces (wired and wireless). Use Bridged if you do want to use Microsoft Networking (file sharing) and you use just one network interface to reach the Internet.

When you use NAT for a virtual network interface it uses ALL the network interfaces in Slackware, not just "eth0". The default gateway in Slackware will determine how VirtualBox NAT gets to the Internet. IP routing is done by Slackware. That's good if there are multiple network interfaces (wired and wireless) used to reach the Internet. You do not need to do anything with "vboxnet0". NAT does not work well with Microsoft Networking (file sharing).

If you use a "Bridged" virtual network interface for the virtual machine then you do not need to do anything with "vboxnet0". You do have to make sure that the Windows XP system is set to a compatible IP address with the same network prefix as your LAN. If your LAN supports DHCP then you can set Windows XP to obtain an IP address automatically. The default gateway in Windows XP determines how it gets to the Internet.Windows XP does its own IP routing. That works well if there is only one network interface in Slackware used to reach the Internet. A bridged virtual network interface works the best with Microsoft Networking (file sharing).

The latest version of VirtualBox (from their web site) installs with no problem on Slackware. You don't need to use a Slackbuild, and you're better off to use the latest 3.1.2 version. One of the latest fixes is that you can use more than one Bridged virtual network interface on a virtual machine. That's helpful if you have wired and wireless, so that you can bridge two virtual network interfaces and allow Windows XP to access both.
 
Old 01-11-2010, 03:45 AM   #10
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
Hi there again. Sorry, but still my networking from host to guest doesn't work. The laptop is stand alone. No network / LAN of whatsoever and no wireless network to connect.

I remembered in Windows, using VMWare that when I attempt to run a virtual machine, while the main hub/switch is switched off, it gives me warning that networking may not work.

So I guess it was because I have no network that's why my host to guest networking does not work no matter how I've tried? Or maybe still I miss something.

All of my network adapters eth0 and wireless are working.

By the way, I tried the suggestion above, regarding NAT.
 
Old 01-11-2010, 10:16 AM   #11
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
It's difficult to help you when you have not made it clear how you now have the system configured. Please pick one configuration for the virtual machine and Linux, then post exactly how you have everything configured. Describe exactly what isn't working along with the configuration. The "bridged" virtual network interface is probably the best choice since it supports all types of communication like a normal computer on the LAN.

Your main router most likely provides a DHCP (Dynamic Host Configuration Protocol) server and assigns the IP addresses to computers on your LAN. To avoid a problem when that is turned off you have to set the IP addresses manually instead of automatically using DHCP.
 
Old 01-11-2010, 07:00 PM   #12
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
Sorry for the incomplete details. Here is my ifconfig output:

Code:
root@darkstar:/home/lysender# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:90:f5:66:fe:f9  
          inet addr:10.0.2.1  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1              
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0      
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0    
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:23 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1480 (1.4 KiB)  TX bytes:1480 (1.4 KiB)

vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:15:af:40:f8:f8
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-15-AF-40-F8-F8-6C-6F-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
And I've attached the screenshot of my VirtualBox configuration for Windows Guest.

The Windows Guest is configured with ip address 10.0.2.1, netmask address 255.255.255.0, default gateway to 10.0.2.1 and no DNS settings.

I cannot ping from both directions. I want to test my project into Windows XP using different IE versions. And also with Safari and other browsers.

I have installed Guest Additions to the guest but it seems to not affect anything related to networking.

I have also tried Bridged connection using eth0 but still they cannot communicate.

I hope I have given enough information. If you need more information, please tell me and I will take it tomorrow.

TIA
Attached Images
File Type: png virtual-box.png (233.7 KB, 13 views)

Last edited by dc_eros; 01-12-2010 at 05:56 PM.
 
Old 01-11-2010, 09:30 PM   #13
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
To use VirtualBox NAT you must set "eth0" to some other network address besides 10.0.2.nnn. That is because the NAT is a sort of network gateway/router and connects the two networks (host LAN and virtual machine LAN). The host and the guest SHOULD NOT be on the same IP sub-network.

eth0 (10.1.xxx.xxx/24) <===> NAT (10.0.2.2/24) <===> (10.0.2.yyy/24) PCNet Fast III Windows XP

NOTE: "/24" is the same as saying network mask "255.255.255.0".

VirtualBox NAT assigns the virtual machine's virtual adapters addresses of 10.0.2.yyy for the first adapter, 10.0.3.yyy for the second adapter, and so forth. In order for NAT routing to work, the host OS (Linux) cannot use the same network addresses for any network interfaces. NAT is different than the other virtual networking modes in that respect.

In order for the guest to connect to the host, the guest must use the VirtualBox NAT host address 10.0.nnn.2 (EX: 10.0.3.2), or the address assigned to one of the host's hardware interfaces such as eth0 (EX: 10.1.4.5). The host cannot connect to the guest unless you forward ports using "vboxmanage". The host also can't ping the guest.

ALL the virtual machines that have NAT virtual interfaces will share the same set of addresses. In other words the first network interface of all virtual machines will use 10.0.2.yyy if configured for NAT and all of those virtual machines will be able to communicate with each other.

The default gateway for a guest OS should be set to the VirtualBox NAT host address 10.0.nnn.2 (EX: 10.0.3.2). That is usually done by the VirtualBox DHCP server. If the default gateway is not defined, then guests can only communicate with the host using the NAT host address 10.0.nnn.2.

Last edited by Erik_FL; 01-11-2010 at 09:48 PM.
 
1 members found this post helpful.
Old 01-11-2010, 10:25 PM   #14
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
Many thanks! Noted. I have to try this at home and report the result tomorrow. Thanks a lot.

Last edited by dc_eros; 01-12-2010 at 05:56 PM.
 
Old 01-12-2010, 05:47 PM   #15
dc_eros
Member
 
Registered: Nov 2006
Distribution: Slackware
Posts: 292

Original Poster
Rep: Reputation: 39
Hi there, I made it successfully and here is my settings:

host: 10.1.1.1
guest: 10.0.2.15 <= this was what I've put before, not 10.0.2.1, maybe I forgot to type 5 when I post it above.

In guest, I can ping 10.0.2.2 and out of curiosity, I tried to browse in via Internet Explorer 6 and it outputs the default "It works!" page from apache 2.2.

Yes, it really works

Regarding file sharing, I just created a shared folder, which I made it ready on day 1 on /share
Everything works fine, though I think I don't need the ability to ping the guest from the host

You guys rocks! I'll be blogging this and read it again when Slackware 13.1 is released!

Last edited by dc_eros; 01-12-2010 at 05:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
windows7 host, virtual box linux guest, trying to do samba glorsplitz Linux - Networking 5 12-29-2009 07:52 PM
Want to run Virtual Box in Ubuntu with Win98 as guest OS Won't install donrc Linux - General 16 12-13-2009 08:26 AM
BLFS in a Virtual Box guest... trying to get Xorg7.2 to run fdt93 Linux From Scratch 2 08-29-2009 08:25 PM
same IP ad of 2 guest OS in virtual box ic_torres Linux - Newbie 2 05-20-2008 06:06 PM
virtual box networking fakie_flip Linux - Software 10 10-21-2007 01:52 PM


All times are GMT -5. The time now is 01:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration