# Solved: ubuntu in vm



## gina12 (Jan 12, 2012)

Help! Can some one pls help me out here, im doing my 3rd yr project LAMP vs WAMP.

My situation now is my pc is running on windows 7 and i have installed virtualbox n in there i have a unbuntu server 11.10, when setting it up i installed LAMP upon set up the first problem im having is when i try to connect to apache, php i get "cannot display this page" should i have installed openSSH also?
Second problem i have installed desktop client and have configured the eth1 with ips n masks and so on on both machines, set the adaptors to NAT and Internal, do i need to set a proxy also? pls help im new to Linux n this problem is slowing me down.
Thanks,
Gina.


----------



## DVOM (Jun 21, 2002)

gina12 said:


> im new to Linux n this problem is slowing me down.
> Thanks,
> Gina.


I'm guessing that you're also new to virtualization. So I'd suggest experimenting to just make sure you're getting connected to the network. You might also try VMware Player.

When I started with VMs about 5 yrs ago, I tried VirtualPC, VirtualBox and VMware. VMware was by far the easiest, most intuitive and most out of box ready one there was. No config necessary.

Also, google is your friend, there's lots of people setting up LAMP on Ubuntu and willing to tell you about it.


----------



## Elvandil (Aug 1, 2003)

DVOM said:


> I'm guessing that you're also new to virtualization. So I'd suggest experimenting to just make sure you're getting connected to the network. You might also try VMware Player.
> 
> When I started with VMs about 5 yrs ago, I tried VirtualPC, VirtualBox and VMware. VMware was by far the easiest, most intuitive and most out of box ready one there was. No config necessary.
> 
> Also, google is your friend, there's lots of people setting up LAMP on Ubuntu and willing to tell you about it.


I'd add Parallels Desktop to that mix. It is just about as easy as VMWare. But the sad truth is that the commercial products really are the best. The free ones work, and work well, but sometimes need some "tweaking" that beginners are not equipped to take on.


----------



## tomdkat (May 6, 2006)

gina12 said:


> Help! Can some one pls help me out here, im doing my 3rd yr project LAMP vs WAMP.
> 
> My situation now is my pc is running on windows 7 and i have installed virtualbox n in there i have a unbuntu server 11.10, when setting it up i installed LAMP upon set up the first problem im having is when i try to connect to apache, php i get "cannot display this page" should i have installed openSSH also?
> Second problem i have installed desktop client and have configured the eth1 with ips n masks and so on on both machines, set the adaptors to NAT and Internal, do i need to set a proxy also? pls help im new to Linux n this problem is slowing me down.
> ...


I'm not sure you really need to be doing the things you've tried. I have VirtualBox installed on my Linux system and I have both Windows and Linux guest OSes installed. First, when you have your Ubuntu server up and running, which URL do you use to access it? Also, do you get the "cannot display this page" message when you use a browser on Windows to access the server running on Linux?

With regard to the networking, you shouldn't have had to do anything special unless you want to make the Ubuntu server accessible to systems outside your LAN.

Peace...


----------



## gina12 (Jan 12, 2012)

Hi,
yes i am getting the 'cannot display this page' i am just using http://localhost.... and yes i want to connect to the outside world and i have tryed just using 'host only adaptor' which should generate two differant ip for server n client but this not happening either...i have installed the server 3 times now thinking im doing something wrong but im not n thats why i just dont no where the problem is.
Gina.


----------



## gina12 (Jan 12, 2012)

Hi,
The only reason im using virtualbox is cos I have installed server and client before in there n had no problems but trust me your right im not by far any expert at it..... but vm virtualbox is what i have to use for this project so im in a bit of bother


----------



## tomdkat (May 6, 2006)

gina12 said:


> Hi,
> yes i am getting the 'cannot display this page' i am just using http://localhost.... and yes i want to connect to the outside world and i have tryed just using 'host only adaptor' which should generate two differant ip for server n client but this not happening either...i have installed the server 3 times now thinking im doing something wrong but im not n thats why i just dont no where the problem is.
> Gina.


Are you running the browser on Ubuntu or on Windows? When you are logged in to Ubuntu, open a terminal window and issue this command:

ifconfig

