vagrant
vagrant copied to clipboard
Port forward doesn't work if a provision requires reboot
Vagrant version
2.2.19
Host operating system
Arch Linux 5.17.7 with newest packages as of date
Guest operating system
Debian Stretch x64
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
config.vm.provision "shell", inline: "echo", run: "always", reboot: true
config.vm.network "forwarded_port", guest: 80, host: 8080
end
note: my provider is libvirt via QEMU/KVM
Debug output
https://pastebin.com/1TQcghSP
Expected behavior
port forward should redirect requests from localhost:8080 to
Actual behavior
It doesn't forward the port (and/or does other stuff I'm not seeing)
Steps to reproduce
- do vagrant up with the provided vagranfile
- install and start e.g. a webserver inside the vm to confirm the port forwarding
- check if the port gets forwarded via e.g. curl
- check if the webserver is up via the ip address of the VM.
it took me so fckn long to debug this btw, I had no clue what was causing the broken port forward until I disabled the reboot in the config π« β¦it was definitely not the first thing I thought could cause this. π
I'm not able to reproduce this problem. It's likely that this issue has been resolved with a new version of Vagrant, so I'm going to go ahead and close this issue. Happy to re-open and look into it again if that's wrong π¦