<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_vagrant(self, vagrant_file):
 """ Creates a Vagrantfile in the target dir, with only the base image pulled. Copies the runner script to the directory so it's accessible from the VM. """

        if self.inherit_image:
            image_name, image_tag = str(self.inherit_image).split(":")
        else:
            image_name = self.get_arca_base_name()
            image_tag = self.get_python_base_tag(self.get_python_version())

        logger.info("Creating Vagrantfile located in %s, base image %s:%s", vagrant_file, image_name, image_tag)

        repos_dir = (Path(self._arca.base_dir) / 'repos').resolve()
        vagrant_file.parent.mkdir(exist_ok=True, parents=True)
        vagrant_file.write_text(dedent(f"""
        # -*- mode: ruby -*-
        # vi: set ft=ruby :

        Vagrant.configure("2") do |config|
          config.vm.box = "{self.box}"
          config.ssh.insert_key = true
          config.vm.provision "docker" do |d|
            d.pull_images "{image_name}:{image_tag}"
          end

          config.vm.synced_folder ".", "/vagrant"
          config.vm.synced_folder "{repos_dir}", "/srv/repos"
          config.vm.provider "{self.provider}"

        end
        """))

        (vagrant_file.parent / "runner.py").write_text(self.RUNNER.read_text())