{"record":{"id":"daed529c86a0b948","repo":"hashicorp/vagrant","slug":"rsync-was-not-detected-as-installed-in-your-gues","errorCode":null,"errorMessage":"\"rsync\" was not detected as installed in your guest machine. This\nis required for rsync synced folders to work. In addition to this,\nVagrant doesn't know how to automatically install rsync for your\nmachine, so you must do this manually.","messagePattern":"\"rsync\" was not detected as installed in your guest machine\\. This\nis required for rsync synced folders to work\\. In addition to this,\nVagrant doesn't know how to automatically install rsync for your\nmachine, so you must do this manually\\.","errorType":"exception","errorClass":"Vagrant::Errors::RSyncNotInstalledInGuest","httpStatus":null,"severity":"error","filePath":"plugins/synced_folders/rsync/synced_folder.rb","lineNumber":38,"sourceCode":"      end\n\n      def usable?(machine, raise_error=false)\n        rsync_path = Which.which(\"rsync\")\n        return true if rsync_path\n        return false if !raise_error\n        raise Vagrant::Errors::RSyncNotFound\n      end\n\n      def prepare(machine, folders, opts)\n        # Nothing is necessary to do before VM boot.\n      end\n\n      def enable(machine, folders, opts)\n        if machine.guest.capability?(:rsync_installed)\n          installed = machine.guest.capability(:rsync_installed)\n          if !installed\n            can_install = machine.guest.capability?(:rsync_install)\n            raise Vagrant::Errors::RSyncNotInstalledInGuest if !can_install\n            machine.ui.info I18n.t(\"vagrant.rsync_installing\")\n            machine.guest.capability(:rsync_install)\n          end\n        end\n\n        ssh_info = machine.ssh_info\n\n        if ssh_info[:private_key_path].empty? && ssh_info[:password]\n          machine.ui.warn(I18n.t(\"vagrant.rsync_ssh_password\"))\n        end\n\n        folders.each do |id, folder_opts|\n          RsyncHelper.rsync_single(machine, ssh_info, folder_opts)\n        end\n      end\n\n      # Enable rsync synced folders within WSL when in use\n      # on non-DrvFs file systems","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/synced_folders/rsync/synced_folder.rb#L20-L56","documentation":"On enable, the rsync synced folder checks the guest's rsync_installed capability. If rsync is absent and the guest also lacks an rsync_install capability (so Vagrant could auto-install it), it raises RSyncNotInstalledInGuest with %{bin} = \"rsync\". The guest must carry rsync itself.","triggerScenarios":"A type: \"rsync\" synced folder enabled on a guest whose capability set implements rsync_installed but not rsync_install, with rsync not preinstalled — minimal Alpine-style boxes, stripped custom images, distros Vagrant can't auto-provision.","commonSituations":"Minimal cloud-init/container-ish guests; boxes built with packages stripped; switching a guest that always used vboxsf to rsync folders.","solutions":["Pre-install rsync when building the box image (add to Packer provisioners)","Switch the synced folder to a type the guest supports (virtualbox, nfs)","Boot once, install rsync in the guest manually, then run vagrant rsync / vagrant reload","For distro plugin authors: implement the rsync_install capability so Vagrant can auto-install"],"exampleFix":"# before\nconfig.vm.synced_folder \".\", \"/vagrant\", type: \"rsync\"  # guest has no rsync, no auto-install\n\n# after\nconfig.vm.synced_folder \".\", \"/vagrant\", type: \"virtualbox\"  # or bake rsync into the box","handlingStrategy":"validation","validationCode":"# before switching a folder to rsync, probe the guest\nmachine.communicate.test(\"command -v rsync >/dev/null\") or ui.warn(\"guest lacks rsync - bake it into the box\")","typeGuard":"def guest_rsync_available?(machine)\n  machine.guest.capability?(:rsync_installed) && machine.guest.capability(:rsync_installed)\nend","tryCatchPattern":"begin\n  env.cli(%w(up))\nrescue Vagrant::Errors::RSyncNotInstalledInGuest\n  abort \"Install rsync in the guest, then `vagrant rsync` / reload\"\nend","preventionTips":["Add rsync to Packer provisioners when building boxes that will use rsync folders","Match folder type to what the guest image supports","After a one-off manual install, `vagrant rsync` re-syncs without a full rebuild"],"tags":["rsync","synced-folders","guest","missing-package"],"backgroundTag":"guest-package-not-installed","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}