Re: [gentoo-user] virtualbox networking [CONTINUE]
On Wed, 17 Sep 2008 21:11:29 -0300, Norberto Bensa wrote > Quoting pat <[EMAIL PROTECTED]>: > > > Hilco Wijbenga wrote: > > Or my be another question :-) I need to run more then one guest OS, so > > I expect I need to create next bridge, but how? > > No no.. You're confusing bridges and interfaces. You make ONE bridge > and add interfaces to it. Search my email with scripts to create vb > interfaces on-demand. > > Regards, > Norberto > Thanks a lot. It works for me now :-) Pat
Re: [gentoo-user] virtualbox networking
Quoting Marc Joliet <[EMAIL PROTECTED]>: OK, I feel so stupid right now. Please don't. Nobody born knowing everything :) So now it works as intended, tested with WinXP and Ubuntu running in parallel (now that shows me why I should upgrade from 2 to 4GB RAM). Heh... Me too! Regards, Norberto This message was sent using IMP, the Internet Messaging Program.
Re: [gentoo-user] virtualbox networking
Am Wed, 17 Sep 2008 23:05:49 -0300 schrieb Norberto Bensa <[EMAIL PROTECTED]>: > Quoting Marc Joliet <[EMAIL PROTECTED]>: > > > except for the fact that VirtualBox seems to not run the script, even > > with the full path. I can run the script manually, creating vbox1 and > > then start the VM and everything works, but with: > > > > Attached to:vbox1 > > That's your problem. You should leave that blank. OK, I feel so stupid right now. First off, you're absolutely right. I verified that in the VirtualBox manual, to be sure. The problem was, I had commented out the redirects to /dev/null when the script first failed for diagnostic purposes, which showed me that /var/run/VirtualBox/ didn't exist. I just forgot to uncomment them afterwards. *ARGH* So now it works as intended, tested with WinXP and Ubuntu running in parallel (now that shows me why I should upgrade from 2 to 4GB RAM). > > Setup application: /usr/local/bin/addif.sh vbox1 up > > terminate application: /usr/local/bin/addif.sh vbox1 down > > Regards, > Norberto Thanks, -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup signature.asc Description: PGP signature
Re: [gentoo-user] virtualbox networking
Quoting Marc Joliet <[EMAIL PROTECTED]>: except for the fact that VirtualBox seems to not run the script, even with the full path. I can run the script manually, creating vbox1 and then start the VM and everything works, but with: Attached to:vbox1 That's your problem. You should leave that blank. Setup application: /usr/local/bin/addif.sh vbox1 up terminate application: /usr/local/bin/addif.sh vbox1 down Regards, Norberto This message was sent using IMP, the Internet Messaging Program.
Re: [gentoo-user] virtualbox networking [SOLVED]
Thanks to all !!! It works :-) Pat
Re: [gentoo-user] virtualbox networking
Am Wed, 17 Sep 2008 20:22:54 -0300 schrieb Norberto Bensa <[EMAIL PROTECTED]>: > Quoting Marc Joliet <[EMAIL PROTECTED]>: > > > 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? No, on the host. I noticed the following works: [EMAIL PROTECTED] ~ % sudo nmap -PN 172.16.1.2 Passwort: Starting Nmap 4.53 ( http://insecure.org ) at 2008-09-18 02:28 CEST Nmap done: 1 IP address (0 hosts up) scanned in 0.273 seconds [EMAIL PROTECTED] ~ % So I assume nothing is wrong, it's probably Windows built in firewall. > > >> 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. Yeah, I thought it was something like that, I just wanted to be sure, though in retrospect I guess the question was superfluous. > > >> 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. > > > >> [EMAIL PROTECTED] ~ % 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. Sorry, that's because I had it commented out after the failure. It looks like this: config_br0=( "172.16.1.1 broadcast 172.16.1.255 netmask 255.255.255.0" ) brctl_br0=( "setfd 0" "sethello 0" "stp on" ) And that's it. I just created the directory /var/run/VirtualBox/ via mkdir and set the group to vboxusers. Then I ran your script. Now it seems to work, except for the fact that VirtualBox seems to not run the script, even with the full path. I can run the script manually, creating vbox1 and then start the VM and everything works, but with: Attached to:vbox1 Setup application: /usr/local/bin/addif.sh vbox1 up terminate application: /usr/local/bin/addif.sh vbox1 down the VM doesn't start and the TAP devices aren't created. How frustrating :/ . > > 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. Hmm, odd. > Regards, > Norberto > > > This message was sent using IMP, the Internet Messaging Program. > So, I'll try some more tomorrow, but now I really need some sleep :-) . -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup signature.asc Description: PGP signature
Re: [gentoo-user] virtualbox networking [CONTINUE]
Quoting pat <[EMAIL PROTECTED]>: Hilco Wijbenga wrote: Or my be another question :-) I need to run more then one guest OS, so I expect I need to create next bridge, but how? No no.. You're confusing bridges and interfaces. You make ONE bridge and add interfaces to it. Search my email with scripts to create vb interfaces on-demand. Regards, Norberto This message was sent using IMP, the Internet Messaging Program.
Re: [gentoo-user] virtualbox networking
Quoting Marc Joliet <[EMAIL PROTECTED]>: 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. [EMAIL PROTECTED] ~ % 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.
Re: [gentoo-user] virtualbox networking [CONTINUE]
Hilco Wijbenga wrote: On Tue, Sep 16, 2008 at 14:25, pat <[EMAIL PROTECTED]> 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.) Or my be another question :-) I need to run more then one guest OS, so I expect I need to create next bridge, but how? I've try something like this (/etc/conf.d/net): config_eth0=( "null" ) tuntap_vbox0="tap" tuntap_vbox1="tap" config_vbox0=( "null") config_vbox1=( "null") config_br0=( "dhcp" ) config_br1=( "dhcp" ) bridge_br0="eth0 vbox0" bridge_br1="eth0 vbox1" depend_br0() { need net.eth0 need net.vbox0 } depend_br1() { need net.eth0 need net.vbox1 } brctl_br0=( "setfd 0") brctl_br1=( "setfd 0") And create corresponding links in the /etc/init.d directory. ln -s ./net.lo ./net.vbox1 ln -s ./net.lo ./net.br1 And trying to start net.br1 giving me this error: device eth0 is already a member of a bridge; can't enslave it to bridge Again I'm wrong. How to enable more then one bridge? I want all guests to see each other and see the host too and host has to see all guests. Thanks Pat
Re: [gentoo-user] virtualbox networking
Am Tue, 16 Sep 2008 20:49:18 -0300 schrieb Norberto Bensa <[EMAIL PROTECTED]>: > Quoting Marc Joliet <[EMAIL PROTECTED]>: > > >> 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. > [EMAIL PROTECTED] ~ % 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 signature.asc Description: PGP signature
Re: [gentoo-user] 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 <[EMAIL PROTECTED]>: > >> 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: [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] 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.
Re: [gentoo-user] virtualbox networking
On Wednesday 17 September 2008, 06:18, Hilco Wijbenga wrote: > On Tue, Sep 16, 2008 at 17:07, Hal Martin <[EMAIL PROTECTED]> wrote: > > Marc Joliet wrote: > >> Am Tue, 16 Sep 2008 23:25:02 +0200 > >> schrieb pat <[EMAIL PROTECTED]>: > > > > 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).
Re: [gentoo-user] virtualbox networking
On Tue, Sep 16, 2008 at 17:07, Hal Martin <[EMAIL PROTECTED]> wrote: > Marc Joliet wrote: >> Am Tue, 16 Sep 2008 23:25:02 +0200 >> schrieb pat <[EMAIL PROTECTED]>: > 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.
Re: [gentoo-user] virtualbox networking
On Tue, Sep 16, 2008 at 14:25, pat <[EMAIL PROTECTED]> 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.)
Re: [gentoo-user] virtualbox networking
Quoting Hal Martin <[EMAIL PROTECTED]>: 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.
Re: [gentoo-user] virtualbox networking
Marc Joliet wrote: Am Tue, 16 Sep 2008 23:25:02 +0200 schrieb pat <[EMAIL PROTECTED]>: 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
Re: [gentoo-user] virtualbox networking
Quoting Marc Joliet <[EMAIL PROTECTED]>: 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: [EMAIL PROTECTED] ~ $ 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.
Re: [gentoo-user] virtualbox networking
Am Tue, 16 Sep 2008 23:25:02 +0200 schrieb pat <[EMAIL PROTECTED]>: > 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. > 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 ;) ). > Thanks for help > > Pat HTH -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup signature.asc Description: PGP signature
[gentoo-user] virtualbox networking
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. Thanks for help Pat