and post the results here. You can't guess at the VirtualBox settings so you need to be clear on what you want to do so we can figure out what you'll need to do. 

With the default settings of VirtualBox using "NAT" for the network adapter for the guest, you SHOULD be able to access the Internet FROM the guest without problems and without any changes. In fact, I'm running a Fedora 15 update from within VirtualBox right now with the network setting set to "NAT". I can't ping my guest from the host OS because the guest's IP address is on a different internal network than the host's IP address. So, when I can, I'll switch to a "bridged" setting for the network adapter and I should get an IP address on the same subnet as the host OS and then I should be able to ping it.

With the network adapter set to "NAT", I can ping the host OS from the guest OS just fine.

So, for now LEAVE your VirtualBox guest set for a "host only" adapter, run the ifconfig command, and post the results here so we can see how the guest's network interfaces are setup. Also, again, are you running a browser on UBUNTU when you get the "cannot access page" message or are you running your browser on WINDOWS?

Peace...


----------



## gina12 (Jan 12, 2012)

Hi,
ok iv set it to host only adapter n results are addr is 127.0.0.1 mask is 255.0.0.0 .... i have tryed both browsers in ubuntu and windows.... if u want to log on to my machine you are more than welcome

Gina.


----------



## tomdkat (May 6, 2006)

Ok, thanks for the info. Now, are you able to successfully ping the local Ubuntu server from WITHIN the server, using these commands:

ping 127.0.0.1

ping localhost


You should get replies from both commands. If you don't, let us know what you do get. If possible, please post the "raw" command output in this thread so we can see what happened.

I don't need to login to your system. We can work through this here so you can better understand how to get everything configured. 

Peace...


----------



## gina12 (Jan 12, 2012)

Hi,
yes i have pinged 127.0.0.1 on both client and server n got replies but it looks like its just looping i cant take a print screen lol god im a disaster u need patients of a saint to deal with me lol im using windows here to talk to u so it wont copy n paste or take printscreen n i have adapters set to host only like you told me so using unbuntu iv no connection to net.
but it looks like its just looping i have to ctrlz to stop it.
Gina.


----------



## tomdkat (May 6, 2006)

Ok, pinging "127.0.0.1" on the client AND the server isn't what I need for you to do. For now, EVERY command I ask you to run should be run on the Ubuntu server. Right now, there's nothing I need for you to do on the Windows side. Ok? 

So, on the Ubuntu server, I need for you to run these commands:

ping -c 5 127.0.0.1

ping -c 5 localhost

"ping" on Linux/Unix will run until you use Ctrl-Z to stop it. Specifying the "-c" parameter will restrict the number of pings to the specified number. In this case, 5 pings will be sent to the loopback interface.

Let me know if you get replies from BOTH commands in a terminal window on the Ubuntu system.

Peace...


----------



## gina12 (Jan 12, 2012)

ok i got 5 packets transmitted and 5 recieved 0% loss


----------



## tomdkat (May 6, 2006)

Cool. Now, start up your browser on UBUNTU (Firefox or whatever) and tell me what happens when you access:

http://localhost/

Peace...


----------



## gina12 (Jan 12, 2012)

ok done that and it says not able to connect i am using firefox .... but i have that set to host only also..


----------



## gina12 (Jan 12, 2012)

cannot connect to server


----------



## tomdkat (May 6, 2006)

Ok, cool. What do you mean by "I have that set to host only also"? Do you mean Firefox? Based on your comments above, your VirtualBox guest should already be set to " host only" mode for the network adapter, correct?

Now, on your UBUNTU server, make sure Apache is actually up and running. You can issue the "netstat" command to confirm it's listening on port 80 and the "ps" command to make sure the daemon is running.

The netstat command is:

netstat -a | grep LISTEN | more

That should show all of the ports in a "LISTEN" state. You should see the port Apache is configured to listen on in that list.

You can confirm the Apache daemon is running with this command:

ps ax | grep http

or 

ps ax | grep apache

I forget if the Apache daemon runs as "httpd" or as "apache" (maybe "apache2") on Ubuntu and I'm not in a position to fire it up on my system right now. 

Report back the results of those commands.

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> cannot connect to server


