VirtualBox, Linux, networking

This is for discussing general topics about how to use VirtualBox.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox, Linux, networking

Post by Perryg »

169.254.170.66 (Preferred) will not work.

OK so go into the Windows network and find the host-only adapter. Delete it with VirtualBox completely shut down. Then start VirtualBox and set it to the specifications above. This should create it again with the proper addresses.
jtt89
Posts: 23
Joined: 20. Nov 2011, 12:56
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: CentOS

Re: VirtualBox, Linux, networking

Post by jtt89 »

I've beet trying to get it to work all day, and as of right now I have 1) Host-only network and 2) NAT
I installed XAMPP for Linux so I am sure Apache it is working etc.
This is what I get from ifconfig:

th5 Link encap:Ethernet HWaddr 08:00:27:47:1B:D1
inet6 addr: fe80::a00:27ff:fe47:1bd1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3744 (3.6 KiB) TX bytes:1836 (1.7 KiB)

eth6 Link encap:Ethernet HWaddr 08:00:27:B7:15:8C
inet addr:10.0.3.15 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb7:158c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2290 errors:0 dropped:0 overruns:0 frame:0
TX packets:1808 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1702408 (1.6 MiB) TX bytes:158694 (154.9 KiB)

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:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:928779 (907.0 KiB) TX bytes:928779 (907.0 KiB)

I've been doing all that with Windows Firewall turned off, so it should not be a problem. Two things that I am not sure about are static ip (I dont have that, I only have a dynamic one) and DHCP (VB -> File -> Preferences -> Netwok -> "screwdriver" -> DHCP Server - I have this unchecked, when I check it all the fields amount to 0.0.0.0. I was trying to get DHCP servr and subnet mask from win cmd and figure out the other to, but for now I left it blank)
I was able to connect to XAMPP running on Windows from the Linux machine on VirtualBox, but not the other way. I am not sure if this is working now.

How about the opton of setting up ports in .VirtualBox/VirtualBox.xml
I've seen it done like that and it was suppose to work for somebody, like localhost:8888 etc. A lot of people also tell me that it needs to be set to Bridged, and it is actually working for somebody also: http://www.youtube.com/watch?v=K40jFNBwyJI

Thank you.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox, Linux, networking

Post by Perryg »

You simply must get the host-only service set the way I have shown you. If that means deleting the adapter in the VirtualBox preference then you must delete it and add it again NEW.

One other thing that is going to stop this from working. I see that you now have eth5 as the network interface in the guest. This too is going to cause you a lot of issues.
In the guest (while running) edit the /etc/udev/rules.d/70-persistent-net.rules or you can delete the rules and Linux will configure it on the next boot.

Then shut down the guest completely (not saved state)
Open the preference section of VBox network and get the adapter to run exactly as I have shown you.
jtt89
Posts: 23
Joined: 20. Nov 2011, 12:56
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: CentOS

Re: VirtualBox, Linux, networking

Post by jtt89 »

Here is some photos (more than enough, but less important ones are on the bottom): http://www.joliett89.comli.com/

I changed the settings, but I was not 100% sure about DHCP Server (I think I had this one automatically configured begfore, but this time I had to come up with the numbers by myself). I got the info from ipconfig /all and figured out the bottom two by myself (probably incorrectly, because I am getting some kind of error in Windows Network Troubleshooting, as posted on the pictures)

I am not sure if this matters, but I dont have a static IP.

Thanks.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox, Linux, networking

Post by Perryg »

Is there any particular reason you can't/don't want to follow the instructions I have given you?
All of the information that you need is in the screen shot I have pasted here.
jtt89
Posts: 23
Joined: 20. Nov 2011, 12:56
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: CentOS

Re: VirtualBox, Linux, networking

Post by jtt89 »

I added some additional pictures on the bottom (XAMPP running both on Windows and Linux). It looks like Linux is able to connect to the host with an IP in the address bar, but not the other way around. I was not sure if I should change it to what it is on the screen, because IP addresses are different (I was trying to get as close as I could though). The ifconfig (on included pictures) does not show the IP info the way it was before too.. (on the second line of the output, thre is only some hex number over there instead; inet6 address etc).

I am not sure about 2 things:

1) What is the IP of the guest?
2) Should I use 62.21.99.103 for the DHCP server with the subnet mask of 255.255.224.0 (thats from ipconfig /all)?

Thank you.
jtt89
Posts: 23
Joined: 20. Nov 2011, 12:56
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: CentOS

Re: VirtualBox, Linux, networking

Post by jtt89 »

I thik I was able to piece it all together and I am able to ping in both directions. I read somewhere that I should be able to connect to the guest (Linux) with Putty (username: root, password: <myPasswordForRoot>, or another username that is valid etc).

I tired and I was not able to. I also looked at all the network configuration info (ipconfig /all and ifconfig) and that information has changed also. I keep making screenshots, because it is hard to keep track of it when I am not sure how is it suppose to work (pictures are here http://www.joliett89.comli.com/)

After the installation I was using (I think) 192.168.56.1 to ping host (Windows) from Linux and 192.168.56.101 the other way. Today I think it should be 169.254.230.113 (ping from Linux) and 192.168.56.101 (the same, ping from Windows to Linux). So it gets confusing quickly.
Based on above information I was trying to use Putty with 192.168.56.101 as an address and that did not work...

I dont think that Windows Firewall should matter here, because I am trying to connect from Wit to the "outside", but I had it turned off anyway for testing.

Thank you in advance for any info.
okoder
Posts: 1
Joined: 14. Aug 2012, 11:39

Re: VirtualBox, Linux, networking

Post by okoder »

jtt89 wrote:I went to File -> Preferences -> Network -> Host-only Network Details and I changed the settings according to the previous post. Every time I try to click OK and get out I get a message: Do you want the following program to make the changes (it is some VB .exe program). No matter if I choose Yes or No, the settings in the Adapter window (of that Host-only Network Details window) change to something else (different IP and subnet mask), like it would not want to accept it etc.
That probably does not make a difference, but I had Widnows Firewall turned off.

Addresses that it is changing to:

Ethernet adapter VirtualBox Host-Only Network:

Autoconfiguration IPv4 Address: 169.254.170.66 (Preferred)
Subnet Mask: 255.255.0.0

Thats from Win cmd
I am suffering from the same problem on my Win 7 host. My guest Linux works Ok and even get's DHCP address from my selected subnet, but no matter what I do the host side address is always over written by 169.254.* Autoconfiguration address. Setting static address from control panel appears to work,
but when I check the address with ipconfig the 169.254.* is still there. Needles to say, host only networking is totally unusable.
Post Reply