<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Virtual PC</title>
        <link>http://geekswithblogs.net/EltonStoneman/category/9264.aspx</link>
        <description>Virtual PC</description>
        <language>en-GB</language>
        <copyright>EltonStoneman</copyright>
        <managingEditor>elton.stoneman@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Networking Virtual PCs with the Same Computer Name</title>
            <link>http://geekswithblogs.net/EltonStoneman/archive/2008/12/11/networking-virtual-pcs-with-the-same-computer-name.aspx</link>
            <description>&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 10pt;"&gt;[Source: &lt;a href="http://geekswithblogs.net/EltonStoneman"&gt;http://geekswithblogs.net/EltonStoneman&lt;/a&gt;] &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The aim of putting together a single VM and sharing it around a dev team soon hits the problem that multiple computers with the same name are trying to connect to the Windows network. The first VM to connect will be correctly registered, but subsequent images will get a network error: "Computer name already exists". &lt;/p&gt;
&lt;p&gt;The problem is that you once you build up a dev environment (with SQL Server, BizTalk etc.) the computer name quickly becomes integral and changing it is very difficult (in the case of BizTalk, sufficiently difficult that it's not worth even trying). Having a base image with just the operating system means new copies could be taken and the name changed easily – but that defies the point of having one configured machine, as every new joiner needs to install the rest of the environment themselves. &lt;/p&gt;
&lt;p&gt;A couple of alternatives are available: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://geekswithblogs.net/asmith/archive/2005/04/26/38465.aspx"&gt;Alan Smith describes setting up a partial image&lt;/a&gt; using SysPrep and scripts which run the first time a new image is used. Each VM then has a unique name and the scripts handle the remaining installations. This sounds like a good solution for full integration with your network, but there are additional setup costs and it's not much help if you already have a VM in use; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://blogs.msdn.com/ukcrm/archive/2006/05/26/608300.aspx"&gt;Simon Hutson uses a combination of network adapters&lt;/a&gt; in Virtual PC to hide the VM's computer name from the network, but still have access via the host machine. This sounded exactly what I wanted, but I couldn't get it communicating on the network with DNS, only using IP addresses (my VM is not configured as a DNS server so that may be the issue – but setting up DNS on the VM seems like overkill unless you need it anyway). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My solution is an extension of Simon's, basically using Shared Networking in Virtual PC , disabling &lt;em&gt;Client for Microsoft Networks &lt;/em&gt;and &lt;em&gt;File and Printer Sharing for Microsoft Networks&lt;/em&gt; and WINS so the VM doesn't try to register itself with the network. You also need the second network using the Loca adapterl, which you configure with a static IP – an address in the range 10.0.0.x, and a subnet mask of 255.255.255.0 works consistently – and specify your network's real DNS servers. &lt;/p&gt;
&lt;p&gt;This gives you TCP/IP access, and then you can resolve the  machine names you need to connect to using the HOSTS file local to the VM. Obviously this is only suitable for accessing machines on the network with static IP addresses, and means network machines can't connect to your VM by name, but if you can live with that it's a very simple workaround. The image can be set up with the network adapters configured, and the HOSTS file already prepared so it's ready to go for new joiners. &lt;/p&gt;
&lt;p&gt;Note that Windows Server 2003 as a guest OS will need to use a dedicated DNS address for the Shared Networking adapter: 192.168.131.254 – see &lt;a href="http://blogs.msdn.com/virtual_pc_guy/archive/2005/01/06/347965.aspx"&gt;Virtual PC Guy's post on using NAT with W2K3&lt;/a&gt; for details on this.  &lt;/p&gt;
&lt;p&gt;In case it's been a while… The HOSTS file is a simple IP address/computer name lookup table which you'll find in &lt;strong&gt;%SystemRoot%\system32\drivers\etc\&lt;/strong&gt; (by default), which you extend by adding entries on a new line. Mine looks like this: &lt;/p&gt;
&lt;p style="margin-left: 36pt;"&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;127.0.0.1    localhost &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 36pt;"&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;10.5.1.1    SVRNAME1 &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-left: 36pt;"&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;10.5.1.2    SVRNAME2 &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;- and now we have multiple Virtual PCs with the same name connecting to the network, and happily using source control, database and build servers, without trashing our BizTalk install. A script to refresh the HOSTS file from a central location is a simple extension if your list is likely to change. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127819"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127819" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/EltonStoneman/aggbug/127819.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>EltonStoneman</dc:creator>
            <guid>http://geekswithblogs.net/EltonStoneman/archive/2008/12/11/networking-virtual-pcs-with-the-same-computer-name.aspx</guid>
            <pubDate>Fri, 12 Dec 2008 00:59:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/EltonStoneman/comments/127819.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/EltonStoneman/archive/2008/12/11/networking-virtual-pcs-with-the-same-computer-name.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/EltonStoneman/comments/commentRss/127819.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Corrupted Files on Virtual PC Disk</title>
            <link>http://geekswithblogs.net/EltonStoneman/archive/2008/06/20/corrupted-files-on-virtual-pc-disk.aspx</link>
            <description>&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 10pt;"&gt;[Source: &lt;a href="http://geekswithblogs.net/EltonStoneman"&gt;http://geekswithblogs.net/EltonStoneman&lt;/a&gt;] &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One of the nice advantages of developing on a virtual image is that you can set it up with one drive for the OS and another for data. Your dev toolset is ready for project joiners to use, and copying a 15Gb file is far quicker than installing your toolset from nothing. When you want to take work home or on the train with you, it's just a case of zipping up the 1Gb data drive and copying it to your laptop. &lt;/p&gt;
&lt;p&gt;I've been doing this using Microsoft Virtual PC once or twice a day for the last few months, and it's somewhere like 99.99% faultless. But that 0.01% fault is manifested as random files being reduced to zero-bytes. They have the correct name and are in the expected location, but are missing their contents. So suddenly a project fails to build as one of the class files is empty.  &lt;/p&gt;
&lt;p&gt;This seems to be a result of occasionally resizing the .vhd file, rather than with repeatedly zipping and unzipping it. I haven't got an answer for the cause, but the following PowerShell script will output all the zero-length files you have on disk: &lt;/p&gt;
&lt;p&gt;&lt;span style="color: green; font-family: Courier New; font-size: 10pt;"&gt;##FindZeroByteFiles.ps1  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;param&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;[]] &lt;/span&gt;&lt;span style="color: purple;"&gt;$paths&lt;/span&gt;&lt;span style="color: black;"&gt;)  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;function&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;Main&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: black; font-family: Courier New; font-size: 10pt;"&gt;{  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: purple;"&gt;$path&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: purple;"&gt;$paths&lt;/span&gt;&lt;span style="color: black;"&gt;) {  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: purple;"&gt;$list&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: red;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: cadetblue;"&gt;Join-Path&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: purple;"&gt;$path&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: saddlebrown;"&gt;zeros.txt&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: cadetblue;"&gt;Remove-Item&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: purple;"&gt;$list&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: cadetblue;"&gt;-ErrorAction&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;SilentlyContinue&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: cadetblue;"&gt;get-childitem&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: purple;"&gt;$path&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: cadetblue;"&gt;-recurse&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;|&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;sort&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;Length&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;|&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&lt;span style="color: black;"&gt; {  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;          &lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: navy;"&gt;$_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: saddlebrown;"&gt;Length&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: red;"&gt;-eq&lt;/span&gt;&lt;span style="color: black;"&gt; 0) {  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;span style="color: navy;"&gt;$_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: saddlebrown;"&gt;FullName&lt;/span&gt;&lt;span style="color: black;"&gt; &amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="color: purple;"&gt;$list&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: black; font-family: Courier New; font-size: 10pt;"&gt;                        }  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: black; font-family: Courier New; font-size: 10pt;"&gt;                }  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: black; font-family: Courier New; font-size: 10pt;"&gt;        }  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: black; font-family: Courier New; font-size: 10pt;"&gt;}  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt;. &lt;/span&gt;&lt;span style="color: blue;"&gt;Main&lt;/span&gt;&lt;span style="color: black;"&gt; 			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: green; font-family: Courier New; font-size: 10pt;"&gt;##&lt;/span&gt; 	&lt;/p&gt;
&lt;p&gt;Usage – to list all the zero byte files on drives F and G: &lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;"&gt;.\FindZeroByteFiles.ps1 F:\,G:\  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This will output a file called &lt;strong&gt;zeros.txt&lt;/strong&gt; in the root of each drive specified.  &lt;/p&gt;
&lt;p&gt;I'll be running it more frequently and I'll update this post if I track down which part of the process is mangling those files in the virtual drive. Or if I get around to writing a heftier script which compares two virtual drives using &lt;a href="http://blogs.msdn.com/virtual_pc_guy/archive/2007/06/19/using-vhdmount-with-virtual-pc.aspx"&gt;VHDMount&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123043"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123043" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/EltonStoneman/aggbug/123043.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>EltonStoneman</dc:creator>
            <guid>http://geekswithblogs.net/EltonStoneman/archive/2008/06/20/corrupted-files-on-virtual-pc-disk.aspx</guid>
            <pubDate>Sat, 21 Jun 2008 01:00:17 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/EltonStoneman/comments/123043.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/EltonStoneman/archive/2008/06/20/corrupted-files-on-virtual-pc-disk.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/EltonStoneman/comments/commentRss/123043.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>