Are you actually getting a "Problem loading page" error page in Firefox? Or are you getting that "cannot connect to server" message in a browser on Windows?

Remember, right now we're doing EVERYTHING in the Ubuntu server, including running Firefox. 

Peace...


----------



## gina12 (Jan 12, 2012)

god lol your not gonna believe this lol ok im using us keyboard but have it set to irish so my keyboard layout is differant to where the symbols are and now i i cant find the stright line symbol sorry about this now any suggestions ???


----------



## gina12 (Jan 12, 2012)

usually wen i press alt gr and the key beside num 1 the pipe character works on an irish keyboard


----------



## tomdkat (May 6, 2006)

Yep, switch your keyboard to 'US' and restart the VM as necessary. Then, run the commands I posted above. 

Peace...


----------



## gina12 (Jan 12, 2012)

ok how to change my keyboard setting in virtualbox back to us? i set it up on installation to irish how can i set it back to us ??? are you sure you dont want to log on lol i cant even get a simple command to work here..


----------



## tomdkat (May 6, 2006)

Yep, I'm sure. This is about getting YOU up to speed on your configuration. 

You'll have to switch the keyboard layout setting from within Ubuntu, not VirtualBox.

If you can't get the pipe character to display, you'll have to find another way to verify that Apache is up and running. So, how do you normally start Apache?

Peace...


----------



## tomdkat (May 6, 2006)

In the "System Settings" utility on Ubuntu, there is a "Keyboard" icon in the "Hardware" section you can double-click to start the keyboard utility. Using that, you can change your layout to US and install that layout, if necessary.

On a side note, why did you choose the Irish keyboard when you installed Ubuntu? 

If switching keyboard layouts isn't something you can figure out, you'll either need to find a way to get the vertical bar (the pipe character) generated in the commands or find another way to confirm Apache is actually up and running. You could possibly use telnet for this but we'll try that if you can't switch the keyboard layout or if you can't figure out how to get a vertical bar generated.

Peace...


----------



## gina12 (Jan 12, 2012)

let me try work this out and run the command i will post the output to you and we will take it from there im running into every problem a person can have lol thanks you ur time tonight and ur help i will work this out now and post you the output.
Gina.


----------



## tomdkat (May 6, 2006)

Sounds good. 

Peace...


----------



## gina12 (Jan 12, 2012)

lol i set it to irish cos im in ireland and it is wat im used to but my pc was sent from south africa and they use a us keyboard lay out..... I went into setting in unbuntu and i dont see anywhere that i can change the keyboard layout..


----------



## tomdkat (May 6, 2006)

Did you see the "Keyboard" icon in the "Hardware" section? If so, double-click it and when the keyboard settings appear, in the lower right corner of the window, you will see a "Layout settings" link. Click that and you can change the layout.

Peace...


----------



## DVOM (Jun 21, 2002)

If you google "linux pipe character" you'll find some work arounds. On my US keyboard it's "shift + \", on some UK keyboards it's shift plus the broken pipe.


----------



## tomdkat (May 6, 2006)

Thanks for the info! :up:

Peace...


----------



## gina12 (Jan 12, 2012)

ok im back yes thanks for the help .. ok ran the command you said to view what ports are lisening and its not showing any at all.... I can see apache2 is running using the ps ax command but when i try restart or stop apache2 i get an error saying ' could not reliably determine the servers fully qualified domine name using 127.0.0.1 for servername.
Gina.


----------



## tomdkat (May 6, 2006)

hmmm, if you can see the apache2 daemon running but netstat doesn't show ANY ports in the "LISTEN" state, that's not good. It's CRITICAL that you typed the command exact as I entered it above:

netstat -a | grep LISTEN | more

LISTEN must be in all capital letters. Otherwise, run this command:

netstat -a | grep -i "listen" | more

That tells grep to ignore the case of "listen". 

One other thing, when you had the server running and you issued the "ifconfig" command, who many interfaces appeared in the output? Did you see ONLY the loopback interface or did you see two interfaces displayed?

Peace...


----------



## tomdkat (May 6, 2006)

Do you know on which port Apache is configured to listen in your Ubuntu server installation? On my Ubuntu system, I have Apache configured to listen on port 8069. As a result, when I fire it up, netstat output looks like this:

