A C language development environment in HashiCorp Vagrant for the PlutoSDR.
The instructions and Linaro toolchain from [2] was used for this virtual machine (VM) config. It is recommended to read the Quick Start guide at [1].
The $
character indicates terminal/power shell commands, depending on where you installed Vagrant
The bootstrap.sh script will be run when the virtual machine (VM) starts and downloads the toolchain and sysroot, then configures the environment.
- Prerequisites
- Git
- VS Code
- Prerequisites (from Vagrant Quick Start)
- Install the latest version of Vagrant (https://www.vagrantup.com/downloads)
- Install VirtualBox
- Clone this repository
- Initialise and start virtual machine (VM) with
$ vagrant up
- Get the OpenSSH config to use in VS Code
$ vagrant ssh-config
- Connect to VM once it is started
$ vagrant ssh
- Configure VS Code as described below then the development environment is configured
- Destroy the VM when you are done
$ vagrant destroy
A clean environment can be created by destroying the VM and starting a new one. It
is easy to try different Ubuntu/toolchain/sysroot versions by changing the
bootstrap.sh
or Vagrantfile
.
Get the OpenSSH config using $ vagrant ssh-config
, it should look something like
below:
Host vagrant
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile C:/vTestPath/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
In VS Code in the side bar go to the Remote Explorer tab and select the
Configure gearwheel. Use the C:\Users\<username>\.ssh\config
config file
and add the OpenSSH config from the step above to the file.
You should now be able to connect to the running VM using Connect to Host in New Windows.
On the remote host Open Folder and navigate to the test directory
at /tmp/plutoapp/
. The .vscode
folder contains example configuration files for
C properties and tasks such as building the example file from [3]. These must be
updated if you change toolchain or sysroot.