FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-16-2008, 11:49 PM
Norberto Bensa
 
Default virtualbox networking

Quoting Marc Joliet <marcec@gmx.de>:


What I need is the bidirectional communication between host and guest.


Sorry, but I can't help you there, though I'm going to sit down and set
that up myself when I have time (this year, I hope ).


I know! I know!! :-)

The following assumes baselayout-2

This is my /etc/conf.d/net:

bridge_br0="eth0"
config_eth0="null"
config_br0="dhcp"
brctl_br0="setfd 0 sethello 0 stp on"

Then run:

sudo ln -s net.lo /etc/init.d/net.eth0
sudo ln -s net.lo /etc/init.d/net.br0

And:

sudo rc-update add net.eth0
sudo rc-update add net.br0


Reboot if you want. After reboot you should have br0 and eth0:

zoolook@venkman ~ $ sudo ifconfig
[sudo] password for zoolook:
br0 Link encap:Ethernet HWaddr 00:1b:fc:fb:82:08
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21b:fcff:fefb:8208/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:286825 errors:0 dropped:0 overruns:0 frame:0
TX packets:202074 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:242240512 (231.0 MiB) TX bytes:32231791 (30.7 MiB)

eth0 Link encap:Ethernet HWaddr 00:1b:fc:fb:82:08
inet6 addr: fe80::21b:fcff:fefb:8208/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:286819 errors:0 dropped:0 overruns:0 frame:0
TX packets:203897 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:246254404 (234.8 MiB) TX bytes:32369094 (30.8 MiB)

(note that eth0 does not have ipv4 address)

After all this, create a small bash script in /usr/bin. I called mine
addif.sh:


#!/bin/bash

IF="${1}"
ACTION="${2}"
BRIDGE=br0

case "$ACTION" in
up)
sudo VBoxAddIF "${IF}" "${LOGNAME}" "${BRIDGE}" >/dev/null 2>&1
;;
down)
sudo VBoxDeleteIF "${IF}" >/dev/null 2>&1
;;
esac

echo $IF


Add this to /etc/sudores:

%vboxusers ALL=(ALL) NOPASSWD: /usr/bin/VBoxAddIF, /usr/bin/VBoxDeleteIF


Now. Open VirtualBox and configure network like this:

Attached to: Host Interface

Setup application: addif.sh vbox0 up

terminate application: addif.sh vbox0 down


Note that "vbox0" is any name you like. I named mine "xp" or "nt4" or
"centos" depending on the guest.


The interface is create and destroyed on demand.

Regards,
Norberto


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 
Old 09-17-2008, 12:07 AM
Hal Martin
 
Default virtualbox networking

Marc Joliet wrote:

Am Tue, 16 Sep 2008 23:25:02 +0200
schrieb pat <pat@xvalheru.org>:



Hello,



Hi,



I'm trying to setup virtualbox networking. I went through the
tutorial at gentoo wiki, but I have troubles ... obvious :-(

In the howto there's called /sbin/ip, but I have no idea in which
package this program rise ;-)



you're looking for sys-apps/iproute2.

I also installed VirtualBox, however when the Gentoo wiki suggested I
edit a bunch of files in /etc/ I decided to go with the VirtualBox
default configuration files; lo-and-behold, it works, Batman!


What I need is the bidirectional communication between host and guest.



Sorry, but I can't help you there, though I'm going to sit down and set
that up myself when I have time (this year, I hope ).

I currently have all my virtual machines configured to use the
PCnet-FAST III (Am79C973) virtual network adapter. This was because the
Intel PRO/1000 virtual network card often mentioned in the Gentoo wiki
isn't available for some reason. I have the virtual adapter attached to
NAT and I can mount host machines NFS/Samba shares from inside the
virtual machine.


What kind of bidirectional communication are you looking for? I'm sure
that if you setup a virtual network adapter that the guest OS recognizes
you can SSH from the virtual machine into the host machine, or perhaps
this is not what you had in mind.


I just tested SSH on my Ubuntu virtual machine, and I can SSH into
the host machine and other machines on my home network. However,
what I *can't* do is ssh into the virtual machine from any computer,
including the host machine, on my network. Then again, there may be
some sly way to do this that I am not aware of. ;-)


I currently run Ubuntu, Windows XP, and Windows Vista in virtual
machines. Before the Linux>Windows flame war starts; what is the guest
OS you are trying to configure client -> host networking with? If it is
a freely available, non-commercial OS, perhaps I can install it for you
in my VirtualBox installation and test the functionality you're
interested in.


If you would like any direct help regarding VirtualBox, don't hesitate
to send me an email directly.


Here to help whenever possible,
-Hal


Thanks for help

Pat



HTH
 
Old 09-17-2008, 01:05 AM
Norberto Bensa
 
Default virtualbox networking

Quoting Hal Martin <hal.martin@gmail.com>:


What kind of bidirectional communication are you looking for?


OP wants to be able to run services on the guest. AFAIK, the only way
to do that is setting up a bridge.


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 
Old 09-17-2008, 04:14 AM
"Hilco Wijbenga"
 