```
tcp        0      0 localhost.localdoma:ipp *:*                     LISTEN     
[b][color=red]tcp        0      0 *:[u]8069[/u]                  *:*                     LISTEN     [/color][/b]
tcp        0      0 *:5900                  *:*                     LISTEN
```
So, you should see a similar entry in your netstat output. It might appear as "http" or "8080" on your system. If you don't see ANY port listed in a LISTEN state that corresponds to whatever port Apache is configured to listen on, you won't be able to contact the web server from any browser at all.

Peace...


----------



## gina12 (Jan 12, 2012)

hi again i have run the two commands exactly how you have wrote and its telling me bad syntex i also thought that was the problem so i looked it up and its correct... at first i got no output and now im getting bad syntex...... yes when i done ifconfig there was also etho there....


----------



## gina12 (Jan 12, 2012)

im getting nothing at all now with neither command


----------



## gina12 (Jan 12, 2012)

no sorry i dont no what port it is on, how can i find out?


----------



## tomdkat (May 6, 2006)

gina12 said:


> hi again i have run the two commands exactly how you have wrote and its telling me bad syntex i also thought that was the problem so i looked it up and its correct... at first i got no output and now im getting bad syntex...... yes when i done ifconfig there was also etho there....


You must have entered something incorrectly. When I issue the netstat command, it works fine:


```
[email protected]:~$ netstat -a | grep LISTEN | more
tcp        0      0 localhost.localdoma:ipp *:*                     LISTEN     
tcp        0      0 *:8069                  *:*                     LISTEN     
tcp        0      0 *:5900                  *:*                     LISTEN     
....
```
When you ran the ifconfig command, what IP address was assigned to eth0? We need to find out on which port Apache is configured to listen. Without that info, you won't get very far.

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> no sorry i dont no what port it is on, how can i find out?


You'll have to look in the Apache config file. Try looking in /etc/apache2/apache2.conf for starters.

Peace...


----------



## gina12 (Jan 12, 2012)

I got it using netstat tulpn command and port num is 3036,, tcp is lisening and tcp6 is lisening on ports 80 and 22.
Gina


----------



## gina12 (Jan 12, 2012)

I dont see apache2.... there is no ip in eth0


----------



## tomdkat (May 6, 2006)

Ok, cool. Now, let's see if we can get connected to Apache using telnet. On the Ubuntu system, the SERVER, open a terminal window and issue this command:

telnet localhost 80

You should see output similar to this:

```
[email protected]:~$ telnet localhost 8069
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
[email protected]:~$
```
Let me know if you see the "Connected" message or not. The netstat output you mention above indicates something is listening on port 80 on the IPv6 stack, not IPv4 but that might be a buglet in the netstat command:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453272

For now, just let me know if you can get connected using telnet on the Ubuntu SERVER to connect to Apache. Also, let me know which IP address got assigned to eth0 on the Ubuntu server.

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> I dont see apache2.... there is no ip in eth0


If you're telling me eth0 is NOT getting an IP address assigned, you won't be able to contact that server from any other system, whether it be the host OS or another gust OS running in another instance of VirtualBox. Have you made ANY VirtualBox changes since you set the guest network adapter to use "host only"?

Peace...


----------



## gina12 (Jan 12, 2012)

nope didnt make any changes.... on eth0 im getting ipv6 addres but no ip4...... i have used the comand telnet localhost 80 and got a connection for a min and then it cuts out saying ''connection closed by a foreign host


----------



## gina12 (Jan 12, 2012)

Its the exact same output as your


----------



## tomdkat (May 6, 2006)

EXCELLENT! That's GREAT NEWS, actually. Ok, so the fact you're getting IPv6 addresses and not IPv4 addresses is something we'll need to look at.

Now, after doing some research into the "host only" network adapter configuration in VirtualBox, I have to ask. Is the idea to have Ubuntu server running in one VirtualBox session and an Ubuntu desktop client running in another VirtualBox session? Or are you wanting to have Ubuntu server running in a VirtualBox session and being able to access it using browsers on Windows? Or is the idea to do both?

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> Its the exact same output as your


