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
  • Output status messages and test information by writing to the Log File Viewer in Katalon Studio (4)
    • Don Pedro: That is correct. You will need to add KeywordUtil.markFailed to change the Failures count. Other commands in the library are: KeywordUtil.markPassed KeywordUtil.markFailed KeywordUtil.markError KeywordUtil.markWarning
    • Nadim: This is really helpful … the only problem when log.logFailed executed it doesn’t update the results Failures count … still show Failures: 0
  • Working with Dates and Date Formatting in Katalon Studio (7)
    • Sharma: I want to choose date from any of the 12 months but I am not abel to do the same.
  • Securely storing passwords and login details with Set Encrypted Text in Katalon Studio (2)
    • sowmya: hi can u please help me how to read data from text file in katalon studio?
  • Custom Keywords for Custom Functions (1)
    • Sarah: Thank you for this. It helped me understand these better.
  • How To Disable the Quicken Registration Prompt (26)
    • Denise Defoor: I have a Quicken SE Version 6 .. My computer crashed a few weeks ago and I finally got it up and running. Now Quicken is telling me I must registered it. What? I have had this program for 20 years. How can I disable the...
    • Greg: For me, holding the *LEFT* CTL + Shift then clicking Online, One Step Update worked. I originally tried holding the right CTL + Shift, and it didn’t work. I’m using Quicken 2006, so I don’t know if it will work...
    • Joe SR>: My monthly income is deposited into my Credit Union account. I use debit whenever possible. I write checks manually and mail them. I use Quicken 2012 off-line only. I have entered all my money and investment accounts. I...
    • Prtet: Never say never….every time I swear I will never use Quicken again, I discover that there are still no viable alternatives. Amazing that there is no decent personal finance software.
  • Parsing Strings in Katalon – Split, Substring and Readlines (4)
    • Anjana: Hey thanks for the response It is quite strange but initializing variable for delimiter and it worked String splitFormat = ‘-‘ WebUI.println(var_CampaignDura tion.toString().split(splitFor mat)[0])...
    • Don Pedro: I’m not really sure what the difference is, but I don’t think the “-“ in the split is the same as the one in the date. String var_CampaignDuration = “05/13/2019-06/07/2019&# 8221; String[] parsedDateRange =...
    • Anjana: Hi, I tried the same thing to split the string, but does not work for me, Could you plz point out whats wrong Variable var_CampaignDuration has value “05/13/2019-06/07/2019&# 8221; String[] parsedDateRange =...
  • How to Block games by Title and Tag on Steam (2)
    • Marcus861: I made an acc just to say: Same bro
    • JACK: Thanks, same just wanted to block anime games in my discover
  • Create a new and random UUID for an API call (1)
    • Anonymous: Hi ! I found this blog few weeks ago and it’s really helping me out with my tests! Thanks a lot for the Katalon tips and tricks ! Keep up the good work 🙂