You are not logged in.

#1 2012-10-03 20:46:00

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

[SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Hello Everyone,

I created a virtual machine on Virtualbox with Arch Linux only to install a LAMP solution and use it with my host machine (Arch Linux), but I can't access the localhost using the ip (10.0.2.15) in the browser.

Is there any way to solve this problem ?

PS: I already posted this question but I didn't have the change to say about my second instalation with the same problem, since this forum only helps for "Pure Arch Linux" I would like to ask a question for a Arch-to-Arch problem on my second computer that doesn't allow me to do the same operation. I want to "sandbox" this in order to not open unexpected ports on my computer (and just don't have to wory about this).

Thanks in Advance,
Luis Da Costa

Last edited by aliasbody (2012-10-04 21:52:49)


Arch Linux - They see me rollin', they hatin'

Offline

#2 2012-10-03 20:50:24

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,408
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Your other thread which was closed for deletion:

https://bbs.archlinux.org/viewtopic.php?id=150020

Differs from this thread in a meaningful way?  As in, you are really using a Arch host instead of a Parabola one?


We all make choices, but in the end, our choices make us.

Offline

#3 2012-10-03 20:54:01

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

headkase wrote:

Your other thread which was closed for deletion:

https://bbs.archlinux.org/viewtopic.php?id=150020

Differs from this thread in a meaningful way?  As in, you are really using a Arch host instead of a Parabola one?

I have the 2 OS installed on different machines (because of the lack of drivers on the linux-libre version of the kernel for my second computer), and I have the same problem, I first tried with this one because because it is the one I mostly work with, and then I switcher to the Arch-to-Arch solution (following the Arch wiki about the Lamp installation) just to see if it was a problem with Parabola and/or Ubuntu but I did have the exact same problem, this is why I am now posting this so I could have help for "what is supported" and then try myself to do the same on "what is not supported".

Hope you understand and accept my apologies.

Thanks in Advance,
Luis Da Costa


Arch Linux - They see me rollin', they hatin'

Offline

#4 2012-10-03 20:55:57

Kurokaze
Member
Registered: 2012-10-03
Posts: 1

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Hi,
I'm trying to setup a virtual box Arch installation on my Arch (doing some experiments and all, and don't want to ruin the main system since I'm still getting the hang of it), however, trying to set an apache server on the virtualbox machine, but I can't seem to be able to connect to it through my host machine.

I did follow all the LAMP page instructions, and on the host machine (without using vb, it works, just not from a host-to-guest connection or exterior-to-guest)...

Thanks in advance

Offline

#5 2012-10-03 20:57:00

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,408
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

aliasbody wrote:
headkase wrote:

Your other thread which was closed for deletion:

https://bbs.archlinux.org/viewtopic.php?id=150020

Differs from this thread in a meaningful way?  As in, you are really using a Arch host instead of a Parabola one?

I have the 2 OS installed on different machines (because of the lack of drivers on the linux-libre version of the kernel for my second computer), and I have the same problem, I first tried with this one because because it is the one I mostly work with, and then I switcher to the Arch-to-Arch solution (following the Arch wiki about the Lamp installation) just to see if it was a problem with Parabola and/or Ubuntu but I did have the exact same problem, this is why I am now posting this so I could have help for "what is supported" and then try myself to do the same on "what is not supported".

Hope you understand and accept my apologies.

Thanks in Advance,
Luis Da Costa

No need for apologies, the fact is that if your system is not Arch then it may operate is subtly different ways.  That could cause a lot of confusion and headaches for people trying to help you.

So, you are on Arch as the host.  Good.  People here will be able to help.

Last edited by headkase (2012-10-03 20:57:31)


We all make choices, but in the end, our choices make us.

Offline

#6 2012-10-03 21:21:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,406

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

aliasbody wrote:

I have the 2 OS installed on different machines (because of the lack of drivers on the linux-libre version of the kernel for my second computer), and I have the same problem,

I remain skeptical.  Never-the-less, I will accept this at face value.

How is the networking on Virtualbox configured?  Is it Bridged, Nat, or Host Only ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Offline

#7 2012-10-03 21:28:59

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

ewaller wrote:
aliasbody wrote:

I have the 2 OS installed on different machines (because of the lack of drivers on the linux-libre version of the kernel for my second computer), and I have the same problem,

I remain skeptical.  Never-the-less, I will accept this at face value.

How is the networking on Virtualbox configured?  Is it Bridged, Nat, or Host Only ?

It is a Nat type with the Intel PRO/1000 MT Desktop (8254OEM) Adapter Type.


Arch Linux - They see me rollin', they hatin'

Offline

#8 2012-10-03 21:57:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,406

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Can you ping 10.0.2.2  ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Offline

#9 2012-10-03 22:04:41

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

The IP showed by the guest is 10.0.2,15 so I pinged to this one and for the one you showed me (just to test) :

[aliasbody@BodyMSI ~]$ ping -c 3 10.0.2.2
PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data.

--- 10.0.2.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
[aliasbody@BodyMSI ~]$ ping -c 3 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.

--- 10.0.2.15 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

Arch Linux - They see me rollin', they hatin'

Offline

#10 2012-10-03 22:10:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,406

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

... and the output of ip route  ??


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Offline

#11 2012-10-03 22:12:10

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Guest Machine

aliasbody@BodyMsi-VM:~$ ip route
default via 10.0.2.2 dev eth0  proto static 
10.0.2.0/24 dev eth0  proto kernel  scope link  src 10.0.2.15  metric 1 
169.254.0.0/16 dev eth0  scope link  metric 1000

Host Machine

[aliasbody@BodyMSI ~]$ ip route
default via 192.168.1.1 dev wlan0  proto static 
default via 192.168.1.1 dev wlan0  metric 303 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.102  metric 303

Last edited by aliasbody (2012-10-03 22:12:28)


Arch Linux - They see me rollin', they hatin'

Offline

#12 2012-10-04 02:07:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,406

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Well, it appears that your host's  "adapter" should have an address of 10.0.0.2 (The virtual one that talks to the VM)
Can you check that in the host OS with ip addr   ??

The IP showed by the guest is 10.0.2,15 so I pinged to this one and for the one you showed me (just to tes

How did you determine that?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Offline

#13 2012-10-04 08:38:58

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

ewaller wrote:

Well, it appears that your host's  "adapter" should have an address of 10.0.0.2 (The virtual one that talks to the VM)
Can you check that in the host OS with ip addr   ??

The IP showed by the guest is 10.0.2,15 so I pinged to this one and for the one you showed me (just to tes

How did you determine that?

This is the "ip addr" output on the Host Machine :

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:21:85:7a:ba:40 brd ff:ff:ff:ff:ff:ff
    inet 10.48.0.80/23 brd 10.48.1.255 scope global wlan0
    inet6 fe80::221:85ff:fe7a:ba40/64 scope link 
       valid_lft forever preferred_lft forever

And I saw the 10.0.2.15 ip using "ipconfig -a" on my Guest Machine. And I have access to my Host machine from my Guest Machine using the IP that appears on "ipconfig -a" on my Host Machine.

Last edited by aliasbody (2012-10-04 08:52:50)


Arch Linux - They see me rollin', they hatin'

Offline

#14 2012-10-04 21:42:07

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

I think that I know where the problem is but I don't know how to solve it. As I can see in a lot of websites about this situation, the solution to solve this is to change the VM adapter to "Bridged Adapter", the problem is that when I select this option my VM Guest Machine don't start anymore and show me this error message :

Failed to open/create the internal network 'HostInterfaceNetworking-wlan0' (VERR_SUPDRV_COMPONENT_NOT_FOUND).
Failed to attach the network LUN (VERR_SUPDRV_COMPONENT_NOT_FOUND).
One of the kernel modules was not successfully loaded. Make sure that no kernel modules from an older version of VirtualBox exist. Then try to recompile and reload the kernel modules by executing '/etc/init.d/vboxdrv setup' as root (VERR_SUPDRV_COMPONENT_NOT_FOUND).

PS: vboxdrv is fully loaded and functional (If I switch from NAT to Bridged Adapter the error disappear and the VM Guest Machine starts normally)


Arch Linux - They see me rollin', they hatin'

Offline

#15 2012-10-04 21:52:06

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 156
Website

Re: [SOLVED] Acessing LAMP inside a virtual machine with Virtualbox

Sorry it was simple, pure, and beautiful stupidity of myself :S...

Here is the solution :

1 - Install Virtualbox (help by the Wiki of Arch Linux here --> https://wiki.archlinux.org/index.php/VirtualBox
2 - Create the VM Guest Machine and on the Network section select Bridged Adapter
3 - On the host machine type this in the terminal "sudo modprobe -a vboxnetadp vboxnetflt"
4 - Start the Guest VM and enjoy !

Thanks for you help anyway and sorry for the problems with the first post.

I will change this to [SOLVED].


Arch Linux - They see me rollin', they hatin'

Offline

Board footer

Powered by FluxBB