I haven't posted my ifconfig output yet (I will shortly). If you're referring to my netstat output above, the "netstat tunlpn" output is different than the "netstat -a" output but as long as you've seen something listening on port 80, that's the important part. We've confirmed Apache is up and running on listening on port 80 *and* that you can connect to Apache on port 80 using telnet.

Now, on the Ubuntu SERVER, fire up Firefox and point it at:

http://localhost/

and report back what happens. It's important that you DO NOT use Firefox on Windows but Firefox on the Ubuntu Server.

Peace...


----------



## gina12 (Jan 12, 2012)

well my project is to compare LAMP vs WAMP so i would like to be able to access it through windows so yes i would like to do both also.....in my virtualbox i have server and client in the one virtual machine,


----------



## gina12 (Jan 12, 2012)

Im sorry now but iv never ran it from the server before.....???


----------



## tomdkat (May 6, 2006)

gina12 said:


> well my project is to compare LAMP vs WAMP so i would like to be able to access it through windows so yes i would like to do both also.....in my virtualbox i have server and client in the one virtual machine,


Ok, if you want to access the web server from a browser on Windows, you want a "bridged" network adapter setting, not "host only". From what I've been reading, a "host only" network adapter setting is useful if you have multiple virtual machines (think MUTLIPLE instances of VirtualBox running concurrently) that you want to have communicate with each other but NOT allow network connections from remote systems. If you have a "bridged" network adapter setting for the Ubuntu server guest OS, you should be able to ping the guest OS and get replies back and vice versa.

So, are you running only ONE VirtualBox instance with the Ubuntu server as the guest OS or are you running TWO VirtualBox instances, one with Ubuntu server running AND one with Ubuntu desktop running? If you're running only ONE instance of VirtualBox, try changing the network adapter setting to "bridged" for the Ubuntu server guest OS and when you run "ifconfig" in a terminal window on Ubuntu, you should see an IPv4 IP address that's on the same subnet as your Windows host system.

I'm going to configure my Fedora 15 guest OS the same way and will report back my findings. I have Apache installed (now) in my Fedora 15 installation so I'll be able to try out the things I'm suggesting you do as well.

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> Im sorry now but iv never ran it from the server before.....???


Cool. Previously, I asked you to run Firefox ON the Ubuntu Server so we could make sure Apache was functioning correctly.

If you have graphical access to the Ubuntu server desktop, meaning you can see a desktop with icons as if the Ubuntu server was running natively on the system, you should see an icon for Firefox. If not, open your terminal window ON THE UBUNTU SERVER  and type "firefox" and it should start.

If you DO NOT have graphical access to the Ubuntu server, we can run tests from the Windows side to make sure you're able to contact the guest OS ok.

By the way, what kind of class are you taking? Is this at a University or something?

Peace...


----------



## tomdkat (May 6, 2006)

After thinking about this more, I think you shouldn't have needed to change the network adapter from the default of "NAT" to whatever you tried. We'll proceed with using a "bridged" setting for now and then revisit the need to make any network adapter changes at all later. 

Peace...


----------



## gina12 (Jan 12, 2012)

Im in college yes im a mature student on my 3rd yr studying System Engineering/ IT support..... and no I have no GUI lol if it was that easy hey lol im in CLI ....now firefox was not installed so i installed it but i dont think that is working also ..its running like they are being installed but all im seing is failed to fetch http://................... its not fetching anything


----------



## tomdkat (May 6, 2006)

That's fine. See if one of these character mode browsers is installed:

lynx
links
link2

Type each one like this, until you get a hit. 

lynx http://localhost/
links http://localhost/
links2 http://localhost/

If any of those is installed, you can use that to see the default Apache web page. If not, you can install one of them from the command line using "apt-get".

Peace...


----------



## tomdkat (May 6, 2006)

Ok, I just conducted a test and was able to load the default Apache page on Fedora 15 (inside VirtualBox) from my browser running on the host OS (Ubuntu running natively on the system, OUTSIDE of VirtualBox).

Let me know when you have a character mode browser installed.

Peace...


----------



## gina12 (Jan 12, 2012)

ok I changed the adp to NAT and installed firefox using the apt-get but i want to be able to my sever through my client (ubuntu Desktop) by opening my browser in there and typing http://localhost I want the client to be able to see the server.... Thanks a million for your time tonight and all your help, I must go sleep can we continue trying to get me to my goal lol tomorrow or went you have time...thanks again


