Page 1 of 1

using linux server from mac firefox

Posted: 25. May 2010, 21:28
by whimsica
I installed ubuntu and linux successfully on the mac with xampp.

What's the url I would type in to access this server's index.html page in the mac osx firefox? (not the linux firefox)
How do I upload files from my ftp client "Fetch" or Cyberduck to the linux server running on virtualbox?

In other words, how do I access this server from the macos as I would a normal server somewhere?


Thanks for any help.

So far so good.

Dan

Re: using linux server from mac firefox

Posted: 26. May 2010, 00:11
by dmcgraw
It depends on how you have configured the network in the guest.

If you used NAT networking, then you have to setup port forwarding.

If you have configured Bridged networking, then the guest will have its own IP address, just like any other machine on the network. This is the option that I would recommend.

Re: using linux server from mac firefox

Posted: 26. May 2010, 05:37
by whimsica
i know how to do port forwarding on a router like a linksys, but how do you do that on the virtualbox?
The macosx is supplying the addresses?
ifconfig gives like 127.0.0.1 and 10.0.something

So the goal is to type in some address in my mac firefox and then view the pages on the linux virtualbox.
Could someone give me some more hints since I'm totally newbie here.

This question involves apache and virtualbox and linux and the mac I guess. So maybe I'm not sure where to look.

Thanks,

Dan

Re: using linux server from mac firefox

Posted: 26. May 2010, 16:12
by fixedwheel
whimsica wrote:So maybe I'm not sure where to look.
look in the VBox manual ;)

NAT, port forward => http://www.virtualbox.org/manual/ch06.html#natforward
"bridged" => http://www.virtualbox.org/manual/ch06.html#id2533733

Re: using linux server from mac firefox

Posted: 26. May 2010, 17:24
by whimsica
Okay I read the sections, but not sure I understand them very well.

I basically want localhost on the mac to be forwarded to localhost on the linux box.
How do I do that?

This example from the docs shows me that I can forward the port, would it be port 80?
Something like this?

VBoxManage modifyvm "VM name" --natpf1 "tcp,127.0.0.1,80,,80"
also what do I put for "VM name" ?

Am I getting close?
Thanks,

Dan

Re: using linux server from mac firefox

Posted: 27. May 2010, 20:27
by whimsica
Can anyone help with this.

So on the mac when I type in some IP on the mac I want it to show me the index.html page /opt/lampp/htdocs/index.htm on the linux ubuntu guest

Thanks,

Dan

Re: using linux server from mac firefox

Posted: 27. May 2010, 20:37
by Perryg
VBoxManage modifyvm "VM name" --natpf1 "tcp,127.0.0.1,80,,80"
also what do I put for "VM name" ?
This flat will not work. This is the local loopback address that every PC in the world has and can not be accessed from any place but the local machine.

Why not use host-only and save your sanity. Add a second adapter set to NAT if the guest needs the Internet.

Re: using linux server from mac firefox

Posted: 28. May 2010, 07:54
by whimsica
I want the guest to act just like a real server that I have setup in the past
I can ftp files and then test them by typing in the address of the server. In this case I am trying to put a shared folder on the guest and then develop software on the mac and then transfer it to the guest and then serve them up to the host.

How do I reach the guest (ubuntu linux) from the host (mac) so it acts like a real server
What address would I type in the host to reach the index page on the guest.

Guest is running linux ubuntu and the xampp package which includes apache.
and
index.html page is at /opt/lampp/htdocs on the guest

Thanks

Dan

Re: using linux server from mac firefox

Posted: 28. May 2010, 14:56
by Perryg
open a terminal on the guest and type ifconfig -a
this will tell you the IP address of the machine and should be on eth0
This will be the address you need to put in the host machines browser window.
You really need to read your VirtualBox users guide on this. All of these questions are easily found there. Including the types of networks and what they will and will not do.