(Update: Oct. 2, 2015) PlasticSCM has a new hosted cloud solution called Plastic Cloud. It’s free and in beta right now, but there will be paid tiers later. Also, please keep in mind that this tutorial was written over a year ago, and since I’m using Plastic Cloud and GitSync with Visual Studio Online now, I haven’t tried setting up an Azure server recently. Plastic SCM’s installation has also changed slightly. I’m still leaving this post up as some of the steps are still useful to know.
(Original post follows)
In a previous blog post, I explained how to use Plastic SCM GitSync with Visual Studio Online’s Git functionality. However, unlike Git or Mercurial, Plastic SCM is designed to handle large file sizes gracefully, which is good news for game developers,
as they have a free Community edition for up to 15 developers. Update: For commercial projects, Plastic SCM now has a personal version which is free for individuals, and a Team edition for 2-15 developers. They still have a Community version which is free for OSS and Non profits only.
Having just been accepted into Microsoft’s BizSpark program, I wanted to take advantage of the $150 credit towards Microsoft’s Azure offerings as well as Plastic SCM’s native version control system. The only problem was that I had never setup a remote virtual machine before and didn’t know what I was doing. I did find a comprehensive tutorial for setting up Plastic SCM with an Amazon EC2 instance, but nothing for how to set it up with an Azure VM (Virtual Machine). With some help from Plastic SCM’s forums and lots of trial and error, I finally got it set up.
I thought I’d post comprehensive instructions to share with any other game developers in the same situation of needing free version control, a free remote repository (if they’re already BizSpark members), and who are new to the whole thing. If you’re not a BizSpark member, you can set up an extra small remote Azure Virtual Machine for around US $13/month, or for much less if you only start it up when you need it, and shut it down when you don’t (it will only be $0.018/hour).
This tutorial is meant for a complete beginner and is perhaps overly detailed. There are no pictures, unfortunately, but if you follow along closely, you should be good to go. Following along with this tutorial should take you approximately an hour. Sorry for the wall of text, but I couldn’t imagine taking a screenshot for each of the steps. You can select and highlight each step to keep track of where you are, if necessary. Here we go:
- -Go to www.plasticscm.com if you don’t already have Plastic SCM installed. If you do, you can skip to step #8. Click “Download” at the top. Register if you haven’t already, or login with your username and password.
- Click on “Labs Downloads” – The Latest and Complimentary Products. Download the latest version for your local OS, and the latest Windows version for your Azure VM . This is assuming you will be setting up a Windows Server 2012 R2 Datacenter server).
- Click “Licenses” at the top and then “Download Community license”, after reading their instructions on what to do with the file.
- Search on the internet for “Microsoft .NET Framework 3.5 SP1” or go to http://www.microsoft.com/en-us/download/details.aspx?id=22 to download the update (around 2.8 MB), saying no thanks to the malicious software removal tool. If you don’t do this step now, you will be asked to do it during installation anyway.
- Install Plastic SCM, using all the default options, except for the next step.
- If you’re using Windows on your local computer, you may want to “change your database backend” at the end of installation, and choose SQLite as your database backend. This is because the included SQL Server Compact Edition which is installed as default on Windows has a 4GB maximum size, and your project folder may grow bigger than that with all your game assets. If you have a different OS, SQLite will be used as the default.
- Though not completely necessary, I’d highly recommend following this tutorial if you’ve never used Plastic SCM before. Read up on the rest of their documentation when you get the chance as well.
- Once you’ve finished the tutorial, or if you’ve already setup your Plastic installation previously, run Plastic’s “Server configuration wizard” to change the security mode to “User/password based security”. You’ll be asked to create a new user in the “User management tool” if you haven’t done this before. You can click on the “Users” folder in Plastic’s “User management tool”, then click on the icon of the person with the plus sign on it to create a new user. Remember the username and password that you enter here. Once you create the user, they will appear in the folder. You can exit the “User management tool”.
- Once you’ve done this, you can run Plastic’s “Client configuration wizard” and set the security mode to “User/password based security”. You will have to enter the same username and password to complete the wizard.
- If you haven’t already, copy the plasticd.lic file you downloaded earlier to C:\Program Files\PlasticSCM5\server folder (or to whatever directory you installed Plastic to), replacing the existing file.
- If not done already, create the workspace and repository (with your ignore file done) that you’d like to have replicated on the Azure VM. We’ll go over how to set up the Azure VM next.
- Sign up with Azure for a 30-day free trial (worth $200 of services), or sign in with your BizSpark account (by activating Azure through your MSDN portal) if you’ve been accepted. Otherwise sign in with your existing Azure account.
- Go to the Azure management portal. Take the Windows Azure Tour if this is your first time using Microsoft Azure.
- Click on Virtual Machines on the left side, and then click “Create a virtual machine”.
- Fill in the details starting with “DNS Name” (make sure to remember whatever name you choose), select Windows Server 2012 R2 Datacenter as the “Image”, Basic A1 as the “Size” (or choose whichever size you want, making sure to look at Azure’s pricing calculator on their homepage to see just how much it will cost you), enter a NEW username and password to access your VM, choose the closest region to you, and choose the subscription type you’d like to use. Click “Create a virtual machine” when you’re ready.
- Wait for Azure to create and set up the virtual machine… you can click the little “i” on right side of the bottom window for details. If the bottom window isn’t open, you can click on the green
loading bars at the bottom to open it. My VM took about 8-9 minutes to be successfully created and provisioned, and for the extensions to be installed.
- Once your VM is finished installing extensions and the “STATUS” just shows “Running”, select the name of you virtual machine under the “Instances” tab in virtual machines. You can find out all about your VM here. Once you’re finished browsing, go back to the previous “Virtual Machines” screen.
- Make sure your virtual machine is highlighted in blue and click “CONNECT” in the bottom menu. There will be a prompt to save an .rdp file. Save it to your desktop if you’d like. Click “OK” in the management portal at the popup that comes up about saving the file.
- Open the .rdp file wherever you saved it, and enter your account credentials NOT using your Microsoft account, but below that, where it asks to “Use another account”. Enter your virtual machine username and password that you created in step #15, checking “Remember my credentials” if you’d like (although it didn’t really remember my credentials the second time I connected).
- If the connection is successful, you’ll get a popup about “The identity of the remote computer cannot be verified.” Click “Yes” to accept the certificate. Remote desktop will establish a connection and your desktop should show you the remote Azure VM’s desktop!
- Once it’s finished connecting, you should see the Server Manager app, and possibly a popup on the right side about your Network connection. I chose “Yes” for the Network connection sidebar, but I’m not sure if it really matters.
- Click Manage at the top right of the Server Manager Dahsboard, and select “Add Roles and Features”. * Please Note *: Thanks to zionmoose in the comments below this post, if you are having an issue with steps 22-24 (installing .NET Framework 3.5 Features), please see his second or last post in this support thread: http://social.msdn.microsoft.com/Forums/azure/en-US/46b9c436-249b-4388-9927-8d157102ef70/failing-to-install-net-35-on-azure-vm?forum=WAVirtualMachinesforWindows
- Keep clicking next (about 4 times) until you get to “Features”. In case you messed up, make sure that “Role-based or feature-based installation” was selected for installation type, your server is selected in server selection, click “Next” on server roles without selecting anything, and now you’ll be at features.
- Click the checkbox next to .NET Framework 3.5 Features. Click “Next”, then click “Install”. Expect to wait 5 minutes or more for it to install. Close the “Add Roles and Features Wizard” window when installation succeeds. Minimize the Server Manager.
- Go to the Virtual Machine’s Start menu and launch File Explorer. Leave it open and then minimize the whole Remote Desktop app using the blue bar at the very top middle of the screen.
- Back to your own computer, find the Plastic SCM installation file you downloaded for the Windows version. Copy the file to your clipboard (on Windows, right-click and select “copy”).
- Now go back to the Remote Desktop app and your Virtual Machine’s File Explorer and paste the file into any folder you want (for example, the Azure VM’s “Downloads” folder), or create a new folder and paste it there. This will upload the file to your Virtual Machine. It will take a few moments to complete, depending on your upload speed.
- Also copy the plasticd.lic file (Community license you downloaded from Plastic’s website) from your own computer and paste it into any folder you want in the virtual machine. Just remember where!
- Once the files are done uploading, Double-click the Plastic installation file to start the installation. You can proceed up to the point it asks you to select components. Just leave Client components and Server components checked. Click “Next” twice to begin installing. It may not respond for a moment, but let it finish installing. Next, you can leave all the checkboxes checked, and click “Finish”.
- The readme should pop up. Click “OK” after browsing the readme. Wait for the “Server configuration wizard” to pop up. Click “Next”. Choose your language, and click “Next”.
- On the next window, make sure to choose “User/password based security”, and click Next. There will be a popup to “Create users” as the user list is empty. Click “Yes” to launch the “Users management tool”.
- Click on the “Users” folder in the user management tool. Then click on the icon of the person with the plus sign to create a new user. Enter the SAME username and password you used for your local installation of Plastic SCM on your own computer (entered in step #8). Click “Ok”, and you will see your username now under the Users folder. You can close the user management tool.
- Wait a few moments, and you will get an error saying that the Plastic SCM service couldn’t be started. It’s ok, as the server configuration wizard didn’t finish, so click “OK”.
- Next, the Plastic SCM client configuration wizard will come up. Click “Cancel”. You will get a popup saying that the installation is complete. It really isn’t yet, but click “Ok”. We will have to finish the server configuration wizard first.
- Click on the Start menu in your Azure VM, then click on the down arrow towards the bottom of the screen to see all the apps. Under “Plastic SCM”, find the Server configuration wizard, and right-click to pin it to Start. Go back down again, and do the same for the Client configuration wizard. You can even do the same for the Plastic SCM app itself if you’d like.
- Now click on the “Server configuration wizard” to launch it. Proceed again to the security configuration mode screen, select “User/password based security” again, then click “Next”. There should be the name of your VM under Server host, and port should be 8087. Click next, but don’t click Finish yet on the next screen.
- On the Server configuration finished window, click the text link: “change the database backend now”. Select SQLite (Embedded), and then “Next”, and choose a database path if you’d like (if you want the database to be in a specific directory, otherwise just leave everything blank). We’re using SQLite as it doesn’t have size limitations like the default database does. Click “Test connection”, and you will get a “Connection test succeeded” popup. Click “OK” in the popup, and click “Change backend”.
- A message should come up if it’s successful. Click “Close” in the Database Wizard, and click “Finish” in the Server configuration wizard.
- Open the Azure VM’s Server Manager app that you had minimized earlier. On the left side, click “Local Server”. In the main pane, scroll down to find the “Services” section. In the “Filter” box, type “plastic” to find the “Plastic Server 5” service. The status should say “Stopped”. We’ll want to re-start it, so right-click it and select “Start service”. After a few moments, it will say “Running”. You can minimize the Server Manager again.
- Now go back to the Start menu and launch the Plastic SCM “Client configuration wizard”. Click “Next” to continue and select the language, and click “Next” again.
- Click the “Find in Network” button on the right side, and select your available Plastic SCM Server in the window that comes up. Click “Ok” in that window, then click “Next” in the wizard.
- Select “User/password based security” again, and click “Next”. Enter the SAME username and password you used for your local Plastic installation as well as in the User managent tool previously (step #32). Click “Finish”.
- Open File Explorer on your Virtual Machine (if it’s not already open), find the “plasticd.lic” file you transferred earlier, and cut and paste the “plasticd.lic” to the C:\Program Files\PlasticSCM5\server folder, replacing the file that was already there.
- You can now also delete your original installation file if you’d like. Close File Explorer.
- Go to the Azure VM’s Start Menu (or the Apps screen if you didn’t pin to Start), and launch the orange Plastic SCM application. The “Select workspace window” will come up.
- Click New in the bottom left, and create your Workspace Name, and a path on the disk you’d like to store your files. DO NOT use the Temporary Storage D: drive for anything, according to the Azure docs. Keep it in C: somewhere, or if you added a disk to your VM earlier, perhaps you can use that.
- Use the default repository and Click “Ok”, or create a new repository by clicking “New”, enter the name of your repository as well as your server name and port number, then Click “Ok, and click “Ok” again.
- Select your workspace now, click “Ok”, and click “Repositories & Workspaces” on the left side to check that your repository was created if you’re not using the default repository. If you are using the “default” repository, you may want to rename it here. Close the application.
- Open the Server Manager in the Azure VM again, and in the top right, choose “Tools” -> “Windows Firewall with Advanced Security”.
- Scroll down the middle pane until you find “View and create firewall rules”. Click “Inbound Rules” underneath that.
- On the right side, Click “New Rule…”, and in the new window that opens up, select “Port”, and then click “Next”. Under “Specific local ports:”, type in 8087, then click “Next”. Select “Allow the connection”, and click “Next”. Leave all 3 selected and click “Next”. Then type in a name like “Plastic SCM Port”, and click “Finish”. A new inbound rule will have been created with a green checkmark next to it.
- Close the “Windows Firewall with Advanced Security” window, and minimize the Server manager. Minimize or close the remote desktop app as well (since we’re now finished with it) to return to your local machine.
- Once back on your own computer, go back to your Azure management portal web page, and go to your Virtual machines tab, clicking on the name of your virtual machine.
- In the next window, click “ENDPOINTS” at the top. At the bottom, click ADD, and select ADD A STAND-ALONE ENDPOINT. Click the Right Arrow in the bottom right.
- Enter Plastic SCM or whatever you’d like to call it in the “Name” field. Leave Protocol as TCP. Enter 8087 for BOTH public and private ports. (If you configured Plastic SCM for SSL connections earlier, you may need to choose 8088. Please see the documentation for that, as I didn’t choose to use SSL).
- Leave the last 2 boxes unchecked, and click the checkmark button in the bottom right. Azure will let you know it’s creating the Endpoint. Let it finish (it may take less than a minute), and you will see your new endpoint show up.
- Open Plastic SCM on your own computer. Go to the workspace you’d like to sync with your virtual machine. On the left side, click “Sync replication”, and click “Add sync view” near the top. Add a name and click “Ok”.
- Select the Sync view you just created, and in the bottom window, click “Add source repository”. Select your localhost server and select the repository you want to sync. Click “Ok”.
- Next, with your local repository selected, click “Add destination repository” in the bottom window. Here, you need to enter your virtual machine’s domain name plus the port. It should look something like this: yourdomain.cloudapp.net:8087 – where “yourdomain” is the DNS Name you entered when you set up the server through the Azure management portal in step #15.
- Click the Search button, and your repository should show up. Select it and click “Ok”.
- Click the plus sign next to your destination repository, and you will see any Outgoing changes that haven’t been synced.
- You can right-click the destination repository and select “Synchronize All” if you’d like to have a complete sync between your local machine and the Azure VM. Proceed ahead with the sync by clicking “Start”, after which you’ll see some progress bars, and then it should successfully finish.
- Congratulations, you did it! Whenever you do checkins locally and you want to synchronize with your Azure VM, you can use this “Sync replication view” to sync them up.
- Another way is to use the Branch Explorer by right-clicking your main branch, and go to Replication -> Push this branch. Use the same address that you used above for the remote server, and you should be able to select your repository there.
That should pretty much cover it. If there are any mistakes in this, please let me know. If you need help beyond my knowledge and ability level, it would be best to ask for it in the Plastic SCM forums.
All the best, and happy developing!