[Solved] Connection Host-Guest without NIC on the Host

Discussions related to using VirtualBox on Windows hosts.
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

[Solved] Connection Host-Guest without NIC on the Host

Post by Behnil »

Hi all,
I have a little problem with creating network between my host (Windows 7 RC) and guest (Ubuntu 9.04). I need to do this 2 ponts:

a) I need to communicate from the host to the guest and vice versa. But it shall to work if my host is connected to the Internet even if my host isn't connected to the Internet and all NICs are disabled! I think there is only one solution, Host-only connection. But I try it for 2 day, no success. I have installed software VB NIC on the host, VM has PCnet-FAST III (Am79C973) attached to the VB Host-only NIC. But when I turn the ubuntu on, it tryes to connect but then signalizes no connection :( When I monitor the software NIC on the host, there is outgoing but absolutely no incomming activity. Can you help me please?

b) When I have an Internet connection on the host, I will have Internet connection on the guest too. It's possible with NAT connection, but I need also the connection that I describe in part a of this question. So how can I to have 2 active NICs on the Ubuntu OS? On Windows 7 it's automaticly, but on the Ubuntu I can choice only one connection in the NetworkManager.

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

Re: Connection Host-Guest without NIC on the Host

Post by Perryg »

Section 6.2. Introduction to networking modes of the users guide explains what you need to do.
Read the last paragraph.
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

