Setting up a Virtual Machine

ENV 872 - EDA   |   Spring 2024   |   Instructor: John Fay  |   

Setting up a virtual machine requires a bit of an investment up-front in that you need to install and configure everything from scratch, but they come with a few distinct advantages:

  • First, because you are starting from a clean machine, the likelihood of odd software conflicts or other issues is minimized, and if they do occur, they are usually easier to identify.
  • Second, you have full administrative control over these machines; you can install helper applications if you wish.
  • Third, installing the software actually gives you good experience if you ever need to do this on your own – and you are doing this in a protected environment: if you run into serious glitches, you can always reset your VM and start fresh.
  • And finally, these machines are accessible from anywhere: just fire up VPN and your remote desktop software and you are back where you left off.

Creating your virtual machine

  1. Navigate to Duke’s Virtual Computing Manager: https://vcm.duke.edu/

  2. Log in. (Multifactor authentication is required…)

  3. Click Reserve a VM.

  4. From the New Virtual Machine Reservation list, select Windows 10 and click Reserve.

    It will take some time - up to 30 minutes - for your virtual machine to build. Please don’t delete then re-request a machine while waiting for your machine to be built as this will just slow things down more. An email will be sent to you when the machine is ready to use. Remember that before you can remote desktop into the machine, you’ll need to be using a VPN connection.

    NOTE: I’ve heard reports that build times during peak periods have been in the hours! If you haven’t received an email stating your machine is ready, then it’s still building. Cancelling and restarting will only increase build times for everyone.

    Note the name of your machine, something like vcm-12345.vm.duke.edu. You can use this to access your machine via remote desktop. Or you can always return to https://vcm.duke.edu/ to log into your machine.

    Also note that VMs are set to power down every night. This is to conserve power. However, if you are likely to use your machine consecutive days or will have processes running over serval days, you may consider switching off the “Automatic power downs” option.

  5. When your machine has been built, click the Remote Desktop button.

    You may wish to save instead of open the remote desktop vcm-XXXXX.vm.duke.edu.rdpfile. I recommend saving it to your desktop so that you’ll have an easy shortcut to your virtual machine.

  6. Open the remote desktop connection (vcm-XXXXX.vm.duke.edu.rdp) file.

    If you get a “failed to connect” error, it’s possible that your machine is not finished being build. Wait a few more moments; if after 20 minutes or so you still cannot connect, seek help.

    You may get a warning stating “The publisher of this remote connection can’t be identified. Do you want to connect anyway.” That’s ok; check the “Don’t ask me again” and you won’t get this for this machine anymore.

  7. Log in to the machine using your Duke NetID and password.


Configuring your virtual machine

Once created, your machine has very little software installed. In addition to R, RStudio, and Git, it will be helpful to install a few utility programs.

Part 1: Installing helper applications

  1. Open the Software Center via the icon on the machine’s desktop.
  2. From the Applications tab, click Google Chrome and then click Install from the Application details page.
  3. Repeat for 7-zip, and optionally MS Office. Do NOT select RStudio (We will install that ourselves using different methods.)
  4. You can check the installation process from the Installation status tab. Once complete, it’s a good idea to restart your VM which will close your remote desktop session. After a few moments you’ll be able to again remote into your VM.

Part 2: Installing class applications

  • From here, you can now follow the instructions on installing R, RStudio, and Git as outlined here.