Can I run a web server in Virtualbox?

I just wanted to know if it’s possible to run a web server from within Virtualbox. I would install Open SuSE 10.3 on it. It would be command-line only, hardened, and with minimal packages. Or, should I use a sandbox instead? I’m trying to read about sandboxes to learn what they are, but I’m relatively new to the Linux world, and I don’t quite understand what sandboxes are yet. Any advice would be appreciated.

Sure, but you have to arrange to forward the web requests to it, either by portforwarding, or by assigning a bridged interface to the vbox instance. This is explained in the vbox documentation.

BTW, a webserver running in a vbox is just as susceptible to defacement as one outside, it’s just that by putting a vbox around it, you can prevent access to other things on the machine.


So If I understand correctly, it would more advisable to virtualize the webserver if the tower is being used for more than just a webserver?


Yep, I think ken_yap meant that it’s actually a good thing if a server is inside a virtualbox environment, because then if someone cracks it, they’ve only managed to crack the virtualbox machine, not your actual computer.

But you see these days they are not so interested in other stuff on your computer, unless you have credit card numbers, customer info and that sort of thing. They are interested in using SQL injection, cross-site scripting and other vulnerabilities to use your machine to redirect browsers to malware sites. Since you are hosting a LAMP stack on the vbox, that LAMP stack is just as liable to being attacked as one not in a vbox.

Got my attention, because in my case, my LAMP stack is on the same tower as in my home fileserver. (Yes it is on a WinServer2003 too, :o)

I have always wondered about that, even though apache docs says the version I use, it is nearly impossible to get through.