# internet via virtualbox [solved]

## ilovebeer

hello all, after many months of trying i have finally got a usb wireless modem stick to work under linux... well sort of. i fire up virtualbox, load xp and after hours of stuffing around can connect to the internet via sierra's 3g watcher. within virtualbox i have an internet connection but in gentoo outside virtualbox i have no internet. i tried putting the ip in resolv.conf to no avail and after that i'm out of ideas. could someone kindly point me in the direction of how to share this virtualbox connection with gentoo. it is a stop gap measure till i get the modem working in gentoo proper but it's a breakthrough. yay i've nearly got gentoo back.

regards ilbLast edited by ilovebeer on Thu Jun 04, 2009 2:08 pm; edited 1 time in total

----------

## massimo

AFAIK you have to "share" the internet connection within your VirtualBox's Windows XP - there's probably a wizard in Windows for that. You have to make sure that you have a route to the VirtualBox's virtual network interface (get the interface's IP with ifconfig and check with the command route). Putting that in resolve makes not much sense unless your Windows XP system is running an DNS server.

----------

## ilovebeer

hello, yes i had connection sharing enabled in xp.  i run the same *vdi file from a vfat partition under both windows and linux. in windows the connection  in virtualbox xp is automatically shared with it's vista host but as of yet the connection in virtualbox xp is not shared with it's linux host. it can be done just gotta figure out how! i'm a bit perplexed as to what you mean. i suppose i could look at the route between vbox xp and the vista host to get an idea and adapt it to whatever the linux host needs (dunno how to do this just yet   :Shocked:  ). i reckon i'll come across an answer somewhere or by just plain fiddling about. any suggestions very welcome. i'm dying to do an "emerge --sync --deep --newuse --world"  gentoo on this box hasn't been updated since december 08.

----------

## massimo

After starting WindowsXP within VirtualBox, what does the commands route -n and ifconfig return?

----------

## MaximeG

Wait, 

What's the host, what is(are) the guest(s) ? And in which is Internet actually working ?

Regards,

Maxime

----------

## ilovebeer

 *massimo wrote:*   

> After starting WindowsXP within VirtualBox, what does the commands route -n and ifconfig return?

 

hello, route -n returned;

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

```

and ifconfig returned;

```
lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  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:0 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

i'm afraid it's all a bit foreign to me. thanks for any explanations or links you can give to enlighten me.

hi maxi, basically i have active internet in my virtualbox windows xp installation which is the guest of host gentoo linux. host gentoo doesn't tap into the active virtualbox connection... and i dunno how to do it. 

i'm hoping it's an arse about way that i can use gentoo again with vbox on minimal resources providing the internet connection in the background until i can get the usb stick working in linux proper. info on this is pretty slim on the web as it's not the usual direction for internet connectivity.

regards

i've since discovered that according to the usb modem lights the internet connection persists even after i've closed vbox.  i've had a series of wireless usb modems that haven't worked on linux and not even in vbox till now... i'm getting close  :Smile: .Last edited by ilovebeer on Thu Jun 04, 2009 11:43 am; edited 1 time in total

----------

## MaximeG

Well, 

Your usb modem will never be shown nor detected in your guest machines.

Instead, you have to configure your VirtualBox to share (via NAT for example) the connection your host Windows XP provides (coming from the actual USB modem this time).

Then in Gentoo, can you post the output of 

```
ipconfig
```

 ?

Regards,

Maxime

----------

## ilovebeer

 *MaximeG wrote:*   

> Well, 
> 
> Your usb modem will never be shown nor detected in your guest machines.
> 
> Instead, you have to configure your VirtualBox to share (via NAT for example) the connection your host Windows XP provides (coming from the actual USB modem this time).
> ...

 

thanks for you help.Last edited by ilovebeer on Thu Jun 04, 2009 12:25 pm; edited 2 times in total

----------

## MaximeG

Hi,

I think I'm a bit confused as well ; what I understood was :

1) WinXP is the host (actual) machine on which you plugged your USB Modem.

2) On this XP Host, you installed VirtualBox and created a virtual machine.

3) Within this virtual machine (the guest) you installed your gentoo machine.

4) In this Gentoo machine, you don't have Internet up and you don't see your modem

Are we all right on this one ?  :Smile: 

Maxime

----------

## ilovebeer

lol, yes it is a bit confusing... must be the way i explain things.

in this case i have the usb cellular modem plugged into a gentoo machine.

the gentoo machine has vbox installed.

the xp.vdi was generated by gentoo and virtualbox. the xp.vdi sees the usb modem connects properly.  it works inside a gentoo prison.

the host machine gentoo actually does see the modem but has never even been close to connecting with the linux tools available or my skills  :Wink: . i hope the host machine gentoo, will be able to piggy back on the virtualbox  connection so i ca update my gentoo system new kernel etc, but it doesn't.

thanks again

----------

## ilovebeer

hello again, i just had a thought... gentoo is 64 bit and the virtualbox xp.vdi is 32 bit. would that stop the communicating or matter?

thanks.

----------

## ilovebeer

YAY! i cant believe it. all i did was disabled the pin in windows... booted to gentoo fired up wvdial and the whole shebang worked. thx for your help. i did have the pin option stated in wvdial but it's a bit dodgy and never worked properly just gave the ridiculous ppp error message 16 (the modem hung up) and disconnected. i've got a 21mb modem cellular modem that i'll try using the same method.

my regards

----------

