vagrant-tramp icon indicating copy to clipboard operation
vagrant-tramp copied to clipboard

vagrant-tramp really slow when working on codebases inside a VM

Open mspinelli opened this issue 6 years ago • 2 comments

Description :octocat:

Running spacemacs on host connected to a VM containing code files via vagrant-trap is very slow and auto-complete doesn't work (like it does if the code is on the host instead of the VM -- using python)

Reproduction guide :beetle:

  • Start Emacs
  • Add the following to dotspacemacs/user-config ()
  (defun connect-vagrant ()
    (interactive)
    (dired "/ssh:vagrant@localhost#2222:/"))
  • SPC f e R
  • M-x connect-vagrant
  • navigate to a file on the VM
  • starting coding

Observed behaviour: :eyes: :broken_heart: As you type and short pause between words or symbols kicks off a bunch of vagrant-tramp opening connection and sending ssh operations (See messages below). This makes typing really slow as it interrupts and prevents you from doing anything in the meantime. Also auto complete does not work.

Expected behaviour: :heart: :smile: Coding should not be interrupted and auto-complete should work.

System Info :computer:

  • OS: gnu/linux
  • Emacs: 26.1
  • Spacemacs: 0.200.13
  • Spacemacs branch: master (rev. c7a103a77)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(html javascript auto-completion c-c++ emacs-lisp git vagrant ruby themes-megapack
      (python :variables python-test-runner 'pytest)
      ess colors markdown org
      (shell :variables shell-default-height 30 shell-default-position 'bottom)
      spell-checking syntax-checking html yaml version-control)
  • System configuration features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS

Messages :paw_prints:

Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done
Directory has changed on disk; type g to update Dired [3 times]
Tramp: Inserting ‘/ssh:vagrant@localhost#2222:/sync/path/hidden/backend/manage.py’...
Tramp: Encoding remote file ‘/ssh:vagrant@localhost#2222:/sync/path/hidden/backend/manage.py’ with ‘base64 <%s’...done
Tramp: Decoding local file ‘/tmp/tramp.bC8AqM.py’ with ‘base64-decode-region’...done
Tramp: Inserting ‘/ssh:vagrant@localhost#2222:/sync/path/hidden/backend/manage.py’...done
git-gutter+-refresh: Wrong type argument: arrayp, (tramp-file-name "ssh" "vagrant" nil "localhost" "2222" "/sync/path/hidden/backend/manage.py" nil)
Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -q -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done
auto trimmed 0 chars
Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -q -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done
user-error: No further undo information [2 times]
auto trimmed 0 chars
Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -q -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done
Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -q -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done
Tramp: Opening connection for vagrant@localhost using ssh...
Tramp: Sending command ‘exec ssh -q -l vagrant -p 2222 -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none localhost’
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘localhost’
Tramp: Opening connection for vagrant@localhost using ssh...done

mspinelli avatar Jul 29 '18 04:07 mspinelli

Did you figure out a solution to this? @mspinelli

NahsiN avatar Jun 28 '22 20:06 NahsiN

@NahsiN, I don't think so. Haven't used Vagrant since I posted this ~4 years ago. Wishing you the best of luck, though!

mspinelli avatar Jul 01 '22 22:07 mspinelli