How to configure a Web Server within VirtualBox

The point of the project was this, create a web server using VirtualBox and host it on a Windows 7 64-bit platform. And why would I do something odd? Well, I need a copy of Windows 2003 Server Web Edition running on a new platform since the physical PC it was running on literally tore itself to pieces. The drives failed and the cost of buying EIDE drives is just a waste of money.

So why not just upgrade? Well, I will in the future, but I was actually using that machine. I’m familiar with 2003 and had everything dialed in the way I like it. And why host it in Windows 7? That’s the host OS of my most powerful machine, a 6-core machine with 16GB of ram. No sense in rebuilding everything when Windows 2003 Server isn’t multicore aware and only accesses 4GB of ram. But anyway, the OS and the host are sort of irrelevant, it’s the configuration that’s important. So here’s what I did.

First, within VirtualBox, change the networking from NAT to BRIDGED ADAPTER. Select the physical network adapter you want your host machine to connect to. If you have more than one network card, pick which one you want the Guest OS using. My machine has both wired and wireless NICs. I set VirtualBox up on the Wireless NIC.

image

Second, pick the Virtual network card you want the guest OS to emulate. I chose the Intel Pro/1000 MT.

Third, boot the Guest OS and change the IP address of the virtual machine to the same IP address as your internal network. By default VirtualBox using 192.168.56.1. You Guest machine will probably have a similar address. Change it over to the same IP range as the guest machine, something like 192.168.1.xxx. For example, my host is 192.168.1.100 so the guest is 192.168.1.101. You need to give it a static IP address so you can set the Port Forwarding on your Router.

image

Fouth, set Port forwarding on your router. Send traffic destined for port 80, 21 and whatever else you like (such as RDP) to the internal address of the Guest machine. Again, if the Guest is 192.168.1.101 then forward the traffic to that address. DON’T send anything to the VirtualBox network address of 192.168.56.xxx.

image

Finally, make sure to DISABLE all POWER MANAGEMENT functions of both the HOST and GUEST OS. And not just for the machine and hard drives. Make sure you turn it off for the Network Cards. Your Server OS probably doesn’t have anything, but the Host might. My Windows 7 machine had Power Management turned on for both NICS. Disable that or your web server won’t get any traffic. For Windows 7 – Control Panel – Power Options – Change When the Computer Sleeps.

For the network card, Control Panel – Network and Internet – View Network Status and Tasks – Change Adapter Settings – Pick the BRIDGED ADAPTER you selected in VirtualBox, Right Click and choose Properties – Click Configure for the networking device itself. Click the Power Management tab to turn off any power saving options.

image

image 

That should be it. I now have Windows Server 2003 on the live web and it loads PHP, HTML and ASPX pages just fine. In fact, it’s faster than it ever was on the old hardware. Now I can load Windows Server 2008, configure it within it’s own VirtualBox, load all the correct modules and make the switch when I’m ready. Plus, I can have a standby server by making a copy of the VHD files.

This is specific to Windows 7 and Server 2003, but the concept is the same. You need to configure a BRIDGED APAPTER and configure a STATIC IP ADDRESS in the Guest OS. From there, you should have it all set.

Other articles of interest:

2 Responses to How to configure a Web Server within VirtualBox

  • venkat says:

    Hi,

    I had set up windows server 2003 in my windows 7 with bridge network connection. I have used dnsafraid to configure my ip. The problem i am facing is that when i hit my domain name say http://www.abc.com on the browser the page that is being displayed is my router entry page http://192.168.1.1/ and it prompts for username and password. I had also configured nat – virtual server in my router page as follows. NAT — Virtual Servers Setup as follows. Pls help me with this issue. The ip of my windows server within the lan is set to 192.168.1.4. Can u help me find out the mistake i am doing while configuring i have been trying for about a week. pls help me.

    Virtual Server allows you to direct incoming traffic from WAN side (identified by Protocol and External port) to the Internal server with private IP address on the LAN side. The Internal port is required only if the external port needs to be converted to a different port number used by the server on the LAN side. A maximum 32 entries can be configured.

    Server Name External Port Start External Port End Protocol Internal Port Start Internal Port End Server IP Address Remove
    Webserver2003 80 80 TCP/UDP 80 80 192.168.1.4

    • Don Pedro says:

      It sounds like the port forwarding isn’t set up correctly on the router itself. You’re making it to the inside network but the traffic isn’t being sent to VirtualBox. There should be something in the router that sends your HTTP traffic to the correct IP address of your Virtual Machine.

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments
  • How To Download Movies From Hulu Using Freemake Video Downloader (1)
    • Doomups: I often use allavsoft to download Videos from Hulu on Mac and Windows. And it also can batch and Direclty Download Hulu Videos to MP4, WMV, MOV, AVI, FLV, etc.
  • Why is Daemon Tools Lite triggering Norton Internet Security Anti-Virus? (1)
    • Jaguar: What’s an alternative to using daemon tools? That would be useful to know.
  • Loot Drops for the last few hours of Season Surprise Event – Crime City (1)
  • Topping out with a Trillion Dollars in Crime City (13)
    • Don Pedro: So, just to show how ridiculous things have become, a few weeks ago, I crossed over the 3 Trillion mark in cash. My income has moved to 525.7M IPH. I have both Luggage Lugger buildings upgrading and am working to upgrade the...
    • Tom Offski: Thank you
    • Don Pedro: My income is all from buildings. I have just about every LTB they’ve introduced. I skipped one or two based on their enormous size and terrible income/upgrade costs. Almost all of those buildings are now level 10s. The...
    • Tom Offski: Hey, I’ve been playing sonce 2013, but stopped for a year and a half mid-way. My IPH is 1.05m, and my main source of income is a certain job which gives you 2-7mil for 178 energy… how do you make so much money? Is...
    • Don Pedro: I am very familiar with the time of which you speak. That is when I first came on board as well. There were some good prizes back then such as the decrease in deposit fee. Some of those old buildings are somewhat laughable...
    • Duane Stovall: Yeah 3 of the 5 building upgrades are working on the older regular buildings now. I’ve got all the LTB’s up to level 10. Started playing when FUNZIO owned CC…so was able to purchase every LTB that came...
    • Don Pedro: Upgrading 5 buildings at a time? Damn son! And your IPH is a lot higher than mine. I’ve only got 485 with 3 upgrades at a time, of which I’ve only been using 2. I’ve thought about getting another upgrade...
    • Duane Stovall: I’m up to 517mil iph…just hit my first trillion in the bank. Would have hit a while back…but started a baby syn for my two smaller accounts and maxed out most of the bonuses with the help of one other...
    • Up!: Wow, and here I come with 2m iPH trying to build up a syn.. How long have you been playing? I do think that for normal accounts (without the reduction) its cheaper to leave the money out, being robbed 10% .. would mean in my case 5m...
  • Put another trillion on the fire – Crime City (1)
    • Paul: Im right behind u Scabby at 425 mil iph!! Wish there were better 12 hour buildings coming out
  • New version of Freemake Video Downloader brings back YouTube Playlist downloads (1)
    • ALI: Hi there, I have been trying to download a playlist contains more than 300 episodes but when I copy and paste the link into freemake video downloader app, I can only download max of 100 videos only. Is there anyway to download all...
  • How To Disable the Quicken Registration Prompt (9)
    • teddibier: What you say is correct except in the case where you have downloaded a file and is already in your “Downloads” folder and you want to call that up to be opened by the Quicken Program. It does not open without the...