----------



## tomdkat (May 6, 2006)

Gina, I have to ask that you SLOW DOWN here. You changed the adapter setting to "NAT" before I asked you to. We have to work at the same pace so I'll know what you're doing on your end. I have everything working on my system with the network setting for the guest OS as "bridged adapter". Since yours is currently set to "NAT", DO NOT CHANGE IT. For now, focus on getting the character mode browser installed and we'll use that to make sure you can access Apache on the Ubuntu server. Once we can do that, we'll make sure the guest OS and the host OS can "see" each other. Then, we'll get you connected from a browser on the host OS to the web server on the guest OS. That's the plan.

For now, just get a character mode browser installed and we can go from there. If you're not sure which one of the ones I listed above to install, install links2 like this:

sudo apt-get install links2

Unless you're logged in to the server as root (tisk-tisk if you are), which means you can drop the "sudo" part.

Good night and we can resume this tomorrow. In the meantime, I'll get my guest set back to NAT and make sure everything works.

Peace...


----------



## tomdkat (May 6, 2006)

Ok, here is more information. Again, ALL I would like for you to do at this point is to get the character mode browser installed so we can make sure Apache is working properly on the Ubuntu server. Then, we can move on to getting access to the web server on Ubuntu from Windows and elsewhere.

Here is what I found: I was able to get the browser on my host system accessing Apache running in VirtualBox three ways:

1) With VirtualBox configured with the guest network adapter set to NAT:
For this, I had to configure port forwarding. Once I got the ports worked out right, this worked perfectly.

2) With VirtualBox configured with the guest network adapter set to "Bridged Adapter:
This is the most straight forward configuration and worked the first time I tried it.

3) With VirtualBox configured with the guest network adapter set to "Host Only Adapter":
This was about as straight forward as using the "Bridged Adapter" but not quite.

In the cases of configurations 2 & 3, I had to use the IP address of the guest OS (which is easy to obtain). Once I had that (and I configured the firewall to allow the inbound HTTP traffic), I was able to connect to the web server from the browser on my host system without problems.

In the case of configuration 1, I was able to access the web server using "localhost" as the address but I had to specify the correct port.

Once we've confirmed Apache is working properly on the server, itself, we can figure out which of these configurations is best for you.

Peace...


----------



## gina12 (Jan 12, 2012)

Hi good afternoon,
Ok i have installed links2 on my server with the adaptor set to nat I havent changed that since we spoke last night, i have just followed your instructions...... and awaiting .... NOTE i am using the command line (black and white screen) and my desktop edition have the nice GUI but at the moment we only working with the server (CLI).
Gina.


----------



## tomdkat (May 6, 2006)

Great! Now, that links2 is installed, please run this command ON THE UBUNTU server. 

links2 http://localhost/

and report back what happens.

Thanks!

Peace...


----------



## gina12 (Jan 12, 2012)

i got a window saying it works yippppe  so im ready for the next step


----------



## tomdkat (May 6, 2006)

Ok, so you got the default Apache "Welcome to Apache" page? Cool!

Ok, now, let's get your Ubuntu server talking to Windows. Since the guest OS, Ubuntu server, is configured with "NAT" as the adapter type, we need to get port forwarding setup. Previously, you mentioned you had port forwarding configured. What *exactly* did you get setup as the port forwarding rules? How did you get those rules setup?

Peace...


----------



## gina12 (Jan 12, 2012)

no i got "it works" on running the command http://localhost and yes server is set to NAT ...i dont remenber doing any port forwarding????


----------



## tomdkat (May 6, 2006)

Ok, I guess I misread your initial post in this thread. Now, we need to setup port forwarding in VirutalBox and it's really easy.

Here's how it works: when port forwarding is enabled in VirtualBox, VirtualBox *itself* will listen on the port it's configured to listen on and will automagically forward requests sent to that port to the corresponding port in the guest OS. So, let's say you configure VirtualBox to forward traffic IT receives on port 8080 to port 80 in the guest OS. VirtualBox will listen on port 8080 and will forward any traffic received on that port to whatever is listening on port 80 in the guest OS.

