Using Shared Networking (NAT) with a Windows Server 2003 virtual machine

Virtual PC has a convenient feature called ‘Shared Networking’.  What this is is a small virtual NAT (network address translation) router – which is quite similar to the cheap hardware broadband routers that a lot of people use (myself included).  The advantage of Shared Networking is that your virtual machine can access the external network with needing to be directly connected to it*.  This is handy if you don’t want to have to worry about whether your virtual machine has all the latest security patches, or if you regularly move your physical machine between different network configurations (e.g. moving a laptop from you work network to your home network).

Normally using Shared Networking is very simple.  You just enable it and set the guest operating system to use DHCP – and everything works.  This is not the case with a Windows Server 2003 guest though.  The problem is that Shared Networking configures the guest operating system to use the same DNS servers as are used by the physical computer.  However – all DNS packets are actually returned from ‘’ – which is the virtual gateway used by Shared Networking.

Windows Server 2003 looks at the DNS packet, sees that it is coming from a source other than the DNS server it requested the information from, and rejects it.  A simple fix for this is to manually assign the DNS server inside the virtual machine to – then everything will work just fine.


* The downsides of Shared Networking are that external computers cannot connect directly to the virtual machine (so it is not useful for server applications) and that Shared Networking only works for IP based networking.