Running Apache and PHP on Windows with XAMPP or WAMP sucks, because installing new PHP extensions on Windows is very hard. Most binary releases for Windows don't work :(

So I was thinking to run Ubuntu from Virtuabox, and install Apache and PHP in Ubuntu.

What I am asking is if is it possible to set up the server in Ubuntu (the virtual box), and see it working in the browser under Windows.

So if I type "localhost" outside the VM, in Chrome/Win, it should display a webpage that is running under the Apache server from Ubuntu.


The virtual machine will (and should) behave like another computer on your network.

Just make sure you set the networking adapter to Bridged Adapter:
enter image description here

Then you will be able to open the website by surfing to the IP address of the virtual machine, like To get the IP address of the virtual machine, just run ip a in a console.

It is definitely not required to run in bridged mode, but it is often the easiest mode to work in, as it will allow the virtual machine to behave just like another client on the network.

  • cool :D "It works!" Do you know if there's a way to share the var/www folder to windows? – maryjane May 17 '13 at 15:08
  • @maryjane: Well, there is really nothing special in that regard with this setup. You could try sharing it with Samba or by setting up an FTP server like vsftpd. Maybe you can even simply access it through SSH. Depending on what tool you use to work on your project, the latter option might actually be the easiest. – Der Hochstapler May 17 '13 at 15:42
  • Thanks! I've installed vsftpd but it seems I can only modify the user dir even if I log in with the administrator account. Anyway I'll try the samba thing (for developing I'm just using Sublime2 text editor) – maryjane May 17 '13 at 16:16
  • @maryjane: It might be a configuration issue with vsftpd. By default, you land in your home directory, that's normal. Depending on the configuration, you can navigate to higher up folders though. Look for the line chroot_local_user=YES in the configuration. You either want to have it commented out or set to NO. There seems to be a plugin for Sublime that bring SFTP (SSH) support: wbond.net/sublime_packages/sftp Maybe that helps :) – Der Hochstapler May 17 '13 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.