Since Apache is listening on port 80 in the guest OS (Ubuntu server), all we need to do is tell VirtualBox on which port to listen for incoming requests.

So, EXIT your current guest OS (the Ubuntu server) to make sure our changes are made cleanly.  Once the guest OS session has ended, go to the VirtualBox network settings for the guest OS. You will do this on Windows since Windows is your host OS (the OS on which you're running VirtualBox). Once in the network settings for the guest OS, click "Port Forwarding" to setup the port forwarding rules. I suggest specifying '8080' as the "Host Port" and "80" as the guest port and leave the other fields alone. Save those settings and then startup your guest OS.

Attached are some screen shots to help guide you.

Let me know if you have any questions.

Peace...


----------



## gina12 (Jan 12, 2012)

I will just run through the set up that I have done before to see my server through my client,
1) i set adp 1 to NAT and adp2 to INTERNAL on the SERVER and on the client
2) I used the vi editor vi /etc/network/interfaces to create an eth1 both on server and client with the following:
IP 192.168.100.10 on sever, 192.168.100.20 on client
mask 255.255.255.0 
network 192.168.100.0
broadcast 192.168.100.255
and then i had to apply system wide on the client and thats where it all went wrong.. but now b4 we spoke i installed a hold new server and that is what we have been working on now... so no network configured on the one we working on.


----------



## tomdkat (May 6, 2006)

Hold on, slow down. If you do that, you will lose me and I'll stop helping you. One step at a time. 

Peace...


----------



## gina12 (Jan 12, 2012)

No i havent done that Im just explaning to you that i have done that before on differant machines...... but i have set up port forwarding like you said with host set to 8080 and guest to 80 and have started up the server again....


----------



## tomdkat (May 6, 2006)

Ok, cool. Now on the Windows side, open your browser (IE, FIrefox, whatever) and point it at:

http://localhost:8080/

and let me know what happens. Sorry for the delay but I'm having some system performance issues due to my overloading my system. 

Peace...


----------



## gina12 (Jan 12, 2012)

its fine im also slow trying to make dinner also lol yipeeee that worked you a star ......... now if we can get my client (desktop ) talking to my server im can move on with this project before i get any more stressed out


----------



## tomdkat (May 6, 2006)

Excellent. Ok, now we can talk about your Ubuntu desktop client a bit. I'm still a bit fuzzy on your configuration so I need to come up to speed on that. First, in my VirtualBox screen shot above, you can see I have 4 virtual machines defined; two for ChromeOS, one for OpenSolaris, one for Windows 2000, and one for Fedora 15.

Do you have only ONE virtual machine configured in VirtualBox or two?

Also, how do you start your Ubuntu server (which steps do you follow) and how do you start the Ubuntu desktop client?

Peace...


----------



## tomdkat (May 6, 2006)

gina12 said:


> its fine im also slow trying to make dinner also lol yipeeee that worked you a star ......... now if we can get my client (desktop ) talking to my server im can move on with this project before i get any more stressed out


So, when you loaded localhost:8080 in your browser on Windows, you received the same "It Worked" page like you did in links2 on the Ubuntu server?

Peace...


----------



## gina12 (Jan 12, 2012)

yes it was the same in browser and links2 it was the same message :it works" ...... now in my virualbox i have the server and the client(desktop) edition ubuntu 11.10......both virtual machines are in virtualbox like your screen shot but i only have server and client defined ...... To start any of them i click on them and click start and log in using my username and password.


----------



## gina12 (Jan 12, 2012)

oh yes and the adp on the desktop is at the default NAT .....


----------



## tomdkat (May 6, 2006)

gina12 said:


> yes it was the same in browser and links2 it was the same message :it works" ...... now in my virualbox i have the server and the client(desktop) edition ubuntu 11.10......both virtual machines are in virtualbox like your screen shot but i only have server and client defined ...... To start any of them i click on them and click start and log in using my username and password.


Cool, so you click either virtual machine to start them individually. That's good.  I'm tracking with you.

Now, because NAT is being used, you can't get the TWO virtual machines to communicate with each other. Now that we know you ARE able to reach the web server in the Ubuntu server VM from outside of the Ubuntu server VM, it should be easy to get everything working the way you want.

