You are not logged in.

#1 2009-05-08 01:24:26

zeug
Member
Registered: 2009-05-08
Posts: 25

[SOLVED] Guest Arch in Virtual Box Internet Problems

I have installed Arch a few times already in virtual machines on Virtual Box and each time it is unable to configure the internet connection properly.  Having gone through the beginner wiki-pages on starting with Arch, I have tried "ping -c 3 www.google.com" and get "ping: unknown host www.google.com".  However, IP addresses usually work with 0% packet loss.

I then followed the "hwdetect" instruction and that yielded "-bash: hwdetect: command not found".  The command "modprobe pcnet32" does not yield an error and returns nothing.

I have also tried other methods
http://eligere.wordpress.com/2008/03/05 … i-problem/
http://bbs.archlinux.org/viewtopic.php?id=55811.

Thanks.

Last edited by zeug (2009-05-08 23:03:56)

Offline

#2 2009-05-08 03:11:51

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

zeug,

if I understand you well, symbolic names do not work with ping, but IP addresses do.

In this case you have a DNS problem, that is, ARCH doesnt know how to contact a Domain name
server.

Take a look at the file /etc/resolv.conf.

If you have a router, most probably the correct name server is the IP of the router.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#3 2009-05-08 03:41:52

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

In /etc/resolv.conf there are two entries for nameserver one of which is "0.0.0.0", I am using wireless internet on my host computer.  The virtual machine uses PCnet-FAST III (NAT).

Thanks!

Offline

#4 2009-05-08 07:26:23

Wikimig
Developer
From: France
Registered: 2004-12-10
Posts: 77
Website

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

Hi,

Pretty much the same here

That is strange but adding "nameserver 192.168.0.1" to /etc/resolv.conf enables me to access the internet. 192.168.0.1 is of course the IP of the host computer's vitual card but what is strange is: I need to use dhcpcd from guest to be given an IP that isn't even in the same range as 192.168.0.1 (for instance 10.0.2.15)!!

So to basically, host PC has that virtual ethernet card with static IP 192.168.0.1 and internet connection shared (don't know if this is compulsory though) and guest uses dhcp, is given 10.0.2.15 (don't ask me where it gets it from because I disabled it on VirtualBox). Then I just have to add "nameserver 192.168.0.1" to resolv.conf and I'm good... till dhcpcd rewrites the resolv.conf. How could we set dhcp to use a particular DNS?

As you can see, I am not a DNS expert. Using static IPs for both would be great but it doesn't work smile

Does it help?

Offline

#5 2009-05-08 10:45:40

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

zeug wrote:

In /etc/resolv.conf there are two entries for nameserver one of which is "0.0.0.0", I am using wireless internet on my host computer.  The virtual machine uses PCnet-FAST III (NAT).

Thanks!

With 0.0.0.0 DNS is going nowhere.

You seem to be using NAT networking.

In the VirtualBox configuration under network you can select  "Attached to: Bridged Adapter".
Then start Vbox-ARCH and recheck /etc/resolv.conf.

You didn't say if you are using a router. If yes, and /etc/resolv.conf still has 0.0.0.0, replace with the routers IP.

You could keep using NAT networking, but if you don't have a strong reason to use it, Bridged is easier then NAT,
which assigns an IP of the 10.x.x.x range to your Virtual ARCH and does then Network Address Translation.

With Bridged your Virtual PC will look like a normal attached PC to your local LAN.

BTW, Bridgeg Networking is only available on newer Vbox versions, 2.x.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#6 2009-05-08 10:54:05

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

Wikimig wrote:

Hi,

Pretty much the same here

That is strange but adding "nameserver 192.168.0.1" to /etc/resolv.conf enables me to access the internet. 192.168.0.1 is of course the IP of the host computer's vitual card but what is strange is: I need to use dhcpcd from guest to be given an IP that isn't even in the same range as 192.168.0.1 (for instance 10.0.2.15)!!

So to basically, host PC has that virtual ethernet card with static IP 192.168.0.1 and internet connection shared (don't know if this is compulsory though) and guest uses dhcp, is given 10.0.2.15 (don't ask me where it gets it from because I disabled it on VirtualBox). Then I just have to add "nameserver 192.168.0.1" to resolv.conf and I'm good... till dhcpcd rewrites the resolv.conf. How could we set dhcp to use a particular DNS?

As you can see, I am not a DNS expert. Using static IPs for both would be great but it doesn't work smile

Does it help?

The 10.x.x.x.x address range is assigned because you are most probably using NAT networking on the Virtual Box configuration.

Try with 'Bridged'.

If all goes well you shouldn't need to fiddle with /etc/resolv.conf.

Still, if you still need to change /etc/resolv.conf, put your changes in a file called /etc/resolv.conf.head which will survive
the changes that sometimes DHCP does on /etc/resolv.conf.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#7 2009-05-08 11:11:00

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

I've noticed this issue too.
Configure your nameservers correctly once, then install dhclient and use it instead of dhcpcd.

You will need to change the way network is configured, don't use the network daemon and put a couple of lines rc.local, something like

ifconfig eth0 up
dhclient

then all should work well in vbox.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2009-05-08 20:11:38

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

I tried to select bridged network but Virtual Box (2.2) says that none of my adapters are bridged network adapters.

I have tried editing /etc/resolv.conf and then /etc/resolv.conf.head with "nameserver" and the IP address of the wireless card on my host but it does nothing.  The entries in /etc/resolv.conf were overwritten with another IP and 0.0.0.0.

Also, I do not have a router - I am using a wireless connection but I in no way have access to a router.

Thanks.

Offline

#9 2009-05-08 20:18:28

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

zeug,

seems bridged has some problems in window$ hosts:

http://tinyurl.com/o364k7

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#10 2009-05-08 22:20:56

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

I repaired Virtual Box now and have the bridged network set up.  When I booted Arch, though, it fails to start the network.  I looked in /etc/resolv.conf and there are no nameserver entries anymore.  I tried "/etc/rc.d/network restart" and it still fails to start the network, shows the error "eth0: timed out [FAIL]".

Offline

#11 2009-05-08 22:21:46

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

zeug wrote:

I have installed Arch a few times already in virtual machines on Virtual Box and each time it is unable to configure the internet connection properly.  Having gone through the beginner wiki-pages on starting with Arch, I have tried "ping -c 3 www.google.com" and get "ping: unknown host www.google.com".  However, IP addresses usually work with 0% packet loss.

Thanks.

it´s a name resolution problem.

/etc/conf.d/dhcpcd should look like:

DHCPCD_ARGS="-C resolv.conf -q"

and resolv.conf:

nameserver 10.0.2.3

ps:  this works for NAT connections (perhaps bridge - i don´t know)

Last edited by DonVla (2009-05-08 22:22:43)

Offline

#12 2009-05-08 22:32:23

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

It works now with the lines DonVla suggested!

Dankeschön!

Offline

#13 2009-05-08 22:33:36

zeug
Member
Registered: 2009-05-08
Posts: 25

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

Thanks, Mektub, too!

Should I mark this as solved?
[SOLVED] or?

Offline

#14 2009-05-08 22:46:00

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [SOLVED] Guest Arch in Virtual Box Internet Problems

zeug wrote:

Dankeschön!

Gerngeschehen big_smile
i would say it´s solved....

Offline

Board footer

Powered by FluxBB