💻
CSC3150 VM Setup Workflow
  • VM Configuration
    • MacOS/Linux (Intel/x86)
      • Grant Permissions
    • MacOS (ARM64/M1/M2)
    • Windows (AMD/Intel x86)
    • Transferring File from/to VM
Powered by GitBook
On this page
  • Set up VM
  • Set up VS Code (Optional)
  • Shutdown the VM
  • Trouble Shootings
  • Troubles in "vagrant up"
  1. VM Configuration

MacOS/Linux (Intel/x86)

PreviousVM ConfigurationNextGrant Permissions

Last updated 2 years ago

Set up VM

  • Install and . After installation, reboot your machine.

  • If you are using macOS Catalina or higher, you are recommended to (please do it)

  • Set up a directory for csc3150 (make sure the full path does not include space or Chinese, e.g. mkdir -p ~/dev/csc3150)

  • Launch terminal and change current directory to the one you set up (e.g. cd ~/dev/csc3150), then execute vagrant init cyzhu/csc3150

  • Then execute vagrant up. It may take a while to download the system image. After that a virtualbox window may pop up. Leave it open but put it aside.

  • The VM is set up. Now we can set up the ssh to connect to the VM. Still in terminal, execute mkdir -p ~/.ssh && vagrant ssh-config >> ~/.ssh/config and now you can connect to VM in terminal with ssh default

Set up VS Code (Optional)

To simplified the workflow, you are recommended to set up Remote SSH plugin in VS Code.

After installing, go to the remote explorer tab, and find SSH Target called default. Click the icon to connect to the VM and launch a new window.

The first time you connect to the VM via VS Code, it may take some time for it to load. Wait patiently. After it finshes loading, start a terminal.

In the terminal you just opened, install essential dependencies and libraries: sudo apt update && sudo apt install -y build-essential (it may take a while). After it finishes, create a directory for the course: mkdir -p ~/csc3150

After everything, you can open a folder in the VS Code window to locate to the directory you create:

Finally, try a hello world program on the VM

As usual, open a (remote) terminal in VS Code and compile the hello world program (gcc hello.c -o hello) and try to run it.

Shutdown the VM

To shutdown the VM gracefully, go to terminal (on your host machine, not in VM/VS Code) and cd to your csc3150 diretory, and execute vagrant halt.

Symmetrically, next time you want to re-launch the VM, go to terminal (on your host machine, not in VM/VS Code) and cd to your csc3150 diretory, and execute vagrant up

Trouble Shootings

Troubles in "vagrant up"

vagrant up download the system image from the cloud and may involve network problems. In common case where you encounter a network problem, you may retry and succeed. However, if the problem persists, there is an alternative solution:

  • Remove the directory (rm -rf csc3150) and create it again

  • In terminal, cd to the directory and execute

    vagrant box add csc3150 /the/path/to/the/box/you/just/download
    vagrant init csc3150
    vagrant up

Download the image manually

here
vitrualbox
vagrant
set the virtualbox permissions
Terminal on Mac OS
vagrant init cyzhu/csc3150 && vagrant up
Install Remote SSH Plugin
Go to the remote explorer tab and open a new window by connecting to "default"
Start a terminal (in remote machine)
Make a directory for the course
Hellow World
You are good to go