Closed mgupta8143 closed 2 years ago
Please provide your Vagrantfile?
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = false
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.vm.provider "qemu" do |qe|
qe.arch = "x86_64"
qe.machine = "q35"
qe.cpu = "max"
qe.net_device = "virtio-net-pci"
end
config.vm.define "dev" do |dev|
dev.network :forwarded_port, guest: 22, host: 10022, id: "ssh"
dev.network :forwarded_port, guest: 906, host: 1501
end
end
It seems that config.hostmanager
and config.vm.define
are invalid.
Please try:
config.vm.network :forwarded_port, guest: 22, host: 10022, id: "ssh"
config.vm.network :forwarded_port, guest: 906, host: 1501
And 'forwarded_port' with id "ssh" is ignored by the plugin, you should use qe.ssh_port
instead, the "fixed" Vagrantfile should be:
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.provider "qemu" do |qe|
qe.arch = "x86_64"
qe.machine = "q35"
qe.cpu = "max"
qe.net_device = "virtio-net-pci"
qe.ssh_port = 10022
end
#config.vm.network :forwarded_port, guest: 22, host: 10022, id: "ssh"
config.vm.network :forwarded_port, guest: 906, host: 1501
end
JFYI I hit the similar issue when tried to use multi-machine config.. it's a bit unexpected that SSH port forwarding is managed by ssh_port
provider option 🤔
=> dev: Warning! The QEMU provider doesn't support any of the Vagrant ==> dev: high-level network configurations (
config.vm.network
). They ==> dev: will be silently ignored.I am using a Vagrantfile to provision a VM, and run
vagrant up
, but then I get this message and the port forwarding doesn't seem to work. Why is this and how can I resolve it because in the README, it shows port forwarding works