So, now I want you to do this:

1) Stop ALL virtual machines so NONE are running.
2) Edit the network settiings for EACH VM and change the adapter to either "Bridged" or "Host Only Adapter". The one you choose will depend on your preferences. Here's a brief description of the differences of the two:

Bridged: connects the VM to the LAN as if it were a real computer, such that it will get an IP address assigned from the SAME DHCP server your Windows system gets its IP address from. If your Windows system is connected to a router, the VM will get its IP address from that same router and will get an IP address in the same subnet as your Windows system.

Host-only: sets up a LAN between the VMs and the host computer (your Windows 7 system). You will be able to contact the VMs and the host computer from any VM or the host BUT the IP address you get will be something you will need to pay attention to.

From a security standpoint, the "host-only" option is better because no other systems on your real LAN will have access to the VirtualBox LAN. From a simplicity standpoint, the "Bridged" option is easier because you can access each system using an IP address on the same subnet.

So, choose which one and let me know so I can configure VirtualBox the same way.

3) After you choose which network adapter mode you want to use (Bridged or Host-Only), configure EACH VM with that adapter mode.

4) Fire up each VM and make sure Apache is running in the Ubuntu Server VM

5) Report back here your status and let me know which networking adapter mode you chose.

We're much closer than you might think. 

Peace...


----------



## gina12 (Jan 12, 2012)

Im going to go with Bridged I will report back in a min..


----------



## gina12 (Jan 12, 2012)

ok iv set both to BRIDGED and checked my status of apache2 on my server and the out put is "apache2 is running on (pid 734) and in windows browser it is working but in the browser in my client (in virtualbox) i get cannot connect but i can browse the internet ....


----------



## tomdkat (May 6, 2006)

gina12 said:


> ok iv set both to BRIDGED and checked my status of apache2 on my server and the out put is "apache2 is running on (pid 734) and in windows browser it is working but in the browser in my client (in virtualbox) i get cannot connect but i can browse the internet ....


Ok, cool. In EACH VM, I want you to open a terminal window and issue this command:

ifconfig

Report back which IP address each VM was assigned.

Thanks!

Peace...


----------



## gina12 (Jan 12, 2012)

ok on server i got 192.168.1.4 and on desktop client i got 192.168.1.6 mask 255.255.255.0


----------



## gina12 (Jan 12, 2012)

and they both on eth0


----------



## tomdkat (May 6, 2006)

Excellent! Now, on the Ubuntu server, issue this command:

ping -c 5 192.168.1.6

on the Ubuntu desktop, issue this command:

ping -c 5 192.168.1.4

You should get 5 "pongs" from each ping. If you do, open a command window on your Windows 7 system and run this command:

ipconfig

record the IP address and it should be in the 192.168.1.nnn subnet. You can then issue these commands:

ping 192.168.1.4
ping 192.168.1.6

you should get "pongs" from both ping commands.

If all of that works, then you can point your browsers on BOTH Windows AND Ubuntu Desktop to this URL:

http://192.168.1.4/

and you should get the SAME "It Worked" page from Apache.

If you get the "It Worked" page in both browsers, you have managed to get your two VMs talkng to each other and both VMs can talk to the Windows host.

At this point, you can configure Apache as necessary to get it setup so you can conduct your LAMP vs WAMP testing.

Let me know how it goes. 

Peace...


----------



## gina12 (Jan 12, 2012)

I dont no how to thank you honestly all is working and pinging fine n apache working u have saved me a lot of time and heartship lol im so greatfull and you have patients of a saint  if i run into any more problems i will be in contact with you if thats ok......once again thanks a million for all yout time and help.

Regards,
Gina.


----------



## tomdkat (May 6, 2006)

Great! Glad it's working now! 

Please mark this thread as "solved". You can do that by using the "Thread tools", I think, in the first post of this thread.

If you have any more Linux questions, please start a new thread in this forum.

If you have VirtualBox questions, I guess the "All Other Software" forum is the best place to ask.

Good luck with your LAMP vs WAMP testing!

Peace...


----------



## gina12 (Jan 12, 2012)

thanks a mill i maked this sorved  im sure ill be in touch again soon take care and god bless


----------