Default virtualbox networking

On Tue, Sep 16, 2008 at 14:25, pat <pat@xvalheru.org> wrote:
> Hello,
>
> I'm trying to setup virtualbox networking. I went through the tutorial at
> gentoo wiki, but I have troubles ... obvious :-(
>
> In the howto there's called /sbin/ip, but I have no idea in which package
> this program rise ;-)
>
> What I need is the bidirectional communication between host and guest.

When you say tutorial, do you mean
http://gentoo-wiki.com/HOWTO:_VirtualBox ? That's what Norberto seems
to have used.

You should definitely look into dnsmasq as well. It allows all my
boxes to see all other boxes (including VirtualBoxes). (I added a
little script that updates /etc/hosts on my server.)
 
Old 09-17-2008, 04:18 AM
"Hilco Wijbenga"
 
Default virtualbox networking

On Tue, Sep 16, 2008 at 17:07, Hal Martin <hal.martin@gmail.com> wrote:
> Marc Joliet wrote:
>> Am Tue, 16 Sep 2008 23:25:02 +0200
>> schrieb pat <pat@xvalheru.org>:
> I also installed VirtualBox, however when the Gentoo wiki suggested I edit a
> bunch of files in /etc/ I decided to go with the VirtualBox default
> configuration files; lo-and-behold, it works, Batman!

The default uses NAT so that you're not visible from the little
network that VirtualBox sets up for you. Hence, if you need
*bi*directional access you must use "Host Interface" and to get that
working you need the bridge stuff.
 
Old 09-17-2008, 07:19 AM
Etaoin Shrdlu
 
Default virtualbox networking

On Wednesday 17 September 2008, 06:18, Hilco Wijbenga wrote:

> On Tue, Sep 16, 2008 at 17:07, Hal Martin <hal.martin@gmail.com> wrote:
> > Marc Joliet wrote:
> >> Am Tue, 16 Sep 2008 23:25:02 +0200
> >> schrieb pat <pat@xvalheru.org>:
> >
> > I also installed VirtualBox, however when the Gentoo wiki suggested
> > I edit a bunch of files in /etc/ I decided to go with the VirtualBox
> > default configuration files; lo-and-behold, it works, Batman!
>
> The default uses NAT so that you're not visible from the little
> network that VirtualBox sets up for you. Hence, if you need
> *bi*directional access you must use "Host Interface" and to get that
> working you need the bridge stuff.

Or no bridge, but proper NAT and forwarding configured on the host (this
is how I use it).
 
Old 09-17-2008, 10:42 AM
"Ricardo Bevilacqua"
 
Default virtualbox networking

Hello!

This is the script I use to start my VirtualBox:

------------------------------------------------------------------------
#if you previously loaded the driver, you don't need
#the following line.
modprobe vboxdrv
tunctl -t tap1 -u root
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
dhcpcd br0
brctl addif br0 tap1
ifconfig tap1 up
------------------------------------------------------------------------

Then as a normal user (which is in the vboxusers group) I simply start
and configure my VirtualBox to use 'tap1'.

$VirtualBox


Hope this helps.

Regards.

Richard.
 
Old 09-17-2008, 08:34 PM
Momesso Andrea
 
Default virtualbox networking

On Wednesday 17 September 2008 02:07:49 Hal Martin wrote:
> Marc Joliet wrote:
> > Am Tue, 16 Sep 2008 23:25:02 +0200
> >
> > schrieb pat <pat@xvalheru.org>:
> >> Hello,
[.....]
>
> I currently have all my virtual machines configured to use the
> PCnet-FAST III (Am79C973) virtual network adapter. This was because the
> Intel PRO/1000 virtual network card often mentioned in the Gentoo wiki
> isn't available for some reason. I have the virtual adapter attached to
> NAT and I can mount host machines NFS/Samba shares from inside the
> virtual machine.
>

Can you do it the reverse way? I mean to mount on the host a nfs share
residing in the guest?


========================
Jabber: topper_harley@jabber.org
 
Old 09-17-2008, 10:46 PM
Marc Joliet
 
Default virtualbox networking

Am Tue, 16 Sep 2008 20:49:18 -0300
schrieb Norberto Bensa <nbensa@gmail.com>:

> Quoting Marc Joliet <marcec@gmx.de>:
>
> >> What I need is the bidirectional communication between host and
> >> guest.
> >
> > Sorry, but I can't help you there, though I'm going to sit down and
> > set that up myself when I have time (this year, I hope ).
>
> I know! I know!! :-)

Well, turns out your email got me going ;-) .

Right now I got it working without using a bridge. I can ping my
Windows XP VM and it can ping everything else on my side, however,
nmap won't work. I wonder why? Does the Windows firewall block it off?

Otherwise, everything works to my liking.

My /etc/conf.d/net:

> # My standard configuration
>
> modules=( "iproute2" "ifplugd" )
>
> # Only use dhcp with eth0
> # (Note that only dhclient allows you to specify additional domain name servers
> # (i.e. localhost) apart from the ones provided by the dhcp server.)
> modules_eth0=( "dhcpcd" )
> modules_eth1=( "!plug" )
> modules_vbox0=( "!plug" )
>
> dhcp_eth0="nodns nonis"
> dhcpcd_eth0="-t 10"
>
> # Configure eth0 with dhcp, configure eth1 with a static ip
> # eth0 has a static IPv6 Address so that it can be used as a router.
> config_eth0=(
> "dhcp"
> "2001:470:d138:1:218:f3ff:fe97:1772/64"
> )
> routes_eth0=( "default via 2001:470:d138:1::1" )
> config_eth1=(
> "172.16.0.1 broadcast 172.16.0.255 netmask 255.255.255.0"
> "fe80::20e:2eff:feb0:8cce/64" # link, needed or it will not be set
> "2001:470:d138:d909::1/64" # global
> )
>
> tuntap_vbox0="tap"
> tunctl_vbox0=( "-u marcec" )
> config_vbox0=( "172.16.1.1 broadcast 172.16.1.255 netmask 255.255.255.0" )
>
> # Manually set the dns server to first look up on localhost
> dns_servers_eth0="127.0.0.1 ::1"

[...]

> After all this, create a small bash script in /usr/bin. I called
> mine addif.sh:
>
> #!/bin/bash
>
> IF="${1}"
> ACTION="${2}"
> BRIDGE=br0
>
> case "$ACTION" in
> up)
> sudo VBoxAddIF "${IF}" "${LOGNAME}" "${BRIDGE}" >/dev/null
> 2>&1 ;;
> down)
> sudo VBoxDeleteIF "${IF}" >/dev/null 2>&1
> ;;
> esac
>
> echo $IF

I would think such a script belongs in /usr/local/bin?

> Add this to /etc/sudores:
>
> %vboxusers ALL=(ALL)
> NOPASSWD: /usr/bin/VBoxAddIF, /usr/bin/VBoxDeleteIF
>
>
> Now. Open VirtualBox and configure network like this:
>
> Attached to: Host Interface
>
> Setup application: addif.sh vbox0 up
>
> terminate application: addif.sh vbox0 down
>
>
> Note that "vbox0" is any name you like. I named mine "xp" or "nt4"
> or "centos" depending on the guest.
>
> The interface is create and destroyed on demand.

I would do that (create a bridge without any IFs attached and
then have them added dynamically), except the VBoxAddIF script in
virtualbox-ose-2.0.2 craps out on a missing file
(/var/run/VirtualBox/vboxnet). Google didn't yield anything useful.

> marcec@marcec ~ % sudo VBoxAddIF vbox0 marcec br0
> VirtualBox host networking interface creation utility, version _VERSION_
> (C) 2005-2007 Sun Microsystems, Inc.
> All rights reserved.
>
> Creating the permanent host networking interface "vbox0" for user marcec.
>
> Failed to add the interface "vbox0" to the bridge "br0".
> Make sure that the bridge exists and that you currently have sufficient
> permissions to do this.
> /usr/bin/VBoxAddIF: line 237: /var/run/VirtualBox/vboxnet: Datei oder Verzeichnis nicht gefunden

When looking at the relevent line (237), apparently it's because the
directory doesn't exist so it can't create the file. What does it look
like on your system? Shouldn't the ebuild have created that directory?

> Regards,
> Norberto

Regards,
--
Marc Joliet
--
"People who think they know everything really annoy those of us who
know we don't" - Bjarne Stroustrup
 
Old 09-17-2008, 11:22 PM
Norberto Bensa
 
Default virtualbox networking

Quoting Marc Joliet <marcec@gmx.de>:


Right now I got it working without using a bridge. I can ping my
Windows XP VM and it can ping everything else on my side, however,
nmap won't work. I wonder why? Does the Windows firewall block it off?



nmap runs on the guest?



After all this, create a small bash script in /usr/bin. I called

I would think such a script belongs in /usr/local/bin?


Errr.. Yup. But I don't know why VB doesn't get my $PATH.



The interface is create and destroyed on demand.


I would do that (create a bridge without any IFs attached and
then have them added dynamically), except the VBoxAddIF script in
virtualbox-ose-2.0.2 craps out on a missing file
(/var/run/VirtualBox/vboxnet). Google didn't yield anything useful.


marcec@marcec ~ % sudo VBoxAddIF vbox0 marcec br0
VirtualBox host networking interface creation utility, version _VERSION_
(C) 2005-2007 Sun Microsystems, Inc.
All rights reserved.

Creating the permanent host networking interface "vbox0" for user marcec.

Failed to add the interface "vbox0" to the bridge "br0".


And where's your br0 in /etc/conf.d/net? I can't find it.



When looking at the relevent line (237), apparently it's because the
directory doesn't exist so it can't create the file. What does it look
like on your system? Shouldn't the ebuild have created that directory?


I have no /var/run/VirtualBox... but I use virtualbox-bin-2.0.2.

Regards,
Norberto

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 

Thread Tools




All times are GMT. The time now is 04:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org