Do you mean this?
Finally, host-only networking can be used to create a network containing the host and
a set of virtual machines, without the need for the host’s physical network interface.
Instead, a virtual network interface (similar to a loopback interface) is created on the
host, providing connectivity among virtual machines and the host.
The following sections describe the available network modes in more detail.
But there is nothing about setting interface on the host or on the guest. I know I need Host-only connection, but it doesn't work. I wrote it :
I have installed software VB NIC on the host, VM has PCnet-FAST III (Am79C973) attached to the VB Host-only NIC. But when I turn the ubuntu on, it tryes to connect but then signalizes no connection :( When I monitor the software NIC on the host, there is outgoing but absolutely no incomming activity.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Connection Host-Guest without NIC on the Host

Post by Perryg »

Typically you would set the first adapter to host-only and add a second adapter for NAT to allow Internet for the guest if/when it is available.
If for some reason the host-only adapter is not working then you might want to re-install VirtualBox and select repair to be sure the drivers have been installed.
The host-only parameters are set in the VirtualBox main program under file-preferences-network. You should be using DHCP and then you need not configure the guest adapter settings.
Things that can cause this not to work properly are (1) Firewall settings, (2) missing drivers, (3) wrong network settings in VirtualBox preferences.

After you have the setup as above then in Win7 command window post the results of ipconfig /all and from a terminal window in Linux ifconfig. We can then see where the problem might be. Also (host terminal vboxmanage showvminfo <VM Name> and post here. Replace <VM Name> with the actual name of the VM. Use "" if the name has a space in it) can help in determining the problem
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

I reinstalled VirtualBox, turned my firewall (Comodo) off and there are screens :

EDIT : The images was deleted from the server, sorry

PS: I'm not connected to the Internet on the host and I don't solve Internet connection from the guest now. So I don't install NAT interface on the guest. I just want to connect host and guest together without active interface on the host.
Last edited by Behnil on 28. Sep 2009, 15:18, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Connection Host-Guest without NIC on the Host

Post by Perryg »

eth2 looks strange to me. I assume that you have changed this a few times.
Try editing the /etc/udev/rules.d/70-persistent-net.rules or you can delete the rules and Linux will configure it on the next boot. This should get you back to eth0 and might allow this to work.
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

I have done it, ifconfig shows eth0 and net rules have been generated automatically :

Code: Select all

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:22:28:ed", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
But it still not works. Ubuntu tryes to connect through the Host-only interface but unsuccessfully :( Btw. On the VirtualBox Host-Only Network on host isn't any outgoing activity!?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Connection Host-Guest without NIC on the Host

Post by Perryg »

What about the Windows 7 Firewall?
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

It's forbidden.
I have no idea what's wrong. I reinstalled VirtualBox as well as VM Ubuntu. This VM has 2 NICs, the first is NAT and the second is Host-Only. I turn the VM on, it tries to connect throuhg this interfaces. eth0 (NAT) is connected always and correct, even I have no active interface on the host system. eth1 (Host-Only) ontimes one times connect, one times doesn't connect. I don't understand it :x
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Connection Host-Guest without NIC on the Host

Post by Perryg »

I don't know what else I can tell you. I just got through testing this on one of my Ubuntu 9.04 VM's and it works fine.
Does ifconfig still not show an address?
If this still does not work for you you really should look at the Windows Firewall. Something must be blocking the connection. Also I do not use Windows 7 as a host so there may be something there, but I have no way to tell.

See my results below.
Attachments
host-only.jpg
host-only.jpg (110.56 KiB) Viewed 9991 times
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

Windows Firewall is disabled.
It's interesting, because ubuntu signalizes "wired network disconnected"one time and next time is all ok, like you have it. And this 2 situation rotate periodically. I think if something would block connection it didn't connect ever. Maybe it's because I use Windows 7, but it's weird. In any case thanks for your effort.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Connection Host-Guest without NIC on the Host

Post by Sasquatch »

It's possible that it's an NM bug. Remove Network Manager and install WICD manager (internet connection required for installation), or configure the network manually through /etc/network/interfaces.

Something you can also do is keep an eye on the NM applet and keep checking the link with mii-tool eth0, possibly run with root privileges. As soon as you see a loss in connection, open a terminal and run that command. If it says there is a link, but NM says it doesn't, there's a bug in it. I never liked Network Manger, caused too many problems for me and didn't have the functions I wanted. WICD does have what I want and manual configuration is working perfect too.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

Well done :D You're right. I have removed NM and installed WICD and it works always perfect! Thank you very much :wink:

But there is one weird thing for me. I have 2 network cards installed, the first is NAT and the second is Host-Only. Why does ifconfig show me only eth0 and eth1 doesn't? When I had NM, ifconfig shows eth0, eth1 and lo of course.

But mii-tool shows both networks :

Code: Select all

behnil@behnil-ubuntu:~$ sudo mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok
behnil@behnil-ubuntu:~$ sudo mii-tool eth1
eth1: 10 Mbit, half duplex, link ok
behnil@behnil-ubuntu:~$ 
I don't understand it. :( And why is eth1 link only 10 Mbit half duplex, when befor it was same link as eth0? Also WICD manager shows only eth0 connection only (I have 10.0.2.15 IP on the guest and it's ok), but eth1 (with IP 192.168.56.x) doesn't. Withal I can ping my host with IP 192.168.56.1, so the Host-Only network (eth1) must be active! Can you explain it to me?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Connection Host-Guest without NIC on the Host

Post by Sasquatch »

That's currently a limitation of WICD, it only supports one wired and one wireless NIC at the same time. If they both use DHCP, you can always configure them manually through the interfaces file. Something like this:

Code: Select all

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp
Should give them both DHCP addresses.
The reason you only see eth0 in the ifconfig output is because that's the only interface that's 'up'. Eth1 isn't brought up for configuration.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Behnil
Posts: 16
Joined: 27. Sep 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 9.04, Windows XP SP3
Location: Tabor, Czech Republic

Re: Connection Host-Guest without NIC on the Host

Post by Behnil »

Ok, but if you say WICD only supports one wired NIC, how is it possible that both networks are online and connected correctly? eth0 as well as eth1 have assigned IP addresses from the DHCP. So I have 2 questions :

a) If WICD configurates eth0 (NAT), who did configurate eth1 (Host-Only)?
b) How can I identify my IP address on the eth1 interface when ifconfig as well as WICD doesn't show me it?
Post Reply