Page 1 of 2
Question about integrating guest LAMP server in Windows
Posted: 26. May 2009, 00:28
by ReyJavikVI
So here's the thing. I've found that Apache/MySQL/PHP is easier to setup in Linux than in Windows, so I'm looking for a way to run a virtual machine with the Ubuntu server and edit settings and stuff like that from there, but manage the actual files, directories and view the sites from Windows. Is there a way to accomplish this, or maybe an alternative?
Re: Question about integrating guest LAMP server in Windows
Posted: 26. May 2009, 14:27
by Sasquatch
You can connect to the Guest using SSH, so you can control the VM from Windows. Other settings, like the database can be used with phpmyadmin. Install it on the Guest (if it isn't already), configure it for your current MySQL install and with the proper network settings (check the Manual for the different options you have available, chapter 6), you can mange it from the Host browser.
Re: Question about integrating guest LAMP server in Windows
Posted: 26. May 2009, 18:15
by ReyJavikVI
Thanks, but how can I see the site from the host? Is the guest assigned an IP address?
Re: Question about integrating guest LAMP server in Windows
Posted: 26. May 2009, 19:09
by TerryE
Read the networking section in the user guide.
If you want to make the VM accessible to other PCs on your LAN choose a Bridged network. With this the VM with pick up its IP address from whatever DHCP host is serving the LAN. If the host is running DNS, then it will register itself.
If you want to use the VM only inside host PC then choose a Host Network.
Knowing what the IP address is is a little more problematic. It depends on how it acquires it. The easiest way is to run ifconfig inside the VM and then put an entry in your %windir%\system32\drivers\etc\hosts file.
Re: Question about integrating guest LAMP server in Windows
Posted: 26. May 2009, 19:31
by ReyJavikVI
Thanks.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 00:29
by ReyJavikVI
I've tried but no luck. This is the thing: no matter what I do, I can't get it to have connectivity to Internet and the host machine at the same time. Could someone give more precise help, please?
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 00:48
by TerryE
Use a Bridged Network. This should do the trick.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 01:26
by ReyJavikVI
That doesn't work. It can't resolve domain names, and its IP address is 127.0.0.1, which is not what I want.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 12:42
by Sasquatch
ReyJavikVI wrote:That doesn't work. It can't resolve domain names, and its IP address is 127.0.0.1, which is not what I want.
That's your loopback address. You need to have more than one NIC listed in ifconfig output. What do you get when you enter
ifconfig -a? If you don't run a DHCP server on your network, like a router, then the Guest won't get an IP address.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 14:11
by ReyJavikVI
I ran ifconfig -a, but still the only IP address I see is 127.0.0.1. However, in the Ethernet section there is a MAC address. I don't know if that's useful, but it's there.
Could this have something to do with the fact that I have wireless? The manual says that wireless is supported in recent versions of VirtualBox.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 14:17
by baf
Post the output from ifconfig -a here. If we don't see it we can not check it.
How is your hosts wireless configured? Dhcp? Static ip address?
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 14:43
by Sasquatch
If ifconfig -a doesn't show an eth0 or similar, you don't have a NIC defined in the VM settings. Or the module isn't loaded, which I doubt.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 15:57
by ReyJavikVI
Wireless with DHCP is configured on the host and works correctly. This is the output from ifconfig -a:
Code: Select all
eth4 Link encap:Ethernet HWaddr 08:00:27:98:7b:9a
BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:11 Base address:0xc020
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
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)
Hope this helps
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 16:06
by Sasquatch
That certainly helps. I'm pretty sure that your Guest OS config is for eth0, or eth1 at most. It doesn't have anything for eth4. You need to remove the following file, which will be regenerated when you reboot the Guest.
/etc/udev/rules.d/70-persistent-net.rules
Now it should set the configuration you made for eth0.
Re: Question about integrating guest LAMP server in Windows
Posted: 30. May 2009, 16:29
by ReyJavikVI
Thank you so much!
Now just a little question: can I give it a static IP address?