How do you open and edit files on vagrant?

I know this is a super easy and dumb question but this is my first time using a virtual machine.

For example, I want to open and edit part1.c in a text editor. I'm currently using Visual studio on my mac but I don't know where to go from here.

2 thoughts on “How do you open and edit files on vagrant?”

  1. This minimal vagrantfile will share the current directory (on your workstation) with the virtual machine. The files will be available on the VM in the directory `/vagrant`

    Vagrant.configure(“2”) do |config| = “generic/rocky8”
    config.vm.synced_folder “./”, “/vagrant”

    You can edit your Vagrantfile the same way if `/vagrant` isn’t shared already.

    After `vagrant reload` you move or copy the files in your screenshot to `/vagrant` and you can edit them in an editor on the OSX side.

    Check the docs for more info:


Leave a Comment