Use TFS Workspace in Virtual Machine

839 Views Asked by At

I have a virtual machine (in Virtual PC) that is used to run/update specific COM objects in our solution. Currently, both the host OS and the VM OS have separate workspaces, and I have to check out the files in either location, then check them in separately as work is completed.

It's also a huge branch (several GB of data) that needs to be pulled down over a slow VPN connection. Given that I need the files on my host and the VM, it means pulling this code down twice.

Is there a way I can configure the VM to make use of the Workspace on the host? I'm fairly sure I can map that folder into the VM, but I want, when I check out files in the VM, that it checks them out from the hosts workspace.

Update 1

I tried to fool the system, by setting the _CLUSTER_NETWORK_NAME_ environment variable as per this answer. This certainly allowed Visual Studio to see the workspace as valid for the machine. However, when I rebooted the machine, I couldn't connect to the machine since the Guest and the Host now appear to have the same name.

1

There are 1 best solutions below

0
Giulio Vian On

You cannot have the same workspace on two machines, fullstop. This means that you can fool Team Explorer mapping a common file system for both the machine, but careful! you should always get from one client and not the other. Now I can suggest you to test this recipe based on DiskMgmt.msc.

Say VM and PM your two clients, say that both map $/YourProj/src and you have $/YourProj/src/Common that you want to download once. PM workspace mapping is $/YourProj/src -> C:\src. PM is at least Win7; create a VHD and mount it on C:\src\Common; now you can get latest. Unmount the VHD, start your VM with the same VHD as a secondary disk. Mount this secondary disk as C:\src\Common inside the VM. Inside the VM the workspace mapping should be $/YourProj/src -> C:\src $/YourProj/src/Common -> (cloacked)