RTC Website

Setting up a D1a development system

DX

This page contains information on setting up a D1a development system. For other specific D1 development systems, see Specific development systems.

A development computer

DX

Most personal computers (PCs) can serve as a development computer. The primary requirement is that it have a 64-bit x86 microprocessor architecture (primarily made by Intel and AMD), which currently includes the vast majority of PCs. Further requirements are as follows.

  1. Operating system:
    1. Windows or
    2. MacOS or
    3. Linux.
  2. At least 4 GB RAM, but 8 GB is preferable.
  3. At least 26 GB of free local storage.
  4. A USB port.

Installing your virtual machine and IDE

DX

We will now install on your development computer a virtual machine (VM) that already includes an integrated development environment (IDE).

  1. Download and install the latest VirtualBox release (choose your operating system): www.virtualbox.org/wiki/Downloads VirtualBox is a hypervisor that lets you run virtual machines.

  2. Download and install the VirtualBox Extension Pack from the same page.

  3. Download and install Vagrant: https://developer.hashicorp.com/vagrant/install Download the version corresponding to your operating system. Vagrant is a virtual machine builder.

  4. Download1 the latest release D1a.zip of the code repository listed here: github.com/rtc-book/D1a/releases

  5. Unzip the code repository file. We should now have the release in a directory D1a.

  6. Generate your virtual machine via a terminal window.2 In a terminal window, cd into the D1a directory and enter the command

    vagrant up

    After several minutes (the download is large), this will create a new VM rtcbook-D1a that should be available in VirtualBox and boot up.

  7. Intel MacOS users: An ongoing bug in VirtualBox requires that we launch the VirtualBox app with administrator privileges.

    1. Shut down the VM by shutting down Windows in the usual way.

    2. Open a terminal window and execute the command

      sudo virtualbox

      You will be prompted for your MacOS password, which you should enter. (Note: when typing your password, the cursor will not appear to move, but the terminal is receiving your password.)

    3. Your VM won’t be listed. Click Add and browse to ~/VirtualBox VMs/rtcbook-D1a/rtcbook-D1a.vbox; click Open. Now you are able to Start the VM.

    4. Whenever you shut down your VM, you will need to relaunch it from the terminal with sudo.

Username and password

The default user in the virtual machine is Vagrant and the password is vagrant. You may not be prompted for a password.

Installation finished!

After this initial setup, the virtual machine can be accessed directly through VirtualBox. For information about configuring, updating, and troubleshooting your VM, see below.

Configuring, updating, and troubleshooting the VM

DX

The shared directory

DX

A shared directory between the host and the guest should be mounted by default. On the guest, its location is C:_vagrant. If it is not mounted, see the troubleshooting section, below.

Configuring your virtual machine

There are many configuration options for your VM in VirtualBox, accessible in the app through Settings, which are documented here: www.virtualbox.org/manual/ch03.html

Most commonly, you may want to configure your System settings to improve performance: www.virtualbox.org/manual/ch03.html#settings-system

You may also want to configure your Display settings to improve the scale, video performance, etc.: www.virtualbox.org/manual/ch03.html#settings-display

Updating

There are two primary components you may want to update.

Updating your copy of the vm-vagrant repository

If there is an update to the repository, you have a few options for updating your local copy.

If you forked this repo

In this case, use GitHub’s instructions: docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork … TODO write instructions

If you cloned this repo

In this case, you can simply cd to your local copy and

git pull

Note that you cannot push your changes back to the remote (GitHub) because you do not have permissions.

If you downloaded the ZIP of this repo

You are pretty much stuck re-downloading or choosing one of the other methods (described in step 4 of Installation) for getting this repo.

Warning You should consider saving your old workspace directory and potentially bringing in your work to the new copy.

Updating the Vagrant box

If you would like to update a local Vagrant box built with a previous version of drrico/rtcbook, app.vagrantup.com/drrico/boxes/rtcbook which is the base of your VM, first delete your old VM in VirtualBox (back up anything you’ve saved in the machine; the shared folder will not be deleted from the host).

With the associated VM deleted, update your local boxes with the following.

vagrant box update

You can now re-generate your VM, as before.

vagrant up

You may then want to get rid of your local copy of the old box.

vagrant box prune

Troubleshooting installation

Here are some general considerations, independent of host OS.

  1. When generating the virtual machine, A VirtualBox machine with the name 'rtcbook-dist' already exists: You have already built the virtual machine. If you are just trying to open the virtual machine, there’s no need to rebuild, open VirtualBox and double-click your virtual machine rtcbook-dist. If it was unsuccessful and you want to retry, in VirtualBox, right-click the virtual machine rtcbook-distRemove …Delete all files. Now step 5 of jo should work.

MacOS host

  1. VirtualBox installation failed:
    1. Try this fix first.
    2. If that didn’t work, explore these options.
  2. Terminal permission problems:
    1. Go to  → System Preferences → Security & Privacy → Privacy → Full Disk Access and make sure Terminal.app is checked (may need to unlock).
    2. Go to  → System Preferences → Security & Privacy → Privacy → Files and Folders and make sure Terminal.app is checked (may need to unlock).

Troubleshooting the VM

The following issues may occur after installation.

Can’t connect to myRIO target

With the VM running, plugging in the myRIO to one of your computer’s USB ports should automatically connect it with your VM. If there are issues, try the following.

  1. Make sure the myRIO is connected to your computer via USB.
  2. With the VM running, go to the toolbar DevicesUSB and, if it is not checked, click Linux 3.14.40 .... Verify that it is checked and retry.
  3. Occasionally, the “Ethernet” connection can be corrupted. To ⊞ → SettingsNetwork & InternetPropertiesChange Adpater Options. The Ethernet 2 connection should appear. Right-click on it and select Diagnose, as shown below. Try to automatically repair the connection. It may say the repair was unsuccessful, but it may in fact have worked.

screenshot

Missing shared folder/empty workspace

The directory created from this repository vm-vagrant-main should be automatically available on the guest as a shared folder at C:_vagrant. Occasionally, something goes wrong and VirtualBox will lose the shared folder. If this happens, it can be re-added in the VirtualBox GUI under the VM SettingsShared Folder tab. Add a folder and select the D1a directory. Mount it to C:_vagrant as usual, and check the automount and permanent options.

Alternatively, in a terminal window on the host machine, the following will reconnect the shared folder:

VBoxManage sharedfolder add rtcbook --name vagrant --hostpath "." --automount --auto-mount-point 'C:\vagrant'

  1. If you know Git, you could also clone or fork the repository. For now, if you are unfamiliar with Git, please feel free not to get bogged down here.↩︎

  2. A terminal or terminal “emulator” is an interactive command-line program in which a user enters text commands that are interpreted and executed by the operating system. On Windows, click and search for cmd and select the Command Prompt app. On macOS, type cmd+space and search for Terminal.app.↩︎