Vagrant: Using ssh controlmaster breaks terminal when using libvirt and port forwards

Created on 5 Nov 2018  ยท  5Comments  ยท  Source: hashicorp/vagrant

Vagrant version

2.2.0

Host operating system

Arch Linux

Guest operating system

Centos 7.5 (Bento)

Vagrantfile

Vagrant.configure("2") do |config|
    config.vm.box = "bento/centos-7.5"
    config.vm.define "node1", autostart: true, primary: true do |node|
      node.vm.network "forwarded_port", guest: 8080, host: 18080
    end
end

Debug output

https://gist.github.com/jhalfmoon/00179bf8ee21b3a2570efd8522f28d1d

Expected behavior

After running Vagrant and returning to the command prompt, the terminal should work as usual.

Actual behavior

Each second keystroke 'disappear', making it near impossible to use the terminal. After destroying the vm, the behavior of the terminal will return to normal.

Steps to reproduce

  • Setup your ssh client to use controlmaste:
# ~/.ssh/config
Host *
ControlMaster yes
  • Install a working libvirt/kvm environement and activate it:
export VAGRANT_DEFAULT_PROVIDER=libvirt
  • Run vagrant with the given Vagrantfile
  • The terminal used to start vagrant will now have the issue
  • Doing 'vagrant destroy' will restore normal behaviour
  • Repeating the above experiment with 'ControlMaster no' will not exhibit any issues

Application versions uses:

  • OpenSSH_7.9p1, OpenSSL 1.1.1 11 Sep 2018
  • GNU bash, version 4.4.23(1)

References

None, as far as I can tell.

bug needs-repro synced-folderrsync

All 5 comments

@jhalfmoon If you disable the default synced folder so nothing is synced to the new guest, do you still experience the same behavior in your shell?

config.vm.synced_folder ".", "/vagrant", disabled: true

Yes, the same behaviour remains. I also tried to see if the issue is maybe related to my terminal and/or tmux, which I always use. So I used xfce-terminal instead of Konsole and also ran it without tmux, but the issue remains the same. It's as if something is stealing characters from stdin. An strace of the bash process doesn't shine any light on this either as there's no difference to be seen between the working and non-working situation.

@jhalfmoon Was able to reproduce the behavior you are experiencing. It is not an issue with Vagrant but with the vagrant-libvirt plugin. I have submitted a PR there to fix the issue vagrant-libvirt/vagrant-libvirt#935

Cheers!

@chrisroberts That was fast, man! Thank you!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hesco picture hesco  ยท  3Comments

luispabon picture luispabon  ยท  3Comments

janw-me picture janw-me  ยท  3Comments

rhencke picture rhencke  ยท  3Comments

StefanScherer picture StefanScherer  ยท  3Comments